Moved some methods around
This commit is contained in:
@@ -91,6 +91,6 @@ public class DatabaseDialog extends FloatingDialog{
|
||||
}
|
||||
|
||||
boolean unlocked(UnlockableContent content){
|
||||
return (!Vars.world.isCampaign() && !Vars.state.is(State.menu)) || content.unlocked();
|
||||
return (!Vars.state.isCampaign() && !Vars.state.is(State.menu)) || content.unlocked();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class GameOverDialog extends FloatingDialog{
|
||||
t.add(Core.bundle.format("stat.playtime", control.saves.getCurrent().getPlayTime()));
|
||||
t.row();
|
||||
}
|
||||
if(world.isCampaign() && !state.stats.itemsDelivered.isEmpty()){
|
||||
if(state.isCampaign() && !state.stats.itemsDelivered.isEmpty()){
|
||||
t.add("$stat.delivered");
|
||||
t.row();
|
||||
for(Item item : content.items()){
|
||||
@@ -80,14 +80,14 @@ public class GameOverDialog extends FloatingDialog{
|
||||
}
|
||||
}
|
||||
|
||||
if(world.isCampaign()){
|
||||
RankResult result = state.stats.calculateRank(world.getSector(), state.launched);
|
||||
if(state.isCampaign()){
|
||||
RankResult result = state.stats.calculateRank(state.getSector(), state.launched);
|
||||
t.add(Core.bundle.format("stat.rank", result.rank + result.modifier));
|
||||
t.row();
|
||||
}
|
||||
}).pad(12);
|
||||
|
||||
if(world.isCampaign()){
|
||||
if(state.isCampaign()){
|
||||
buttons.addButton("$continue", () -> {
|
||||
hide();
|
||||
state.set(State.menu);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
cont.addImageTextButton("$back", Icon.left, this::hide).colspan(2).width(dw * 2 + 20f);
|
||||
|
||||
cont.row();
|
||||
if(world.isCampaign()){
|
||||
if(state.isCampaign()){
|
||||
cont.addImageTextButton("$techtree", Icon.tree, ui.tech::show);
|
||||
}else{
|
||||
cont.addImageTextButton("$database", Icon.book, ui.database::show);
|
||||
@@ -49,7 +49,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
cont.addImageTextButton("$settings", Icon.settings, ui.settings::show);
|
||||
|
||||
if(!state.rules.tutorial){
|
||||
if(!world.isCampaign() && !state.isEditor()){
|
||||
if(!state.isCampaign() && !state.isEditor()){
|
||||
cont.row();
|
||||
cont.addImageTextButton("$savegame", Icon.save, save::show);
|
||||
cont.addImageTextButton("$loadgame", Icon.upload, load::show).disabled(b -> net.active());
|
||||
@@ -79,7 +79,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
cont.addRowImageTextButton("$back", Icon.play, this::hide);
|
||||
cont.addRowImageTextButton("$settings", Icon.settings, ui.settings::show);
|
||||
|
||||
if(!world.isCampaign() && !state.isEditor()){
|
||||
if(!state.isCampaign() && !state.isEditor()){
|
||||
cont.addRowImageTextButton("$save", Icon.save, save::show);
|
||||
|
||||
cont.row();
|
||||
|
||||
@@ -84,7 +84,7 @@ public class HudFragment extends Fragment{
|
||||
}else{
|
||||
ui.chatfrag.toggle();
|
||||
}
|
||||
}else if(world.isCampaign()){
|
||||
}else if(state.isCampaign()){
|
||||
ui.tech.show();
|
||||
}else{
|
||||
ui.database.show();
|
||||
@@ -497,10 +497,10 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
private boolean inLaunchWave(){
|
||||
return world.isCampaign() &&
|
||||
world.getSector().metCondition() &&
|
||||
return state.isCampaign() &&
|
||||
state.getSector().metCondition() &&
|
||||
!net.client() &&
|
||||
state.wave % world.getSector().launchPeriod == 0 && !spawner.isSpawning();
|
||||
state.wave % state.getSector().launchPeriod == 0 && !spawner.isSpawning();
|
||||
}
|
||||
|
||||
private boolean canLaunch(){
|
||||
@@ -559,7 +559,7 @@ public class HudFragment extends Fragment{
|
||||
}else{
|
||||
builder.append(Core.bundle.get("launch"));
|
||||
builder.append("\n");
|
||||
builder.append(Core.bundle.format("launch.next", state.wave + world.getSector().launchPeriod));
|
||||
builder.append(Core.bundle.format("launch.next", state.wave + state.getSector().launchPeriod));
|
||||
builder.append("\n");
|
||||
}
|
||||
builder.append("[]\n");
|
||||
|
||||
@@ -440,7 +440,7 @@ public class PlacementFragment extends Fragment{
|
||||
}
|
||||
|
||||
boolean unlocked(Block block){
|
||||
return !world.isCampaign() || data.isUnlocked(block);
|
||||
return !state.isCampaign() || data.isUnlocked(block);
|
||||
}
|
||||
|
||||
/** Returns the currently displayed block in the top box. */
|
||||
|
||||
Reference in New Issue
Block a user