use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class MasteryIconColumn method refresh.
@Override
public void refresh() {
updateMasteries();
removeAll();
int i = 0;
for (PARAMETER mastery : masteries) {
Component icon = getMasteryIconComp(mastery);
int x = i % 2 == 0 ? -offset : fitSize - offset;
int y = i / 2 * fitSize;
// 40x40 override? overlap,
add(icon, "pos " + x + " " + y);
// that is... selected
// on top... custom zorder
i++;
// page controls needed? perhaps not!
}
// setComponentZOrder(comp, index);
revalidate();
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class FloatingTextMaster method createAndShowParamModText.
public void createAndShowParamModText(Object o) {
Pair<PARAMETER, Ref> pair = (Pair<PARAMETER, Ref>) o;
Entity active = pair.getValue().getObj(KEYS.ACTIVE);
int amount = 0;
if (pair.getValue().getAmount() != null)
amount = pair.getValue().getAmount();
else {
return;
}
FloatingText text = getFloatingText(active, TEXT_CASES.PARAM_MOD, new ImmutablePair<>(pair.getKey(), amount));
Obj obj = active.getRef().getTargetObj();
if (obj == null)
obj = active.getRef().getSourceObj();
if (obj != null) {
BaseView view = DungeonScreen.getInstance().getGridPanel().getViewMap().get(obj);
if (view != null) {
Vector2 v = view.localToStageCoordinates(new Vector2(view.getX(), view.getY()));
text.setPosition(v.x, v.y);
}
}
GuiEventManager.trigger(GuiEventType.ADD_FLOATING_TEXT, text);
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method modifyParamByPercent.
public void modifyParamByPercent(String param, String string) {
PARAMETER p = ContentManager.getPARAM(param);
int perc = StringMaster.getInteger(string);
modifyParamByPercent(p, perc);
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method resetPercentage.
public void resetPercentage(PARAMETER p) {
p = ContentManager.getBaseParameterFromCurrent(p);
PARAMETER c_p = ContentManager.getCurrentParam(p);
PARAMETER c_perc = ContentManager.getPercentageParam(p);
if (c_perc == null || c_perc == p) {
return;
}
int base_value = getIntParam(p);
Integer c_value = getIntParam(c_p);
int percentage = MathMaster.getPercentage(c_value, base_value);
setParam(c_perc, percentage, true);
LogMaster.log(LogMaster.VALUE_DEBUG, getName() + "'s " + p.getName() + " percentage reset: " + c_value + " out of " + base_value + " = " + percentage);
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DataModel method getValue.
public String getValue(VALUE val, boolean base) {
String value = "";
if (val instanceof MultiParameter) {
MultiParameter multiParameter = (MultiParameter) val;
for (PARAMETER p : multiParameter.getParameters()) {
value += getParamRounded(p, base) + multiParameter.getSeparator();
// % sign?
}
value = StringMaster.cropLast(value, multiParameter.getSeparator().length());
} else if (val instanceof PARAMETER) {
value = getDoubleParam((PARAMETER) val, base);
} else if (val instanceof PROPERTY) {
value = getProperty((PROPERTY) val);
}
if (value == null) {
LogMaster.log(LogMaster.VALUE_DEBUG, "Value not found: " + val.getName());
}
return value;
}
Aggregations