use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.
the class ActionCostTooltip method getDescriptionAction.
private Action getDescriptionAction() {
DelayAction addAfter = new DelayAction();
Action add = new Action() {
@Override
public boolean act(float delta) {
if (getActor() instanceof Group) {
((TablePanel) getActor()).row();
((TablePanel) getActor()).addElement(getDescription());
}
return true;
}
};
// TODO add move up action!
add.setActor(this);
addAfter.setAction(add);
addAfter.setDuration(0.7f);
addAfter.setTarget(this);
return addAfter;
}
use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.
the class ScenarioInfoPanel method initHeader.
@Override
protected void initHeader(TablePanel<Actor> header) {
header.addNormalSize(preview).left().padLeft(20).padTop(45);
header.addElement(title).left();
header.row();
TablePanel<Actor> infoTable = new TablePanel<>();
header.addNoGrow(infoTable);
infoTable.padLeft(50).padTop(50);
missionsInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
missionsInfo.setText("Missions: N/A");
infoTable.addNoGrow(missionsInfo);
infoTable.row();
partyInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
partyInfo.setText("Party: N/A");
infoTable.addNoGrow(partyInfo);
infoTable.row();
mainInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
mainInfo.setText("Difficulty: Unknown");
infoTable.addNoGrow(mainInfo);
}
use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.
the class AttackTooltip method updateAct.
@Override
public void updateAct(float delta) {
clear();
TablePanel left = new TablePanel();
final ActionTooltipSource source = (ActionTooltipSource) getUserObject();
final MultiValueContainer valueContainer = source.getHead();
final List<Container<Label>> values = valueContainer.getValues();
final TextureRegion leftImage = getOrCreateR(values.get(0).getActor().getText().toString());
final TextureRegion rightImage = getOrCreateR(values.get(1).getActor().getText().toString());
baseTable = new TablePanel();
baseTable.addElement(null).expand(0, 0).fill(false);
baseTable.addElement(new ValueContainer(valueContainer.getName(), ""));
baseTable.addElement(new ValueContainer(leftImage));
baseTable.addElement(new ValueContainer(rightImage));
baseTable.row();
ValueContainer precalcRow = source.getPrecalcRow();
if (precalcRow != null) {
Label label = new Label("Est.", StyleHolder.getDefaultLabelStyle());
baseTable.addElement(label);
baseTable.addElement(precalcRow);
baseTable.row();
}
List<MultiValueContainer> list = source.getBase();
for (Object o : list) {
MultiValueContainer container = (MultiValueContainer) o;
final List<ValueContainer> separated = container.separate();
separated.forEach(el -> {
baseTable.addElement(el);
});
baseTable.row();
}
rangeTable = new TablePanel();
list = source.getRange();
for (Object o : list) {
MultiValueContainer container = (MultiValueContainer) o;
final List<ValueContainer> separated = container.separate();
separated.forEach(el -> {
rangeTable.addElement(el);
});
rangeTable.row();
}
List<List<ValueContainer>> listText = source.getText();
for (List<ValueContainer> valueContainers : listText) {
TablePanel panel = new TablePanel();
textTables.add(panel);
for (ValueContainer container : valueContainers) {
// container.wrapNames();
panel.addElement(container);
panel.row();
}
}
left.addElement(baseTable).width(282).pad(0, 0, 3, 0);
left.row();
left.addElement(rangeTable).width(282).pad(0, 0, 3, 0);
left.row();
textTables.forEach(el -> {
left.addElement(el).width(282).pad(0, 0, 3, 0);
left.row();
});
addElement(left);
CostsPanel costsPanel = new CostsPanel();
costsPanel.setUserObject(source.getCostsSource());
addElement(costsPanel);
}
use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.
the class WeaponPanel method addWeapons.
protected void addWeapons(ValueContainer mainWeapon, List<ValueContainer> list, String tabName) {
final TablePanel panel = new TablePanel();
Cell<ValueContainer> lastCell = panel.add(mainWeapon).left().bottom();
for (ValueContainer valueContainer : list) {
lastCell = panel.addElement(valueContainer).expand(0, 0).fill(false).left().bottom().padLeft(5);
}
if (lastCell != null) {
lastCell.expand();
}
addTab(panel, tabName);
}
Aggregations