docs: add function-level documentation comments across various source files to improve the readability of codebase

This commit is contained in:
Bluewhale1337
2026-08-24 12:42:23 +02:00
parent d09e49d26a
commit 6d977f6963
24 changed files with 335 additions and 27 deletions
+25 -15
View File
@@ -1,9 +1,11 @@
-- HealBot Options panel file: HealBot_Options_Spells.lua
-- Split from original HealBot_Options.lua
-- HealBot_ComboButtons_Button_OnLoad: UI handler for dropdown combo box.
function HealBot_ComboButtons_Button_OnLoad(this,text)
getglobal(this:GetName().."Text"):SetText(text);
end
-- HealBot_ComboButtons_Button_OnClick: Click event handler.
function HealBot_ComboButtons_Button_OnClick(this,id)
if HealBot_Options_ComboButtons_Button>0 then
getglobal("HealBot_ComboButtons_Button"..HealBot_Options_ComboButtons_Button):SetChecked(nil);
@@ -14,27 +16,35 @@ function HealBot_ComboButtons_Button_OnClick(this,id)
end
HealBot_Options_ComboClass_Text()
end
-- HealBot_Options_ShowTooltip_OnLoad: UI handler for OnLoad options panel.
function HealBot_Options_ShowTooltip_OnLoad(this,text)
getglobal(this:GetName().."Text"):SetText(text);
end
-- HealBot_Options_ShowTooltip_OnClick: UI handler for OnClick options panel.
function HealBot_Options_ShowTooltip_OnClick(this)
HealBot_Config.ShowTooltip = this:GetChecked() or 0;
end
-- HealBot_Options_ShowTooltipTarget_OnLoad: UI handler for OnLoad options panel.
function HealBot_Options_ShowTooltipTarget_OnLoad(this,text)
getglobal(this:GetName().."Text"):SetText(text);
end
-- HealBot_Options_ShowTooltipTarget_OnClick: UI handler for OnClick options panel.
function HealBot_Options_ShowTooltipTarget_OnClick(this)
HealBot_Config.Tooltip_ShowTarget = this:GetChecked() or 0;
end
-- HealBot_Options_ShowTooltipSpellDetail_OnLoad: UI handler for OnLoad options panel.
function HealBot_Options_ShowTooltipSpellDetail_OnLoad(this,text)
getglobal(this:GetName().."Text"):SetText(text);
end
-- HealBot_Options_ShowTooltipSpellDetail_OnClick: UI handler for OnClick options panel.
function HealBot_Options_ShowTooltipSpellDetail_OnClick(this)
HealBot_Config.Tooltip_ShowSpellDetail = this:GetChecked() or 0;
end
-- HealBot_Options_ShowTooltipInstant_OnLoad: UI handler for OnLoad options panel.
function HealBot_Options_ShowTooltipInstant_OnLoad(this,text)
getglobal(this:GetName().."Text"):SetText(text);
end
-- HealBot_Options_ShowTooltipInstant_OnClick: UI handler for OnClick options panel.
function HealBot_Options_ShowTooltipInstant_OnClick(this)
HealBot_Config.Tooltip_Recommend = this:GetChecked() or 0;
end
@@ -46,6 +56,7 @@ local HealBot_Options_TooltipPos_List = {
HEALBOT_TOOLTIP_POSBELOW,
}
-- HealBot_Options_TooltipPos_DropDown: UI handler for DropDown options panel.
function HealBot_Options_TooltipPos_DropDown()
for i=1, getn(HealBot_Options_TooltipPos_List), 1 do
local info = {};
@@ -55,21 +66,25 @@ function HealBot_Options_TooltipPos_DropDown()
end
end
-- HealBot_Options_TooltipPos_Initialize: UI handler for Initialize options panel.
function HealBot_Options_TooltipPos_Initialize()
UIDropDownMenu_Initialize(HealBot_Options_TooltipPos,HealBot_Options_TooltipPos_DropDown)
end
-- HealBot_Options_TooltipPos_Refresh: UI handler for Refresh options panel.
function HealBot_Options_TooltipPos_Refresh(onselect)
if not HealBot_Config.TooltipPos then return end
if not onselect then HealBot_Options_TooltipPos_Initialize() end -- or wrong menu may be used !
HealBot_UIDropDownMenu_SetSelectedID(HealBot_Options_TooltipPos,HealBot_Config.TooltipPos)
end
-- HealBot_Options_TooltipPos_OnLoad: UI handler for OnLoad options panel.
function HealBot_Options_TooltipPos_OnLoad()
UIDropDownMenu_Initialize(this, HealBot_Options_TooltipPos_DropDown)
UIDropDownMenu_SetWidth(128, this)
end
-- HealBot_Options_TooltipPos_OnSelect: UI handler for OnSelect options panel.
function HealBot_Options_TooltipPos_OnSelect()
HealBot_Config.TooltipPos = this:GetID()
HealBot_Options_TooltipPos_Refresh(true)
@@ -91,6 +106,7 @@ local HealBot_Options_ComboClass_List = {
-- HealBot_Options_ComboClass_Text: UI handler for Text options panel.
function HealBot_Options_ComboClass_Text()
local class=UnitClass("Player");
local combo = HealBot_Config.KeyCombo[class]
@@ -108,6 +124,7 @@ end
-- HealBot_Options_ComboClass_Button: UI handler for Button options panel.
function HealBot_Options_ComboClass_Button()
local button = "Left"
if HealBot_Options_ComboButtons_Button==2 then button = "Middle"; end
@@ -128,10 +145,12 @@ ColorPickerFrame.func = HealBot_Returned_Colours
--------------------------------------------------------------------------------
-- HealBot_Options_EditBox_OnLoad: UI handler for OnLoad options panel.
function HealBot_Options_EditBox_OnLoad(this,text)
getglobal(this:GetName().."Text"):SetText(text);
end
-- HealBot_Options_Click_OnTextChanged: UI handler for OnTextChanged options panel.
function HealBot_Options_Click_OnTextChanged(this)
local class=UnitClass("Player");
if not HealBot_Config.KeyCombo[class] then HealBot_Config.KeyCombo[class] = {} end
@@ -141,6 +160,7 @@ function HealBot_Options_Click_OnTextChanged(this)
HealBot_Options_KeyCombo_Change()
end
-- HealBot_Options_Shift_OnTextChanged: UI handler for OnTextChanged options panel.
function HealBot_Options_Shift_OnTextChanged(this)
local class=UnitClass("Player");
if not HealBot_Config.KeyCombo[class] then HealBot_Config.KeyCombo[class] = {} end
@@ -150,6 +170,7 @@ function HealBot_Options_Shift_OnTextChanged(this)
HealBot_Options_KeyCombo_Change()
end
-- HealBot_Options_Ctrl_OnTextChanged: UI handler for OnTextChanged options panel.
function HealBot_Options_Ctrl_OnTextChanged(this)
local class=UnitClass("Player");
if not HealBot_Config.KeyCombo[class] then HealBot_Config.KeyCombo[class] = {} end
@@ -159,6 +180,7 @@ function HealBot_Options_Ctrl_OnTextChanged(this)
HealBot_Options_KeyCombo_Change()
end
-- HealBot_Options_ShiftCtrl_OnTextChanged: UI handler for OnTextChanged options panel.
function HealBot_Options_ShiftCtrl_OnTextChanged(this)
local class=UnitClass("Player");
if not HealBot_Config.KeyCombo[class] then HealBot_Config.KeyCombo[class] = {} end
@@ -168,32 +190,20 @@ function HealBot_Options_ShiftCtrl_OnTextChanged(this)
HealBot_Options_KeyCombo_Change()
end
-- HealBot_Options_KeyCombo_Change: Applies binding combo updates.
function HealBot_Options_KeyCombo_Change()
local class=UnitClass("Player");
HealBot_Config.KeyCombo[class]=HealBot_Config.KeyCombo[class];
end
-- HealBot_Options_EnableHealthy_OnLoad: UI handler for OnLoad options panel.
function HealBot_Options_EnableHealthy_OnLoad(this,text)
getglobal(this:GetName().."Text"):SetText(text);
end
-- HealBot_Options_EnableHealthy_OnClick: UI handler for OnClick options panel.
function HealBot_Options_EnableHealthy_OnClick(this)
HealBot_Config.EnableHealthy = this:GetChecked() or 0;
HealBot_Action_EnableButtons();
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Chat Custom Messages UI Logic
--------------------------------------------------------------------------------