Add option to not show level up stats
This commit is contained in:
1 parent
7e5615c1bb
commit
4f91c47168
4 files changed
+20
-8
No files matched your search
@@ -131,6 +131,8 @@ export default class BattleMessageUiHandler extends MessageUiHandler {
|
||||
}
|
||||
|
||||
promptLevelUpStats(partyMemberIndex: integer, prevStats: integer[], showTotals: boolean, callback?: Function): void {
|
||||
if (!this.scene.showLevelUpStats)
|
||||
return callback();
|
||||
const newStats = (this.scene as BattleScene).getParty()[partyMemberIndex].stats;
|
||||
let levelUpStatsValuesText = '';
|
||||
const stats = Utils.getEnumValues(Stat);
|
||||
|
||||
@@ -39,13 +39,14 @@ export default class SettingsUiHandler extends UiHandler {
|
||||
|
||||
this.optionsContainer = this.scene.add.container(0, 0);
|
||||
|
||||
const settingLabels = [];
|
||||
this.optionValueLabels = [];
|
||||
|
||||
Object.keys(Setting).forEach((setting, s) => {
|
||||
const settingLabel = addTextObject(this.scene, 8, 28 + s * 16, setting.replace(/\_/g, ' '), TextStyle.SETTINGS_LABEL);
|
||||
settingLabel.setOrigin(0, 0);
|
||||
settingLabels[s] = addTextObject(this.scene, 8, 28 + s * 16, setting.replace(/\_/g, ' '), TextStyle.SETTINGS_LABEL);
|
||||
settingLabels[s].setOrigin(0, 0);
|
||||
|
||||
this.optionsContainer.add(settingLabel);
|
||||
this.optionsContainer.add(settingLabels[s]);
|
||||
|
||||
this.optionValueLabels.push(settingOptions[Setting[setting]].map((option, o) => {
|
||||
const valueLabel = addTextObject(this.scene, 0, 0, option, settingDefaults[Setting[setting]] === o ? TextStyle.SETTINGS_SELECTED : TextStyle.WINDOW);
|
||||
@@ -58,13 +59,15 @@ export default class SettingsUiHandler extends UiHandler {
|
||||
|
||||
const totalWidth = this.optionValueLabels[s].map(o => o.width).reduce((total, width) => total += width, 0);
|
||||
|
||||
const totalSpace = 220 - totalWidth / 6;
|
||||
const labelWidth = Math.max(78, settingLabels[s].displayWidth + 8);
|
||||
|
||||
const totalSpace = (300 - labelWidth) - totalWidth / 6;
|
||||
const optionSpacing = Math.floor(totalSpace / (this.optionValueLabels[s].length - 1));
|
||||
|
||||
let xOffset = 0;
|
||||
|
||||
for (let value of this.optionValueLabels[s]) {
|
||||
value.setPositionRelative(settingLabel, 82 + xOffset, 0);
|
||||
value.setPositionRelative(settingLabels[s], labelWidth + xOffset, 0);
|
||||
xOffset += value.width / 6 + optionSpacing;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user