Skip to content

Commit 5769160

Browse files
fix(ui): Change player XP when the level is changed
1 parent ea3ff86 commit 5769160

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bw_save_game/ui/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ def show_persisted_value_editor(state: State, label: str, prop: PersistencePrope
382382
if changed:
383383
state.save_game.set_persistence_property(prop, new_value)
384384
imgui.pop_id()
385+
return changed
385386

386387

387388
def show_persisted_value_options_editor(
@@ -729,7 +730,8 @@ def show_editor_main(state: State):
729730
CLASS_KEYBINDING_VALUES,
730731
CLASS_KEYBINDING_LABELS,
731732
)
732-
show_persisted_value_editor(state, "Level:", PROGRESSION_CurrentLevel)
733+
if show_persisted_value_editor(state, "Level:", PROGRESSION_CurrentLevel):
734+
state.save_game.change_level(state.save_game.get_persistence_property(PROGRESSION_CurrentLevel))
733735
if show_persisted_value_options_editor(
734736
state,
735737
"Voice",

0 commit comments

Comments
 (0)