use of main.content.VALUE in project Eidolons by IDemiurge.
the class PropertyPage method init.
@Override
protected void init() {
X = super.getDefaultX();
Y = getDefaultY();
i = 0;
Z = getDefaultZ();
if (isAddHeader()) {
addHeader();
}
resetDisplayedValues();
for (VALUE p : displayedValues) {
EntityValueComponent comp = getComponent(p);
super.addComponent(comp, p);
}
}
use of main.content.VALUE in project Eidolons by IDemiurge.
the class ValueIconPanel method createBoxes.
protected void createBoxes() {
removeAll();
boxes = new XLinkedMap<>();
int x = 0;
int y;
for (VALUE[] values : getValueColumns()) {
y = 0;
for (VALUE value : values) {
ValueBox box = getValueBox(value);
boxes.put(value, box);
String pos = "pos " + x + " " + y;
add(box, pos);
y += ROW_HEIGHT;
box.addMouseListener(ToolTipMaster.getValueMouseListener(value));
}
x += COLUMN_WIDTH;
}
revalidate();
}
use of main.content.VALUE in project Eidolons by IDemiurge.
the class ReportGenerator method getSessionReport.
private static String getSessionReport(Session session) {
// Session previousVersion
Map<VALUE, String> map = VersionMaster.getVersionDifferenceMap(VERSION_PERIOD.SESSION, 1, session);
String report = getReportName(session);
for (VALUE v : map.keySet()) {
report += v + ": " + map.get(v) + ";" + StringMaster.NEW_LINE;
}
// String notes;
return report;
}
use of main.content.VALUE in project Eidolons by IDemiurge.
the class InfoTable method initComponents.
protected void initComponents() {
for (int y = 0; y < rows; y++) {
int x = 0;
for (VALUE value : valueTable[y]) {
boolean special = false;
PropertyComponent comp = new PropertyComponent(value, obj, special);
components.add(comp);
String pos = "sg comps, wrap, " + "pos 0 " + y * comp.getPanelSize().getHeight() * y;
add(comp, pos);
}
x++;
}
}
use of main.content.VALUE in project Eidolons by IDemiurge.
the class TextParser method parseRef.
// perhaps I should refactor into method per parse_type!
private static String parseRef(String ref_substring, Ref ref) {
if (ref == null) {
return parseVarRef(ref_substring);
}
String value = StringMaster.cropRef(ref_substring);
if (!StringMaster.isInteger(value)) {
if (isAbilityParsing()) {
return ref_substring;
}
}
int id = 0;
if (isActiveParsing()) {
id = ref.getId(KEYS.ACTIVE);
} else {
try {
id = ref.getId(KEYS.INFO);
} catch (Exception e) {
}
}
Game game = ref.getGame();
// if (id == 0) {
// if (game.isRunning()) {
// id = game.getManager().getInfoObj().getId();
// }
// }
// else if (CharacterCreator.isRunning())
String replacement = ref_substring;
Entity entity = ref.getInfoEntity();
if (entity == null) {
if (game.isSimulation() && !isBuffParsing() && !isAbilityParsing()) {
entity = game.getTypeById(id);
} else {
entity = game.getObjectById(id);
}
}
if (entity == null) {
return ref_substring;
}
if (entity instanceof AbilityObj) {
entity = entity.getType();
}
if (StringMaster.isInteger(value)) {
int index = StringMaster.getInteger(value) - 1;
String varProp = entity.getProperty(G_PROPS.VARIABLES);
if (StringMaster.isEmpty(varProp)) {
varProp = DEFAULT_VARS;
}
boolean containerFormula = false;
if (!entity.getParam("FORMULA").isEmpty()) {
// StringMaster.compare(varProp.replace(";", ""), "FORMULA",
// true)) {
varProp = entity.getParam("FORMULA");
containerFormula = true;
}
List<String> openContainer = StringMaster.openContainer(varProp);
if (openContainer.size() > index) {
VALUE val = null;
if (!containerFormula && !isBuffParsing()) {
val = ContentManager.getValue(openContainer.get(index));
replacement = entity.getValue(val);
} else {
replacement = openContainer.get(index);
}
if (containerFormula || val instanceof PARAMETER) {
if (StringMaster.isInteger(replacement)) {
return replacement;
}
try {
if (isAbilityParsing()) // if (replacement.contains(",")) {
// // TODO all function names!
// if (replacement.toLowerCase().contains("min")
// || replacement.toLowerCase().contains(
// "max")) {
// // get the insides of the formula?
// // parts = replacement.split(regex);
// // parts[1] = parts[1].
// //
// // replacement = parts[0] + parts[1];
// return replacement.replace(",",
// StringMaster.COMMA_CODE);
// }
// } else
{
return replacement.replace(",", StringMaster.COMMA_CODE);
}
if (game.isSimulation()) {
replacement = new Formula(replacement).getInt(ref) + " (" + formatFormula(replacement) + ")";
} else {
replacement = new Formula(replacement).getInt(ref) + "";
}
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
} else {
String result = new Property(true, replacement).getStr(ref);
if (StringMaster.isEmpty(result)) {
replacement = new Parameter(replacement).getInt(ref) + "";
} else {
replacement = result;
}
}
}
} else {
if (!isAbilityParsing()) {
if (StringMaster.isInteger(replacement)) {
return replacement;
}
if (game.isSimulation() && !tooltipParsing) {
Integer VAL = new Formula(replacement).getInt(ref);
replacement = VAL + " (" + replacement + ")";
} else {
// TODO
replacement = new Formula(replacement).getInt(ref) + "";
}
// props!
}
}
return replacement;
}
Aggregations