This commit is contained in:
Anuken
2018-07-28 10:06:28 -04:00
parent 0454c4c25a
commit 924b1c1a67
4 changed files with 30 additions and 27 deletions

View File

@@ -151,6 +151,7 @@ text.save.rename.text=New name:
text.selectslot=Select a save.
text.slot=[accent]Slot {0}
text.save.corrupted=[orange]Save file corrupted or invalid!\nIf you have just updated your game, this is probably a change in the save format and [scarlet]not[] a bug.
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
text.empty=<empty>
text.on=On
text.off=Off

View File

@@ -29,17 +29,10 @@ Font: {
Color: {
black: {a: 1, b: 0, g: 0, r: 0 },
white: {a: 1, b: 1, g: 1, r: 1 },
green: {a: 1, b: 0, g: 1, r: 0 },
red: {a: 1, b: 0, g: 0, r: 1 },
blue: {a: 1, b: 1, g: 0, r: 0 },
grey: {a: 1, b: 0.32, g: 0.32, r: 0.32 },
lightgray: {a: 1, b: 0.3, g: 0.3, r: 0.3 },
orange: {hex: "#FFA500"},
gray: {a: 1, b: 0.32, g: 0.32, r: 0.32 },
lightgray: {a: 1, b: 0.65, g: 0.65, r: 0.65 }
orange: {hex: "FFA500"},
accent: {hex: "f4ba6e"},
vis-blue: {a: 1, b: 0.886, g: 0.631, r: 0.105 },
vis-red: {a: 1, b: 0.047, g: 0, r: 0.862 },
menuitem: {a: 1, b: 0.65, g: 0.65, r: 0.65 },
link-label: {a: 1, b: 0.886, g: 0.631, r: 0.105 }
},
TintedDrawable: {
dialogDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.9} },
@@ -56,21 +49,20 @@ ButtonStyle: {
toggle: {checked: button-down, down: button-down, up: button }
},
TextButtonStyle: {
default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: grey, down: button-down, up: button, transition: 0 },
default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button, transition: 0 },
discord: {over: discord-banner-over, font: default-font, fontColor: white, up: discord-banner},
info: {font: default-font, fontColor: white, up: info-banner},
clear: {down: clear-down, up: clear, over: clear-over, font: default-font, fontColor: white, disabledFontColor: grey },
clear: {down: clear-down, up: clear, over: clear-over, font: default-font, fontColor: white, disabledFontColor: gray },
empty: {font: default-font},
toggle: {font: default-font, fontColor: white, checked: button-down, down: button-down, up: button, over: button-over, disabled: button, disabledFontColor: grey }
toggle: {font: default-font, fontColor: white, checked: button-down, down: button-down, up: button, over: button-over, disabled: button, disabledFontColor: gray }
},
ImageButtonStyle: {
default: {down: button-down, up: button, over: button-over, imageDisabledColor: lightgray, imageUpColor: white },
default: {down: button-down, up: button, over: button-over, imageDisabledColor: gray, imageUpColor: white },
empty: { imageDownColor: accent, imageUpColor: white},
emptytoggle: {imageCheckedColor: white, imageDownColor: white, imageUpColor: lightgray},
emptytoggle: {imageCheckedColor: white, imageDownColor: white, imageUpColor: gray},
static: {up: button },
static-down: {up: button-down },
toggle: {checked: button-down, down: button-down, up: button, imageDisabledColor: lightgray, imageUpColor: white },
togglemap: {down: button-map-down, up: button-map },
toggle: {checked: button-down, down: button-down, up: button, imageDisabledColor: gray, imageUpColor: white },
select: {checked: button-select, up: clear },
clear: {down: clear-down, up: clear, over: clear-over},
},
@@ -86,7 +78,7 @@ WindowStyle: {
dialog: {stageBackground: dialogDim, titleFont: default-font, background: window-empty, titleFontColor: accent }
},
KeybindDialogStyle: {
default: {keyColor: accent, keyNameColor: white, controllerColor: menuitem, paneStyle: clear},
default: {keyColor: accent, keyNameColor: white, controllerColor: lightgray, paneStyle: clear},
},
SliderStyle: {
default-horizontal: {background: slider, knob: slider-knob, knobOver: slider-knob-over, knobDown: slider-knob-down},
@@ -95,16 +87,14 @@ SliderStyle: {
LabelStyle: {
default: {font: default-font, fontColor: white },
title: {font: title, fontColor: white },
link-label: {fontColor: link-label, font: default-font },
small: {font: default-font, fontColor: white },
menuitem-shortcut: {font: default-font, fontColor: menuitem }
small: {font: default-font, fontColor: white }
},
TextFieldStyle: {
default: {font: default-font-chat, fontColor: white, disabledFontColor: grey, selection: selection, background: button, cursor: cursor, messageFont: default-font, messageFontColor: grey }
textarea: {font: default-font-chat, fontColor: white, disabledFontColor: grey, selection: selection, background: textarea, cursor: cursor, messageFont: default-font, messageFontColor: grey }
default: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: button, cursor: cursor, messageFont: default-font, messageFontColor: gray }
textarea: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: textarea, cursor: cursor, messageFont: default-font, messageFontColor: gray }
}
CheckBoxStyle: {
default: {checkboxOn: check-on, checkboxOff: check-off, checkboxOnOver: check-on-over, checkboxOver: check-over, font: default-font, fontColor: white, disabledFontColor: grey }
default: {checkboxOn: check-on, checkboxOff: check-off, checkboxOnOver: check-on-over, checkboxOver: check-over, font: default-font, fontColor: white, disabledFontColor: gray }
}
}

View File

@@ -375,7 +375,7 @@ public class Control extends Module{
if(!state.mode.infiniteResources && Timers.get("timerCheckUnlock", 120)){
checkUnlockableBlocks();
//save if the db changed, but don't save unlocks
//save if the db changed, but don't save in debug
if(db.isDirty() && !debug){
db.save();
}

View File

@@ -15,6 +15,7 @@ import io.anuke.mindustry.world.Edges;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.util.Bits;
import io.anuke.ucore.util.GridMap;
import io.anuke.ucore.util.Log;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.*;
@@ -36,8 +37,19 @@ public class Sectors{
sector.saveID = control.getSaves().addSave("sector-" + sector.packedPosition()).index;
world.sectors().save();
}else{
control.getSaves().getByID(sector.saveID).load();
state.set(State.playing);
try{
sector.getSave().load();
state.set(State.playing);
}catch(Exception e){
Log.err(e);
sector.getSave().delete();
playSector(sector);
if(!headless){
threads.runGraphics(() -> ui.showError("$text.sector.corrupted"));
}
}
}
}