A somewhat complete tutorial
This commit is contained in:
@@ -48,25 +48,21 @@ public class PausedDialog extends FloatingDialog{
|
||||
}
|
||||
cont.addButton("$settings", ui.settings::show);
|
||||
|
||||
if(!world.isZone() && !state.isEditor()){
|
||||
if(!state.rules.tutorial){
|
||||
if(!world.isZone() && !state.isEditor()){
|
||||
cont.row();
|
||||
cont.addButton("$savegame", save::show);
|
||||
cont.addButton("$loadgame", load::show).disabled(b -> Net.active());
|
||||
}
|
||||
|
||||
cont.row();
|
||||
cont.addButton("$savegame", save::show);
|
||||
cont.addButton("$loadgame", load::show).disabled(b -> Net.active());
|
||||
|
||||
cont.addButton("$hostserver", ui.host::show).disabled(b -> Net.active()).colspan(2).width(dw * 2 + 20f);
|
||||
}
|
||||
|
||||
cont.row();
|
||||
|
||||
cont.addButton("$hostserver", ui.host::show).disabled(b -> Net.active()).colspan(2).width(dw * 2 + 20f);
|
||||
cont.row();
|
||||
|
||||
cont.addButton("$quit", () -> {
|
||||
ui.showConfirm("$confirm", "$quit.confirm", () -> {
|
||||
wasClient = Net.client();
|
||||
if(Net.client()) netClient.disconnectQuietly();
|
||||
runExitSave();
|
||||
hide();
|
||||
});
|
||||
}).colspan(2).width(dw + 10f);
|
||||
cont.addButton("$quit", this::showQuitConfirm).colspan(2).width(dw + 10f);
|
||||
|
||||
}else{
|
||||
cont.defaults().size(120f).pad(5);
|
||||
@@ -87,17 +83,23 @@ public class PausedDialog extends FloatingDialog{
|
||||
|
||||
cont.addRowImageTextButton("$hostserver.mobile", "icon-host", isize, ui.host::show).disabled(b -> Net.active());
|
||||
|
||||
cont.addRowImageTextButton("$quit", "icon-quit", isize, () -> {
|
||||
ui.showConfirm("$confirm", "$quit.confirm", () -> {
|
||||
wasClient = Net.client();
|
||||
if(Net.client()) netClient.disconnectQuietly();
|
||||
runExitSave();
|
||||
hide();
|
||||
});
|
||||
});
|
||||
cont.addRowImageTextButton("$quit", "icon-quit", isize, this::showQuitConfirm);
|
||||
}
|
||||
}
|
||||
|
||||
void showQuitConfirm(){
|
||||
ui.showConfirm("$confirm", state.rules.tutorial ? "$quit.confirm.tutorial" : "$quit.confirm", () -> {
|
||||
if(state.rules.tutorial){
|
||||
Core.settings.put("tutorial", true);
|
||||
Core.settings.save();
|
||||
}
|
||||
wasClient = Net.client();
|
||||
if(Net.client()) netClient.disconnectQuietly();
|
||||
runExitSave();
|
||||
hide();
|
||||
});
|
||||
}
|
||||
|
||||
public void runExitSave(){
|
||||
if(state.isEditor() && !wasClient){
|
||||
ui.editor.resumeEditing();
|
||||
|
||||
@@ -71,7 +71,7 @@ public class HudFragment extends Fragment{
|
||||
}else{
|
||||
state.set(state.is(State.paused) ? State.playing : State.paused);
|
||||
}
|
||||
}).update(i -> {
|
||||
}).name("pause").update(i -> {
|
||||
if(Net.active()){
|
||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-players");
|
||||
}else{
|
||||
@@ -312,9 +312,10 @@ public class HudFragment extends Fragment{
|
||||
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
|
||||
});
|
||||
|
||||
//tutorial text
|
||||
parent.fill(t -> {
|
||||
t.top().visible(() -> state.rules.tutorial);
|
||||
t.table("button-trans", f -> f.labelWrap(() -> control.tutorial.stage.text()).width(400f).pad(3f));
|
||||
t.table("button-trans", f -> f.labelWrap(() -> control.tutorial.stage.text()).width(500f).pad(3f));
|
||||
});
|
||||
|
||||
//paused table
|
||||
@@ -549,6 +550,7 @@ public class HudFragment extends Fragment{
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
table.setName("waves");
|
||||
table.labelWrap(() -> {
|
||||
builder.setLength(0);
|
||||
builder.append(wavef.get(state.wave));
|
||||
|
||||
@@ -55,6 +55,6 @@ public class LoadingFragment extends Fragment{
|
||||
table.clearActions();
|
||||
table.toFront();
|
||||
table.touchable(Touchable.disabled);
|
||||
table.actions(Actions.fadeOut(1f), Actions.visible(false));
|
||||
table.actions(Actions.fadeOut(0.5f), Actions.visible(false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,9 +45,7 @@ public class MenuFragment extends Fragment{
|
||||
|
||||
parent = group;
|
||||
|
||||
parent.fill((x, y, w, h) -> {
|
||||
renderer.render();
|
||||
});
|
||||
parent.fill((x, y, w, h) -> renderer.render());
|
||||
|
||||
parent.fill(c -> {
|
||||
container = c;
|
||||
|
||||
@@ -13,8 +13,7 @@ import io.anuke.arc.scene.ui.*;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.entities.type.TileEntity;
|
||||
import io.anuke.mindustry.game.EventType.UnlockEvent;
|
||||
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
||||
import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.graphics.Pal;
|
||||
import io.anuke.mindustry.input.Binding;
|
||||
import io.anuke.mindustry.input.InputHandler;
|
||||
@@ -200,8 +199,10 @@ public class PlacementFragment extends Fragment{
|
||||
.left().width(190f).padLeft(5);
|
||||
header.add().growX();
|
||||
if(unlocked(lastDisplay)){
|
||||
header.addButton("?", "clear-partial", () -> ui.content.show(lastDisplay))
|
||||
.size(8 * 5).padTop(-5).padRight(-5).right().grow();
|
||||
header.addButton("?", "clear-partial", () -> {
|
||||
ui.content.show(lastDisplay);
|
||||
Events.fire(new BlockInfoEvent());
|
||||
}).size(8 * 5).padTop(-5).padRight(-5).right().grow().name("blockinfo");
|
||||
}
|
||||
if(lastDisplay.buildVisibility == Blocks.padVisible && !lastDisplay.buildVisibility.get()){
|
||||
header.row();
|
||||
|
||||
Reference in New Issue
Block a user