Better planet selection (#8572)
* Better AboutDialog * I'm there! * New Planet Select UI * fix * Better Planet Selection * no
This commit is contained in:
@@ -154,3 +154,4 @@ zenonet
|
|||||||
AyuKo-o
|
AyuKo-o
|
||||||
JojoFR1
|
JojoFR1
|
||||||
Xasmedy
|
Xasmedy
|
||||||
|
xStaBUx
|
||||||
@@ -606,31 +606,48 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
t.label(() -> mode == select ? "@sectors.select" : "").style(Styles.outlineLabel).color(Pal.accent);
|
t.label(() -> mode == select ? "@sectors.select" : "").style(Styles.outlineLabel).color(Pal.accent);
|
||||||
}),
|
}),
|
||||||
buttons,
|
buttons,
|
||||||
//planet selection
|
// planet selection
|
||||||
new Table(t -> {
|
new Table(t -> {
|
||||||
t.top().left();
|
t.top().left();
|
||||||
if(content.planets().count(this::selectable) > 1){
|
ScrollPane pane = new ScrollPane(null, Styles.smallPane);
|
||||||
t.table(Tex.pane, pt -> {
|
t.add(pane).colspan(2).row();
|
||||||
pt.margin(4f);
|
Table starsTable = new Table(Styles.black);
|
||||||
for(int i = 0; i < content.planets().size; i++){
|
pane.setWidget(starsTable);
|
||||||
Planet planet = content.planets().get(i);
|
pane.setScrollingDisabled(true, false);
|
||||||
if(selectable(planet)){
|
int starCount = 0;
|
||||||
pt.button(planet.localizedName, Icon.icons.get(planet.icon + "Small", Icon.icons.get(planet.icon, Icon.commandRallySmall)), Styles.flatTogglet, () -> {
|
for(Planet star : content.planets()){
|
||||||
selected = null;
|
if(star.solarSystem != star) continue;
|
||||||
launchSector = null;
|
boolean hasSelectablePlanets = false;
|
||||||
if(state.planet != planet){
|
for(Planet planet : content.planets()){
|
||||||
newPresets.clear();
|
if(planet.solarSystem == star && selectable(planet)){
|
||||||
state.planet = planet;
|
hasSelectablePlanets = true;
|
||||||
rebuildExpand();
|
break;
|
||||||
}
|
}
|
||||||
settings.put("lastplanet", planet.name);
|
}
|
||||||
}).width(190).height(40).growX().update(bb -> bb.setChecked(state.planet == planet)).with(w -> w.marginLeft(10f)).get().getChildren().get(1).setColor(planet.iconColor);
|
if(!hasSelectablePlanets) continue;
|
||||||
pt.row();
|
starCount++;
|
||||||
|
if(starCount > 1) starsTable.add(star.localizedName).padLeft(10f).padBottom(10f).padTop(10f).left().width(190f).row();
|
||||||
|
Table planetTable = new Table();
|
||||||
|
starsTable.add(planetTable).left().row();
|
||||||
|
for(Planet planet : content.planets()){
|
||||||
|
if(planet.solarSystem == star && selectable(planet)){
|
||||||
|
Button planetButton = planetTable.button(planet.localizedName, Icon.icons.get(planet.icon + "Small", Icon.icons.get(planet.icon, Icon.commandRallySmall)), Styles.flatTogglet, () -> {
|
||||||
|
selected = null;
|
||||||
|
launchSector = null;
|
||||||
|
if(state.planet != planet){
|
||||||
|
newPresets.clear();
|
||||||
|
state.planet = planet;
|
||||||
|
rebuildExpand();
|
||||||
|
}
|
||||||
|
settings.put("lastplanet", planet.name);
|
||||||
|
}).width(200).height(40).update(bb -> bb.setChecked(state.planet == planet)).with(w -> w.marginLeft(10f)).get();
|
||||||
|
planetButton.getChildren().get(1).setColor(planet.iconColor);
|
||||||
|
planetButton.setColor(planet.iconColor);
|
||||||
|
planetTable.background(Tex.pane).row();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}),
|
||||||
}
|
|
||||||
}),
|
|
||||||
|
|
||||||
new Table(c -> {
|
new Table(c -> {
|
||||||
expandTable = c;
|
expandTable = c;
|
||||||
|
|||||||
Reference in New Issue
Block a user