Fixed numerical rules resetting on Android
This commit is contained in:
@@ -3,7 +3,7 @@ package io.anuke.mindustry.ui.dialogs;
|
|||||||
import io.anuke.arc.function.*;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.arc.util.Strings;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.content.Blocks;
|
import io.anuke.mindustry.content.Blocks;
|
||||||
import io.anuke.mindustry.content.Items;
|
import io.anuke.mindustry.content.Items;
|
||||||
import io.anuke.mindustry.core.Platform;
|
import io.anuke.mindustry.core.Platform;
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
|
|
||||||
onResize(() -> {
|
onResize(() -> {
|
||||||
if(lastMap != null){
|
if(lastMap != null){
|
||||||
|
Rules rules = this.rules;
|
||||||
show(lastMap);
|
show(lastMap);
|
||||||
|
this.rules = rules;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -53,6 +55,7 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
modes.addButton(mode.toString(), "toggle", () -> {
|
modes.addButton(mode.toString(), "toggle", () -> {
|
||||||
selectedGamemode = mode;
|
selectedGamemode = mode;
|
||||||
rules = mode.apply(map.rules());
|
rules = mode.apply(map.rules());
|
||||||
|
Log.info("toggle rules " + rules);
|
||||||
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f).disabled(!mode.valid(map));
|
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f).disabled(!mode.valid(map));
|
||||||
if(i++ % 2 == 1) modes.row();
|
if(i++ % 2 == 1) modes.row();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user