diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cd7315..9995955 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,6 @@ jobs: uses: "actions/upload-artifact@v4" if: success() with: - name: Clicked + name: Clicked2 path: .release/ include-hidden-files: true diff --git a/.pkgmeta b/.pkgmeta index e3c5e79..c81a917 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -1,4 +1,4 @@ -package-as: Clicked +package-as: Clicked2 enable-nolib-creation: no ignore: @@ -41,8 +41,8 @@ externals: commit: default move-folders: - Clicked/Clicked: Clicked - Clicked/ClickedMedia: ClickedMedia - Clicked/Libs/LibLog-1.0/LibLog-1.0: Clicked/Libs/LibLog-1.0 - Clicked/Libs/LibMacroSyntaxHighlight-1.0/LibMacroSyntaxHighlight-1.0: Clicked/Libs/LibMacroSyntaxHighlight-1.0 - Clicked/Libs/LibTalentInfo-1.0/LibTalentInfo-1.0: Clicked/Libs/LibTalentInfo-1.0 + Clicked2/Clicked: Clicked2 + Clicked2/ClickedMedia: ClickedMedia2 + Clicked2/Libs/LibLog-1.0/LibLog-1.0: Clicked2/Libs/LibLog-1.0 + Clicked2/Libs/LibMacroSyntaxHighlight-1.0/LibMacroSyntaxHighlight-1.0: Clicked2/Libs/LibMacroSyntaxHighlight-1.0 + Clicked2/Libs/LibTalentInfo-1.0/LibTalentInfo-1.0: Clicked2/Libs/LibTalentInfo-1.0 diff --git a/Clicked/BindingConfig/BindingConfig.lua b/Clicked/BindingConfig/BindingConfig.lua index 24024e2..c2aa446 100644 --- a/Clicked/BindingConfig/BindingConfig.lua +++ b/Clicked/BindingConfig/BindingConfig.lua @@ -51,7 +51,7 @@ local function FilterTargets(selected) local containsIllegal = false for _, uid in ipairs(selected) do - local obj = Clicked:GetByUid(uid) + local obj = Clicked2:GetByUid(uid) if obj ~= nil then allowedType = allowedType or obj.type @@ -74,8 +74,8 @@ local function SortByName(left, right) local leftScope = Addon:GetScopeFromUid(left.uid) local rightScope = Addon:GetScopeFromUid(right.uid) - local leftObj = Clicked:GetByUid(left.uid) - local rightObj = Clicked:GetByUid(right.uid) + local leftObj = Clicked2:GetByUid(left.uid) + local rightObj = Clicked2:GetByUid(right.uid) leftScope = leftScope or leftObj ~= nil and leftObj.scope or 1 rightScope = rightScope or rightObj ~= nil and rightObj.scope or 1 @@ -99,7 +99,7 @@ local function SortByName(left, right) end if leftObj ~= nil and rightObj ~= nil then - if leftObj.type == Clicked.DataObjectType.GROUP and rightObj.type == Clicked.DataObjectType.GROUP then + if leftObj.type == Clicked2.DataObjectType.GROUP and rightObj.type == Clicked2.DataObjectType.GROUP then --- @cast leftObj Group --- @cast rightObj Group @@ -111,7 +111,7 @@ local function SortByName(left, right) if not left.isAnyChildEnabled and right.isAnyChildEnabled then return false end - elseif leftObj.type == Clicked.DataObjectType.BINDING and rightObj.type == Clicked.DataObjectType.BINDING then + elseif leftObj.type == Clicked2.DataObjectType.BINDING and rightObj.type == Clicked2.DataObjectType.BINDING then --- @cast leftObj Binding --- @cast rightObj Binding @@ -144,8 +144,8 @@ local function SortByKey(left, right) local leftScope = Addon:GetScopeFromUid(left.uid) local rightScope = Addon:GetScopeFromUid(right.uid) - local leftObj = Clicked:GetByUid(left.uid) - local rightObj = Clicked:GetByUid(right.uid) + local leftObj = Clicked2:GetByUid(left.uid) + local rightObj = Clicked2:GetByUid(right.uid) leftScope = leftScope or leftObj ~= nil and leftObj.scope or 1 rightScope = rightScope or rightObj ~= nil and rightObj.scope or 1 @@ -169,7 +169,7 @@ local function SortByKey(left, right) end if leftObj ~= nil and rightObj ~= nil then - if leftObj.type == Clicked.DataObjectType.GROUP and rightObj.type == Clicked.DataObjectType.GROUP then + if leftObj.type == Clicked2.DataObjectType.GROUP and rightObj.type == Clicked2.DataObjectType.GROUP then --- @cast leftObj Group --- @cast rightObj Group @@ -181,7 +181,7 @@ local function SortByKey(left, right) if not left.isAnyChildEnabled and right.isAnyChildEnabled then return false end - elseif leftObj.type == Clicked.DataObjectType.BINDING and rightObj.type == Clicked.DataObjectType.BINDING then + elseif leftObj.type == Clicked2.DataObjectType.BINDING and rightObj.type == Clicked2.DataObjectType.BINDING then --- @cast leftObj Binding --- @cast rightObj Binding @@ -358,7 +358,7 @@ function Addon.BindingConfig.Window:GetSelection() local result = {} for _, id in ipairs(self.treeStatus.selected) do - table.insert(result, Clicked:GetByUid(id)) + table.insert(result, Clicked2:GetByUid(id)) end return result @@ -421,7 +421,7 @@ function Addon.BindingConfig.Window:RedrawPage() Addon:SafeCall(impl.Redraw, impl) end - self.frame:SetStatusText(string.format("%s | %s", Clicked.VERSION, Addon.db:GetCurrentProfile())) + self.frame:SetStatusText(string.format("%s | %s", Clicked2.VERSION, Addon.db:GetCurrentProfile())) end --- @private @@ -646,28 +646,28 @@ function Addon.BindingConfig.Window:CreateFrame() local id if type == "item" then - actionType = Clicked.ActionType.ITEM + actionType = Clicked2.ActionType.ITEM id = p2 --[[@as integer]] elseif type == "spell" then - actionType = Clicked.ActionType.SPELL + actionType = Clicked2.ActionType.SPELL id = p4 --[[@as integer]] elseif type == "petaction" then - actionType = Clicked.ActionType.SPELL + actionType = Clicked2.ActionType.SPELL id = p2 --[[@as integer]] elseif type == "macro" then - actionType = Clicked.ActionType.MACRO + actionType = Clicked2.ActionType.MACRO id = p2 --[[@as integer]] end if actionType ~= nil then - local binding = Clicked:CreateBinding() + local binding = Clicked2:CreateBinding() binding.actionType = actionType - if binding.actionType == Clicked.ActionType.SPELL then + if binding.actionType == Clicked2.ActionType.SPELL then binding.action.spellValue = id - elseif binding.actionType == Clicked.ActionType.ITEM then + elseif binding.actionType == Clicked2.ActionType.ITEM then binding.action.itemValue = id - elseif binding.actionType == Clicked.ActionType.MACRO then + elseif binding.actionType == Clicked2.ActionType.MACRO then local name, icon, content = GetMacroInfo(id) binding.action.macroName = name binding.action.macroIcon = icon @@ -704,19 +704,19 @@ function Addon.BindingConfig.Window:CreateOrUpdateTree() end end - for _, group in Clicked:IterateGroups() do + for _, group in Clicked2:IterateGroups() do local parent = Addon:GetScopeUid(group.scope) hierarchy[parent] = hierarchy[parent] or {} table.insert(hierarchy[parent], group) end - for _, binding in Clicked:IterateConfiguredBindings() do + for _, binding in Clicked2:IterateConfiguredBindings() do local parent = binding.parent or Addon:GetScopeUid(binding.scope) hierarchy[parent] = hierarchy[parent] or {} table.insert(hierarchy[parent], binding) end - for _, scope in pairs(Clicked.DataObjectScope) do + for _, scope in pairs(Clicked2.DataObjectScope) do local uid = Addon:GetScopeUid(scope) --- @type ClickedTreeGroupItem @@ -739,7 +739,7 @@ function Addon.BindingConfig.Window:CreateOrUpdateTree() for _, item in ipairs(hierarchy[current]) do existing[item.uid] = nil - if item.type == Clicked.DataObjectType.BINDING then + if item.type == Clicked2.DataObjectType.BINDING then --- @cast item Binding local title, icon = Addon:GetBindingNameAndIcon(item) @@ -751,7 +751,7 @@ function Addon.BindingConfig.Window:CreateOrUpdateTree() title = title, subtitle = #item.keybind > 0 and Addon:SanitizeKeybind(item.keybind) or Addon.L["UNBOUND"], icon = icon, - enabled = Clicked:IsBindingLoaded(item) + enabled = Clicked2:IsBindingLoaded(item) } self.treeItems[item.uid] = data @@ -759,11 +759,11 @@ function Addon.BindingConfig.Window:CreateOrUpdateTree() data.title = title data.subtitle = #item.keybind > 0 and Addon:SanitizeKeybind(item.keybind) or Addon.L["UNBOUND"] data.icon = icon - data.enabled = Clicked:IsBindingLoaded(item) + data.enabled = Clicked2:IsBindingLoaded(item) end table.insert(children, data) - elseif item.type == Clicked.DataObjectType.GROUP then + elseif item.type == Clicked2.DataObjectType.GROUP then --- @cast item Group local title, icon = Addon:GetGroupNameAndIcon(item) @@ -847,7 +847,7 @@ function Addon.BindingConfig.Window:CreateTreeFrame() local targets = FilterTargets(selected) if #targets > 0 then - self:SetPage(targets[1].type == Clicked.DataObjectType.BINDING and self.PAGE_BINDING or self.PAGE_GROUP) + self:SetPage(targets[1].type == Clicked2.DataObjectType.BINDING and self.PAGE_BINDING or self.PAGE_GROUP) else local page = self.pageStack[#self.pageStack].page @@ -860,7 +860,7 @@ function Addon.BindingConfig.Window:CreateTreeFrame() --- @param uid integer --- @param button Button local function OnButtonEnter(_, _, uid, button) - local obj = Clicked:GetByUid(uid) + local obj = Clicked2:GetByUid(uid) if obj == nil then return end @@ -868,7 +868,7 @@ function Addon.BindingConfig.Window:CreateTreeFrame() local text = "" local subtext = nil - if obj.type == Clicked.DataObjectType.BINDING then + if obj.type == Clicked2.DataObjectType.BINDING then --- @cast obj Binding text = Addon:GetBindingNameAndIcon(obj) @@ -895,12 +895,12 @@ function Addon.BindingConfig.Window:CreateTreeFrame() subtext = subtext .. "\n" subtext = subtext .. (self.treeItems[uid].enabled and Addon.L["Loaded"] or Addon.L["Unloaded"]) - elseif obj.type == Clicked.DataObjectType.GROUP then + elseif obj.type == Clicked2.DataObjectType.GROUP then --- @cast obj Group text = Addon:GetGroupNameAndIcon(obj) - local bindings = Clicked:GetByParent(uid) + local bindings = Clicked2:GetByParent(uid) local numLoaded = 0 for _, binding in ipairs(bindings) do @@ -925,7 +925,7 @@ function Addon.BindingConfig.Window:CreateTreeFrame() local objects = {} for _, id in ipairs(ids) do - local obj = Clicked:GetByUid(id) + local obj = Clicked2:GetByUid(id) if obj ~= nil and (#objects == 0 or obj.type == objects[1].type) then table.insert(objects, obj) @@ -939,7 +939,7 @@ function Addon.BindingConfig.Window:CreateTreeFrame() local ref = objects[1] MenuUtil.CreateContextMenu(UIParent, function(_, rootDescription) - if ref.type == Clicked.DataObjectType.BINDING then + if ref.type == Clicked2.DataObjectType.BINDING then --- @cast objects Binding[] --- @cast ref Binding @@ -948,7 +948,7 @@ function Addon.BindingConfig.Window:CreateTreeFrame() end):SetEnabled(#objects == 1) rootDescription:CreateButton(Addon.L["Paste Data"], function() - local source = Clicked:GetByUid(self.bindingCopyTarget) --[[@as Binding?]] + local source = Clicked2:GetByUid(self.bindingCopyTarget) --[[@as Binding?]] if source ~= nil then for _, binding in ipairs(objects) do @@ -992,20 +992,20 @@ function Addon.BindingConfig.Window:CreateTreeFrame() first = first or binding -- When converting to any macro, try to fill in the macro name, value and icon - if type == Clicked.ActionType.MACRO and Addon:IsNilOrEmpty(binding.action.macroValue) then + if type == Clicked2.ActionType.MACRO and Addon:IsNilOrEmpty(binding.action.macroValue) then local name = nil local icon = nil local format = nil - if binding.actionType == Clicked.ActionType.SPELL then + if binding.actionType == Clicked2.ActionType.SPELL then name = C_Spell.GetSpellName(binding.action.spellValue) icon = C_Spell.GetSpellTexture(binding.action.spellValue) format = Addon.L["Cast %s"] - elseif binding.actionType == Clicked.ActionType.ITEM then + elseif binding.actionType == Clicked2.ActionType.ITEM then name = C_Item.GetItemNameByID(binding.action.itemValue) icon = C_Item.GetItemIconByID(binding.action.itemValue) format = Addon.L["Use %s"] - elseif binding.actionType == Clicked.ActionType.CANCELAURA then + elseif binding.actionType == Clicked2.ActionType.CANCELAURA then name = C_Spell.GetSpellName(binding.action.auraName) icon = C_Spell.GetSpellTexture(binding.action.auraName) format = Addon.L["Cancel %s"] @@ -1031,15 +1031,15 @@ function Addon.BindingConfig.Window:CreateTreeFrame() end) end - CreateOption(Clicked.ActionType.SPELL, Addon.L["Cast a spell"]) - CreateOption(Clicked.ActionType.ITEM, Addon.L["Use an item"]) - CreateOption(Clicked.ActionType.CANCELAURA, Addon.L["Cancel an aura"]) - CreateOption(Clicked.ActionType.UNIT_SELECT, Addon.L["Target the unit"]) - CreateOption(Clicked.ActionType.UNIT_MENU, Addon.L["Open the unit menu"]) - CreateOption(Clicked.ActionType.MACRO, Addon.L["Run a macro"]) - CreateOption(Clicked.ActionType.APPEND, Addon.L["Append a binding segment"]) + CreateOption(Clicked2.ActionType.SPELL, Addon.L["Cast a spell"]) + CreateOption(Clicked2.ActionType.ITEM, Addon.L["Use an item"]) + CreateOption(Clicked2.ActionType.CANCELAURA, Addon.L["Cancel an aura"]) + CreateOption(Clicked2.ActionType.UNIT_SELECT, Addon.L["Target the unit"]) + CreateOption(Clicked2.ActionType.UNIT_MENU, Addon.L["Open the unit menu"]) + CreateOption(Clicked2.ActionType.MACRO, Addon.L["Run a macro"]) + CreateOption(Clicked2.ActionType.APPEND, Addon.L["Append a binding segment"]) end - elseif ref.type == Clicked.DataObjectType.GROUP then + elseif ref.type == Clicked2.DataObjectType.GROUP then --- @cast objects Group[] --- @cast ref Group @@ -1093,8 +1093,8 @@ function Addon.BindingConfig.Window:CreateTreeFrame() end end - CreateOption(Clicked.DataObjectScope.GLOBAL, Addon.L["Global"]) - CreateOption(Clicked.DataObjectScope.PROFILE, Addon.L["Profile"]) + CreateOption(Clicked2.DataObjectScope.GLOBAL, Addon.L["Global"]) + CreateOption(Clicked2.DataObjectScope.PROFILE, Addon.L["Profile"]) end rootDescription:CreateButton(Addon.L["Share"], function() @@ -1108,7 +1108,7 @@ function Addon.BindingConfig.Window:CreateTreeFrame() end for _, obj in ipairs(objects) do - Clicked:DeleteDataObject(obj) + Clicked2:DeleteDataObject(obj) end end @@ -1121,13 +1121,13 @@ function Addon.BindingConfig.Window:CreateTreeFrame() if #objects > 1 then msg = string.format(Addon.L["Are you sure you want to delete these %d bindings and/or groups?"], #objects) else - if ref.type == Clicked.DataObjectType.BINDING then + if ref.type == Clicked2.DataObjectType.BINDING then --- @cast ref Binding msg = Addon.L["Are you sure you want to delete this binding?"] .. "\n\n" msg = msg .. ref.keybind .. " " .. Addon:GetBindingNameAndIcon(ref) - elseif ref.type == Clicked.DataObjectType.GROUP then + elseif ref.type == Clicked2.DataObjectType.GROUP then --- @cast ref Group - local bindings = Clicked:GetByParent(ref.uid) + local bindings = Clicked2:GetByParent(ref.uid) msg = Addon.L["Are you sure you want to delete this group and ALL bindings it contains? This will delete %s bindings."]:format(#bindings) .. "\n\n" msg = msg .. Addon:GetGroupNameAndIcon(ref) diff --git a/Clicked/BindingConfig/Helpers.lua b/Clicked/BindingConfig/Helpers.lua index 04f7663..745cfe1 100644 --- a/Clicked/BindingConfig/Helpers.lua +++ b/Clicked/BindingConfig/Helpers.lua @@ -91,10 +91,10 @@ function Addon.BindingConfig.Helpers:GetMixedValues(targets, valueSelector) --- @type string local name - if obj.type == Clicked.DataObjectType.BINDING then + if obj.type == Clicked2.DataObjectType.BINDING then --- @cast obj Binding name = Addon:GetBindingNameAndIcon(obj) - elseif obj.type == Clicked.DataObjectType.GROUP then + elseif obj.type == Clicked2.DataObjectType.GROUP then --- @cast obj Group name = Addon:GetGroupNameAndIcon(obj) end diff --git a/Clicked/BindingConfig/Pages/Binding.lua b/Clicked/BindingConfig/Pages/Binding.lua index 6d3834e..98ad7f5 100644 --- a/Clicked/BindingConfig/Pages/Binding.lua +++ b/Clicked/BindingConfig/Pages/Binding.lua @@ -36,13 +36,13 @@ local Addon = select(2, ...) local Helpers = Addon.BindingConfig.Helpers -local BT_SPELL = Clicked.ActionType.SPELL -local BT_ITEM = Clicked.ActionType.ITEM -local BT_MACRO = Clicked.ActionType.MACRO -local BT_UNIT_SELECT = Clicked.ActionType.UNIT_SELECT -local BT_UNIT_MENU = Clicked.ActionType.UNIT_MENU -local BT_APPEND = Clicked.ActionType.APPEND -local BT_CANCELAURA = Clicked.ActionType.CANCELAURA +local BT_SPELL = Clicked2.ActionType.SPELL +local BT_ITEM = Clicked2.ActionType.ITEM +local BT_MACRO = Clicked2.ActionType.MACRO +local BT_UNIT_SELECT = Clicked2.ActionType.UNIT_SELECT +local BT_UNIT_MENU = Clicked2.ActionType.UNIT_MENU +local BT_APPEND = Clicked2.ActionType.APPEND +local BT_CANCELAURA = Clicked2.ActionType.CANCELAURA --- @param bindings Binding[] --- @param bindingTypes string[] @@ -149,7 +149,7 @@ Addon.BindingConfig.BindingPage = { for _, binding in ipairs(FilterBindingsByActionType(bindings, bindingTypes)) do -- TODO: Maybe we can retrieve this from the tree status? - if Clicked:IsBindingLoaded(binding) then + if Clicked2:IsBindingLoaded(binding) then table.insert(result, binding) end end diff --git a/Clicked/BindingConfig/Pages/ExportString.lua b/Clicked/BindingConfig/Pages/ExportString.lua index 1e43615..afdd7de 100644 --- a/Clicked/BindingConfig/Pages/ExportString.lua +++ b/Clicked/BindingConfig/Pages/ExportString.lua @@ -47,10 +47,10 @@ function Addon.BindingConfig.ExportStringPage:Show(mode, target) if mode == Addon.BindingConfig.ExportStringModes.BINDING_GROUP then --- @cast target DataObject - self.serialized = Clicked:SerializeDataObject(target) + self.serialized = Clicked2:SerializeDataObject(target) elseif mode == Addon.BindingConfig.ExportStringModes.PROFILE then --- @cast target Profile - self.serialized = Clicked:SerializeProfile(target, true, false) + self.serialized = Clicked2:SerializeProfile(target, true, false) end end @@ -73,10 +73,10 @@ function Addon.BindingConfig.ExportStringPage:Redraw() if self.mode == Addon.BindingConfig.ExportStringModes.BINDING_GROUP then --- @cast target DataObject - if target.type == Clicked.DataObjectType.BINDING then + if target.type == Clicked2.DataObjectType.BINDING then --- @cast target Binding widget:SetLabel(string.format(Addon.L["Exporting binding '%s'"], Addon:GetBindingNameAndIcon(target))) - elseif target.type == Clicked.DataObjectType.GROUP then + elseif target.type == Clicked2.DataObjectType.GROUP then --- @cast target Group widget:SetLabel(string.format(Addon.L["Exporting group '%s'"], target.name)) end diff --git a/Clicked/BindingConfig/Pages/IconSelect.lua b/Clicked/BindingConfig/Pages/IconSelect.lua index f09c21d..6705b7b 100644 --- a/Clicked/BindingConfig/Pages/IconSelect.lua +++ b/Clicked/BindingConfig/Pages/IconSelect.lua @@ -19,7 +19,7 @@ local AceGUI = LibStub("AceGUI-3.0") --- @class ClickedInternal local Addon = select(2, ...) -local MEDIA_ADDON_NAME = "ClickedMedia" +local MEDIA_ADDON_NAME = "ClickedMedia2" -- Private addon API @@ -42,7 +42,7 @@ function Addon.BindingConfig.IconSelectPage:Show(onSelectCallback) C_AddOns.EnableAddOn(MEDIA_ADDON_NAME) C_AddOns.LoadAddOn(MEDIA_ADDON_NAME) else - return Clicked:LogFatal("Unable to load {mediaAddonName}: {reason}", MEDIA_ADDON_NAME, reason) + return Clicked2:LogFatal("Unable to load {mediaAddonName}: {reason}", MEDIA_ADDON_NAME, reason) end end end diff --git a/Clicked/BindingConfig/Pages/ImportString.lua b/Clicked/BindingConfig/Pages/ImportString.lua index d108973..296f8a9 100644 --- a/Clicked/BindingConfig/Pages/ImportString.lua +++ b/Clicked/BindingConfig/Pages/ImportString.lua @@ -25,7 +25,7 @@ local Addon = select(2, ...) --- @return ExportProfile|ShareData|string local function OnTextChanged(mode, text) if mode == Addon.BindingConfig.ImportStringModes.BINDING_GROUP then - local success, data = Clicked:Deserialize(text, true) + local success, data = Clicked2:Deserialize(text, true) if not success then return false, data --[[@as string]] @@ -37,7 +37,7 @@ local function OnTextChanged(mode, text) return true, data --[[@as ShareData]] elseif mode == Addon.BindingConfig.ImportStringModes.PROFILE then - local success, data = Clicked:Deserialize(text, true) + local success, data = Clicked2:Deserialize(text, true) if not success then return false, data --[[@as string]] @@ -213,12 +213,12 @@ function Addon.BindingConfig.ImportStringPage:RedrawToReview() binding.keybind = "" end else - return Clicked:LogFatal("Unknown data type: {dataType}", review.type) + return Clicked2:LogFatal("Unknown data type: {dataType}", review.type) end end local type = review.type - Clicked:Import(review) + Clicked2:Import(review) if type == "group" then Addon.BindingConfig.Window:Select(review.group.uid) diff --git a/Clicked/BindingConfig/Pages/New.lua b/Clicked/BindingConfig/Pages/New.lua index de476e8..d63e3a0 100644 --- a/Clicked/BindingConfig/Pages/New.lua +++ b/Clicked/BindingConfig/Pages/New.lua @@ -41,7 +41,7 @@ local ItemTemplate = { --- @return Group local function CreateGroup() - local group = Clicked:CreateGroup() + local group = Clicked2:CreateGroup() Addon.BindingConfig.Window:RedrawTree() return group @@ -51,33 +51,33 @@ end --- @param parent DataObject? --- @return Binding local function CreateBinding(type, parent) - local binding = Clicked:CreateBinding(parent ~= nil and parent.scope or nil) + local binding = Clicked2:CreateBinding(parent ~= nil and parent.scope or nil) if type == ItemTemplate.BINDING_CAST_SPELL then - binding.actionType = Clicked.ActionType.SPELL + binding.actionType = Clicked2.ActionType.SPELL elseif type == ItemTemplate.BINDING_CAST_SPELL_CLICKCAST then - binding.actionType = Clicked.ActionType.SPELL + binding.actionType = Clicked2.ActionType.SPELL binding.targets.hovercastEnabled = true binding.targets.regularEnabled = false elseif type == ItemTemplate.BINDING_USE_ITEM then - binding.actionType = Clicked.ActionType.ITEM + binding.actionType = Clicked2.ActionType.ITEM elseif type == ItemTemplate.BINDING_RUN_MACRO then - binding.actionType = Clicked.ActionType.MACRO + binding.actionType = Clicked2.ActionType.MACRO elseif type == ItemTemplate.BINDING_RUN_MACRO_APPEND then - binding.actionType = Clicked.ActionType.APPEND + binding.actionType = Clicked2.ActionType.APPEND elseif type == ItemTemplate.BINDING_CANCELAURA then - binding.actionType = Clicked.ActionType.CANCELAURA + binding.actionType = Clicked2.ActionType.CANCELAURA elseif type == ItemTemplate.BINDING_UNIT_TARGET then - binding.actionType = Clicked.ActionType.UNIT_SELECT + binding.actionType = Clicked2.ActionType.UNIT_SELECT elseif type == ItemTemplate.BINDING_UNIT_MENU then - binding.actionType = Clicked.ActionType.UNIT_MENU + binding.actionType = Clicked2.ActionType.UNIT_MENU end if parent ~= nil then - if parent.type == Clicked.DataObjectType.BINDING then + if parent.type == Clicked2.DataObjectType.BINDING then --- @cast parent Binding binding.parent = parent.parent - elseif parent.type == Clicked.DataObjectType.GROUP then + elseif parent.type == Clicked2.DataObjectType.GROUP then binding.parent = parent.uid end end @@ -91,7 +91,7 @@ local function CreateActionBarBindingCache() --- @type { [string]: Binding[] } local result = {} - for _, binding in Clicked:IterateConfiguredBindings() do + for _, binding in Clicked2:IterateConfiguredBindings() do result[binding.keybind] = result[binding.keybind] or {} table.insert(result[binding.keybind], binding) end @@ -104,8 +104,8 @@ local function CreateMacroBindingCache() --- @type { name: string, content: string }[] local result = {} - for _, binding in Clicked:IterateConfiguredBindings() do - if binding.actionType == Clicked.ActionType.MACRO then + for _, binding in Clicked2:IterateConfiguredBindings() do + if binding.actionType == Clicked2.ActionType.MACRO then table.insert(result, { name = binding.action.macroName, content = binding.action.macroValue @@ -123,17 +123,17 @@ local function DoesActionBarBindingExist(cache, spell) local collection = cache[key] or {} for _, binding in ipairs(collection) do - if spell.type == "SPELL" and binding.actionType == Clicked.ActionType.SPELL then + if spell.type == "SPELL" and binding.actionType == Clicked2.ActionType.SPELL then --- @cast spell SpellLibrarySpellResult if binding.action.spellValue == spell.spellId then return true end - elseif spell.type == "ITEM" and binding.actionType == Clicked.ActionType.ITEM then + elseif spell.type == "ITEM" and binding.actionType == Clicked2.ActionType.ITEM then --- @cast spell SpellLibraryItemResult if binding.action.itemValue == spell.itemId then return true end - elseif spell.type == "MACRO" and binding.actionType == Clicked.ActionType.MACRO then + elseif spell.type == "MACRO" and binding.actionType == Clicked2.ActionType.MACRO then --- @cast spell SpellLibraryMacroResult if binding.action.macroName == spell.name and binding.action.macroValue == spell.content then return true @@ -165,14 +165,14 @@ local function FindGroupId(name, icon, disableAutoCreate) return nil end - for _, group in Clicked:IterateGroups() do + for _, group in Clicked2:IterateGroups() do if group.name == name and group.displayIcon == icon then return group.uid end end if not disableAutoCreate and name ~= nil and icon ~= nil then - local group = Clicked:CreateGroup() + local group = Clicked2:CreateGroup() group.name = name group.displayIcon = icon return group.uid @@ -184,7 +184,7 @@ end --- @param spell SpellLibrarySpellResult --- @param parent? integer local function DoesSpellBookBindingExist(spell, parent) - for _, binding in ipairs(Clicked:GetByActionType(Clicked.ActionType.SPELL)) do + for _, binding in ipairs(Clicked2:GetByActionType(Clicked2.ActionType.SPELL)) do if binding.action.spellValue == spell.spellId and binding.parent == parent then return true end @@ -207,10 +207,10 @@ local function ImportSpellbook(importClassAbilitiesPerSpec) table.insert(genericSpells, spell) else if not DoesSpellBookBindingExist(spell, FindGroupId(spell.tabName, spell.tabIcon, true)) then - local binding = Clicked:CreateBinding() + local binding = Clicked2:CreateBinding() table.insert(result, binding) - binding.actionType = Clicked.ActionType.SPELL + binding.actionType = Clicked2.ActionType.SPELL binding.parent = FindGroupId(spell.tabName, spell.tabIcon) binding.action.spellValue = spell.spellId @@ -246,10 +246,10 @@ local function ImportSpellbook(importClassAbilitiesPerSpec) for _, spell in ipairs(genericSpells) do for _, spec in ipairs(specs) do if not DoesSpellBookBindingExist(spell, spec.groupId) then - local binding = Clicked:CreateBinding() + local binding = Clicked2:CreateBinding() table.insert(result, binding) - binding.actionType = Clicked.ActionType.SPELL + binding.actionType = Clicked2.ActionType.SPELL binding.parent = spec.groupId binding.action.spellValue = spell.spellId @@ -277,7 +277,7 @@ local function ImportActionbar() for _, spell in ipairs(Addon.SpellLibrary:GetActionBarSpells()) do if not DoesActionBarBindingExist(cache, spell) then - local binding = Clicked:CreateBinding() + local binding = Clicked2:CreateBinding() table.insert(result, binding) if spell.key ~= nil then @@ -299,15 +299,15 @@ local function ImportActionbar() binding.load.specialization.single = GetPrimaryTalentTree() end - binding.actionType = Clicked.ActionType.SPELL + binding.actionType = Clicked2.ActionType.SPELL binding.action.spellValue = spell.spellId elseif spell.type == "ITEM" then --- @cast spell SpellLibraryItemResult - binding.actionType = Clicked.ActionType.ITEM + binding.actionType = Clicked2.ActionType.ITEM binding.action.itemValue = spell.itemId elseif spell.type == "MACRO" then --- @cast spell SpellLibraryMacroResult - binding.actionType = Clicked.ActionType.MACRO + binding.actionType = Clicked2.ActionType.MACRO binding.action.macroName = spell.name binding.action.macroIcon = spell.icon binding.action.macroValue = spell.content @@ -332,10 +332,10 @@ local function ImportMacros() for _, spell in ipairs(Addon.SpellLibrary:GetMacroSpells()) do if not DoesMacroBindingExist(cache, spell) then - local binding = Clicked:CreateBinding() + local binding = Clicked2:CreateBinding() table.insert(result, binding) - binding.actionType = Clicked.ActionType.MACRO + binding.actionType = Clicked2.ActionType.MACRO binding.action.macroName = spell.name binding.action.macroIcon = spell.icon binding.action.macroValue = spell.content diff --git a/Clicked/BindingConfig/Tabs/Action.lua b/Clicked/BindingConfig/Tabs/Action.lua index c9e68dd..e0bccc5 100644 --- a/Clicked/BindingConfig/Tabs/Action.lua +++ b/Clicked/BindingConfig/Tabs/Action.lua @@ -24,15 +24,15 @@ local Helpers = Addon.BindingConfig.Helpers --- @param binding Binding --- @param value string|integer local function SetBindingValue(binding, value) - if binding.actionType == Clicked.ActionType.SPELL then + if binding.actionType == Clicked2.ActionType.SPELL then --- @cast value integer binding.action.spellValue = value Addon:ReloadBinding(binding, "value") - elseif binding.actionType == Clicked.ActionType.ITEM then + elseif binding.actionType == Clicked2.ActionType.ITEM then --- @cast value integer binding.action.itemValue = value Addon:ReloadBinding(binding, "value") - elseif binding.actionType == Clicked.ActionType.CANCELAURA then + elseif binding.actionType == Clicked2.ActionType.CANCELAURA then binding.action.auraName = value Addon:ReloadBinding(binding, "value") end @@ -41,11 +41,11 @@ end --- @param binding Binding --- @return string|integer? local function GetRawBindingValue(binding) - if binding.actionType == Clicked.ActionType.SPELL then + if binding.actionType == Clicked2.ActionType.SPELL then return binding.action.spellValue - elseif binding.actionType == Clicked.ActionType.ITEM then + elseif binding.actionType == Clicked2.ActionType.ITEM then return binding.action.itemValue - elseif binding.actionType == Clicked.ActionType.CANCELAURA then + elseif binding.actionType == Clicked2.ActionType.CANCELAURA then return binding.action.auraName end @@ -96,8 +96,8 @@ function Addon.BindingConfig.BindingActionTab:OnBindingReload(relevant, changed) end end - for _, other in Clicked:IterateActiveBindings() do - if other.keybind == self.bindings[1].keybind and other.actionType ~= Clicked.ActionType.MACRO and tContains(changed, other.uid) then + for _, other in Clicked2:IterateActiveBindings() do + if other.keybind == self.bindings[1].keybind and other.actionType ~= Clicked2.ActionType.MACRO and tContains(changed, other.uid) then self.controller:RedrawTab() return end @@ -132,11 +132,11 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() end for _, binding in ipairs(self.bindings) do - if binding.actionType == Clicked.ActionType.SPELL then + if binding.actionType == Clicked2.ActionType.SPELL then self:UpdateSpellValue(binding, value) - elseif binding.actionType == Clicked.ActionType.ITEM then + elseif binding.actionType == Clicked2.ActionType.ITEM then self:UpdateItemValue(binding, value) - elseif binding.actionType == Clicked.ActionType.CANCELAURA then + elseif binding.actionType == Clicked2.ActionType.CANCELAURA then self:UpdateCancelAuraValue(binding, value) end end @@ -175,11 +175,11 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() --- @param name string local function UpdateValue(name) for _, binding in ipairs(self.bindings) do - if binding.actionType == Clicked.ActionType.SPELL and type == "spell" then + if binding.actionType == Clicked2.ActionType.SPELL and type == "spell" then SetBindingValue(binding, linkId) - elseif binding.actionType == Clicked.ActionType.ITEM and type == "item" then + elseif binding.actionType == Clicked2.ActionType.ITEM and type == "item" then SetBindingValue(binding, linkId) - elseif binding.actionType == Clicked.ActionType.CANCELAURA then + elseif binding.actionType == Clicked2.ActionType.CANCELAURA then SetBindingValue(binding, name) end end @@ -226,17 +226,17 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() if hasMixedTypes then table.insert(lines, Addon.L["Target spell, item, or aura"]) else - if self.bindings[1].actionType == Clicked.ActionType.SPELL then + if self.bindings[1].actionType == Clicked2.ActionType.SPELL then table.insert(lines, Addon.L["Target spell"]) table.insert(lines, Addon.L["Enter the spell name or spell ID."]) table.insert(lines, "") table.insert(lines, Addon.L["You can also shift-click a spell in your spellbook or talent window to auto-fill."]) - elseif self.bindings[1].actionType == Clicked.ActionType.ITEM then + elseif self.bindings[1].actionType == Clicked2.ActionType.ITEM then table.insert(lines, Addon.L["Target item"]) table.insert(lines, Addon.L["Enter an item name, item ID, or equipment slot number."]) table.insert(lines, "") table.insert(lines, Addon.L["You can also shift-click an item from your bags to auto-fill."]) - elseif self.bindings[1].actionType == Clicked.ActionType.CANCELAURA then + elseif self.bindings[1].actionType == Clicked2.ActionType.CANCELAURA then table.insert(lines, Addon.L["Target aura"]) table.insert(lines, Addon.L["Enter the aura name or spell ID."]) table.insert(lines, "") @@ -249,7 +249,7 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() local widget - if not hasMixedTypes and self.bindings[1].actionType == Clicked.ActionType.SPELL then + if not hasMixedTypes and self.bindings[1].actionType == Clicked2.ActionType.SPELL then local function CreateOptions() --- @type ClickedAutoFillEditBox.Option[] local result = {} @@ -324,9 +324,9 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() ticker = C_Timer.NewTimer(Addon.TOOLTIP_SHOW_DELAY, function() GameTooltip:SetOwner(widget.frame, "ANCHOR_TOPLEFT") - if actionType == Clicked.ActionType.SPELL or actionType == Clicked.ActionType.CANCELAURA then + if actionType == Clicked2.ActionType.SPELL or actionType == Clicked2.ActionType.CANCELAURA then GameTooltip:SetSpellByID(id) - elseif actionType == Clicked.ActionType.ITEM then + elseif actionType == Clicked2.ActionType.ITEM then GameTooltip:SetItemByID(id) end @@ -344,9 +344,9 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() --- @type integer local icon - if actionType == Clicked.ActionType.SPELL or actionType == Clicked.ActionType.CANCELAURA then + if actionType == Clicked2.ActionType.SPELL or actionType == Clicked2.ActionType.CANCELAURA then icon = C_Spell.GetSpellTexture(id) - elseif actionType == Clicked.ActionType.ITEM then + elseif actionType == Clicked2.ActionType.ITEM then icon = C_Item.GetItemIconByID(id) --[[@as integer]] end @@ -364,7 +364,7 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() do local anyHasRank = FindInTableIf(self.bindings, function(binding) - if binding.actionType ~= Clicked.ActionType.SPELL then + if binding.actionType ~= Clicked2.ActionType.SPELL then return false end @@ -376,7 +376,7 @@ function Addon.BindingConfig.BindingActionTab:RedrawTargetSpell() if Addon.EXPANSION_LEVEL <= Addon.Expansion.WOTLK and anyHasRank then local function OnClick() for _, binding in ipairs(self.bindings) do - if binding.actionType == Clicked.ActionType.SPELL and not binding.action.spellMaxRank then + if binding.actionType == Clicked2.ActionType.SPELL and not binding.action.spellMaxRank then binding.action.spellMaxRank = true Addon:ReloadBinding(binding) end @@ -427,19 +427,19 @@ function Addon.BindingConfig.BindingActionTab:RedrawActionGroups() --- @param right Binding --- @return boolean local function SortFunc(left, right) - if left.actionType ~= Clicked.ActionType.APPEND and right.actionType == Clicked.ActionType.APPEND then + if left.actionType ~= Clicked2.ActionType.APPEND and right.actionType == Clicked2.ActionType.APPEND then return true end - if left.actionType == Clicked.ActionType.APPEND and right.actionType ~= Clicked.ActionType.APPEND then + if left.actionType == Clicked2.ActionType.APPEND and right.actionType ~= Clicked2.ActionType.APPEND then return false end return left.uid < right.uid end - for _, other in Clicked:IterateActiveBindings() do - if other.keybind == self.bindings[1].keybind and other.actionType ~= Clicked.ActionType.MACRO then + for _, other in Clicked2:IterateActiveBindings() do + if other.keybind == self.bindings[1].keybind and other.actionType ~= Clicked2.ActionType.MACRO then local id = other.action.executionOrder if groups[id] == nil then @@ -513,9 +513,9 @@ function Addon.BindingConfig.BindingActionTab:RedrawActionGroups() --- @param b Binding --- @return string? local function GetType(b) - if b.actionType == Clicked.ActionType.SPELL or b.actionType == Clicked.ActionType.ITEM then + if b.actionType == Clicked2.ActionType.SPELL or b.actionType == Clicked2.ActionType.ITEM then return "cast" - elseif b.actionType == Clicked.ActionType.CANCELAURA then + elseif b.actionType == Clicked2.ActionType.CANCELAURA then return "cancelaura" end @@ -577,8 +577,8 @@ function Addon.BindingConfig.BindingActionTab:RedrawKeyOptions() --- @type Binding[] local setBy = {} - for _, other in ipairs(Clicked:GetByKey(binding.keybind)) do - if other ~= binding and Clicked:IsBindingLoaded(other) then + for _, other in ipairs(Clicked2:GetByKey(binding.keybind)) do + if other ~= binding and Clicked2:IsBindingLoaded(other) then if other.action[option] then table.insert(setBy, other) end @@ -637,7 +637,7 @@ function Addon.BindingConfig.BindingActionTab:RedrawKeyOptions() return true else local _, loaded = FindInTableIf(self.bindings, function(binding) - return Clicked:IsBindingLoaded(binding) + return Clicked2:IsBindingLoaded(binding) end) if loaded ~= nil and IsSharedDataSet(loaded, key) then @@ -701,8 +701,8 @@ end --- @param binding Binding --- @param value string function Addon.BindingConfig.BindingActionTab:UpdateSpellValue(binding, value) - if binding.actionType ~= Clicked.ActionType.SPELL then - return Clicked:LogFatal("Cannot set spell value for a binding that is not a spell binding") + if binding.actionType ~= Clicked2.ActionType.SPELL then + return Clicked2:LogFatal("Cannot set spell value for a binding that is not a spell binding") end value = string.trim(value) @@ -725,8 +725,8 @@ end --- @param binding Binding --- @param value string function Addon.BindingConfig.BindingActionTab:UpdateItemValue(binding, value) - if binding.actionType ~= Clicked.ActionType.ITEM then - return Clicked:LogFatal("Cannot set item value for a binding that is not an item binding") + if binding.actionType ~= Clicked2.ActionType.ITEM then + return Clicked2:LogFatal("Cannot set item value for a binding that is not an item binding") end value = string.trim(value) @@ -743,8 +743,8 @@ end --- @param binding Binding --- @param value string function Addon.BindingConfig.BindingActionTab:UpdateCancelAuraValue(binding, value) - if binding.actionType ~= Clicked.ActionType.CANCELAURA then - return Clicked:LogFatal("Cannot set cancelaura value for a binding that is not a cancelaura binding") + if binding.actionType ~= Clicked2.ActionType.CANCELAURA then + return Clicked2:LogFatal("Cannot set cancelaura value for a binding that is not a cancelaura binding") end value = string.trim(value) diff --git a/Clicked/BindingConfig/Tabs/Macro.lua b/Clicked/BindingConfig/Tabs/Macro.lua index f8771e5..84cc0ba 100644 --- a/Clicked/BindingConfig/Tabs/Macro.lua +++ b/Clicked/BindingConfig/Tabs/Macro.lua @@ -124,7 +124,7 @@ function Addon.BindingConfig.BindingMacroTab:Redraw() --- @param binding Binding --- @return string local function ValueSelector(binding) - if binding.actionType ~= Clicked.ActionType.MACRO then + if binding.actionType ~= Clicked2.ActionType.MACRO then return Helpers.IGNORE_VALUE end @@ -173,7 +173,7 @@ function Addon.BindingConfig.BindingMacroTab:Redraw() -- hovercast-only warning do local hide = FindInTableIf(self.bindings, function(binding) - return binding.actionType ~= Clicked.ActionType.MACRO or Addon:IsMacroCastEnabled(binding) + return binding.actionType ~= Clicked2.ActionType.MACRO or Addon:IsMacroCastEnabled(binding) end) if not hide then @@ -188,7 +188,7 @@ function Addon.BindingConfig.BindingMacroTab:Redraw() -- append mode instructions do local hide = FindInTableIf(self.bindings, function(binding) - return binding.actionType == Clicked.ActionType.MACRO + return binding.actionType == Clicked2.ActionType.MACRO end) if not hide then diff --git a/Clicked/BindingConfig/Tabs/Status.lua b/Clicked/BindingConfig/Tabs/Status.lua index 34fcb78..2092de0 100644 --- a/Clicked/BindingConfig/Tabs/Status.lua +++ b/Clicked/BindingConfig/Tabs/Status.lua @@ -102,7 +102,7 @@ function Addon.BindingConfig.BindingStatusTab:OnBindingReload(relevant, changed) end end - for _, other in Clicked:IterateActiveBindings() do + for _, other in Clicked2:IterateActiveBindings() do if other.keybind == binding.keybind and tContains(changed, other.uid) then self.controller:RedrawTab() return @@ -162,7 +162,7 @@ function Addon.BindingConfig.BindingStatusTab:RedrawPage() table.wipe(self.references) - for _, other in Clicked:IterateActiveBindings() do + for _, other in Clicked2:IterateActiveBindings() do if other.keybind == binding.keybind then local valid = false diff --git a/Clicked/BindingConfig/Tabs/Target.lua b/Clicked/BindingConfig/Tabs/Target.lua index d435764..9542567 100644 --- a/Clicked/BindingConfig/Tabs/Target.lua +++ b/Clicked/BindingConfig/Tabs/Target.lua @@ -86,7 +86,7 @@ function Addon.BindingConfig.BindingTargetTab:Redraw() --- @param binding Binding --- @return boolean local function CanEnableRegularTargetMode(binding) - local disallowed = { Clicked.ActionType.UNIT_SELECT, Clicked.ActionType.UNIT_MENU } + local disallowed = { Clicked2.ActionType.UNIT_SELECT, Clicked2.ActionType.UNIT_MENU } if Addon:IsRestrictedKeybind(binding.keybind) or tContains(disallowed, binding.actionType) then return false diff --git a/Clicked/Clicked.toc b/Clicked/Clicked2.toc similarity index 94% rename from Clicked/Clicked.toc rename to Clicked/Clicked2.toc index e245131..c8c8a9a 100644 --- a/Clicked/Clicked.toc +++ b/Clicked/Clicked2.toc @@ -1,11 +1,11 @@ ## Interface: 11508, 20505, 50503, 120001 -## Title: Clicked +## Title: Clicked2 ## IconTexture: Interface\Icons\inv_misc_punchcards_yellow ## Author: Snakybo ## Version: @project-version@ ## Notes: Easy keybind and macro management -## SavedVariables: ClickedDB -## Group: Clicked +## SavedVariables: Clicked2DB +## Group: Clicked2 ## Category-enUS: Action Bars ## Category-deDE: Aktionsleisten ## Category-esES: Barras de acción @@ -27,7 +27,6 @@ Libs.xml Locales\Locales.xml Widgets\Widgets.xml -Templates\Clicked.xml # Core systems Core\Init.lua @@ -49,6 +48,7 @@ Conditions\LoadConditions.lua Conditions\MacroConditions.lua # Unitframe and clickcast support +#UnitFrames\ClickCastUnitTemplate.xml UnitFrames\ClickCastHeader.lua UnitFrames\ClickCastFrames.lua UnitFrames\Blizzard.lua diff --git a/Clicked/Config/Addon.lua b/Clicked/Config/Addon.lua index 4324a35..8c03960 100644 --- a/Clicked/Config/Addon.lua +++ b/Clicked/Config/Addon.lua @@ -26,8 +26,8 @@ local Addon = select(2, ...) local AddonOptions = {} function AddonOptions:Initialize() - AceConfig:RegisterOptionsTable("Clicked", self:CreateOptionsTable()) - AceConfigDialog:AddToBlizOptions("Clicked", Addon.L["Clicked"]) + AceConfig:RegisterOptionsTable("Clicked2", self:CreateOptionsTable()) + AceConfigDialog:AddToBlizOptions("Clicked2", Addon.L["Clicked2"]) end --- @private @@ -35,7 +35,7 @@ end function AddonOptions:CreateOptionsTable() return { type = "group", - name = Addon.L["Clicked"], + name = Addon.L["Clicked2"], args = { minimapIcon = { name = Addon.L["Enable minimap icon"], @@ -47,9 +47,9 @@ function AddonOptions:CreateOptionsTable() Addon.db.profile.options.minimap.hide = not val if val then - LibDBIcon:Show(Addon.L["Clicked"]) + LibDBIcon:Show(Addon.L["Clicked2"]) else - LibDBIcon:Hide(Addon.L["Clicked"]) + LibDBIcon:Hide(Addon.L["Clicked2"]) end end, get = function(_) @@ -65,13 +65,13 @@ function AddonOptions:CreateOptionsTable() hidden = Addon.EXPANSION_LEVEL < Addon.Expansion.DF, set = function (_, val) if val then - LibDBIcon:AddButtonToCompartment(Addon.L["Clicked"]) + LibDBIcon:AddButtonToCompartment(Addon.L["Clicked2"]) else - LibDBIcon:RemoveButtonFromCompartment(Addon.L["Clicked"]) + LibDBIcon:RemoveButtonFromCompartment(Addon.L["Clicked2"]) end end, get = function(_) - return LibDBIcon:IsButtonInCompartment(Addon.L["Clicked"]) + return LibDBIcon:IsButtonInCompartment(Addon.L["Clicked2"]) end }, onKeyDown = { @@ -83,12 +83,12 @@ function AddonOptions:CreateOptionsTable() set = function(_, val) Addon.db.profile.options.onKeyDown = val - for _, frame in Clicked:IterateClickCastFrames() do - Clicked:RegisterFrameClicks(frame) + for _, frame in Clicked2:IterateClickCastFrames() do + Clicked2:RegisterFrameClicks(frame) end - Clicked:RegisterFrameClicks(_G[Addon.MACRO_FRAME_HANDLER_NAME]) - Clicked:ProcessActiveBindings() + Clicked2:RegisterFrameClicks(_G[Addon.MACRO_FRAME_HANDLER_NAME]) + Clicked2:ProcessActiveBindings() Addon:ShowInformationPopup(Addon.L["If you are using custom unit frames you may have to adjust a setting within the unit frame configuration panel to enable support for this, and potentially even a UI reload."]) end, @@ -117,7 +117,7 @@ function AddonOptions:CreateOptionsTable() width = "full", set = function (_, val) Addon.db.profile.options.bindUnassignedModifiers = val - Clicked:ProcessActiveBindings() + Clicked2:ProcessActiveBindings() end, get = function () return Addon.db.profile.options.bindUnassignedModifiers @@ -131,7 +131,7 @@ function AddonOptions:CreateOptionsTable() width = "full", set = function (_, val) Addon.db.profile.options.autoBindActionBar = val - Clicked:ProcessActiveBindings() + Clicked2:ProcessActiveBindings() end, get = function () return Addon.db.profile.options.autoBindActionBar @@ -154,7 +154,7 @@ function AddonOptions:CreateOptionsTable() return Addon.db.profile.options.disableInHouse end }, - logLevel = Mixin(Clicked:GetLogLevelOptionObject(Addon.db.global), { + logLevel = Mixin(Clicked2:GetLogLevelOptionObject(Addon.db.global), { order = 700 }) } diff --git a/Clicked/Config/Blacklist.lua b/Clicked/Config/Blacklist.lua index a287f20..ba8d0eb 100644 --- a/Clicked/Config/Blacklist.lua +++ b/Clicked/Config/Blacklist.lua @@ -71,8 +71,8 @@ local BlacklistOptions = {} function BlacklistOptions:Initialize() config = self:CreateOptionsTable() - AceConfig:RegisterOptionsTable("Clicked/Blacklist", config) - AceConfigDialog:AddToBlizOptions("Clicked/Blacklist", Addon.L["Frame Blacklist"], "Clicked") + AceConfig:RegisterOptionsTable("Clicked2/Blacklist", config) + AceConfigDialog:AddToBlizOptions("Clicked2/Blacklist", Addon.L["Frame Blacklist"], "Clicked2") self:Refresh() end @@ -109,7 +109,7 @@ end function BlacklistOptions:GetBlacklistGroupItems(group) local result = {} - for _, frame in Clicked:IterateClickCastFrames() do + for _, frame in Clicked2:IterateClickCastFrames() do if self:GetBlacklistGroup(frame) == group then table.insert(result, frame:GetName()) end @@ -119,7 +119,7 @@ function BlacklistOptions:GetBlacklistGroupItems(group) end function BlacklistOptions:Refresh() - for _, frame in Clicked:IterateClickCastFrames() do + for _, frame in Clicked2:IterateClickCastFrames() do self:RegisterFrame(frame) end @@ -223,8 +223,8 @@ function BlacklistOptions:CreateOptionsTable() self:SetSelectedItem(val, true) self:SetDropdownItem(val, false) - Clicked:UnregisterClickCastFrame(val) - Clicked:ProcessActiveBindings() + Clicked2:UnregisterClickCastFrame(val) + Clicked2:ProcessActiveBindings() end end, get = function() @@ -318,8 +318,8 @@ function BlacklistOptions:SetSelectedItem(name, enabled) self:SetDropdownItem(name, true) - Clicked:RegisterClickCastFrame(name) - Clicked:ProcessActiveBindings() + Clicked2:RegisterClickCastFrame(name) + Clicked2:ProcessActiveBindings() end end, get = function() diff --git a/Clicked/Config/KeyVisualizer.lua b/Clicked/Config/KeyVisualizer.lua index 9d969f1..f7bd243 100644 --- a/Clicked/Config/KeyVisualizer.lua +++ b/Clicked/Config/KeyVisualizer.lua @@ -248,13 +248,13 @@ local function PopulateKeys() end if db.showOnlyLoadedBindings then - for _, binding in Clicked:IterateActiveBindings() do + for _, binding in Clicked2:IterateActiveBindings() do if showGroup == GROUP_ALL or binding.parent == showGroup then RegisterBinding(binding, true) end end else - for _, binding in Clicked:IterateConfiguredBindings() do + for _, binding in Clicked2:IterateConfiguredBindings() do if showGroup == GROUP_ALL or binding.parent == showGroup then RegisterBinding(binding, Addon:TableContains(Addon:GetActiveBindings(), binding)) end @@ -444,7 +444,7 @@ function KeyVisualizer:Open() --- @type { id: string, name: string }[] local order = {} - for _, group in Clicked:IterateGroups() do + for _, group in Clicked2:IterateGroups() do items[group.uid] = Addon:GetTextureString(group.name, group.displayIcon) table.insert(order, { id = group.uid, name = group.name }) end diff --git a/Clicked/Config/Profile.lua b/Clicked/Config/Profile.lua index a6818bf..0a1129d 100644 --- a/Clicked/Config/Profile.lua +++ b/Clicked/Config/Profile.lua @@ -36,13 +36,13 @@ local shareMessage = "" local ProfileOptions = {} function ProfileOptions:Initialize() - AceConfig:RegisterOptionsTable("Clicked/Profile", self:CreateOptionsTable()) - AceConfigDialog:AddToBlizOptions("Clicked/Profile", Addon.L["Profiles"], "Clicked") + AceConfig:RegisterOptionsTable("Clicked2/Profile", self:CreateOptionsTable()) + AceConfigDialog:AddToBlizOptions("Clicked2/Profile", Addon.L["Profiles"], "Clicked2") AceComm:Embed(self) - if not C_ChatInfo.IsAddonMessagePrefixRegistered("Clicked") then - C_ChatInfo.RegisterAddonMessagePrefix("Clicked") + if not C_ChatInfo.IsAddonMessagePrefixRegistered("Clicked2") then + C_ChatInfo.RegisterAddonMessagePrefix("Clicked2") end end @@ -122,7 +122,7 @@ function ProfileOptions:CreateOptionsTable() if not shareAckReceived then shareBusy = false - AceConfigRegistry:NotifyChange("Clicked/Profile") + AceConfigRegistry:NotifyChange("Clicked2/Profile") Addon:ShowInformationPopup(string.format(Addon.L["Unable to send a message to %s. Make sure that they are online, have allowed profile sharing, and are on the same realm or a connected realm."], shareTarget)) end end @@ -131,11 +131,11 @@ function ProfileOptions:CreateOptionsTable() -- Just wait for the ACK timeout if we're currently in combat, to prevent stuttering if not InCombatLockdown() then - shareMessage = Clicked:SerializeProfile(Addon.db.profile, false, false) + shareMessage = Clicked2:SerializeProfile(Addon.db.profile, false, false) shareAckReceived = false - self:RegisterComm("Clicked", "OnCommReceived") - self:SendCommMessage("Clicked", "ShareRequest", "WHISPER", shareTarget, "NORMAL") + self:RegisterComm("Clicked2", "OnCommReceived") + self:SendCommMessage("Clicked2", "ShareRequest", "WHISPER", shareTarget, "NORMAL") end C_Timer.After(5, OnTimeout) @@ -153,7 +153,7 @@ function ProfileOptions:CreateOptionsTable() shareEnabled = value if value then - self:RegisterComm("Clicked", "OnCommReceived") + self:RegisterComm("Clicked2", "OnCommReceived") else self:UnregisterAllComm() end @@ -196,7 +196,7 @@ function ProfileOptions:OnCommReceived(_, message, _, sender) if message == "ShareRequest" then if shareEnabled then - self:SendCommMessage("Clicked", "ShareRequestAck", "WHISPER", sender, "NORMAL") + self:SendCommMessage("Clicked2", "ShareRequestAck", "WHISPER", sender, "NORMAL") end elseif message == "ShareRequestAck" then shareAckReceived = true @@ -205,16 +205,16 @@ function ProfileOptions:OnCommReceived(_, message, _, sender) self:UnregisterAllComm() end - self:SendCommMessage("Clicked", shareMessage, "WHISPER", shareTarget, "NORMAL", self.OnCommProgress, self) + self:SendCommMessage("Clicked2", shareMessage, "WHISPER", shareTarget, "NORMAL", self.OnCommProgress, self) else - local success, data = Clicked:Deserialize(message, false) + local success, data = Clicked2:Deserialize(message, false) Addon.BindingConfig.Window:SetPage(Addon.BindingConfig.Window.PAGE_IMPORT_STRING, Addon.BindingConfig.ImportStringModes.PROFILE_COMM, data, sender) shareEnabled = not success end - AceConfigRegistry:NotifyChange("Clicked/Profile") + AceConfigRegistry:NotifyChange("Clicked2/Profile") end --- @private @@ -228,7 +228,7 @@ function ProfileOptions:OnCommProgress(sent, total) shareBusy = false end - AceConfigRegistry:NotifyChange("Clicked/Profile") + AceConfigRegistry:NotifyChange("Clicked2/Profile") end Addon.ProfileOptions = ProfileOptions diff --git a/Clicked/Core/AttributeHandler.lua b/Clicked/Core/AttributeHandler.lua index 0c05c12..c9322e0 100644 --- a/Clicked/Core/AttributeHandler.lua +++ b/Clicked/Core/AttributeHandler.lua @@ -21,7 +21,7 @@ local hasTypeRelease = Addon.EXPANSION_LEVEL >= Addon.Expansion.DF or Addon.EXPA local frameCache = {} -local logger = Clicked:CreateSystemLogger("AttributeHandler") +local logger = Clicked2:CreateSystemLogger("AttributeHandler") -- Local support functions diff --git a/Clicked/Core/BindingProcessor.lua b/Clicked/Core/BindingProcessor.lua index a3e5942..85aa76b 100644 --- a/Clicked/Core/BindingProcessor.lua +++ b/Clicked/Core/BindingProcessor.lua @@ -21,7 +21,7 @@ local issecretvalue = issecretvalue or function(val) return false end local Addon = select(2, ...) --- @enum ActionType -Clicked.ActionType = { +Clicked2.ActionType = { SPELL = "SPELL", ITEM = "ITEM", MACRO = "MACRO", @@ -120,7 +120,7 @@ local reloadTalentCacheDelayTicker = nil --- @type function[] local reloadTalentCacheCallbacks = {} -local logger = Clicked:CreateSystemLogger("BindingProcessor") +local logger = Clicked2:CreateSystemLogger("BindingProcessor") -- Local support functions @@ -456,7 +456,7 @@ local function ProcessBuckets() command.prefix, command.suffix = Addon:CreateAttributeIdentifier(command.keybind, command.hovercast) - if Addon:GetInternalBindingType(reference) == Clicked.ActionType.MACRO then + if Addon:GetInternalBindingType(reference) == Clicked2.ActionType.MACRO then command.action = Addon.CommandType.MACRO command.data = Addon:GetMacroForBindings(bindings, interactionType) @@ -468,13 +468,13 @@ local function ProcessBuckets() logger:LogWarning(message, name) end - elseif reference.actionType == Clicked.ActionType.UNIT_SELECT then + elseif reference.actionType == Clicked2.ActionType.UNIT_SELECT then command.action = Addon.CommandType.TARGET if reference.load.combat.selected then command.data = reference.load.combat.value end - elseif reference.actionType == Clicked.ActionType.UNIT_MENU then + elseif reference.actionType == Clicked2.ActionType.UNIT_MENU then command.action = Addon.CommandType.MENU if reference.load.combat.selected then @@ -639,7 +639,7 @@ local function ReloadBindings(immediate) seen[binding.uid] = true end - for _, binding in Clicked:IterateConfiguredBindings() do + for _, binding in Clicked2:IterateConfiguredBindings() do if not seen[binding.uid] then local isValid, wasValid = Addon:UpdateBindingLoadState(binding, pendingReloadCauses) @@ -655,7 +655,7 @@ local function ReloadBindings(immediate) wipe(pendingReloadCauses.binding) wipe(pendingReloadCauses.conditions) - Clicked:ProcessActiveBindings() + Clicked2:ProcessActiveBindings() Addon.BindingConfig.Window:OnBindingReload(changed) Addon.KeyVisualizer:Redraw() @@ -675,7 +675,7 @@ end --- Bindings are always bulk-reloaded once per frame, this function will queue a reload for the next frame. --- --- @param bindings? Binding|Binding[] -function Clicked:ReloadBindings(bindings) +function Clicked2:ReloadBindings(bindings) if bindings == nil then bindings = {} elseif bindings[1] == nil then @@ -688,7 +688,7 @@ function Clicked:ReloadBindings(bindings) Addon:UpdateLookupTable() end -function Clicked:ProcessActiveBindings() +function Clicked2:ProcessActiveBindings() if InCombatLockdown() then return end @@ -702,7 +702,7 @@ end --- @param binding Binding The input binding, cannot be `nil` and must be a valid binding table --- @return string? hovercastTarget The first satisfied hovercast unit if any, `nil` otherwise. If this has a value it will always be `@mouseover`. --- @return string? regularTarget The first satisfied regular unit if any, `nil` otherwise. -function Clicked:EvaluateBindingMacro(binding) +function Clicked2:EvaluateBindingMacro(binding) assert(type(binding) == "table", "bad argument #1, expected table but got " .. type(binding)) --- @type Binding[] @@ -728,7 +728,7 @@ function Clicked:EvaluateBindingMacro(binding) end --- Iterate through all currently active bindings, this function can be used in a `for in` loop. -function Clicked:IterateActiveBindings() +function Clicked2:IterateActiveBindings() return ipairs(activeBindings) end @@ -745,7 +745,7 @@ end --- --- @param unit string --- @return Binding[] -function Clicked:GetBindingsForUnit(unit) +function Clicked2:GetBindingsForUnit(unit) assert(type(unit) == "string", "bad argument #1, expected table but got " .. type(unit)) --- @type Binding[] @@ -785,7 +785,7 @@ function Clicked:GetBindingsForUnit(unit) --- @param binding Binding --- @return boolean local function IsBindingValidForUnit(binding) - if binding.actionType ~= Clicked.ActionType.SPELL and binding.actionType ~= Clicked.ActionType.ITEM then + if binding.actionType ~= Clicked2.ActionType.SPELL and binding.actionType ~= Clicked2.ActionType.ITEM then return false end @@ -816,7 +816,7 @@ function Clicked:GetBindingsForUnit(unit) local enabled = Addon:IsMacroCastEnabled(binding) if enabled then - local _, target = Clicked:EvaluateBindingMacro(binding) + local _, target = Clicked2:EvaluateBindingMacro(binding) if target ~= nil and units[target] then return true @@ -827,7 +827,7 @@ function Clicked:GetBindingsForUnit(unit) return false end - for _, binding in Clicked:IterateActiveBindings() do + for _, binding in Clicked2:IterateActiveBindings() do if IsBindingValidForUnit(binding) then table.insert(result, binding) end @@ -838,7 +838,7 @@ end --- @param binding Binding --- @return boolean -function Clicked:IsBindingLoaded(binding) +function Clicked2:IsBindingLoaded(binding) for _, active in ipairs(activeBindings) do if active.uid == binding.uid then return true @@ -1089,7 +1089,7 @@ function Addon:UpdateBindingLoadState(binding, causes) local state = bindingStateCache[binding.uid] or {} local conditions = Addon.Condition.Registry:GetConditionSet("load") - if wasValid and Clicked:GetByUid(binding.uid) == nil then + if wasValid and Clicked2:GetByUid(binding.uid) == nil then bindingStateCache[binding.uid] = nil return false, wasValid end @@ -1108,7 +1108,7 @@ function Addon:UpdateBindingLoadState(binding, causes) if Addon.EXPANSION_LEVEL >= Addon.Expansion.TWW and Addon.db.profile.options.disableInHouse and ShouldPerformStateCheck("housing", { "HOUSE_EDITOR_MODE_CHANGED" }) then state.housing = not C_HouseEditor.IsHouseEditorActive() - Clicked:LogVerbose("Evaluated condition {condition} for binding {binding}: {value}", "housing", binding.uid, state.housing) + Clicked2:LogVerbose("Evaluated condition {condition} for binding {binding}: {value}", "housing", binding.uid, state.housing) end for _, condition in ipairs(conditions.config) do @@ -1159,7 +1159,7 @@ function Addon:IsBindingValidForCurrentState(binding) return false end - if binding.actionType == Clicked.ActionType.SPELL and not IsSpellKnown(id) then + if binding.actionType == Clicked2.ActionType.SPELL and not IsSpellKnown(id) then return false end end @@ -1214,20 +1214,20 @@ end --- @param binding Binding --- @return string function Addon:GetInternalBindingType(binding) - if binding.actionType == Clicked.ActionType.SPELL then - return Clicked.ActionType.MACRO + if binding.actionType == Clicked2.ActionType.SPELL then + return Clicked2.ActionType.MACRO end - if binding.actionType == Clicked.ActionType.ITEM then - return Clicked.ActionType.MACRO + if binding.actionType == Clicked2.ActionType.ITEM then + return Clicked2.ActionType.MACRO end - if binding.actionType == Clicked.ActionType.APPEND then - return Clicked.ActionType.MACRO + if binding.actionType == Clicked2.ActionType.APPEND then + return Clicked2.ActionType.MACRO end - if binding.actionType == Clicked.ActionType.CANCELAURA then - return Clicked.ActionType.MACRO + if binding.actionType == Clicked2.ActionType.CANCELAURA then + return Clicked2.ActionType.MACRO end return binding.actionType @@ -1313,7 +1313,7 @@ function Addon:GetMacroForBindings(bindings, interactionType, ignoreActionBar) end for _, binding in ipairs(bindings) do - if binding.actionType == Clicked.ActionType.SPELL or binding.actionType == Clicked.ActionType.ITEM or binding.actionType == Clicked.ActionType.CANCELAURA then + if binding.actionType == Clicked2.ActionType.SPELL or binding.actionType == Clicked2.ActionType.ITEM or binding.actionType == Clicked2.ActionType.CANCELAURA then if binding.action.cancelQueuedSpell then RegisterCommand(cancelQueuedSpell, binding) end @@ -1354,11 +1354,11 @@ function Addon:GetMacroForBindings(bindings, interactionType, ignoreActionBar) --- @param binding Binding --- @return string|nil local function GetPrefixForBinding(binding) - if binding.actionType == Clicked.ActionType.SPELL or binding.actionType == Clicked.ActionType.ITEM then + if binding.actionType == Clicked2.ActionType.SPELL or binding.actionType == Clicked2.ActionType.ITEM then return "/cast " end - if binding.actionType == Clicked.ActionType.CANCELAURA then + if binding.actionType == Clicked2.ActionType.CANCELAURA then return "/cancelaura " end @@ -1415,20 +1415,20 @@ function Addon:GetMacroForBindings(bindings, interactionType, ignoreActionBar) local nextActionIndex = 1 for _, binding in ipairs(group) do - if binding.actionType == Clicked.ActionType.SPELL or binding.actionType == Clicked.ActionType.ITEM then + if binding.actionType == Clicked2.ActionType.SPELL or binding.actionType == Clicked2.ActionType.ITEM then for _, action in ipairs(ConstructActions(binding, interactionType, actionBar)) do table.insert(actions[order], action) actionsSequence[action] = nextActionIndex nextActionIndex = nextActionIndex + 1 end - elseif binding.actionType == Clicked.ActionType.MACRO then + elseif binding.actionType == Clicked2.ActionType.MACRO then local value = Addon:GetBindingValue(binding) table.insert(macros[order], value) - elseif binding.actionType == Clicked.ActionType.APPEND then + elseif binding.actionType == Clicked2.ActionType.APPEND then local value = Addon:GetBindingValue(binding) table.insert(appends[order], value) - elseif binding.actionType == Clicked.ActionType.CANCELAURA then + elseif binding.actionType == Clicked2.ActionType.CANCELAURA then local target = Addon:GetNewBindingTargetTemplate() target.unit = Addon.TargetUnit.DEFAULT target.hostility = Addon.TargetHostility.ANY diff --git a/Clicked/Core/Clicked.lua b/Clicked/Core/Clicked.lua index a171773..19f59a9 100644 --- a/Clicked/Core/Clicked.lua +++ b/Clicked/Core/Clicked.lua @@ -20,15 +20,15 @@ local LibDBIcon = LibStub("LibDBIcon-1.0") --- @class ClickedInternal local Addon = select(2, ...) -Addon.L = LibStub("AceLocale-3.0"):GetLocale("Clicked") --[[@as table]] +Addon.L = LibStub("AceLocale-3.0"):GetLocale("Clicked2") --[[@as table]] --- @class Clicked : AceAddon, AceEvent-3.0, LibLog-1.0.Logger -Clicked = LibStub("AceAddon-3.0"):NewAddon("Clicked", "AceEvent-3.0", "LibLog-1.0") -Clicked.VERSION = C_AddOns.GetAddOnMetadata("Clicked", "Version") +Clicked2 = LibStub("AceAddon-3.0"):NewAddon("Clicked2", "AceEvent-3.0", "LibLog-1.0") +Clicked2.VERSION = C_AddOns.GetAddOnMetadata("Clicked2", "Version") --@debug@ -if Clicked.VERSION == "@project-version@" then - Clicked.VERSION = "development" +if Clicked2.VERSION == "@project-version@" then + Clicked2.VERSION = "development" end --@end-debug@ @@ -43,20 +43,20 @@ local playerFlagsCache = {} -- Local support functions local function RegisterIcons() - local iconData = LibDataBroker:NewDataObject("Clicked", { + local iconData = LibDataBroker:NewDataObject("Clicked2", { type = "launcher", - label = Addon.L["Clicked"], + label = Addon.L["Clicked2"], icon = "Interface\\Icons\\inv_misc_punchcards_yellow", OnClick = function() Addon.BindingConfig.Window:Open() end, OnTooltipShow = function(tooltip) - tooltip:AddLine(Addon.L["Clicked"]) + tooltip:AddLine(Addon.L["Clicked2"]) end }) - LibDBIcon:Register(Addon.L["Clicked"], iconData, Addon.db.profile.options.minimap) - LibDBIcon:AddButtonToCompartment(Addon.L["Clicked"]) + LibDBIcon:Register(Addon.L["Clicked2"], iconData, Addon.db.profile.options.minimap) + LibDBIcon:AddButtonToCompartment(Addon.L["Clicked2"]) end --- Parse a chat command input and handle it appropriately. @@ -81,13 +81,13 @@ local function HandleChatCommand(input) if #args == 0 then if InCombatLockdown() then openConfigOnCombatExit = true - Clicked:LogWarning(Addon.L["Binding configuration will open once you leave combat."]) + Clicked2:LogWarning(Addon.L["Binding configuration will open once you leave combat."]) else Addon.BindingConfig.Window:Open() end elseif #args == 1 then if args[1] == "opt" or args[1] == "options" then - Addon:OpenSettingsMenu("Clicked") + Addon:OpenSettingsMenu("Clicked2") elseif args[1] == "dump" then Addon:StatusOutput_Open() elseif (args[1] == "viz" or args[1] == "visualizer") then @@ -96,9 +96,9 @@ local function HandleChatCommand(input) Addon.db.profile.options.ignoreSelfCastWarning = not Addon.db.profile.options.ignoreSelfCastWarning if Addon.db.profile.options.ignoreSelfCastWarning then - Clicked:LogInfo(Addon.L["Disabled self-cast warning, type this command again to re-enable it."]) + Clicked2:LogInfo(Addon.L["Disabled self-cast warning, type this command again to re-enable it."]) else - Clicked:LogInfo(Addon.L["Enabled self-cast warning, type this command again to disable it."]) + Clicked2:LogInfo(Addon.L["Enabled self-cast warning, type this command again to disable it."]) end end end @@ -107,7 +107,7 @@ end -- Event handlers local function PLAYER_REGEN_DISABLED() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_REGEN_DISABLED") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_REGEN_DISABLED") isPlayerInCombat = true openConfigOnCombatExit = Addon.BindingConfig.Window:IsOpen() @@ -116,12 +116,12 @@ local function PLAYER_REGEN_DISABLED() Addon:AbilityTooltips_Refresh() if Addon:IsCombatProcessRequired() then - Clicked:ProcessActiveBindings() + Clicked2:ProcessActiveBindings() end end local function PLAYER_REGEN_ENABLED() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_REGEN_ENABLED") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_REGEN_ENABLED") isPlayerInCombat = false @@ -129,7 +129,7 @@ local function PLAYER_REGEN_ENABLED() Addon:AbilityTooltips_Refresh() if Addon:IsCombatProcessRequired() then - Clicked:ProcessActiveBindings() + Clicked2:ProcessActiveBindings() end if openConfigOnCombatExit then @@ -139,7 +139,7 @@ local function PLAYER_REGEN_ENABLED() end local function PLAYER_ENTERING_WORLD() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_ENTERING_WORLD") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_ENTERING_WORLD") isInitialized = true playerFlagsCache = { @@ -163,7 +163,7 @@ local function PLAYER_ENTERING_WORLD() end local function ADDON_LOADED() - Clicked:LogVerbose("Received event {eventName}", "ADDON_LOADED") + Clicked2:LogVerbose("Received event {eventName}", "ADDON_LOADED") Addon:ProcessFrameQueue() end @@ -177,13 +177,13 @@ local function ZONE_CHANGED_INDOORS() end local function ZONE_CHANGED_NEW_AREA() - Clicked:LogVerbose("Received event {eventName}", "ZONE_CHANGED_NEW_AREA") + Clicked2:LogVerbose("Received event {eventName}", "ZONE_CHANGED_NEW_AREA") Addon:ReloadBindings("ZONE_CHANGED_NEW_AREA") end local function CHARACTER_POINTS_CHANGED() - Clicked:LogVerbose("Received event {eventName}", "CHARACTER_POINTS_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "CHARACTER_POINTS_CHANGED") Addon:UpdateTalentCache(function() Addon:ReloadBindings("CHARACTER_POINTS_CHANGED") @@ -203,14 +203,14 @@ local function PLAYER_FLAGS_CHANGED(_, unit) end if changed then - Clicked:LogVerbose("Received event {eventName}", "PLAYER_FLAGS_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_FLAGS_CHANGED") Addon:ReloadBindings("PLAYER_FLAGS_CHANGED") end end local function PLAYER_TALENT_UPDATE() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_TALENT_UPDATE") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_TALENT_UPDATE") Addon:UpdateTalentCache(function() Addon:ReloadBindings("PLAYER_TALENT_UPDATE") @@ -218,13 +218,13 @@ local function PLAYER_TALENT_UPDATE() end local function PLAYER_PVP_TALENT_UPDATE() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_PVP_TALENT_UPDATE") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_PVP_TALENT_UPDATE") Addon:ReloadBindings("PLAYER_PVP_TALENT_UPDATE") end local function TRAIT_CONFIG_CREATED() - Clicked:LogVerbose("Received event {eventName}", "TRAIT_CONFIG_CREATED") + Clicked2:LogVerbose("Received event {eventName}", "TRAIT_CONFIG_CREATED") Addon:UpdateTalentCache(function() Addon:ReloadBindings("TRAIT_CONFIG_CREATED") @@ -232,7 +232,7 @@ local function TRAIT_CONFIG_CREATED() end local function TRAIT_CONFIG_UPDATED() - Clicked:LogVerbose("Received event {eventName}", "TRAIT_CONFIG_UPDATED") + Clicked2:LogVerbose("Received event {eventName}", "TRAIT_CONFIG_UPDATED") Addon:UpdateTalentCache(function() Addon:ReloadBindings("TRAIT_CONFIG_UPDATED") @@ -240,19 +240,19 @@ local function TRAIT_CONFIG_UPDATED() end local function PLAYER_FOCUS_CHANGED() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_FOCUS_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_FOCUS_CHANGED") Addon:AbilityTooltips_Refresh() end local function PLAYER_LEVEL_CHANGED() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_LEVEL_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_LEVEL_CHANGED") Addon:ReloadBindings("PLAYER_LEVEL_CHANGED") end local function ACTIONBAR_SLOT_CHANGED() - Clicked:LogVerbose("Received event {eventName}", "ACTIONBAR_SLOT_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "ACTIONBAR_SLOT_CHANGED") if Addon.db.profile.options.autoBindActionBar then Addon:ReloadBindings("ACTIONBAR_SLOT_CHANGED") @@ -260,49 +260,49 @@ local function ACTIONBAR_SLOT_CHANGED() end local function LEARNED_SPELL_IN_TAB() - Clicked:LogVerbose("Received event {eventName}", "LEARNED_SPELL_IN_TAB") + Clicked2:LogVerbose("Received event {eventName}", "LEARNED_SPELL_IN_TAB") Addon:ReloadBindings("LEARNED_SPELL_IN_TAB") end local function LEARNED_SPELL_IN_SKILL_LINE() - Clicked:LogVerbose("Received event {eventName}", "LEARNED_SPELL_IN_SKILL_LINE") + Clicked2:LogVerbose("Received event {eventName}", "LEARNED_SPELL_IN_SKILL_LINE") Addon:ReloadBindings("LEARNED_SPELL_IN_SKILL_LINE") end local function PLAYER_EQUIPMENT_CHANGED() - Clicked:LogVerbose("Received event {eventName}", "PLAYER_EQUIPMENT_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "PLAYER_EQUIPMENT_CHANGED") Addon:ReloadBindings("PLAYER_EQUIPMENT_CHANGED") end local function GROUP_ROSTER_UPDATE() - Clicked:LogVerbose("Received event {eventName}", "GROUP_ROSTER_UPDATE") + Clicked2:LogVerbose("Received event {eventName}", "GROUP_ROSTER_UPDATE") Addon:ReloadBindings("GROUP_ROSTER_UPDATE") end local function MODIFIER_STATE_CHANGED() - Clicked:LogVerbose("Received event {eventName}", "MODIFIER_STATE_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "MODIFIER_STATE_CHANGED") Addon:AbilityTooltips_Refresh() end local function UNIT_TARGET() - Clicked:LogVerbose("Received event {eventName}", "UNIT_TARGET") + Clicked2:LogVerbose("Received event {eventName}", "UNIT_TARGET") Addon:AbilityTooltips_Refresh() end local function RUNE_UPDATED() - Clicked:LogVerbose("Received event {eventName}", "RUNE_UPDATED") + Clicked2:LogVerbose("Received event {eventName}", "RUNE_UPDATED") Addon:ReloadBindings("RUNE_UPDATED") end local function HOUSE_EDITOR_MODE_CHANGED() - Clicked:LogVerbose("Received event {eventName}", "HOUSE_EDITOR_MODE_CHANGED") + Clicked2:LogVerbose("Received event {eventName}", "HOUSE_EDITOR_MODE_CHANGED") if Addon.db.profile.options.disableInHouse and C_HouseEditor.IsHouseEditorActive() ~= wasHouseEditorActive then wasHouseEditorActive = C_HouseEditor.IsHouseEditorActive() @@ -317,10 +317,10 @@ local function ITEM_DATA_LOAD_RESULT(_, itemId, success) return end - Clicked:LogVerbose("Received event {eventName}", "ITEM_DATA_LOAD_RESULT", itemId) + Clicked2:LogVerbose("Received event {eventName}", "ITEM_DATA_LOAD_RESULT", itemId) - for _, binding in Clicked:IterateConfiguredBindings() do - if binding.actionType == Clicked.ActionType.ITEM and binding.action.itemValue == itemId then + for _, binding in Clicked2:IterateConfiguredBindings() do + if binding.actionType == Clicked2.ActionType.ITEM and binding.action.itemValue == itemId then Addon:ReloadBinding(binding, "value") end end @@ -385,10 +385,10 @@ end -- Public addon API -function Clicked:OnInitialize() +function Clicked2:OnInitialize() local defaultProfile = select(2, UnitClass("player")) - Addon.db = LibStub("AceDB-3.0"):New("ClickedDB", self:GetDatabaseDefaults(), defaultProfile) + Addon.db = LibStub("AceDB-3.0"):New("Clicked2DB", self:GetDatabaseDefaults(), defaultProfile) Addon.db.RegisterCallback(self, "OnProfileChanged", "ReloadDatabase") Addon.db.RegisterCallback(self, "OnProfileCopied", "ReloadDatabase") Addon.db.RegisterCallback(self, "OnProfileReset", "ReloadDatabase") @@ -408,14 +408,14 @@ function Clicked:OnInitialize() Addon:StatusOutput_Initialize() Addon:AbilityTooltips_Initialize() - AceConsole:RegisterChatCommand("clicked", HandleChatCommand) - AceConsole:RegisterChatCommand("cc", HandleChatCommand) + AceConsole:RegisterChatCommand("clicked2", HandleChatCommand) + AceConsole:RegisterChatCommand("cc2", HandleChatCommand) end -function Clicked:OnEnable() +function Clicked2:OnEnable() --@debug@ local projectUrl = "https://www.curseforge.com/wow/addons/clicked" - Clicked:LogWarning("You are using a development version, download the latest release from {url}", projectUrl) + Clicked2:LogWarning("You are using a development version, download the latest release from {url}", projectUrl) --@end-debug@ UpdateEventHooks(self, self.RegisterEvent) @@ -426,19 +426,19 @@ function Clicked:OnEnable() if selfCastModifier ~= "NONE" then local message = Addon.L["The behavior of the self-cast modifier has changed in Dragonflight, bindings using the '{key}' key modifier may not work correctly. It is recommended to disable it by setting it to 'NONE' in the options menu. You can disable this warning by typing: {command}"] - Clicked:LogWarning(message, selfCastModifier, "/clicked ignore-self-cast-warning") + Clicked2:LogWarning(message, selfCastModifier, "/clicked ignore-self-cast-warning") end end end -function Clicked:OnDisable() +function Clicked2:OnDisable() UpdateEventHooks(self, self.UnregisterEvent) end --- @param system string --- @return LibLog-1.0.Logger -function Clicked:CreateSystemLogger(system) - return Clicked:ForLogContext({ +function Clicked2:CreateSystemLogger(system) + return Clicked2:ForLogContext({ system = system }) end @@ -446,8 +446,8 @@ end -- Private addon API function Addon:RequestItemLoadForBindings() - for _, binding in Clicked:IterateConfiguredBindings() do - if binding.actionType == Clicked.ActionType.ITEM then + for _, binding in Clicked2:IterateConfiguredBindings() do + if binding.actionType == Clicked2.ActionType.ITEM then local itemId = tonumber(binding.action.itemValue) if itemId ~= nil then diff --git a/Clicked/Core/CommandProcessor.lua b/Clicked/Core/CommandProcessor.lua index 9878073..f72aab9 100644 --- a/Clicked/Core/CommandProcessor.lua +++ b/Clicked/Core/CommandProcessor.lua @@ -118,7 +118,7 @@ local function EnsureMacroFrameHandler() CreateStateDriverAttribute(macroFrameHandler, "possessbar", "[possessbar] enabled; disabled") CreateStateDriverAttribute(macroFrameHandler, "overridebar", "[overridebar] enabled; disabled") - Clicked:RegisterFrameClicks(macroFrameHandler) + Clicked2:RegisterFrameClicks(macroFrameHandler) end -- Private addon API diff --git a/Clicked/Core/Database.lua b/Clicked/Core/Database.lua index e48b086..46ae7b3 100644 --- a/Clicked/Core/Database.lua +++ b/Clicked/Core/Database.lua @@ -23,13 +23,13 @@ local GetSpecialization = C_SpecializationInfo.GetSpecialization or GetSpecializ local Addon = select(2, ...) --- @enum DataObjectType -Clicked.DataObjectType = { +Clicked2.DataObjectType = { BINDING = 1, GROUP = 2 } --- @enum DataObjectScope -Clicked.DataObjectScope = { +Clicked2.DataObjectScope = { PROFILE = 1, GLOBAL = 2 } @@ -133,7 +133,7 @@ end --- Get the default values for a Clicked profile. --- --- @return AceDBObject-3.0 -function Clicked:GetDatabaseDefaults() +function Clicked2:GetDatabaseDefaults() local database = { global = { version = nil, @@ -170,13 +170,13 @@ function Clicked:GetDatabaseDefaults() end --- Reload the database, this should be called after high-level profile changes have been made, such as switching the active profile, or importing a proifle. -function Clicked:ReloadDatabase() +function Clicked2:ReloadDatabase() Addon:UpgradeDatabase() if Addon.db.profile.options.minimap.hide then - LibDBIcon:Hide("Clicked") + LibDBIcon:Hide("Clicked2") else - LibDBIcon:Show("Clicked") + LibDBIcon:Show("Clicked2") end Addon.BlacklistOptions:Refresh() @@ -187,11 +187,11 @@ end --- Create a new binding group. Groups are purely cosmetic and have no additional impact on binding functionality. --- --- @return Group -function Clicked:CreateGroup() +function Clicked2:CreateGroup() --- @type Group --- @diagnostic disable-next-line: missing-fields local group = { - type = Clicked.DataObjectType.GROUP, + type = Clicked2.DataObjectType.GROUP, name = Addon.L["New Group"], displayIcon = "Interface\\ICONS\\INV_Misc_QuestionMark" } @@ -205,7 +205,7 @@ end --- --- @param scope? DataObjectScope --- @return Binding -function Clicked:CreateBinding(scope) +function Clicked2:CreateBinding(scope) local binding = Addon:GetNewBindingTemplate() Addon:RegisterDataObject(binding, scope) @@ -216,7 +216,7 @@ end --- --- @param object DataObject --- @returns boolean -function Clicked:DeleteDataObject(object) +function Clicked2:DeleteDataObject(object) assert(type(object) == "table", "bad argument #1, expected table but got " .. type(object)) local function Delete(tbl, uid) @@ -241,16 +241,16 @@ function Clicked:DeleteDataObject(object) local current = table.remove(queue, 1) local db = Addon:GetContainingDatabase(current) - if current.type == Clicked.DataObjectType.GROUP then + if current.type == Clicked2.DataObjectType.GROUP then if Delete(db.groups, current.uid) then table.insert(lookupTable.deleted, object.uid) table.insert(deleted, current) - for _, binding in ipairs(Clicked:GetByParent(current.uid)) do + for _, binding in ipairs(Clicked2:GetByParent(current.uid)) do table.insert(queue, binding) end end - elseif current.type == Clicked.DataObjectType.BINDING then + elseif current.type == Clicked2.DataObjectType.BINDING then if Delete(db.bindings, current.uid) then table.insert(lookupTable.deleted, object.uid) table.insert(deleted, current) @@ -259,10 +259,10 @@ function Clicked:DeleteDataObject(object) end for _, current in ipairs(deleted) do - if current.type == Clicked.DataObjectType.BINDING then + if current.type == Clicked2.DataObjectType.BINDING then --- @cast current Binding Addon:ReloadBinding(current) - elseif current.type == Clicked.DataObjectType.GROUP then + elseif current.type == Clicked2.DataObjectType.GROUP then Addon:UpdateLookupTable(current) Addon.BindingConfig.Window:RedrawTree() end @@ -275,7 +275,7 @@ end --- --- @param identifier? integer --- @return DataObject? -function Clicked:GetByUid(identifier) +function Clicked2:GetByUid(identifier) if identifier == nil then return nil end @@ -285,7 +285,7 @@ end --- @param key? string --- @return Binding[] -function Clicked:GetByKey(key) +function Clicked2:GetByKey(key) if key == nil then return {} end @@ -295,7 +295,7 @@ end --- @param scope DataObjectScope --- @return DataObject[] -function Clicked:GetByScope(scope) +function Clicked2:GetByScope(scope) return lookupTable.scope[scope] or {} end @@ -303,7 +303,7 @@ end --- --- @param identifier? integer --- @return Binding[] -function Clicked:GetByParent(identifier) +function Clicked2:GetByParent(identifier) if identifier == nil then return {} end @@ -315,12 +315,12 @@ end --- --- @param type ActionType --- @return Binding[] -function Clicked:GetByActionType(type) +function Clicked2:GetByActionType(type) return lookupTable.actionType[type] or {} end --- Iterate trough all configured groups. This function can be used in a `for in` loop. -function Clicked:IterateGroups() +function Clicked2:IterateGroups() --- @type Group[] local result = {} @@ -339,7 +339,7 @@ end --- Iterate through all configured bindings, this will also include any bindings avaialble in the current profile that are not currently loaded. This function --- can be used in a `for in` loop. -function Clicked:IterateConfiguredBindings() +function Clicked2:IterateConfiguredBindings() --- @type Binding[] local result = {} @@ -359,7 +359,7 @@ end --@debug@ --- @param from string -function Clicked:UpgradeDatabase(from) +function Clicked2:UpgradeDatabase(from) Addon:UpgradeDatabase(from) Addon:ReloadBindings() end @@ -377,9 +377,9 @@ end --- @param obj? DataObject function Addon:UpdateLookupTable(obj) if obj ~= nil then - Clicked:LogVerbose("Updating binding lookup table for {uid}", obj.uid) + Clicked2:LogVerbose("Updating binding lookup table for {uid}", obj.uid) else - Clicked:LogVerbose("Updating binding lookup table") + Clicked2:LogVerbose("Updating binding lookup table") end --- @type DataObject[] @@ -394,11 +394,11 @@ function Addon:UpdateLookupTable(obj) table.wipe(lookupTable.scope) table.wipe(lookupTable.deleted) - for _, configured in Clicked:IterateConfiguredBindings() do + for _, configured in Clicked2:IterateConfiguredBindings() do table.insert(queue, configured) end - for _, group in Clicked:IterateGroups() do + for _, group in Clicked2:IterateGroups() do table.insert(queue, group) end else @@ -443,7 +443,7 @@ function Addon:UpdateLookupTable(obj) Addon:TableRemoveItem(lookupTable.deleted, current.uid) - if current.type == Clicked.DataObjectType.BINDING then + if current.type == Clicked2.DataObjectType.BINDING then --- @cast current Binding DeleteFromLookupTable(lookupTable.keybind, current) DeleteFromLookupTable(lookupTable.parent, current) @@ -454,7 +454,7 @@ function Addon:UpdateLookupTable(obj) else lookupTable.uid[current.uid] = current - if current.type == Clicked.DataObjectType.BINDING then + if current.type == Clicked2.DataObjectType.BINDING then --- @cast current Binding UpdateLookupTable(lookupTable.keybind, current.keybind, current) UpdateLookupTable(lookupTable.parent, current.parent, current) @@ -471,8 +471,8 @@ function Addon:GetNewBindingTemplate() --- @type Binding --- @diagnostic disable-next-line: missing-fields local template = { - actionType = Clicked.ActionType.SPELL, - type = Clicked.DataObjectType.BINDING, + actionType = Clicked2.ActionType.SPELL, + type = Clicked2.DataObjectType.BINDING, keybind = "", parent = nil, action = { @@ -579,7 +579,7 @@ function Addon:ChangeDataObjectScope(item, scope) assert(type(scope) == "number", "bad argument #1, expected number but got " .. type(scope)) if item.uid == nil then - return Clicked:LogFatal("Can only change the scope of a binding or group") + return Clicked2:LogFatal("Can only change the scope of a binding or group") end if item.scope == scope then @@ -593,34 +593,34 @@ function Addon:ChangeDataObjectScope(item, scope) --- @type DataObject local current = table.remove(queue, 1) - if current.type == Clicked.DataObjectType.GROUP then + if current.type == Clicked2.DataObjectType.GROUP then --- @cast current Group - for _, binding in ipairs(Clicked:GetByParent(current.uid)) do + for _, binding in ipairs(Clicked2:GetByParent(current.uid)) do table.insert(queue, binding) end end current.scope = scope - if current.type == Clicked.DataObjectType.BINDING then + if current.type == Clicked2.DataObjectType.BINDING then --- @cast current Binding - local parent = Clicked:GetByUid(current.parent) + local parent = Clicked2:GetByUid(current.parent) if parent ~= nil and parent.scope ~= scope then current.parent = nil end end - if scope == Clicked.DataObjectScope.PROFILE and current.type == Clicked.DataObjectType.GROUP then + if scope == Clicked2.DataObjectScope.PROFILE and current.type == Clicked2.DataObjectType.GROUP then table.insert(Addon.db.profile.groups, current) Addon:TableRemoveItem(Addon.db.global.groups, current) - elseif scope == Clicked.DataObjectScope.GLOBAL and current.type == Clicked.DataObjectType.GROUP then + elseif scope == Clicked2.DataObjectScope.GLOBAL and current.type == Clicked2.DataObjectType.GROUP then table.insert(Addon.db.global.groups, current) Addon:TableRemoveItem(Addon.db.profile.groups, current) - elseif scope == Clicked.DataObjectScope.PROFILE and current.type == Clicked.DataObjectType.BINDING then + elseif scope == Clicked2.DataObjectScope.PROFILE and current.type == Clicked2.DataObjectType.BINDING then table.insert(Addon.db.profile.bindings, current) Addon:TableRemoveItem(Addon.db.global.bindings, current) - elseif scope == Clicked.DataObjectScope.GLOBAL and current.type == Clicked.DataObjectType.BINDING then + elseif scope == Clicked2.DataObjectScope.GLOBAL and current.type == Clicked2.DataObjectType.BINDING then table.insert(Addon.db.global.bindings, current) Addon:TableRemoveItem(Addon.db.profile.bindings, current) end @@ -638,7 +638,7 @@ end function Addon:ChangeDataObjectParent(item, parent) assert(type(item) == "table", "bad argument #1, expected table but got " .. type(item)) - if item.type ~= Clicked.DataObjectType.BINDING then + if item.type ~= Clicked2.DataObjectType.BINDING then return end @@ -652,7 +652,7 @@ function Addon:ChangeDataObjectParent(item, parent) else --- @cast parent integer? item.parent = parent - parentObject = Clicked:GetByUid(parent) --[[@as Group?]] + parentObject = Clicked2:GetByUid(parent) --[[@as Group?]] end if parentObject ~= nil and item.scope ~= parentObject.scope then @@ -682,7 +682,7 @@ function Addon:ReplaceBindingContents(original, replacement) replacement.uid = original.uid replacement.keybind = original.keybind - for index, binding in Clicked:IterateConfiguredBindings() do + for index, binding in Clicked2:IterateConfiguredBindings() do if binding.uid == original.uid then Addon.db.profile.bindings[index] = replacement break @@ -696,15 +696,15 @@ function Addon:RegisterDataObject(object, scope) assert(type(object) == "table", "bad argument #1, expected table but got " .. type(object)) object.uid = object.uid or self:GetNextUid() - object.scope = scope or Clicked.DataObjectScope.PROFILE + object.scope = scope or Clicked2.DataObjectScope.PROFILE local db = self:GetContainingDatabase(object) - if object.type == Clicked.DataObjectType.GROUP then - Clicked:LogDebug("Registering group {uid} in scope {scope}", object.uid, object.scope) + if object.type == Clicked2.DataObjectType.GROUP then + Clicked2:LogDebug("Registering group {uid} in scope {scope}", object.uid, object.scope) table.insert(db.groups, object) - elseif object.type == Clicked.DataObjectType.BINDING then - Clicked:LogDebug("Registering binding {uid} in scope {scope}", object.uid, object.scope) + elseif object.type == Clicked2.DataObjectType.BINDING then + Clicked2:LogDebug("Registering binding {uid} in scope {scope}", object.uid, object.scope) table.insert(db.bindings, object) end @@ -726,13 +726,13 @@ function Addon:CloneDataObject(original) return clone end - if original.type == Clicked.DataObjectType.GROUP then + if original.type == Clicked2.DataObjectType.GROUP then --- @cast original Group local clone = Clone(original) clone.name = clone.name .. " - " .. Addon.L["copy"] self:RegisterDataObject(clone, original.scope) - for _, binding in ipairs(Clicked:GetByParent(original.uid)) do + for _, binding in ipairs(Clicked2:GetByParent(original.uid)) do local cloneBinding = Clone(binding) cloneBinding.parent = clone.uid cloneBinding.keybind = "" @@ -742,7 +742,7 @@ function Addon:CloneDataObject(original) end return clone - elseif original.type == Clicked.DataObjectType.BINDING then + elseif original.type == Clicked2.DataObjectType.BINDING then --- @cast original Binding local clone = Clone(original) clone.keybind = "" @@ -761,11 +761,11 @@ end function Addon:GetContainingDatabase(item) assert(type(item) == "table", "bad argument #1, expected table but got " .. type(item)) - if item.scope == Clicked.DataObjectScope.GLOBAL then + if item.scope == Clicked2.DataObjectScope.GLOBAL then return Addon.db.global - elseif item.scope == Clicked.DataObjectScope.PROFILE then + elseif item.scope == Clicked2.DataObjectScope.PROFILE then return Addon.db.profile else - return Clicked:LogFatal("Unknown binding scope {scope}", item.scope) + return Clicked2:LogFatal("Unknown binding scope {scope}", item.scope) end end diff --git a/Clicked/Core/Init.lua b/Clicked/Core/Init.lua index ffdb6c5..d651675 100644 --- a/Clicked/Core/Init.lua +++ b/Clicked/Core/Init.lua @@ -93,7 +93,7 @@ end --- @return boolean function Addon:IsDevelopmentBuild() --@debug@ - if Clicked.VERSION == "development" then + if Clicked2.VERSION == "development" then return true end --@end-debug@ diff --git a/Clicked/Core/LocaleUtils.lua b/Clicked/Core/LocaleUtils.lua index 49d5497..6cfbbbd 100644 --- a/Clicked/Core/LocaleUtils.lua +++ b/Clicked/Core/LocaleUtils.lua @@ -758,11 +758,11 @@ end --- @param scope DataObjectScope function Addon:GetLocalizedScope(scope) - if scope == Clicked.DataObjectScope.GLOBAL then + if scope == Clicked2.DataObjectScope.GLOBAL then return Addon.L["Global"] end - if scope == Clicked.DataObjectScope.PROFILE then + if scope == Clicked2.DataObjectScope.PROFILE then local defaultProfiles = { ["Default"] = Addon.L["Default"], [Addon.db.keys.char] = Addon.db.keys.char, @@ -774,5 +774,5 @@ function Addon:GetLocalizedScope(scope) return defaultProfiles[profile] or profile end - Clicked:LogError("Unknown binding scope: {scope}", scope) + Clicked2:LogError("Unknown binding scope: {scope}", scope) end diff --git a/Clicked/Core/Serializer.lua b/Clicked/Core/Serializer.lua index 7b3859c..aafc13e 100644 --- a/Clicked/Core/Serializer.lua +++ b/Clicked/Core/Serializer.lua @@ -20,7 +20,7 @@ local LibDeflate = LibStub("LibDeflate") --- @class ClickedInternal local Addon = select(2, ...) -local logger = Clicked:CreateSystemLogger("Serializer") +local logger = Clicked2:CreateSystemLogger("Serializer") -- Local support functions @@ -66,7 +66,7 @@ local function RegisterBinding(data) end data.binding.uid = nil - Addon:RegisterDataObject(data.binding, Clicked.DataObjectScope.PROFILE) + Addon:RegisterDataObject(data.binding, Clicked2.DataObjectScope.PROFILE) Addon:ReloadBinding(data.binding, true) end @@ -98,7 +98,7 @@ local function RegisterProfile(data) Addon.db.profile[key] = data[key] end - Clicked:ReloadDatabase() + Clicked2:ReloadDatabase() end -- Public addon API @@ -109,13 +109,13 @@ end --- @return string --- @see Clicked#SerializeGroup --- @see Clicked#Deserialize -function Clicked:SerializeDataObject(obj) +function Clicked2:SerializeDataObject(obj) assert(type(obj) == "table", "bad argument #1, expected table but got " .. type(obj)) --- @type ShareData local data - if obj.type == Clicked.DataObjectType.BINDING then + if obj.type == Clicked2.DataObjectType.BINDING then --- @cast obj Binding data = { @@ -126,7 +126,7 @@ function Clicked:SerializeDataObject(obj) -- Clear user-specific data data.binding.parent = nil - elseif obj.type == Clicked.DataObjectType.GROUP then + elseif obj.type == Clicked2.DataObjectType.GROUP then --- @cast obj Group data = { @@ -135,7 +135,7 @@ function Clicked:SerializeDataObject(obj) group = CopyTable(obj) --[[@as ShareData.Group]] } - data.group.bindings = CopyTable(Clicked:GetByParent(obj.uid)) + data.group.bindings = CopyTable(Clicked2:GetByParent(obj.uid)) end logger:LogDebug("Serializing data object of type {type}", data.type) @@ -150,7 +150,7 @@ end --- @param printable boolean Whether the profile should be serialized in a printable format, `false` if the profile is shared via addon communication channels. --- @param full boolean Whether the full profile should be serialized, or only a lightweight variant containing no user settings. --- @return string -function Clicked:SerializeProfile(profile, printable, full) +function Clicked2:SerializeProfile(profile, printable, full) assert(type(profile) == "table", "bad argument #1, expected table but got " .. type(profile)) assert(type(printable == "boolean"), "bad argument #2, expected boolean but got " .. type(printable)) assert(type(full == "boolean"), "bad argument #3, expected boolean but got " .. type(full)) @@ -188,7 +188,7 @@ end --- @param printable boolean --- @return boolean status The resulting decode and deserialize status, `false` if anything went wrong during the deserialization process. --- @return ShareData|ExportProfile|string result A table containing the resulting data, or a `string` with an error message if `status` is `false`. -function Clicked:Deserialize(encoded, printable) +function Clicked2:Deserialize(encoded, printable) local compressed if printable then @@ -224,7 +224,7 @@ end --- --- @param data ShareData|ExportProfile --- @return boolean -function Clicked:Import(data) +function Clicked2:Import(data) if data.type == "group" then --- @cast data ShareData RegisterGroup(data) diff --git a/Clicked/Core/Tooltips.lua b/Clicked/Core/Tooltips.lua index f41ad82..ac2be11 100644 --- a/Clicked/Core/Tooltips.lua +++ b/Clicked/Core/Tooltips.lua @@ -126,7 +126,7 @@ local function OnTooltipSetUnit(self) if rebuild then rebuild = false - local bindings = Clicked:GetBindingsForUnit(unit) + local bindings = Clicked2:GetBindingsForUnit(unit) table.sort(bindings, SortBindings) table.wipe(lineCache) @@ -165,8 +165,8 @@ local function OnTooltipSetSpell(self) local addedEmptyLine = false --- @type Binding - for _, binding in Clicked:IterateActiveBindings() do - if binding.actionType == Clicked.ActionType.SPELL and binding.action.spellValue == spellId then + for _, binding in Clicked2:IterateActiveBindings() do + if binding.actionType == Clicked2.ActionType.SPELL and binding.action.spellValue == spellId then local text = string.format(Addon.L["Bound to %s"], Addon:SanitizeKeybind(binding.keybind)) if not addedEmptyLine then diff --git a/Clicked/Core/Upgrader.lua b/Clicked/Core/Upgrader.lua index b8eae2a..25b394b 100644 --- a/Clicked/Core/Upgrader.lua +++ b/Clicked/Core/Upgrader.lua @@ -336,7 +336,7 @@ local function UpgradeLegacy(profile, from) end end - if binding.type == Clicked.ActionType.MACRO then + if binding.type == Clicked2.ActionType.MACRO then while #regular > 0 do table.remove(regular, 1) end @@ -376,7 +376,7 @@ local function UpgradeLegacy(profile, from) itemValue = binding.actions.item.value, macroValue = binding.actions.macro.value, macroMode = binding.actions.macro.mode, - interrupt = binding.type == Clicked.ActionType.SPELL and binding.actions.spell.interruptCurrentCast or binding.type == Clicked.ActionType.ITEM and binding.actions.item.interruptCurrentCast or false, + interrupt = binding.type == Clicked2.ActionType.SPELL and binding.actions.spell.interruptCurrentCast or binding.type == Clicked2.ActionType.ITEM and binding.actions.item.interruptCurrentCast or false, allowStartAttack = true } @@ -457,7 +457,7 @@ local function UpgradeLegacy(profile, from) binding.action.macroName = Addon.L["Run custom macro"] binding.action.macroIcon = [[Interface\ICONS\INV_Misc_QuestionMark]] - if binding.type == Clicked.ActionType.MACRO then + if binding.type == Clicked2.ActionType.MACRO then binding.action.macroName = binding.cache.displayName binding.action.macroIcon = binding.cache.displayIcon end @@ -522,7 +522,7 @@ local function UpgradeLegacy(profile, from) end for _, binding in ipairs(profile.bindings) do - if binding.type == Clicked.ActionType.MACRO then + if binding.type == Clicked2.ActionType.MACRO then if binding.action.macroMode == "FIRST" then for _, other in GetRelatedBindings(binding) do other.action.executionOrder = other.action.executionOrder + 1 diff --git a/Clicked/Core/Utils.lua b/Clicked/Core/Utils.lua index 0e547a3..ee2109b 100644 --- a/Clicked/Core/Utils.lua +++ b/Clicked/Core/Utils.lua @@ -292,7 +292,7 @@ end StaticPopupDialogs["CLICKED_INCOMPATIBLE_ADDON"] = { text = "", - button1 = string.format(Addon.L["Keep %s"], Addon.L["Clicked"]), + button1 = string.format(Addon.L["Keep %s"], Addon.L["Clicked2"]), button2 = "", OnShow = function(self) -- deprecated in 11.2.0 @@ -309,7 +309,7 @@ StaticPopupDialogs["CLICKED_INCOMPATIBLE_ADDON"] = { ReloadUI() end, OnCancel = function() - C_AddOns.DisableAddOn("Clicked") + C_AddOns.DisableAddOn("Clicked2") ReloadUI() end, timeout = 0, @@ -453,7 +453,7 @@ end function Addon:GetBindingValue(binding) assert(type(binding) == "table", "bad argument #1, expected table but got " .. type(binding)) - if binding.actionType == Clicked.ActionType.SPELL then + if binding.actionType == Clicked2.ActionType.SPELL then local spell = binding.action.spellValue if spell == nil then return nil @@ -485,7 +485,7 @@ function Addon:GetBindingValue(binding) return name end - if binding.actionType == Clicked.ActionType.ITEM then + if binding.actionType == Clicked2.ActionType.ITEM then local item = binding.action.itemValue if item == nil then return nil @@ -503,7 +503,7 @@ function Addon:GetBindingValue(binding) return item end - if binding.actionType == Clicked.ActionType.CANCELAURA then + if binding.actionType == Clicked2.ActionType.CANCELAURA then local aura = binding.action.auraName if aura == nil then return nil @@ -527,11 +527,11 @@ function Addon:GetBindingValue(binding) return name end - if binding.actionType == Clicked.ActionType.MACRO or binding.actionType == Clicked.ActionType.APPEND then + if binding.actionType == Clicked2.ActionType.MACRO or binding.actionType == Clicked2.ActionType.APPEND then return binding.action.macroValue end - if binding.actionType == Clicked.ActionType.UNIT_SELECT or binding.actionType == Clicked.ActionType.UNIT_MENU then + if binding.actionType == Clicked2.ActionType.UNIT_SELECT or binding.actionType == Clicked2.ActionType.UNIT_MENU then return binding.actionType end @@ -545,7 +545,7 @@ end function Addon:GetSimpleSpellOrItemInfo(binding) assert(type(binding) == "table", "bad argument #1, expected table but got " .. type(binding)) - if binding.actionType == Clicked.ActionType.SPELL then + if binding.actionType == Clicked2.ActionType.SPELL then local spell = Addon:GetSpellInfo(binding.action.spellValue, not binding.action.spellMaxRank) if spell == nil then return nil, nil, nil @@ -554,7 +554,7 @@ function Addon:GetSimpleSpellOrItemInfo(binding) return spell.name, spell.iconID, spell.spellID end - if binding.actionType == Clicked.ActionType.ITEM then + if binding.actionType == Clicked2.ActionType.ITEM then local name, _, _, _, _, _, _, _, _, icon = Addon:GetItemInfo(binding.action.itemValue) if name == nil then @@ -564,7 +564,7 @@ function Addon:GetSimpleSpellOrItemInfo(binding) return name, icon, self:GetItemId(name) end - if binding.actionType == Clicked.ActionType.CANCELAURA then + if binding.actionType == Clicked2.ActionType.CANCELAURA then local spell = Addon:GetSpellInfo(binding.action.auraName, true) if spell == nil then return nil, nil, nil @@ -601,8 +601,8 @@ function Addon:GetBindingNameAndIcon(binding) --- @type string|integer local icon = "Interface\\ICONS\\INV_Misc_QuestionMark" - if binding.actionType == Clicked.ActionType.SPELL or binding.actionType == Clicked.ActionType.ITEM then - local label = binding.actionType == Clicked.ActionType.SPELL and Addon.L["Cast %s"] or Addon.L["Use %s"] + if binding.actionType == Clicked2.ActionType.SPELL or binding.actionType == Clicked2.ActionType.ITEM then + local label = binding.actionType == Clicked2.ActionType.SPELL and Addon.L["Cast %s"] or Addon.L["Use %s"] local spellName, spellIcon = Addon:GetSimpleSpellOrItemInfo(binding) local value = Addon:GetBindingValue(binding) @@ -614,7 +614,7 @@ function Addon:GetBindingNameAndIcon(binding) if IsValidIcon(spellIcon) then icon = spellIcon --[[@as string|integer]] end - elseif binding.actionType == Clicked.ActionType.MACRO or binding.actionType == Clicked.ActionType.APPEND then + elseif binding.actionType == Clicked2.ActionType.MACRO or binding.actionType == Clicked2.ActionType.APPEND then if Addon:IsNilOrEmpty(binding.action.macroName) then name = Addon.L["Run custom macro"] else @@ -624,7 +624,7 @@ function Addon:GetBindingNameAndIcon(binding) if IsValidIcon(binding.action.macroIcon) then icon = binding.action.macroIcon end - elseif binding.actionType == Clicked.ActionType.CANCELAURA then + elseif binding.actionType == Clicked2.ActionType.CANCELAURA then local spellName, spellIcon = Addon:GetSimpleSpellOrItemInfo(binding) local value = Addon:GetBindingValue(binding) @@ -635,9 +635,9 @@ function Addon:GetBindingNameAndIcon(binding) if IsValidIcon(spellIcon) then icon = spellIcon --[[@as string|integer]] end - elseif binding.actionType == Clicked.ActionType.UNIT_SELECT then + elseif binding.actionType == Clicked2.ActionType.UNIT_SELECT then name = Addon.L["Target the unit"] - elseif binding.actionType == Clicked.ActionType.UNIT_MENU then + elseif binding.actionType == Clicked2.ActionType.UNIT_MENU then name = Addon.L["Open the unit menu"] end @@ -859,11 +859,11 @@ function Addon:CompareBindings(left, right, leftCanLoad, rightCanLoad) do if leftCanLoad == nil then - leftCanLoad = Clicked:IsBindingLoaded(left) + leftCanLoad = Clicked2:IsBindingLoaded(left) end if rightCanLoad == nil then - rightCanLoad = Clicked:IsBindingLoaded(right) + rightCanLoad = Clicked2:IsBindingLoaded(right) end if leftCanLoad and not rightCanLoad then @@ -1192,7 +1192,7 @@ end --- @param binding Binding --- @return boolean function Addon:IsHovercastEnabled(binding) - if binding.actionType == Clicked.ActionType.CANCELAURA then + if binding.actionType == Clicked2.ActionType.CANCELAURA then return false end @@ -1204,11 +1204,11 @@ end --- @param binding Binding --- @return boolean function Addon:IsMacroCastEnabled(binding) - if binding.actionType == Clicked.ActionType.CANCELAURA then + if binding.actionType == Clicked2.ActionType.CANCELAURA then return true end - if binding.actionType == Clicked.ActionType.UNIT_MENU or binding.actionType == Clicked.ActionType.UNIT_SELECT then + if binding.actionType == Clicked2.ActionType.UNIT_MENU or binding.actionType == Clicked2.ActionType.UNIT_SELECT then return false end @@ -1285,7 +1285,7 @@ end --- @param message string --- @return string function Addon:AppendClickedMessagePrefix(message) - return Addon:GetColorizedString(Addon.L["Clicked"], "ffe31919") .. ": " .. message + return Addon:GetColorizedString(Addon.L["Clicked2"], "ffe31919") .. ": " .. message end --- Run `string.format` on the specified string, and prefix the resulting string with `Clicked:`. diff --git a/Clicked/Debug/StatusOutput.lua b/Clicked/Debug/StatusOutput.lua index 52e189a..3cd2b22 100644 --- a/Clicked/Debug/StatusOutput.lua +++ b/Clicked/Debug/StatusOutput.lua @@ -42,7 +42,7 @@ local data local function GetBasicinfoString() local lines = {} - table.insert(lines, "Version: " .. Clicked.VERSION) + table.insert(lines, "Version: " .. Clicked2.VERSION) table.insert(lines, "Data Version: " .. Addon.DATA_VERSION) table.insert(lines, "Project ID: " .. WOW_PROJECT_ID) table.insert(lines, "Race: " .. select(2, UnitRace("player"))) @@ -142,7 +142,7 @@ local function GetUnloadedBindings() "----- Configured bindings -----" } - for _, binding in Clicked:IterateConfiguredBindings() do + for _, binding in Clicked2:IterateConfiguredBindings() do local info = { "ID: " .. binding.uid, "Type: " .. binding.actionType, @@ -172,7 +172,7 @@ end local function GetRegisteredClickCastFrames() local lines = {} - for _, clickCastFrame in Clicked:IterateClickCastFrames() do + for _, clickCastFrame in Clicked2:IterateClickCastFrames() do if clickCastFrame ~= nil and clickCastFrame.GetName ~= nil then local name = clickCastFrame:GetName() @@ -196,7 +196,7 @@ end local function GetRegisteredClickCastSidecars() local lines = {} - for _, sidecar in Clicked:IterateSidecars() do + for _, sidecar in Clicked2:IterateSidecars() do local targetFrameName = sidecar:GetAttribute("clicked-name") table.insert(lines, sidecar:GetName() .. (targetFrameName and " (for " .. targetFrameName .. ")" or "")) @@ -216,10 +216,10 @@ local function GetSerializedProfileString() local lines = {} table.insert(lines, "----- Saved Global Variables -----") - table.insert(lines, Clicked:SerializeProfile(Addon.db.global, true, true)) + table.insert(lines, Clicked2:SerializeProfile(Addon.db.global, true, true)) table.insert(lines, "") table.insert(lines, "----- Saved Profile Variables -----") - table.insert(lines, Clicked:SerializeProfile(Addon.db.profile, true, true)) + table.insert(lines, Clicked2:SerializeProfile(Addon.db.profile, true, true)) return table.concat(lines, "\n") end diff --git a/Clicked/Locales/deDE.lua b/Clicked/Locales/deDE.lua index 48c9746..5246988 100644 --- a/Clicked/Locales/deDE.lua +++ b/Clicked/Locales/deDE.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "deDE") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "deDE") if not L then return diff --git a/Clicked/Locales/enUS.lua b/Clicked/Locales/enUS.lua index fcb6a06..c0a1ae3 100644 --- a/Clicked/Locales/enUS.lua +++ b/Clicked/Locales/enUS.lua @@ -14,13 +14,13 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "enUS", true) +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "enUS", true) if not L then return end -L["Clicked"] = true +L["Clicked2"] = true L["Clicked is not compatible with %s and requires one of the two to be disabled."] = true L["Keep %s"] = true L["Upgraded profile from version %s to version %s"] = true diff --git a/Clicked/Locales/esES.lua b/Clicked/Locales/esES.lua index 94a5e4a..fe110db 100644 --- a/Clicked/Locales/esES.lua +++ b/Clicked/Locales/esES.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "esES") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "esES") if not L then return diff --git a/Clicked/Locales/esMX.lua b/Clicked/Locales/esMX.lua index c7acedc..105172e 100644 --- a/Clicked/Locales/esMX.lua +++ b/Clicked/Locales/esMX.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "esMX") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "esMX") if not L then return diff --git a/Clicked/Locales/frFR.lua b/Clicked/Locales/frFR.lua index 8766f27..7e14b78 100644 --- a/Clicked/Locales/frFR.lua +++ b/Clicked/Locales/frFR.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "frFR") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "frFR") if not L then return diff --git a/Clicked/Locales/itIT.lua b/Clicked/Locales/itIT.lua index c5b7599..d6c46b6 100644 --- a/Clicked/Locales/itIT.lua +++ b/Clicked/Locales/itIT.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "itIT") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "itIT") if not L then return diff --git a/Clicked/Locales/koKR.lua b/Clicked/Locales/koKR.lua index 8f989c3..5d055a4 100644 --- a/Clicked/Locales/koKR.lua +++ b/Clicked/Locales/koKR.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "koKR") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "koKR") if not L then return @@ -54,7 +54,7 @@ L["Cast a spell on a unit frame"] = "유닛 프레임에 주문 시전" L["Cast on key down rather than key up"] = "클릭 시 주문 시전" L["Channeling"] = "정신 집중" L["Class"] = "직업" -L["Clicked"] = true +L["Clicked2"] = true L["Clicked Binding Configuration"] = "Clicked 단축키 구성" L["Clicked is not compatible with %s and requires one of the two to be disabled."] = "Clicked은 %s와 호환되지 않으며 두 가지 중 하나를 비활성화해야 합니다." L["Combat"] = "전투" diff --git a/Clicked/Locales/ptBR.lua b/Clicked/Locales/ptBR.lua index 9627921..430bab5 100644 --- a/Clicked/Locales/ptBR.lua +++ b/Clicked/Locales/ptBR.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "ptBR") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "ptBR") if not L then return diff --git a/Clicked/Locales/ruRU.lua b/Clicked/Locales/ruRU.lua index 2498ddb..72d10a9 100644 --- a/Clicked/Locales/ruRU.lua +++ b/Clicked/Locales/ruRU.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "ruRU") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "ruRU") if not L then return diff --git a/Clicked/Locales/zhCN.lua b/Clicked/Locales/zhCN.lua index e4add2c..0f4a2f0 100644 --- a/Clicked/Locales/zhCN.lua +++ b/Clicked/Locales/zhCN.lua @@ -14,13 +14,13 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "zhCN") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "zhCN") if not L then return end -L["Clicked"] = "Clicked" +L["Clicked2"] = "Clicked" L["Unable to register unit frame: %s"] = "无法注册单位框架: %s" L["Clicked is not compatible with %s and requires one of the two to be disabled."] = "Clicked 和 %s 不兼容,请禁用其中一个插件." L["Keep %s"] = "保留 %s" diff --git a/Clicked/Locales/zhTW.lua b/Clicked/Locales/zhTW.lua index e464caa..db58d69 100644 --- a/Clicked/Locales/zhTW.lua +++ b/Clicked/Locales/zhTW.lua @@ -14,7 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local L = LibStub("AceLocale-3.0"):NewLocale("Clicked", "zhTW") +local L = LibStub("AceLocale-3.0"):NewLocale("Clicked2", "zhTW") if not L then return diff --git a/Clicked/Media/Media.lua b/Clicked/Media/Media.lua index fad2824..b25424d 100644 --- a/Clicked/Media/Media.lua +++ b/Clicked/Media/Media.lua @@ -23,7 +23,7 @@ Addon.Media = { FONT_MONO = "JetBrains Mono Regular" } -local basePath = [[Interface\AddOns\Clicked\Media\]] +local basePath = [[Interface\AddOns\Clicked2\Media\]] local fontPath = basePath .. [[Fonts\]] LSM:Register("font", Addon.Media.FONT_MONO, fontPath .. "JetBrainsMonoNL-Regular.ttf", LSM.LOCALE_BIT_western + LSM.LOCALE_BIT_ruRU) diff --git a/Clicked/Templates/Clicked.xml b/Clicked/Templates/Clicked.xml deleted file mode 100644 index 26fe496..0000000 --- a/Clicked/Templates/Clicked.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/Clicked/UnitFrames/Blizzard.lua b/Clicked/UnitFrames/Blizzard.lua index f86f0eb..43fc300 100644 --- a/Clicked/UnitFrames/Blizzard.lua +++ b/Clicked/UnitFrames/Blizzard.lua @@ -29,7 +29,7 @@ local function HookUnitFrame(count, names, addon) for _, name in ipairs(names) do for i = 1, count do - Clicked:RegisterClickCastFrame(string.format(name, i), addon) + Clicked2:RegisterClickCastFrame(string.format(name, i), addon) end end end @@ -40,7 +40,7 @@ local function HookCompactUnitFramePart(parent, name) local frame = _G[name] Addon.BlacklistOptions:SetBlacklistGroup(frame, parent:GetName()) - Clicked:RegisterClickCastFrame(frame) + Clicked2:RegisterClickCastFrame(frame) end --- @param frame Button @@ -66,22 +66,22 @@ local function HookCompactUnitFrame(frame) end HookCompactUnitFramePart(frame, name .. "CenterStatusIcon") - Clicked:RegisterClickCastFrame(frame) + Clicked2:RegisterClickCastFrame(frame) end -- Private addon API function Addon:RegisterBlizzardUnitFrames() - Clicked:RegisterClickCastFrame("PlayerFrame") - Clicked:RegisterClickCastFrame("PetFrame") - Clicked:RegisterClickCastFrame("TargetFrame") - Clicked:RegisterClickCastFrame("TargetFrameToT") + Clicked2:RegisterClickCastFrame("PlayerFrame") + Clicked2:RegisterClickCastFrame("PetFrame") + Clicked2:RegisterClickCastFrame("TargetFrame") + Clicked2:RegisterClickCastFrame("TargetFrameToT") HookUnitFrame(5, "Boss%dTargetFrame") if Addon.EXPANSION_LEVEL >= Addon.Expansion.TBC then - Clicked:RegisterClickCastFrame("FocusFrame") - Clicked:RegisterClickCastFrame("FocusFrameToT") + Clicked2:RegisterClickCastFrame("FocusFrame") + Clicked2:RegisterClickCastFrame("FocusFrameToT") end if Addon.EXPANSION_LEVEL >= Addon.Expansion.CATA then @@ -92,11 +92,11 @@ function Addon:RegisterBlizzardUnitFrames() local partyFrameIndex = 1 for frame in PartyFrame.PartyMemberFramePool:EnumerateActive() do - Clicked:RegisterClickCastFrame(frame) - Clicked:RegisterClickCastFrame(frame.PetFrame) + Clicked2:RegisterClickCastFrame(frame) + Clicked2:RegisterClickCastFrame(frame.PetFrame) - Clicked:CreateSidecar(frame, "PartyMemberFrame" .. partyFrameIndex) - Clicked:CreateSidecar(frame.PetFrame, "PartyMemberFrame" .. partyFrameIndex .. "PetFrame") + Clicked2:CreateSidecar(frame, "PartyMemberFrame" .. partyFrameIndex) + Clicked2:CreateSidecar(frame.PetFrame, "PartyMemberFrame" .. partyFrameIndex .. "PetFrame") partyFrameIndex = partyFrameIndex + 1 end diff --git a/Clicked/UnitFrames/ClickCastFrames.lua b/Clicked/UnitFrames/ClickCastFrames.lua index 2b99cbf..134b2d3 100644 --- a/Clicked/UnitFrames/ClickCastFrames.lua +++ b/Clicked/UnitFrames/ClickCastFrames.lua @@ -35,7 +35,7 @@ local cachedAttributes = {} --- @type Button[] local sidecars = {} -local logger = Clicked:CreateSystemLogger("ClickCast") +local logger = Clicked2:CreateSystemLogger("ClickCast") -- Local support functions @@ -67,7 +67,7 @@ function Addon:ProcessFrameQueue() unregisterQueue = {} for _, frame in ipairs(queue) do - Clicked:UnregisterClickCastFrame(frame) + Clicked2:UnregisterClickCastFrame(frame) end end @@ -76,7 +76,7 @@ function Addon:ProcessFrameQueue() registerQueue = {} for _, frame in ipairs(queue) do - Clicked:RegisterClickCastFrame(frame.frame, frame.addon) + Clicked2:RegisterClickCastFrame(frame.frame, frame.addon) end end @@ -85,7 +85,7 @@ function Addon:ProcessFrameQueue() registerClicksQueue = {} for _, frame in ipairs(queue) do - Clicked:RegisterFrameClicks(frame) + Clicked2:RegisterFrameClicks(frame) end end end @@ -142,7 +142,7 @@ end --- @param frame Button|string Either the frame to register, or the name of the frame that can be found in the global table. --- @param addon? string The name of the addon that has requested the frame, unless the frames are part of a load-on-demand addon, this can be nil. --- @see Clicked.UnregisterClickCastFrame -function Clicked:RegisterClickCastFrame(frame, addon) +function Clicked2:RegisterClickCastFrame(frame, addon) if frame == nil then return end @@ -217,10 +217,10 @@ function Clicked:RegisterClickCastFrame(frame, addon) end if name == nil then - Clicked:CreateSidecar(frame, nil) + Clicked2:CreateSidecar(frame, nil) end - Clicked:RegisterFrameClicks(frame) + Clicked2:RegisterFrameClicks(frame) local setup = Addon.ClickCastHeader:GetAttribute("setup-keybinds") local clear = Addon.ClickCastHeader:GetAttribute("clear-keybinds") @@ -243,7 +243,7 @@ end --- --- @param frame Button|string The frame to unregister --- @see Clicked.RegisterClickCastFrame -function Clicked:UnregisterClickCastFrame(frame) +function Clicked2:UnregisterClickCastFrame(frame) if frame == nil then return end @@ -309,7 +309,7 @@ end --- this too. --- --- @param frame Button The frame to register for clicks and scrollwheel events -function Clicked:RegisterFrameClicks(frame) +function Clicked2:RegisterFrameClicks(frame) if frame == nil or frame.RegisterForClicks == nil then return end @@ -330,7 +330,7 @@ end --- @param frame Button The frame to create a sidecar for --- @param name string? The human-readable name of the frame, since these frames are generally unamed, a custom name needs to be supploed --- @return Button sidecar -function Clicked:CreateSidecar(frame, name) +function Clicked2:CreateSidecar(frame, name) local sidecarId = frame:GetAttribute("clicked-sidecar") --- @param sidecar Button @@ -364,7 +364,7 @@ function Clicked:CreateSidecar(frame, name) end --- Iterate through all registered click-cast enabled frames. This function can be used in a `for in` loop. -function Clicked:IterateClickCastFrames() +function Clicked2:IterateClickCastFrames() return ipairs(frames) end @@ -372,6 +372,6 @@ end --- --- A sidecar is a custom overlay frame used when a registered frame does not have a name. A name is required for --- unit frame casting. -function Clicked:IterateSidecars() +function Clicked2:IterateSidecars() return ipairs(sidecars) end diff --git a/Clicked/UnitFrames/ClickCastHeader.lua b/Clicked/UnitFrames/ClickCastHeader.lua index fd5317e..915e2ea 100644 --- a/Clicked/UnitFrames/ClickCastHeader.lua +++ b/Clicked/UnitFrames/ClickCastHeader.lua @@ -111,9 +111,9 @@ function Addon:RegisterClickCastHeader() end if name == "export_register" then - Clicked:RegisterClickCastFrame(frameName) + Clicked2:RegisterClickCastFrame(frameName) elseif name == "export_unregister" then - Clicked:UnregisterClickCastFrame(frameName) + Clicked2:UnregisterClickCastFrame(frameName) end end) @@ -125,22 +125,22 @@ function Addon:RegisterClickCastHeader() ClickCastFrames = setmetatable({}, { __newindex = function(_, frame, options) if options ~= nil and options ~= false then - Clicked:RegisterClickCastFrame(frame) + Clicked2:RegisterClickCastFrame(frame) else - Clicked:UnregisterClickCastFrame(frame) + Clicked2:UnregisterClickCastFrame(frame) end end }) for frame in pairs(originalClickCastFrames) do - Clicked:RegisterClickCastFrame(frame) + Clicked2:RegisterClickCastFrame(frame) end -- Hook into Clique because a lot of (older) addons are hardcoded to add Clique-support Clique = {} Clique.header = ClickCastHeader Clique.UpdateRegisteredClicks = function(_, frame) - safecall(Clicked.RegisterFrameClicks, Clicked, frame, true) + safecall(Clicked2.RegisterFrameClicks, Clicked2, frame, true) end end diff --git a/Clicked/UnitFrames/ClickCastUnitTemplate.xml b/Clicked/UnitFrames/ClickCastUnitTemplate.xml new file mode 100644 index 0000000..388857b --- /dev/null +++ b/Clicked/UnitFrames/ClickCastUnitTemplate.xml @@ -0,0 +1,9 @@ + + + diff --git a/Clicked/Widgets/AceGUIContainer-ClickedTargetGroup.lua b/Clicked/Widgets/AceGUIContainer-ClickedTargetGroup.lua index 3a04ae6..8df8857 100644 --- a/Clicked/Widgets/AceGUIContainer-ClickedTargetGroup.lua +++ b/Clicked/Widgets/AceGUIContainer-ClickedTargetGroup.lua @@ -22,7 +22,7 @@ Support functions --- @param callback fun(frame: Frame) --- @return Button local function CreateButton(parent, texture, callback) - texture = [[Interface\AddOns\Clicked\Media\Textures\]] .. texture .. ".tga" + texture = [[Interface\AddOns\Clicked2\Media\Textures\]] .. texture .. ".tga" local frame = CreateFrame("Button", nil, parent) frame:SetScript("OnClick", callback) diff --git a/Clicked/Widgets/AceGUIContainer-ClickedTreeGroup.lua b/Clicked/Widgets/AceGUIContainer-ClickedTreeGroup.lua index 36f4587..54edd5f 100644 --- a/Clicked/Widgets/AceGUIContainer-ClickedTreeGroup.lua +++ b/Clicked/Widgets/AceGUIContainer-ClickedTreeGroup.lua @@ -232,7 +232,7 @@ local function Button_OnDragStop(button) local newParent = nil --- @type DataObjectScope - local newScope = Clicked.DataObjectScope.PROFILE + local newScope = Clicked2.DataObjectScope.PROFILE --- @type ClickedTreeGroupRuntimeItem --- @diagnostic disable-next-line: assign-type-mismatch @@ -252,17 +252,17 @@ local function Button_OnDragStop(button) scopeItem = self.treeLookup[btn.uid] break else - local obj = Clicked:GetByUid(btn.uid) + local obj = Clicked2:GetByUid(btn.uid) if obj ~= nil then newScope = obj.scope scopeItem = self.treeLookup[Addon:GetScopeUid(newScope)] - if obj.type == Clicked.DataObjectType.BINDING then + if obj.type == Clicked2.DataObjectType.BINDING then --- @cast obj Binding newParent = obj.parent groupItem = self.treeLookup[obj.parent or Addon:GetScopeUid(newScope)] - elseif obj.type == Clicked.DataObjectType.GROUP then + elseif obj.type == Clicked2.DataObjectType.GROUP then --- @cast obj Group newParent = obj.uid groupItem = self.treeLookup[obj.uid] @@ -275,7 +275,7 @@ local function Button_OnDragStop(button) end for _, uid in ipairs(status.dragging) do - local obj = Clicked:GetByUid(uid) + local obj = Clicked2:GetByUid(uid) if obj ~= nil then local item = self.treeLookup[uid] @@ -284,7 +284,7 @@ local function Button_OnDragStop(button) Addon:ChangeDataObjectScope(obj, newScope) end - if obj.type == Clicked.DataObjectType.BINDING then + if obj.type == Clicked2.DataObjectType.BINDING then --- @cast obj Binding Addon:ChangeDataObjectParent(obj, newParent) @@ -297,7 +297,7 @@ local function Button_OnDragStop(button) updateItem = updateItem or parent end - elseif obj.type == Clicked.DataObjectType.GROUP then + elseif obj.type == Clicked2.DataObjectType.GROUP then --- @cast obj Group if item ~= nil and item ~= scopeItem then diff --git a/Clicked/Widgets/AceGUIWidget-ClickedReorderableLabel.lua b/Clicked/Widgets/AceGUIWidget-ClickedReorderableLabel.lua index 7fed429..46e54ac 100644 --- a/Clicked/Widgets/AceGUIWidget-ClickedReorderableLabel.lua +++ b/Clicked/Widgets/AceGUIWidget-ClickedReorderableLabel.lua @@ -233,7 +233,7 @@ local function Constructor() local upImage = up:CreateTexture(nil, "BACKGROUND") upImage:SetSize(16, 16) upImage:SetPoint("CENTER") - upImage:SetTexture([[Interface\Addons\Clicked\Media\Textures\ui_arrow_up.tga]]) + upImage:SetTexture([[Interface\Addons\Clicked2\Media\Textures\ui_arrow_up.tga]]) local down = CreateFrame("Button", nil, frame) down:SetSize(16, 16) @@ -242,7 +242,7 @@ local function Constructor() local downImage = down:CreateTexture(nil, "BACKGROUND") downImage:SetSize(16, 16) downImage:SetPoint("CENTER") - downImage:SetTexture([[Interface\Addons\Clicked\Media\Textures\ui_arrow_down.tga]]) + downImage:SetTexture([[Interface\Addons\Clicked2\Media\Textures\ui_arrow_down.tga]]) local image = frame:CreateTexture(nil, "BACKGROUND") diff --git a/ClickedMedia/ClickedMedia.toc b/ClickedMedia/ClickedMedia2.toc similarity index 87% rename from ClickedMedia/ClickedMedia.toc rename to ClickedMedia/ClickedMedia2.toc index bffcda2..ae611b1 100644 --- a/ClickedMedia/ClickedMedia.toc +++ b/ClickedMedia/ClickedMedia2.toc @@ -1,12 +1,12 @@ ## Interface: 120001 -## Title: ClickedMedia +## Title: ClickedMedia2 ## IconTexture: Interface\Icons\inv_misc_punchcards_yellow ## Author: Snakybo ## Version: @project-version@ ## Notes: Icon data for Clicked. -## Dependencies: Clicked +## Dependencies: Clicked2 ## LoadOnDemand: 1 -## Group: Clicked +## Group: Clicked2 ## Category-enUS: Media ## Category-deDE: Medien ## Category-esES: Medios diff --git a/ClickedMedia/ClickedMedia_Mists.toc b/ClickedMedia/ClickedMedia2_Mists.toc similarity index 87% rename from ClickedMedia/ClickedMedia_Mists.toc rename to ClickedMedia/ClickedMedia2_Mists.toc index 4077b4f..bfbe5cc 100644 --- a/ClickedMedia/ClickedMedia_Mists.toc +++ b/ClickedMedia/ClickedMedia2_Mists.toc @@ -1,12 +1,12 @@ ## Interface: 50503 -## Title: ClickedMedia +## Title: ClickedMedia2 ## IconTexture: Interface\Icons\inv_misc_punchcards_yellow ## Author: Snakybo ## Version: @project-version@ ## Notes: Icon data for Clicked. -## Dependencies: Clicked +## Dependencies: Clicked2 ## LoadOnDemand: 1 -## Group: Clicked +## Group: Clicked2 ## Category-enUS: Media ## Category-deDE: Medien ## Category-esES: Medios diff --git a/ClickedMedia/ClickedMedia_TBC.toc b/ClickedMedia/ClickedMedia2_TBC.toc similarity index 87% rename from ClickedMedia/ClickedMedia_TBC.toc rename to ClickedMedia/ClickedMedia2_TBC.toc index 11a4349..b1ba22a 100644 --- a/ClickedMedia/ClickedMedia_TBC.toc +++ b/ClickedMedia/ClickedMedia2_TBC.toc @@ -1,12 +1,12 @@ ## Interface: 20505 -## Title: ClickedMedia +## Title: ClickedMedia2 ## IconTexture: Interface\Icons\inv_misc_punchcards_yellow ## Author: Snakybo ## Version: @project-version@ ## Notes: Icon data for Clicked. -## Dependencies: Clicked +## Dependencies: Clicked2 ## LoadOnDemand: 1 -## Group: Clicked +## Group: Clicked2 ## Category-enUS: Media ## Category-deDE: Medien ## Category-esES: Medios diff --git a/ClickedMedia/ClickedMedia_Vanilla.toc b/ClickedMedia/ClickedMedia2_Vanilla.toc similarity index 87% rename from ClickedMedia/ClickedMedia_Vanilla.toc rename to ClickedMedia/ClickedMedia2_Vanilla.toc index 94abbd6..45e4b11 100644 --- a/ClickedMedia/ClickedMedia_Vanilla.toc +++ b/ClickedMedia/ClickedMedia2_Vanilla.toc @@ -1,12 +1,12 @@ ## Interface: 11508 -## Title: ClickedMedia +## Title: ClickedMedia2 ## IconTexture: Interface\Icons\inv_misc_punchcards_yellow ## Author: Snakybo ## Version: @project-version@ ## Notes: Icon data for Clicked. -## Dependencies: Clicked +## Dependencies: Clicked2 ## LoadOnDemand: 1 -## Group: Clicked +## Group: Clicked2 ## Category-enUS: Media ## Category-deDE: Medien ## Category-esES: Medios