Combobox return nil
Fixed an nil value on the combobox default value
What's the purpose of this change? API is designed that you store starting current index explicitly and pass it to widget function.
Only purpose is ease of use. Didnt want to put all my default values in when opening the menu, also not "resetting" settings when opening cus values getting called.
Please provide some more details. Because as I understand, the UI state is managed in the following way:
local state = { }
-- Reset state to default
-- Call it on script init and when menu was closed or just opened
function resetState()
state.index = 1
end
-- Menu loop
local _, state.index = WarMenu.ComboBox('Text', items, state.index)
If defualt states is not set when opening the menu the combobox will return nil. This is just ease of use so you dont have to set default values and potentially not being able to set settings cus the get reset when opening the menu