- Button for perma-sprint hack
Localized button label in languages.lua
Add button to UI
Add event handler for button press event
Localized button label in languages.lua
Code:
/cygdrive/d/Games/SquareEnix/MMOMinion/LuaMods $ diff minionlib/languages.lua ../../test/LuaMods/minionlib/languages.lua
8d7
< sprint = "SprintToggle",
370d368
< sprint = "SprintToggle",
696d693
< sprint = "SprintToggle",
1022d1018
< sprint = "SprintToggle",
1348d1343
< sprint = "SprintToggle",
1676d1670
< sprint = "SprintToggle",
Add button to UI
Code:
/cygdrive/d/Games/SquareEnix/MMOMinion/LuaMods $ diff ffxivminion/ffxiv.lua ../../test/LuaMods/ffxivminion/ffxiv.lua
6d5
< ml_global_information.BtnSprint = { Name=strings[gCurrentLanguage].sprint,Event = "GUI_REQUEST_SPRINT_TOGGLE" }
71d69
< GUI_NewButton(ml_global_information.MainWindow.Name, ml_global_information.BtnSprint.Name , ml_global_information.BtnSprint.Event)
Add event handler for button press event
Code:
/cygdrive/d/Games/SquareEnix/MMOMinion/LuaMods $ diff minionlib/ml_task_hub.lua ../../test/LuaMods/minionlib/ml_task_hub.lua
14d13
< ml_task_hub.shouldSprint = false
136,150d134
< -- sprint toggle
< function ml_task_hub.ToggleSprint()
< ml_task_hub.shouldSprint = not ml_task_hub.shouldSprint
< -- don't reset information when we stop or else we lose debugging info
< if (ml_task_hub.shouldSprint) then
< ml_debug("Enabling Sprint")
< GameHacks:SetPermaSprint(true)
< else
< ml_debug("Disabling Sprint")
< GameHacks:SetPermaSprint(false)
< end
< --ml_debug("Task Hub Update: "..tostring(ml_task_hub.shouldSprint))
< end
<
<
198d181
< RegisterEventHandler( "GUI_REQUEST_SPRINT_TOGGLE", ml_task_hub.ToggleSprint )