Skip to content

Commit 050eed3

Browse files
committed
Fix this types on certain mod options functions
1 parent 0aef9b2 commit 050eed3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/gui/options/tabbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ modmanager.gui.OptionsTabBox = ig.GuiElementBase.extend({
253253

254254
if (option.type == 'JSON_DATA') continue
255255

256-
if (option.hidden && (typeof option.hidden === 'boolean' || option.hidden())) {
256+
if (option.hidden && (typeof option.hidden === 'boolean' || option.hidden.call(option))) {
257257
continue
258258
}
259259

src/mod-options.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface OptionChangeable {
55
/** Does the option require a game restart to take effect */
66
restart?: boolean
77
/** Option change callback */
8-
changeEvent?: (this: GuiOption) => void
8+
changeEvent?: () => void
99
/** Redraw the menu on option change */
1010
updateMenuOnChange?: boolean
1111
/** Prevent the option from resetting the settings using the "Reset Settings" */
@@ -106,7 +106,7 @@ interface INFO {
106106

107107
interface BUTTON {
108108
type: 'BUTTON'
109-
onPress: (this: GuiOption) => void
109+
onPress: () => void
110110
}
111111

112112
interface JSON_DATA extends OptionChangeable {
@@ -422,7 +422,7 @@ export function modOptionsPoststart() {
422422
controlConfig.pressEvent.call(controlConfig)
423423
}
424424
if (controlConfig.holdEvent && ig.input.state(id)) {
425-
controlConfig.holdEvent()
425+
controlConfig.holdEvent.call(controlConfig)
426426
}
427427
}
428428
},

0 commit comments

Comments
 (0)