[Custom View] Ensure cursor stack safety on reload
This commit is contained in:
parent
cd56a2c49d
commit
8854a77417
1 changed files with 5 additions and 1 deletions
|
@ -113,9 +113,13 @@ end
|
|||
local function remove_injected_views(on_reload)
|
||||
-- These elements should be removed only on_reload, because, otherwise, they will be deleted automatically.
|
||||
if on_reload then
|
||||
-- If some custom view is active, close it.
|
||||
-- If some custom view is active, safely close it.
|
||||
if _views_data[_ingame_ui.current_view] then
|
||||
-- Hack to ensure cursor stack safety.
|
||||
ShowCursorStack.stack_depth = ShowCursorStack.stack_depth + 1
|
||||
_ingame_ui:handle_transition("exit_menu")
|
||||
ShowCursorStack.stack_depth = 1
|
||||
ShowCursorStack.pop()
|
||||
end
|
||||
|
||||
for view_name, view_data in pairs(_views_data) do
|
||||
|
|
Loading…
Add table
Reference in a new issue