Research bugfixes
This commit is contained in:
@@ -64,7 +64,7 @@ public class DatabaseDialog extends BaseDialog{
|
||||
all.table(list -> {
|
||||
list.left();
|
||||
|
||||
int cols = (int)Mathf.clamp((Core.graphics.getWidth() - Scl.scl(30)) / Scl.scl(32 + 10), 1, 22);
|
||||
int cols = (int)Mathf.clamp((Core.graphics.getWidth() - Scl.scl(30)) / Scl.scl(32 + 12), 1, 22);
|
||||
int count = 0;
|
||||
|
||||
for(int i = 0; i < array.size; i++){
|
||||
|
||||
@@ -1045,7 +1045,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
return;
|
||||
}
|
||||
|
||||
if(sector.preset != null && sector.preset.locked() && !sector.hasBase()){
|
||||
if(sector.preset != null && sector.preset.locked() && sector.preset.techNode != null && !sector.hasBase()){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ public class ResearchDialog extends BaseDialog{
|
||||
|
||||
public ItemSeq items;
|
||||
|
||||
private boolean showTechSelect;
|
||||
|
||||
public ResearchDialog(){
|
||||
super("");
|
||||
|
||||
@@ -63,17 +65,22 @@ public class ResearchDialog extends BaseDialog{
|
||||
for(TechNode node : TechTree.roots){
|
||||
if(node.requiresUnlock && !node.content.unlocked() && node != getPrefRoot()) continue;
|
||||
|
||||
in.button(node.localizedName(), Styles.cleart, () -> {
|
||||
//TODO toggle
|
||||
in.button(node.localizedName(), node.icon(), Styles.clearTogglet, iconMed, () -> {
|
||||
if(node == lastNode){
|
||||
return;
|
||||
}
|
||||
|
||||
rebuildTree(node);
|
||||
hide();
|
||||
}).row();
|
||||
}).marginLeft(12f).checked(node == lastNode).row();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
addCloseButton();
|
||||
}}.show();
|
||||
}).minWidth(300f);
|
||||
}).visible(() -> showTechSelect = TechTree.roots.count(node -> !(node.requiresUnlock && !node.content.unlocked())) > 1).minWidth(300f);
|
||||
|
||||
margin(0f).marginBottom(8);
|
||||
cont.stack(titleTable, view = new View(), itemDisplay = new ItemsDisplay()).grow();
|
||||
@@ -82,15 +89,19 @@ public class ResearchDialog extends BaseDialog{
|
||||
|
||||
shouldPause = true;
|
||||
|
||||
onResize(() -> {
|
||||
if(Core.graphics.isPortrait()){
|
||||
Runnable checkMargin = () -> {
|
||||
if(Core.graphics.isPortrait() && showTechSelect){
|
||||
itemDisplay.marginTop(60f);
|
||||
}else{
|
||||
itemDisplay.marginTop(0f);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onResize(checkMargin);
|
||||
|
||||
shown(() -> {
|
||||
checkMargin.run();
|
||||
|
||||
Planet currPlanet = ui.planet.isShown() ?
|
||||
ui.planet.state.planet :
|
||||
state.isCampaign() ? state.rules.sector.planet : null;
|
||||
|
||||
Reference in New Issue
Block a user