File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { ModEntry } from '../../types'
22import { GuiOption , ModOptionsSettings } from '../../mod-options'
3+ import { LocalMods } from '../../local-mods'
34
45declare global {
6+ namespace modmanager {
7+ function openModOptionsMenu ( modId : string ) : void
8+ }
59 namespace modmanager . gui {
610 interface OptionsMenu extends sc . BaseMenu , sc . Model . Observer {
711 mod : ModEntry
@@ -38,6 +42,19 @@ declare global {
3842 }
3943}
4044
45+ modmanager . openModOptionsMenu = ( modId : string ) => {
46+ const record = LocalMods . getAllRecord ( )
47+ const mod = record [ modId ]
48+ if ( ! mod ) throw new Error ( `Mod: "${ modId } " does not have options menu!` )
49+ if ( sc . menu . currentMenu == sc . MENU_SUBMENU . START ) {
50+ sc . menu . setDirectMode ( true , sc . MENU_SUBMENU . MOD_OPTIONS )
51+ sc . model . enterMenu ( true )
52+ } else {
53+ sc . menu . pushMenu ( sc . MENU_SUBMENU . MOD_OPTIONS )
54+ }
55+ modmanager . gui . optionsMenu . updateEntries ( mod )
56+ }
57+
4158modmanager . gui . OptionsMenu = sc . BaseMenu . extend ( {
4259 init ( ) {
4360 this . parent ( )
You can’t perform that action at this time.
0 commit comments