diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua index 1f97162..32279cc 100644 --- a/Titan/TitanConfig.lua +++ b/Titan/TitanConfig.lua @@ -623,80 +623,7 @@ local function TitanUpdateConfigBars(t, pos) TitanPanelBarButton_DisplayBarsWanted("Bar reset to default position - " .. tostring(info[1])) end, } ---[[ - position = position + 1 -- spacer - args[v.name].args.position_spacer = { - order = position, - type = "description", - width = "full", - name = " ", - } - position = position + 1 -- reset pos - args[v.name].args.offset_x_num = { - order = position, - name = " X ", - desc = "", - disabled = (v.vert == TITAN_TOP or v.vert == TITAN_BOTTOM), - type = "input", - width = ".2", - get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) - local res = TitanBarDataVars[frame_str].off_x -print("Config X get" -.." ".. tostring(info[1]).."" -.." ".. tostring(frame_str).."" -.." ".. tostring(res).."" -) - return Format_coord(res) - end, - set = function(info, val) - local frame_str = TitanVariables_GetFrameName(info[1]) -print("Config X set" -.." ".. tostring(frame_str).."" -.." ".. tostring(val).."" -) - local num = tonumber(val) - if num == nil then - -- invalid num yell at user :) - TitanPrint("error", "X not a number") - else - TitanBarDataVars[frame_str].off_x = val - end - end, - } - position = position + 1 -- reset pos - args[v.name].args.offset_y_num = { - order = position, - name = " Y ", - desc = "", - disabled = (v.vert == TITAN_TOP or v.vert == TITAN_BOTTOM), - type = "input", - width = ".2", - get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) - local res = TitanBarDataVars[frame_str].off_y -print("Config Y get" -.." ".. tostring(frame_str).."" -.." ".. tostring(res).."" -) - return Format_coord(res) - end, - set = function(info, val) - local frame_str = TitanVariables_GetFrameName(info[1]) -print("Config Y set" -.." ".. tostring(frame_str).."" -.." ".. tostring(val).."" -) - local num = tonumber(val) - if num == nil then - -- invalid num yell at user :) - TitanPrint("error", "Y not a number") - else - TitanBarDataVars[frame_str].off_y = val - end - end, - } ---]] + -- ====== -- Background group position = position + 1 -- background @@ -2289,29 +2216,85 @@ NOTE: :NOTE --]] local function TitanPanel_AddNewSkin(skinname, skinpath) + local out_str = "Start : " + local msg_type = "warning" -- assume something went wrong :) + -- name and path must be provided - if not skinname or not skinpath then return end + if skinname and skinpath then -- continue - -- name cannot be empty or "None", path cannot be empty - if skinname == "" or skinname == L["TITAN_PANEL_NONE"] or skinpath == "" then - return - end + -- name cannot be empty or "None", path cannot be empty + if skinname == "" or skinname == L["TITAN_PANEL_NONE"] or skinpath == "" then + out_str = "No Skin added - blank value :" + else + -- Assume the skin is already in the Titan saved variables list + local found + for _, i in pairs(TitanSkins) do + if i.name == skinname or i.path == skinpath then + found = true + break + end + end - -- Assume the skin is already in the Titan saved variables list - local found - for _, i in pairs(TitanSkins) do - if i.name == skinname or i.path == skinpath then - found = true - break + -- The skin is new so add it to the Titan saved variables list + if found then + out_str = "No Skin added - already in list :" + else + table.insert(TitanSkins, { name = skinname, path = skinpath }) + msg_type = "info" + out_str = "Skin added :" + end end + else + out_str = "No Skin added - no value :" end - -- The skin is new so add it to the Titan saved variables list - if not found then - table.insert(TitanSkins, { name = skinname, path = skinpath }) + -- Regardless of result, rebuild Skin list + BuildSkins() + + out_str = out_str + .." '"..tostring(skinname).."'" + .."\n Full Path:"..tostring(skinpath).."" + TitanPrint(out_str, msg_type) +end + +--[[ local +NAME: Remove_Skin +DESC: Remove requested skin from selectable list. +VAR: skinname - the file name to use +VAR: skinpath - the file path to use +OUT: None +NOTE: +- Blizz *does not allow* LUA to access the user file system dynamically so the skins have to be input by hand. Titan can not search for available skins in the Artwork folder. +- On the flip side a user can add a custom skin to the Titan saved variables then later delete the skin from the file system. This will not cause an error when the user tries to use (show) that skin but Titan will show a 'blank' skin. +:NOTE +--]] +local function Remove_Skin(skinname) + local out_str = "Start : " + local msg_type = "warning" -- assume something went wrong :) + local found = false + + if skinname == "None" then + out_str = "No Skin removed - none selected :" + else + local k, v; + for k, v in pairs(TitanSkins) do + if v.name == skinname then + table.remove(TitanSkins, k) + found = true + break + end + end + if found then + msg_type = "info" + out_str = "Skin removed :" + else + out_str = "No Skin removed - none selected :" + end end - BuildSkins() + out_str = out_str + .." '"..tostring(skinname).."'" + TitanPrint(out_str, msg_type) end --[[ local @@ -2368,13 +2351,11 @@ local optionsSkinsCustom = { type = "execute", desc = L["TITAN_PANEL_SKINS_ADD_DESC"], func = function() - if TitanSkinName ~= "" and TitanSkinPath ~= "" then TitanPanel_AddNewSkin(TitanSkinName, TitanSkinPath) TitanSkinName = "" TitanSkinPath = "" -- Config Tables changed! AceConfigRegistry:NotifyChange("Titan Panel Skin Custom") - end end, }, nulloption2 = { @@ -2406,10 +2387,10 @@ local optionsSkinsCustom = { and v.path ~= "Interface\\AddOns\\Titan\\Artwork\\" and v.titan ~= true then - Skinlist[v.path] = TitanUtils_GetHexText(v.name, Titan_Global.colors.green) + Skinlist[v.name] = TitanUtils_GetHexText(v.name, Titan_Global.colors.green) end if v.path == TitanSkinToRemove then - Skinlist[v.path] = TitanUtils_GetHexText(v.name, Titan_Global.colors.yellow) + Skinlist[v.name] = TitanUtils_GetHexText(v.name, Titan_Global.colors.yellow) end end if TitanSkinToRemove ~= "None" then @@ -2418,8 +2399,8 @@ local optionsSkinsCustom = { Skinlist["None"] = TitanUtils_GetHexText(L["TITAN_PANEL_NONE"], Titan_Global.colors.yellow) end table.sort(Skinlist, function(a, b) - return string.lower(TitanSkins[a].name) - < string.lower(TitanSkins[b].name) + return string.lower(a) + < string.lower(b) end) return Skinlist end, @@ -2430,17 +2411,10 @@ local optionsSkinsCustom = { name = L["TITAN_PANEL_SKINS_REMOVE_BUTTON"], desc = L["TITAN_PANEL_SKINS_REMOVE_BUTTON_DESC"], func = function() - if TitanSkinToRemove == "None" then return end - local k, v; - for k, v in pairs(TitanSkins) do - if v.path == TitanSkinToRemove then - table.remove(TitanSkins, k) - TitanSkinToRemove = "None" - -- Config Tables changed! - AceConfigRegistry:NotifyChange("Titan Panel Skin Custom") - break - end - end + Remove_Skin(TitanSkinToRemove) + TitanSkinToRemove = "None" + -- Config Tables changed! + AceConfigRegistry:NotifyChange("Titan Panel Skin Custom") end, }, nulloption4 = { diff --git a/TitanLootType/TitanClassicLootType.lua b/TitanLootType/TitanClassicLootType.lua index 90016c1..36e07ac 100644 --- a/TitanLootType/TitanClassicLootType.lua +++ b/TitanLootType/TitanClassicLootType.lua @@ -117,6 +117,14 @@ local function LootDebug(msg, mtype) end end +-- Might be overkill but prepare for an API update... +local LootMethod = nil +if C_PartyInfo and C_PartyInfo.GetLootMethod then + LootMethod = C_PartyInfo.GetLootMethod +else + LootMethod = GetLootMethod +end + -- Tools for the tracker local Tool = {} @@ -448,39 +456,11 @@ VAR: None OUT: true / false --]] local function IsLead() - --[[ -lootmethod, masterlooterPartyID, masterlooterRaidID = GetLootMethod() -lootmethod -String (LootMethod) - One of 'freeforall', 'roundrobin', 'master', 'group', 'needbeforegreed'. Appears to be 'freeforall' if you are not grouped.: At least as of 7.3 the possible return values appear to be "freeforall", "master", "group" and "personalloot". "roundrobin" and "needbeforegreed" appear to be deprecated. -masterlooterPartyID -Number - Returns 0 if player is the mater looter, 1-4 if party member is master looter (corresponding to party1-4) and nil if the master looter isn't in the player's party or master looting is not used. -masterlooterRaidID -Number - Returns index of the master looter in the raid (corresponding to a raidX unit), or nil if the player is not in a raid or master looting is not used. - -raidIndex = UnitInRaid("unit") -raidIndex of "unit" if he is in your raid group, otherwise nil. - -isTrue = UnitInParty("arg1") -inGroup = IsInGroup([groupType]) - -isTrue = UnitIsGroupLeader("unit"[, groupType]) -isLeader = IsRaidLeader() - -isLeader = UnitIsGroupLeader("unit" or "player name") -- may need in later patches? ---]] - --[[ - if IsInRaid() and IsRaidLeader() then - return true - end - if IsInGroup() and UnitIsGroupLeader("player") then - return true - end ---]] if UnitIsGroupLeader("player") then return true end -- The way this flows is both leader AND master looter will have the extra buttons - local lootmethod, masterlooterPartyID, masterlooterRaidID = GetLootMethod() + local lootmethod, masterlooterPartyID, masterlooterRaidID = LootMethod() if lootmethod == "master" then if IsInRaid() and (masterlooterRaidID == UnitInRaid("player")) then return true @@ -1490,7 +1470,7 @@ function TitanPanelLootTypeButton_GetButtonText(id) -- if (GetNumSubgroupMembers() > 0) or (GetNumGroupMembers() > 0) then if IsInRaid() or IsInGroup() then - lootTypeText = TitanLootMethod[GetLootMethod()].text; + lootTypeText = TitanLootMethod[LootMethod()].text; lootThreshold = GetLootThreshold(); color = _G["ITEM_QUALITY_COLORS"][lootThreshold]; else @@ -1511,7 +1491,7 @@ OUT: None function TitanPanelLootTypeButton_GetTooltipText() -- if (GetNumSubgroupMembers() > 0) or (GetNumGroupMembers() > 0) then if IsInRaid() or IsInGroup() then - local lootTypeText = TitanLootMethod[GetLootMethod()].text; + local lootTypeText = TitanLootMethod[LootMethod()].text; local lootThreshold = GetLootThreshold(); local itemQualityDesc = _G["ITEM_QUALITY" .. lootThreshold .. "_DESC"]; local color = _G["ITEM_QUALITY_COLORS"][lootThreshold]; diff --git a/TitanRepair/TitanRepair.lua b/TitanRepair/TitanRepair.lua index a4faec3..1d85a99 100644 --- a/TitanRepair/TitanRepair.lua +++ b/TitanRepair/TitanRepair.lua @@ -1531,11 +1531,17 @@ local function Create_Frames() TitanRepair_RepairItems(); end, OnShow = function(self) - MoneyFrame_Update(self.moneyFrame, TR.repair_total); + local mf = {} + if self.MoneyFrame then + mf = self.MoneyFrame -- retail as of 11.2.0 / TWW / Aug 2025 + else + mf = self.moneyFrame -- older popup scheme + end + MoneyFrame_Update(mf, TR.repair_total); end, hasMoneyFrame = 1, timeout = 0, - hideOnEscape = 1 + hideOnEscape = 1, };