File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { LocalMods } from '../../local-mods'
44
55declare global {
66 namespace modmanager {
7- function openModOptionsMenu ( modId : string ) : void
7+ function openModOptionsMenu ( modId : string , tab ?: number ) : void
88 }
99 namespace modmanager . gui {
1010 interface OptionsMenu extends sc . BaseMenu , sc . Model . Observer {
@@ -42,7 +42,7 @@ declare global {
4242 }
4343}
4444
45- modmanager . openModOptionsMenu = ( modId : string ) => {
45+ modmanager . openModOptionsMenu = ( modId : string , tab ?: number ) => {
4646 const record = LocalMods . getAllRecord ( )
4747 const mod = record [ modId ]
4848 if ( ! mod ) throw new Error ( `Mod: "${ modId } " does not have options menu!` )
@@ -53,6 +53,7 @@ modmanager.openModOptionsMenu = (modId: string) => {
5353 sc . menu . pushMenu ( sc . MENU_SUBMENU . MOD_OPTIONS )
5454 }
5555 modmanager . gui . optionsMenu . updateEntries ( mod )
56+ if ( tab ) modmanager . gui . optionsMenu . listBox . setCurrentTab ( tab , true )
5657}
5758
5859modmanager . gui . OptionsMenu = sc . BaseMenu . extend ( {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ declare global {
5656
5757 onButtonTraversal ( this : this) : void
5858 _resetButtons ( this : this, tabButton ?: modmanager . gui . OptionsTabBox . TabButton , unfocus ?: boolean ) : void
59- setCurrentTab ( this : this, tabIndex : number ) : void
59+ setCurrentTab ( this : this, tabIndex : number , noSound ?: boolean ) : void
6060
6161 addObservers ( this : this) : void
6262 removeObservers ( this : this) : void
@@ -321,10 +321,10 @@ modmanager.gui.OptionsTabBox = ig.GuiElementBase.extend({
321321 if ( unfocus ) tab . focus = false
322322 }
323323 } ,
324- setCurrentTab ( tabIndex ) {
324+ setCurrentTab ( tabIndex , noSound ) {
325325 const button = this . tabArray [ tabIndex ]
326326 if ( this . prevPressed != button ) {
327- sc . BUTTON_SOUND . submit . play ( )
327+ if ( ! noSound ) sc . BUTTON_SOUND . submit . play ( )
328328 this . prevPressed = button !
329329 button . setPressed ( true )
330330
You can’t perform that action at this time.
0 commit comments