Tutorial fixes
This commit is contained in:
@@ -90,7 +90,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
void showQuitConfirm(){
|
||||
ui.showConfirm("$confirm", state.rules.tutorial ? "$quit.confirm.tutorial" : "$quit.confirm", () -> {
|
||||
if(state.rules.tutorial){
|
||||
Core.settings.put("tutorial", true);
|
||||
Core.settings.put("playedtutorial", true);
|
||||
Core.settings.save();
|
||||
}
|
||||
wasClient = Net.client();
|
||||
|
||||
@@ -141,40 +141,23 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
game.pref(new Setting(){
|
||||
@Override
|
||||
public void add(SettingsTable table){
|
||||
table.addButton("$settings.cleardata", () -> {
|
||||
FloatingDialog dialog = new FloatingDialog("$settings.cleardata");
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.defaults().size(230f, 60f).pad(3);
|
||||
dialog.addCloseButton();
|
||||
dialog.cont.addButton("$settings.clearunlocks", () -> {
|
||||
ui.showConfirm("$confirm", "$settings.clear.confirm", () -> {
|
||||
data.reset();
|
||||
dialog.hide();
|
||||
});
|
||||
});
|
||||
dialog.cont.row();
|
||||
dialog.cont.addButton("$settings.clearall", () -> {
|
||||
ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
|
||||
ObjectMap<String, Object> map = new ObjectMap<>();
|
||||
for(String value : Core.settings.keys()){
|
||||
if(value.contains("usid") || value.contains("uuid")){
|
||||
map.put(value, Core.settings.getString(value));
|
||||
}
|
||||
}
|
||||
Core.settings.clear();
|
||||
Core.settings.putAll(map);
|
||||
Core.settings.save();
|
||||
table.addButton("$settings.cleardata", () -> ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
|
||||
ObjectMap<String, Object> map = new ObjectMap<>();
|
||||
for(String value : Core.settings.keys()){
|
||||
if(value.contains("usid") || value.contains("uuid")){
|
||||
map.put(value, Core.settings.getString(value));
|
||||
}
|
||||
}
|
||||
Core.settings.clear();
|
||||
Core.settings.putAll(map);
|
||||
Core.settings.save();
|
||||
|
||||
for(FileHandle file : dataDirectory.list()){
|
||||
file.deleteDirectory();
|
||||
}
|
||||
for(FileHandle file : dataDirectory.list()){
|
||||
file.deleteDirectory();
|
||||
}
|
||||
|
||||
Core.app.exit();
|
||||
});
|
||||
});
|
||||
dialog.cont.row();
|
||||
dialog.show();
|
||||
}).size(220f, 60f).pad(6).left();
|
||||
Core.app.exit();
|
||||
})).size(220f, 60f).pad(6).left();
|
||||
table.add();
|
||||
table.row();
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
||||
cont.row();
|
||||
cont.table(desc -> {
|
||||
desc.left().defaults().left().width(Core.graphics.isPortrait() ? 350f : 500f);
|
||||
desc.pane(t -> t.marginRight(12f).add(zone.description).wrap().growX()).fillX().maxHeight(mobile ? 240f : 400f).pad(2).padBottom(8f).get().setScrollingDisabled(true, false);
|
||||
desc.pane(t -> t.marginRight(12f).add(zone.description).wrap().growX()).fillX().maxHeight(mobile ? 300f : 450f).pad(2).padBottom(8f).get().setScrollingDisabled(true, false);
|
||||
desc.row();
|
||||
|
||||
desc.table(t -> {
|
||||
|
||||
@@ -419,7 +419,8 @@ public class HudFragment extends Fragment{
|
||||
/** Show unlock notification for a new recipe. */
|
||||
public void showUnlock(UnlockableContent content){
|
||||
//some content may not have icons... yet
|
||||
if(content.getContentIcon() == null || state.is(State.menu)) return;
|
||||
//also don't play in the tutorial to prevent confusion
|
||||
if(content.getContentIcon() == null || state.is(State.menu) || state.rules.tutorial) return;
|
||||
|
||||
Sounds.message.play();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user