Merge remote-tracking branch 'origin/master'

This commit is contained in:
Joshua Fan
2020-12-05 22:56:34 -08:00
24 changed files with 208 additions and 120 deletions

View File

@@ -105,13 +105,9 @@ public class ModsDialog extends BaseDialog{
t.button("@mod.import.github", Icon.github, bstyle, () -> {
dialog.hide();
var modString = Core.settings.getString("lastmod", "");
var suggested = Structs.random(suggestedMods);
ui.showTextInput("@mod.import.github", "", 64, modString.isEmpty() ? suggested : modString, text -> {
if(!modString.isEmpty() || !Structs.eq(suggested, text)){
Core.settings.put("lastmod", text);
}
ui.showTextInput("@mod.import.github", "", 64, Core.settings.getString("lastmod", ""), text -> {
Core.settings.put("lastmod", text);
ui.loadfrag.show();
//Try to download the 6.0 branch first, but if it doesn't exist, try master.

View File

@@ -254,6 +254,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
boolean canSelect(Sector sector){
if(mode == select) return sector.hasBase();
if(sector.hasBase()) return true;
//preset sectors can only be selected once unlocked
if(sector.preset != null){
TechNode node = sector.preset.node();
@@ -709,7 +710,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
stable.image().color(Pal.accent).fillX().height(3f).pad(3f).row();
boolean locked = sector.preset != null && sector.preset.locked() && sector.preset.node() != null;
boolean locked = sector.preset != null && sector.preset.locked() && !sector.hasBase() && sector.preset.node() != null;
if(locked){
stable.table(r -> {
@@ -805,7 +806,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
return;
}
if(sector.preset != null && sector.preset.locked()){
if(sector.preset != null && sector.preset.locked() && !sector.hasBase()){
return;
}

View File

@@ -172,16 +172,6 @@ public class ResearchDialog extends BaseDialog{
});
}
@Override
public Dialog show(){
if(net.client()){
ui.showInfo("@research.multiplayer");
return this;
}
return super.show();
}
void treeLayout(){
float spacing = 20f;
LayoutNode node = new LayoutNode(root, null);
@@ -439,6 +429,14 @@ public class ResearchDialog extends BaseDialog{
void unlock(TechNode node){
node.content.unlock();
//unlock parent nodes in multiplayer.
TechNode parent = node.parent;
while(parent != null){
parent.content.unlock();
parent = parent.parent;
}
checkNodes(root);
hoverNode = null;
treeLayout();