From 20fd888fd2ada2a08d71fe12a8d87b1978c2a759 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Tue, 31 Oct 2023 21:37:30 +0100 Subject: [PATCH] :lipstick: --- .luacheckrc | 53 +++++++++++++++++++++++------ modules/automation/teleportgear.lua | 2 +- modules/binding/misdirect.lua | 2 +- modules/map/pin.lua | 2 ++ modules/minimap/mail.lua | 2 +- modules/misc/played.lua | 5 +-- modules/settings/cvars.lua | 1 - modules/tooltip/data.lua | 4 ++- modules/widgets/nekkid.lua | 2 ++ 9 files changed, 56 insertions(+), 17 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 3adaac6..759f527 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -19,11 +19,13 @@ exclude_files = {} globals = { -- FrameXML objects we mutate - 'StaticPopupDialogs', -- FrameXML/StaticPopup.lua - 'LootFrame', -- FrameXML/LootFrame.xml + 'BuffFrame', -- FrameXML/BuffFrame.xml 'ChatTypeInfo', -- FrameXML/ChatFrame.lua - 'DurabilityFrame', -- FrameXML/DurabilityFrame.xml 'ClickBindingFrame', -- AddOns/Blizzard_ClickBindingUI/Blizzard_ClickBindingUI.xml + 'DurabilityFrame', -- FrameXML/DurabilityFrame.xml + 'LootFrame', -- FrameXML/LootFrame.xml + 'StaticPopupDialogs', -- FrameXML/StaticPopup.lua + 'SuperTrackedFrame', -- AddOns/Blizzard_QuestNavigation/SuperTrackedFrame.xml -- savedvariables we mutate 'OPie_SavedData', @@ -47,10 +49,14 @@ read_globals = { 'GenericTraitFrameMixin', -- AddOns/Blizzard_GenericTraitUI/Blizzard_GenericTraitFrame.lua 'HelpTip', -- SharedXML/HelpTip.lua 'HybridMinimap', -- AddOns/Blizzard_HybridMinimap/Blizzard_HybridMinimap.xml + 'ItemLocation', -- FrameXML/ObjectAPI/ItemLocation.lua 'MacroFrame', -- AddOns/Blizzard_MacroUI/Blizzard_MacroUI.xml 'MerchantFrame', -- FrameXML/MerchantFrame.xml 'Minimap', -- FrameXML/Minimap.xml 'MinimapMixin', -- FrameXML/Minimap.lua + 'PaperDollSidebarTab3', -- FrameXML/PaperDollFrame.xml + 'PetCastingBarFrame', -- FrameXML/PetFrame.xml + 'PlayerCastingBarFrame', -- FrameXML/CastingBarFrame.xml 'ProfessionsFrame', -- AddOns/Blizzard_Professions/Blizzard_ProfessionsFrame.xml 'QueueStatusButton', -- FrameXML/QueueStatusFrame.xml 'ReadyCheckListenerFrame', -- FrameXML/ReadyCheck.xml @@ -63,9 +69,10 @@ read_globals = { 'SlashCmdList', -- FrameXML/ChatFrame.lua 'SpellBookFrame', -- FrameXML/SpellBookFrame.xml 'SpellBookFrameTabButton1', -- FrameXML/SpellBookFrame.xml + 'SpellbookMicroButton', -- FrameXML/MainMenuBarMicroButtons.xml 'UIErrorsFrame', -- FrameXML/UIErrorsFrame.xml - 'UIParent', -- FrameXML/UIParent.xml 'UiMapPoint', -- FrameXML/ObjectAPI/UiMapPoint.lua + 'UIParent', -- FrameXML/UIParent.xml 'WeeklyRewardsFrame', -- AddOns/Blizzard_WeeklyRewards/Blizzard_WeeklyRewards.xml 'WorldFrame', -- FrameXML/WorldFrame.xml 'WorldMapFrame', -- AddOns/Blizzard_WorldMap/Blizzard_WorldMap.xml @@ -81,17 +88,13 @@ read_globals = { 'ChatFrame_ReceiveAllPrivateMessages', -- FrameXML/ChatFrame.lua 'ChatFrame_RemoveAllChannels', -- FrameXML/ChatFrame.lua 'ChatFrame_RemoveAllMessageGroups', -- FrameXML/ChatFrame.lua - 'CopyTable', -- SharedXML/TableUtil.lua - 'CreateColor', -- SharedXML/Color.lua - 'CreateRectangle', -- SharedXML/Rectangle.lua - 'CreateVector2D', -- SharedXML/Vector2D.lua + 'ChatFrame_TimeBreakDown', -- FrameXML/ChatFrame.lua 'FCF_Close', -- FrameXML/FloatingChatFrame.lua 'FCF_OpenNewWindow', -- FrameXML/FloatingChatFrame.lua 'FCF_ResetChatWindows', -- FrameXML/FloatingChatFrame.lua 'FCF_SelectDockFrame', -- FrameXML/FloatingChatFrame.lua 'FCF_SetWindowAlpha', -- FrameXML/FloatingChatFrame.lua 'FCF_SetWindowColor', -- FrameXML/FloatingChatFrame.lua - 'FormatLargeNumber', -- SharedXML/FormattingUtil.lua 'GameTooltip_Hide', -- FrameXML/GameTooltip.lua 'GetUnitName', -- FrameXML/UnitFrame.lua 'HideUIPanel', -- FrameXML/UIParent.lua @@ -109,40 +112,56 @@ read_globals = { 'ToggleClickBindingFrame', -- FrameXML/UIParent.lua 'UnregisterStateDriver', -- FrameXML/SecureStateDriver.lua 'WeeklyRewards_ShowUI', -- FrameXML/UIParent.lua - 'WrapTextInColorCode', -- SharedXML/Color.lua 'nop', -- FrameXML/UIParent.lua -- FrameXML mutable globals 'SELECTED_CHAT_FRAME', -- SharedXML functions + 'CopyTable', -- SharedXML/TableUtil.lua + 'CreateColor', -- SharedXML/Color.lua + 'CreateRectangle', -- SharedXML/Rectangle.lua + 'CreateVector2D', -- SharedXML/Vector2D.lua + 'FormatLargeNumber', -- SharedXML/FormattingUtil.lua 'Mixin', -- SharedXML/Mixin.lua + 'SecondsToTime', -- SharedXML/TimeUtil.lua + 'WrapTextInColorCode', -- SharedXML/Color.lua -- namespaces + 'C_AddOns', 'C_BattleNet', 'C_ChallengeMode', 'C_ClassColor', + 'C_ClassTrial', 'C_Container', 'C_Covenants', + 'C_CraftingOrders', 'C_CVar', + 'C_DateAndTime', 'C_EditMode', + 'C_EquipmentSet', 'C_FriendList', 'C_Garrison', 'C_GossipInfo', + 'C_Item', 'C_Map', 'C_Minimap', 'C_MountJournal', + 'C_Navigation', 'C_PartyInfo', 'C_PlayerInfo', 'C_QuestLog', + 'C_Timer', 'C_ToyBox', 'C_UI', + 'C_VignetteInfo', 'Constants', 'Enum', 'TooltipDataProcessor', -- API 'AcceptGroup', + 'AutoEquipCursorItem', 'BNGetNumFriends', 'CanEjectPassengerFromSeat', 'CanGuildBankRepair', @@ -171,10 +190,15 @@ read_globals = { 'GetGuildRosterInfo', 'GetInventoryAlertStatus', 'GetInventoryItemDurability', + 'GetInventoryItemID', + 'GetInventoryItemID', 'GetItemCooldown', 'GetItemCount', + 'GetItemInfo', 'GetLatestThreeSenders', + 'GetMacroInfo', 'GetMacroSpell', + 'GetMaxLevelForPlayerExpansion', 'GetMoney', 'GetNumGroupMembers', 'GetNumGuildMembers', @@ -186,12 +210,14 @@ read_globals = { 'GetScreenHeight', 'GetSpellCooldown', 'GetSpellInfo', + 'GetSpellLink', 'GetSpellTexture', 'GetTime', 'GetTotemCannotDismiss', 'GetTotemInfo', 'GetWeaponEnchantInfo', 'HasBonusActionBar', + 'HasFullControl', 'HasNewMail', 'InCombatLockdown', 'IsAddOnLoaded', @@ -203,14 +229,17 @@ read_globals = { 'IsShiftKeyDown', 'IsSpellKnown', 'PickupBagFromSlot', + 'PickupInventoryItem', 'PlaySound', 'PlaySoundFile', 'PutItemInBag', 'RepairAllItems', + 'RequestTimePlayed', 'SendChatMessage', 'SetBindingClick', 'SetChatColorNameByClass', 'SetOverrideBinding', + 'SetOverrideBindingClick', 'TaxiRequestEarlyLanding', 'UnitAura', 'UnitBattlePetLevel', @@ -232,6 +261,7 @@ read_globals = { 'UnitIsPlayer', 'UnitIsTapDenied', 'UnitIsUnit', + 'UnitLevel', 'UnitName', 'UnitOnTaxi', 'UnitPlayerControlled', @@ -245,4 +275,7 @@ read_globals = { 'LibStub', 'OPie', 'TomTomPaste', + + -- ??? + 'AddonTooltip', } diff --git a/modules/automation/teleportgear.lua b/modules/automation/teleportgear.lua index 8f07c79..ff940e9 100644 --- a/modules/automation/teleportgear.lua +++ b/modules/automation/teleportgear.lua @@ -1,4 +1,4 @@ -local addonName, addon = ... +local _, addon = ... local inventorySlots = {} local function cacheInventorySlot(inventorySlot) diff --git a/modules/binding/misdirect.lua b/modules/binding/misdirect.lua index 4699348..0cb8ed0 100644 --- a/modules/binding/misdirect.lua +++ b/modules/binding/misdirect.lua @@ -55,7 +55,7 @@ local function updateTarget() end local unit = getGroupRoleUnit() - if role == 'TANK' and not unit and UnitExists('pet') then + if SPELL_ROLE == 'TANK' and not unit and UnitExists('pet') then unit = 'pet' end diff --git a/modules/map/pin.lua b/modules/map/pin.lua index 28036a6..780e916 100644 --- a/modules/map/pin.lua +++ b/modules/map/pin.lua @@ -1,5 +1,7 @@ local _, addon = ... +local TIMER_MINUTES_DISPLAY = _G.TIMER_MINUTES_DISPLAY -- globalstring + local math_abs = math.abs local math_floor = math.floor diff --git a/modules/minimap/mail.lua b/modules/minimap/mail.lua index 8d972bf..fe5f365 100644 --- a/modules/minimap/mail.lua +++ b/modules/minimap/mail.lua @@ -50,7 +50,7 @@ local function cooldownWrapper(start, duration) return start > 0 and start - GetTime() + duration end -local function updateTooltip(_, ...) +local function updateTooltip() GameTooltip:SetOwner(mail, 'ANCHOR_BOTTOMLEFT') if HasNewMail() then diff --git a/modules/misc/played.lua b/modules/misc/played.lua index 9220836..36d14d1 100644 --- a/modules/misc/played.lua +++ b/modules/misc/played.lua @@ -1,9 +1,10 @@ local _, addon = ... +local NUM_CHAT_WINDOWS = _G.NUM_CHAT_WINDOWS or 10 -- FrameXML/ChatFrame.lua +local TIME_DAYHOURMINUTESECOND = _G.TIME_DAYHOURMINUTESECOND -- globalstring + local registered = {} function addon:PLAYER_LOGIN() - requested = true - -- unregister events for index = 1, NUM_CHAT_WINDOWS do if _G['ChatFrame' .. index]:IsEventRegistered('TIME_PLAYED_MSG') then diff --git a/modules/settings/cvars.lua b/modules/settings/cvars.lua index 42bf049..8fd40b8 100644 --- a/modules/settings/cvars.lua +++ b/modules/settings/cvars.lua @@ -11,7 +11,6 @@ local CVARS = { autoLootDefault = 1, combinedBags = 0, empowerTapControls = 1, - SoftTargetInteract = 0, softTargettingInteractKeySound = 0, ClipCursor = 0, mouseInvertPitch = 0, diff --git a/modules/tooltip/data.lua b/modules/tooltip/data.lua index 5ca4b36..d4bf1af 100644 --- a/modules/tooltip/data.lua +++ b/modules/tooltip/data.lua @@ -4,8 +4,10 @@ local ENCOUNTER_JOURNAL_ITEM = _G.ENCOUNTER_JOURNAL_ITEM -- globalstring local STAT_CATEGORY_SPELL = _G.STAT_CATEGORY_SPELL -- globalstring local CURRENCY = _G.CURRENCY -- globalstring local MOUNT = _G.MOUNT -- globalstring +local MACRO = _G.MACRO -- globalstring local ID = _G.ID -- globalstring local UNKNOWN = _G.UNKNOWN -- globalstring +local NAME = _G.NAME -- globalstring local PREFIXES = { item = ENCOUNTER_JOURNAL_ITEM, @@ -59,7 +61,7 @@ function tooltip:PetAction(data) end end -function tooltip:Macro(data) +function tooltip:Macro() local button = self:GetOwner() if button and button.action then local _, macroID = GetActionInfo(button.action) diff --git a/modules/widgets/nekkid.lua b/modules/widgets/nekkid.lua index 2dec831..36d8890 100644 --- a/modules/widgets/nekkid.lua +++ b/modules/widgets/nekkid.lua @@ -1,5 +1,7 @@ local addonName, addon = ... +local CONTAINER_BAG_OFFSET = _G.CONTAINER_BAG_OFFSET or 30 -- FrameXML/Constants.lua + -- adjust position of existing tabs PaperDollSidebarTab3:SetPoint('BOTTOMRIGHT', -60, 0) PaperDollSidebarTabs.DecorLeft:SetPoint('BOTTOMLEFT', -25, 0)