|
| 1 | +from mods_base import build_mod#type:ignore |
| 2 | +from ui_utils import show_hud_message#type:ignore |
| 3 | +from typing import Any #type:ignore |
| 4 | +import unrealsdk#type:ignore |
| 5 | +from unrealsdk import make_struct, find_all #type:ignore |
| 6 | +from mods_base import get_pc, hook, keybind, build_mod, ENGINE, SliderOption, BoolOption #type:ignore |
| 7 | +from unrealsdk.hooks import Type, add_hook, Block, remove_hook, inject_next_call #type:ignore |
| 8 | +from unrealsdk.unreal import BoundFunction, UObject, WrappedStruct #type:ignore |
| 9 | +from ui_utils import show_hud_message #type:ignore |
| 10 | + |
| 11 | + |
| 12 | +def ServerUpdateLevelVisibility(obj: UObject, args: WrappedStruct, _3: Any, _4: BoundFunction) -> None: |
| 13 | + for item in unrealsdk.find_all("GbxGFxListCell"): |
| 14 | + if item and item.ListIndex != -1 and "OnPlayClicked" in str(item.OnClicked): |
| 15 | + item.OwningMovie.OnContinueClicked(item, unrealsdk.make_struct("GbxMenuInputEvent")) |
| 16 | + |
| 17 | + remove_hook("/Game/Maps/MenuMap/MenuMap_P.MenuMap_P_C:FadeDownBlackScreen__FinishedFunc", Type.POST, "ServerUpdateLevelVisibility") |
| 18 | + return |
| 19 | + |
| 20 | + |
| 21 | +@keybind("Save Quit, Reload") |
| 22 | +def SaveQuit(): |
| 23 | + if "MenuMap_P" not in str(ENGINE.GameViewport.World.CurrentLevel): |
| 24 | + unrealsdk.construct_object("GFxPauseMenu", get_pc()).OnQuitChoiceMade(None, "GbxMenu_Secondary1", unrealsdk.make_struct("GbxMenuInputEvent")) |
| 25 | + add_hook("/Game/Maps/MenuMap/MenuMap_P.MenuMap_P_C:FadeDownBlackScreen__FinishedFunc", Type.POST, "ServerUpdateLevelVisibility", ServerUpdateLevelVisibility) |
| 26 | + return |
| 27 | + |
| 28 | + |
| 29 | +build_mod() |
| 30 | + |
0 commit comments