diff --git a/HealBotBlue.toc b/HealBotBlue.toc index cb73825..b61b6eb 100644 --- a/HealBotBlue.toc +++ b/HealBotBlue.toc @@ -1,6 +1,6 @@ ## Interface: 11200 ## Title: HealBotBlue -## Version: 1.5 +## Version: 1.5.1 ## Author: Bluewhale ## Notes: Adds panel with skinable bars for healing and decursive ## SavedVariablesPerCharacter: HealBot_Config diff --git a/HealBot_Data.lua b/HealBot_Data.lua index e0a5377..86d1b4c 100644 --- a/HealBot_Data.lua +++ b/HealBot_Data.lua @@ -2,6 +2,20 @@ HealBot_ConfigDefaults = { ShowManaBars=0, ManaBarsHealersOnly=0, Version = HEALBOT_VERSION, + AutoSwap_Enabled = 0, + AutoSwap_Profiles = { + [1] = HEALBOT_SKINS_STD, + [2] = HEALBOT_SKINS_STD, + [3] = HEALBOT_SKINS_STD, + [4] = HEALBOT_SKINS_STD, + [5] = HEALBOT_SKINS_STD, + }, + bmaxrows = { + [HEALBOT_SKINS_STD] = 0, + }, + GridOrientation = { + [HEALBOT_SKINS_STD] = 1, + }, AlertLevel = 0.95, AutoClose = 1, PanelSounds = 1, diff --git a/HealBot_Options.lua b/HealBot_Options.lua index f3ebf3e..61ef947 100644 --- a/HealBot_Options.lua +++ b/HealBot_Options.lua @@ -314,8 +314,8 @@ function HealBot_Options_SetSkins() HealBot_Options_BarHeightS:SetValue(HealBot_Config.bheight[HealBot_Config.Current_Skin]) HealBot_Options_BarWidthS:SetValue(HealBot_Config.bwidth[HealBot_Config.Current_Skin]) HealBot_Options_BarNumColsS:SetValue(HealBot_Config.numcols[HealBot_Config.Current_Skin]) - HealBot_Options_BarMaxRowsS:SetValue(HealBot_Config.bmaxrows[HealBot_Config.Current_Skin] or 0) - HealBot_Options_GridOrientation:SetChecked((HealBot_Config.GridOrientation[HealBot_Config.Current_Skin] == 2) and 1 or nil) + HealBot_Options_BarMaxRowsS:SetValue((HealBot_Config.bmaxrows and HealBot_Config.bmaxrows[HealBot_Config.Current_Skin]) or 0) + HealBot_Options_GridOrientation:SetChecked(((HealBot_Config.GridOrientation and HealBot_Config.GridOrientation[HealBot_Config.Current_Skin]) == 2) and 1 or nil) HealBot_Options_BarBRSpaceS:SetValue(HealBot_Config.brspace[HealBot_Config.Current_Skin]) HealBot_Options_BarBCSpaceS:SetValue(HealBot_Config.bcspace[HealBot_Config.Current_Skin]) HealBot_Options_FramePaddingS:SetValue((HealBot_Config.bpadding and HealBot_Config.bpadding[HealBot_Config.Current_Skin]) or 10) diff --git a/HealBot_Options_Auto.lua b/HealBot_Options_Auto.lua index e476b92..2ebe79c 100644 --- a/HealBot_Options_Auto.lua +++ b/HealBot_Options_Auto.lua @@ -20,6 +20,7 @@ function HealBot_Options_Auto_Initialize() info.text = HealBot_Config.Skins[i] info.func = HealBot_Options_Auto_OnSelect info.value = id + if not HealBot_Config.AutoSwap_Profiles then HealBot_Config.AutoSwap_Profiles = {} end if HealBot_Config.AutoSwap_Profiles[id] == HealBot_Config.Skins[i] then info.checked = 1 else @@ -34,6 +35,7 @@ function HealBot_Options_Auto_OnSelect() local id = this.value if not id or not skin then return end + if not HealBot_Config.AutoSwap_Profiles then HealBot_Config.AutoSwap_Profiles = {} end HealBot_Config.AutoSwap_Profiles[id] = skin local dropdowns = { @@ -45,7 +47,7 @@ function HealBot_Options_Auto_OnSelect() } local dropdownName = dropdowns[id] local dropdownFrame = getglobal(dropdownName) - UIDropDownMenu_SetSelectedValue(dropdownFrame, skin) + HealBot_UIDropDownMenu_SetSelectedValue(dropdownFrame, skin) UIDropDownMenu_SetText(skin, dropdownFrame) HealBot_Action_PartyChanged() @@ -69,9 +71,10 @@ function HealBot_Options_Auto_OnShow(this) local dropdownFrame = getglobal(name) if dropdownFrame then UIDropDownMenu_SetWidth(150, dropdownFrame) + if not HealBot_Config.AutoSwap_Profiles then HealBot_Config.AutoSwap_Profiles = {} end local skin = HealBot_Config.AutoSwap_Profiles[id] if skin then - UIDropDownMenu_SetSelectedValue(dropdownFrame, skin) + HealBot_UIDropDownMenu_SetSelectedValue(dropdownFrame, skin) UIDropDownMenu_SetText(skin, dropdownFrame) end end diff --git a/HealBot_Options_Skins.lua b/HealBot_Options_Skins.lua index 58ed43b..9a0e2a5 100644 --- a/HealBot_Options_Skins.lua +++ b/HealBot_Options_Skins.lua @@ -2,11 +2,13 @@ -- Split from original HealBot_Options.lua function HealBot_Options_BarMaxRowsS_OnValueChanged(this) + if not HealBot_Config.bmaxrows then HealBot_Config.bmaxrows = {} end HealBot_Config.bmaxrows[HealBot_Config.Current_Skin] = this:GetValue() HealBot_Action_PartyChanged() end function HealBot_Options_GridOrientation_OnClick(this) + if not HealBot_Config.GridOrientation then HealBot_Config.GridOrientation = {} end if this:GetChecked() then HealBot_Config.GridOrientation[HealBot_Config.Current_Skin] = 2 -- Horizontal else @@ -25,8 +27,10 @@ function HealBot_Options_NewSkin_OnTextChanged(this) end function HealBot_Options_NewSkinb_OnClick(this) HealBot_Config.numcols[HealBot_Options_NewSkin:GetText()] = HealBot_Config.numcols[HealBot_Config.Current_Skin] - HealBot_Config.bmaxrows[HealBot_Options_NewSkin:GetText()] = HealBot_Config.bmaxrows[HealBot_Config.Current_Skin] - HealBot_Config.GridOrientation[HealBot_Options_NewSkin:GetText()] = HealBot_Config.GridOrientation[HealBot_Config.Current_Skin] + if not HealBot_Config.bmaxrows then HealBot_Config.bmaxrows = {} end + if not HealBot_Config.GridOrientation then HealBot_Config.GridOrientation = {} end + HealBot_Config.bmaxrows[HealBot_Options_NewSkin:GetText()] = HealBot_Config.bmaxrows[HealBot_Config.Current_Skin] or 0 + HealBot_Config.GridOrientation[HealBot_Options_NewSkin:GetText()] = HealBot_Config.GridOrientation[HealBot_Config.Current_Skin] or 1 HealBot_Config.btexture[HealBot_Options_NewSkin:GetText()] = HealBot_Config.btexture[HealBot_Config.Current_Skin] HealBot_Config.bcspace[HealBot_Options_NewSkin:GetText()] = HealBot_Config.bcspace[HealBot_Config.Current_Skin] HealBot_Config.brspace[HealBot_Options_NewSkin:GetText()] = HealBot_Config.brspace[HealBot_Config.Current_Skin] @@ -72,8 +76,8 @@ end function HealBot_Options_DeleteSkin_OnClick(this) if HealBot_Config.Current_Skin~=HEALBOT_SKINS_STD then HealBot_Config.numcols[HealBot_Options_SkinsText:GetText()] = nil - HealBot_Config.bmaxrows[HealBot_Options_SkinsText:GetText()] = nil - HealBot_Config.GridOrientation[HealBot_Options_SkinsText:GetText()] = nil + if HealBot_Config.bmaxrows then HealBot_Config.bmaxrows[HealBot_Options_SkinsText:GetText()] = nil end + if HealBot_Config.GridOrientation then HealBot_Config.GridOrientation[HealBot_Options_SkinsText:GetText()] = nil end HealBot_Config.btexture[HealBot_Options_SkinsText:GetText()] = nil HealBot_Config.bcspace[HealBot_Options_SkinsText:GetText()] = nil HealBot_Config.brspace[HealBot_Options_SkinsText:GetText()] = nil diff --git a/HealBot_View_Layout.lua b/HealBot_View_Layout.lua index 37e3e76..693e99e 100644 --- a/HealBot_View_Layout.lua +++ b/HealBot_View_Layout.lua @@ -402,6 +402,7 @@ function HealBot_Action_PartyChanged() threshold = 5 -- Raid40 end + if not HealBot_Config.AutoSwap_Profiles then HealBot_Config.AutoSwap_Profiles = {} end local swapSkin = HealBot_Config.AutoSwap_Profiles[threshold] if swapSkin and swapSkin ~= HealBot_Config.Current_Skin then HealBot_Config.Current_Skin = swapSkin @@ -769,8 +770,8 @@ function HealBot_Action_PartyChanged() local MaxOffsetY = 0; local MaxOffsetX = 0; - local maxRows = HealBot_Config.bmaxrows[HealBot_Config.Current_Skin] or 0 - local orientation = HealBot_Config.GridOrientation[HealBot_Config.Current_Skin] or 1 + local maxRows = (HealBot_Config.bmaxrows and HealBot_Config.bmaxrows[HealBot_Config.Current_Skin]) or 0 + local orientation = (HealBot_Config.GridOrientation and HealBot_Config.GridOrientation[HealBot_Config.Current_Skin]) or 1 if cols > (numBars - numHeaders) and maxRows == 0 then cols = numBars - numHeaders;