07-04-2016, 02:43 AM
How do I change the value of a variable is they are set to a SafeComboBox?
For example.
I wish to set gAssistMode setting via my own GUI , my GUI reflect the settings as selected in the Assist Window, but I can not set the value via my GUI.
Inside ffxiv_task_assist.lua I can see the value is saved via a SafeComboBox function call.
How can I override this ? Without having to modify the task file itself...
Here is my function attempting to set the value, I was trying different methods to try and force it.
For example.
I wish to set gAssistMode setting via my own GUI , my GUI reflect the settings as selected in the Assist Window, but I can not set the value via my GUI.
Inside ffxiv_task_assist.lua I can see the value is saved via a SafeComboBox function call.
How can I override this ? Without having to modify the task file itself...
Code:
gAssistMode = ffxivminion.SafeComboBox(Settings.FFXIVMINION.gAssistMode,gAssistMode_listitems,GetString("none"))
Code:
function ffxivminion.SafeComboBox(var,varlist,default)
local outputVar = var
local found = false
for k in StringSplit(varlist,",") do
if k == var then
found = true
end
if (found) then
break
end
end
if (not found) then
outputVar = default
end
return outputVar
end
Here is my function attempting to set the value, I was trying different methods to try and force it.
Code:
GUI:AlignFirstTextHeightToWidgets()
GUI:TextColored(1,1,1,200,string.pad(gAssistMode,5));
--===============================================================
-- START ASSIST MODE SELECTION POP UP
--===============================================================
if (GUI:IsItemHovered()) then
GUI:SetTooltip("Assist Modes")
end
if ( GUI:IsItemHovered() and GUI:IsMouseDoubleClicked(0) ) then
GUI:OpenPopup("AssistMode")
end
if (GUI:BeginPopup("AssistMode")) then
for i,e in pairs(mygui.assistmodes) do
if (GUI:Selectable(mygui.assistmodes[i],false)) then
AssistMode = tostring(mygui.assistmodes[i])
--Settings.FFXIVMINION.gAssistMode = GetString(AssistMode)
--gAssistMode = ffxivminion.SafeComboBox(Settings.FFXIVMINION.gAssistMode,gAssistMode_listitems,GetString(AssistMode))
gAssistMode = AssistMode
end
end
GUI:EndPopup()
end