Add UI reskin by LJ Birdman (WiP)
This commit is contained in:
1 parent
f789860e96
commit
0200a2688a
240 files changed
+2594
-149
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import BattleScene, { Button } from "../battle-scene";
|
||||
import { Setting, settingDefaults, settingOptions } from "../system/settings";
|
||||
import { hasTouchscreen, isMobile } from "../touch-controls";
|
||||
import { TextStyle, addTextObject, getTextColor } from "./text";
|
||||
import { TextStyle, addTextObject } from "./text";
|
||||
import { Mode } from "./ui";
|
||||
import UiHandler from "./ui-handler";
|
||||
import { addWindow } from "./window";
|
||||
@@ -48,7 +48,11 @@ export default class SettingsUiHandler extends UiHandler {
|
||||
this.optionValueLabels = [];
|
||||
|
||||
Object.keys(Setting).forEach((setting, s) => {
|
||||
this.settingLabels[s] = addTextObject(this.scene, 8, 28 + s * 16, setting.replace(/\_/g, ' '), TextStyle.SETTINGS_LABEL);
|
||||
let settingName = setting.replace(/\_/g, ' ');
|
||||
if (Setting[setting] === Setting.UI_Theme)
|
||||
settingName += ' (Requires Reload)';
|
||||
|
||||
this.settingLabels[s] = addTextObject(this.scene, 8, 28 + s * 16, settingName, TextStyle.SETTINGS_LABEL);
|
||||
this.settingLabels[s].setOrigin(0, 0);
|
||||
|
||||
this.optionsContainer.add(this.settingLabels[s]);
|
||||
@@ -157,7 +161,7 @@ export default class SettingsUiHandler extends UiHandler {
|
||||
const ret = super.setCursor(cursor);
|
||||
|
||||
if (!this.cursorObj) {
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'select_cursor_highlight', null, (this.scene.game.canvas.width / 6) - 10, 16, 1, 1, 1, 1);
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'summary_moves_cursor', null, (this.scene.game.canvas.width / 6) - 10, 16, 1, 1, 1, 1);
|
||||
this.cursorObj.setOrigin(0, 0);
|
||||
this.optionsContainer.add(this.cursorObj);
|
||||
}
|
||||
@@ -178,14 +182,14 @@ export default class SettingsUiHandler extends UiHandler {
|
||||
const lastCursor = this.optionCursors[settingIndex];
|
||||
|
||||
const lastValueLabel = this.optionValueLabels[settingIndex][lastCursor];
|
||||
lastValueLabel.setColor(getTextColor(TextStyle.WINDOW));
|
||||
lastValueLabel.setShadowColor(getTextColor(TextStyle.WINDOW, true));
|
||||
lastValueLabel.setColor(this.getTextColor(TextStyle.WINDOW));
|
||||
lastValueLabel.setShadowColor(this.getTextColor(TextStyle.WINDOW, true));
|
||||
|
||||
this.optionCursors[settingIndex] = cursor;
|
||||
|
||||
const newValueLabel = this.optionValueLabels[settingIndex][cursor];
|
||||
newValueLabel.setColor(getTextColor(TextStyle.SETTINGS_SELECTED));
|
||||
newValueLabel.setShadowColor(getTextColor(TextStyle.SETTINGS_SELECTED, true));
|
||||
newValueLabel.setColor(this.getTextColor(TextStyle.SETTINGS_SELECTED));
|
||||
newValueLabel.setShadowColor(this.getTextColor(TextStyle.SETTINGS_SELECTED, true));
|
||||
|
||||
if (save)
|
||||
this.scene.gameData.saveSetting(setting, cursor);
|
||||
|
||||
Reference in new issue
Block a user