Reset game stats upon map save in editor
This commit is contained in:
@@ -383,6 +383,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
state.rules.allowEditRules = false;
|
state.rules.allowEditRules = false;
|
||||||
state.rules.objectiveFlags.clear();
|
state.rules.objectiveFlags.clear();
|
||||||
state.rules.objectives.each(MapObjective::reset);
|
state.rules.objectives.each(MapObjective::reset);
|
||||||
|
state.stats = new GameStats();
|
||||||
String name = editor.tags.get("name", "").trim();
|
String name = editor.tags.get("name", "").trim();
|
||||||
editor.tags.put("rules", JsonIO.write(state.rules));
|
editor.tags.put("rules", JsonIO.write(state.rules));
|
||||||
editor.tags.remove("width");
|
editor.tags.remove("width");
|
||||||
|
|||||||
@@ -622,6 +622,7 @@ public class Mods implements Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Check all warnings related to content and show relevant dialogs. Client only. */
|
/** Check all warnings related to content and show relevant dialogs. Client only. */
|
||||||
|
//TODO move to another class, Mods.java should not handle UI
|
||||||
private void checkWarnings(){
|
private void checkWarnings(){
|
||||||
//show 'scripts have errored' info
|
//show 'scripts have errored' info
|
||||||
if(scripts != null && scripts.hasErrored()){
|
if(scripts != null && scripts.hasErrored()){
|
||||||
@@ -679,6 +680,7 @@ public class Mods implements Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Assume mods in toCheck are missing dependencies. */
|
/** Assume mods in toCheck are missing dependencies. */
|
||||||
|
//TODO move to another class, Mods.java should not handle UI
|
||||||
private void checkDependencies(Seq<LoadedMod> toCheck, boolean soft){
|
private void checkDependencies(Seq<LoadedMod> toCheck, boolean soft){
|
||||||
new Dialog(""){{
|
new Dialog(""){{
|
||||||
setFillParent(true);
|
setFillParent(true);
|
||||||
@@ -741,6 +743,7 @@ public class Mods implements Loadable{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO move to another class, Mods.java should not handle UI
|
||||||
private void displayDependencyImportStatus(Seq<String> failed, Seq<String> success){
|
private void displayDependencyImportStatus(Seq<String> failed, Seq<String> success){
|
||||||
new Dialog(""){{
|
new Dialog(""){{
|
||||||
setFillParent(true);
|
setFillParent(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user