Broke 90% of all code
This commit is contained in:
@@ -160,12 +160,12 @@ public class LoadDialog extends FloatingDialog{
|
||||
hide();
|
||||
try{
|
||||
slot.load();
|
||||
GameState.set(State.playing);
|
||||
state.set(State.playing);
|
||||
Vars.ui.paused.hide();
|
||||
}catch(Exception e){
|
||||
UCore.error(e);
|
||||
Vars.ui.paused.hide();
|
||||
GameState.set(State.menu);
|
||||
state.set(State.menu);
|
||||
Vars.control.reset();
|
||||
Vars.ui.showError("$text.save.corrupted");
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
|
||||
shown(() -> {
|
||||
wasPaused = GameState.is(State.paused);
|
||||
if(!Net.active()) GameState.set(State.paused);
|
||||
if(!Net.active()) state.set(State.paused);
|
||||
});
|
||||
|
||||
if(!Vars.android){
|
||||
@@ -43,7 +43,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
content().addButton("$text.back", () -> {
|
||||
hide();
|
||||
if((!wasPaused || Net.active()) && !GameState.is(State.menu))
|
||||
GameState.set(State.playing);
|
||||
state.set(State.playing);
|
||||
});
|
||||
|
||||
content().row();
|
||||
@@ -88,7 +88,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
new imagebutton("icon-play-2", isize, () -> {
|
||||
hide();
|
||||
if(!wasPaused && !GameState.is(State.menu))
|
||||
GameState.set(State.playing);
|
||||
state.set(State.playing);
|
||||
}).text("$text.back").padTop(4f);
|
||||
|
||||
new imagebutton("icon-tools", isize, ui.settings::show).text("$text.settings").padTop(4f);
|
||||
@@ -130,7 +130,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
private void runExitSave(){
|
||||
if(Vars.control.getSaves().getCurrent() == null ||
|
||||
!Vars.control.getSaves().getCurrent().isAutosave()){
|
||||
GameState.set(State.menu);
|
||||
state.set(State.menu);
|
||||
Vars.control.getTutorial().reset();
|
||||
return;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
e = (e.getCause() == null ? e : e.getCause());
|
||||
Vars.ui.showError("[orange]"+ Bundles.get("text.savefail")+"\n[white]" + ClassReflection.getSimpleName(e.getClass()) + ": " + e.getMessage() + "\n" + "at " + e.getStackTrace()[0].getFileName() + ":" + e.getStackTrace()[0].getLineNumber());
|
||||
}
|
||||
GameState.set(State.menu);
|
||||
state.set(State.menu);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class RestartDialog extends Dialog {
|
||||
|
||||
getButtonTable().addButton("$text.menu", ()-> {
|
||||
hide();
|
||||
GameState.set(State.menu);
|
||||
state.set(State.menu);
|
||||
control.reset();
|
||||
}).size(130f, 60f);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
hidden(()->{
|
||||
if(!GameState.is(State.menu)){
|
||||
if(!wasPaused || Net.active())
|
||||
GameState.set(State.playing);
|
||||
state.set(State.playing);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
if(menu.getScene() != null){
|
||||
wasPaused = ((PausedDialog)menu).wasPaused;
|
||||
}
|
||||
if(!Net.active()) GameState.set(State.paused);
|
||||
if(!Net.active()) state.set(State.paused);
|
||||
Vars.ui.paused.hide();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ public class BlocksFragment implements Fragment{
|
||||
private boolean shown = true;
|
||||
|
||||
public void build(){
|
||||
InputHandler input = control.getInput();
|
||||
InputHandler input = control.input();
|
||||
|
||||
new table(){{
|
||||
abottom();
|
||||
@@ -197,7 +197,7 @@ public class BlocksFragment implements Fragment{
|
||||
}
|
||||
|
||||
void updateRecipe(){
|
||||
Recipe recipe = Vars.control.getInput().recipe;
|
||||
Recipe recipe = Vars.control.input().recipe;
|
||||
desctable.clear();
|
||||
desctable.setTouchable(Touchable.enabled);
|
||||
|
||||
@@ -229,7 +229,7 @@ public class BlocksFragment implements Fragment{
|
||||
desclabel.setWrap(true);
|
||||
|
||||
boolean wasPaused = GameState.is(State.paused);
|
||||
GameState.set(State.paused);
|
||||
state.set(State.paused);
|
||||
|
||||
FloatingDialog d = new FloatingDialog("$text.blocks.blockinfo");
|
||||
Table table = new Table();
|
||||
@@ -264,7 +264,7 @@ public class BlocksFragment implements Fragment{
|
||||
}
|
||||
|
||||
d.buttons().addButton("$text.ok", ()->{
|
||||
if(!wasPaused) GameState.set(State.playing);
|
||||
if(!wasPaused) state.set(State.playing);
|
||||
d.hide();
|
||||
}).size(110, 50).pad(10f);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class HudFragment implements Fragment{
|
||||
if (Net.active() && Vars.android) {
|
||||
ui.listfrag.visible = !ui.listfrag.visible;
|
||||
} else {
|
||||
GameState.set(GameState.is(State.paused) ? State.playing : State.paused);
|
||||
state.set(GameState.is(State.paused) ? State.playing : State.paused);
|
||||
}
|
||||
}).update(i -> {
|
||||
if (Net.active() && Vars.android) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PlacementFragment implements Fragment{
|
||||
public void build(){
|
||||
if(!Vars.android) return;
|
||||
|
||||
InputHandler input = control.getInput();
|
||||
InputHandler input = control.input();
|
||||
|
||||
float s = 50f;
|
||||
float translation = Unit.dp.scl(54f);
|
||||
@@ -130,7 +130,7 @@ public class PlacementFragment implements Fragment{
|
||||
defaults().padBottom(-5.5f);
|
||||
|
||||
new imagebutton("icon-" + mode.name(), "toggle", 10 * 3, () -> {
|
||||
control.getInput().resetCursor();
|
||||
control.input().resetCursor();
|
||||
input.breakMode = mode;
|
||||
input.lastBreakMode = mode;
|
||||
if (!mode.both){
|
||||
@@ -174,7 +174,7 @@ public class PlacementFragment implements Fragment{
|
||||
if (!mode.shown || mode.delete) continue;
|
||||
|
||||
new imagebutton("icon-" + mode.name(), "toggle", 10 * 3, () -> {
|
||||
control.getInput().resetCursor();
|
||||
control.input().resetCursor();
|
||||
input.placeMode = mode;
|
||||
input.lastPlaceMode = mode;
|
||||
modeText(Bundles.format("text.mode.place", mode.toString()));
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ToolFragment implements Fragment{
|
||||
public boolean confirming;
|
||||
|
||||
public void build(){
|
||||
InputHandler input = control.getInput();
|
||||
InputHandler input = control.input();
|
||||
|
||||
float isize = 14*3;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ToolFragment implements Fragment{
|
||||
input.placeMode.released(px, py, px2, py2);
|
||||
confirming = false;
|
||||
}else{
|
||||
input.placeMode.tapped(control.getInput().getBlockX(), control.getInput().getBlockY());
|
||||
input.placeMode.tapped(control.input().getBlockX(), control.input().getBlockY());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -61,8 +61,8 @@ public class ToolFragment implements Fragment{
|
||||
tools.setPosition(v.x, v.y, Align.top);
|
||||
|
||||
}else{
|
||||
tools.setPosition(control.getInput().getCursorX(),
|
||||
Gdx.graphics.getHeight() - control.getInput().getCursorY() - 15*Core.cameraScale, Align.top);
|
||||
tools.setPosition(control.input().getCursorX(),
|
||||
Gdx.graphics.getHeight() - control.input().getCursorY() - 15*Core.cameraScale, Align.top);
|
||||
}
|
||||
|
||||
if(input.placeMode != PlaceMode.areaDelete){
|
||||
|
||||
Reference in New Issue
Block a user