From 3d5f3f786331963461a65c1a132652c3346f14ad Mon Sep 17 00:00:00 2001 From: Kerrinen Hope <8914+Ravendwyr@users.noreply.github.com> Date: Sun, 16 May 2021 15:37:20 +0100 Subject: [PATCH] Begin adding support for Burning Crusade Classic. --- .github/workflows/upload.yml | 26 +++++++++++++++++++------- Chinchilla.lua | 17 +++++++++++++++-- Chinchilla.toc | 7 ++----- Modules/Appearance.lua | 13 ++++++++----- Modules/MoveButtons.lua | 19 +++++++++++++++---- Modules/Position.lua | 12 ++++++------ Modules/QuestTracker.lua | 2 +- Modules/ShowHide.lua | 15 +++++++++++++-- Modules/TrackingDots.lua | 2 +- 9 files changed, 80 insertions(+), 33 deletions(-) diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml index 058af41..cc6e0c7 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/upload.yml @@ -12,21 +12,33 @@ jobs: package: runs-on: ubuntu-latest - env: - CF_API_KEY: ${{ secrets.CF_API_KEY }} - WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }} - GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} - steps: - name: Download Repository - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: fetch-depth: 50 - name: Create Package for Classic uses: BigWigsMods/packager@master with: - args: -g 1.13.6 + args: -g classic + env: + CF_API_KEY: ${{ secrets.CF_API_KEY }} + GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} + WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }} + + - name: Create Package for Burning Crusade Classic + uses: BigWigsMods/packager@master + with: + args: -g bcc + env: + CF_API_KEY: ${{ secrets.CF_API_KEY }} + GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} + WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }} - name: Create Package for Retail uses: BigWigsMods/packager@master + env: + CF_API_KEY: ${{ secrets.CF_API_KEY }} + GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} + WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }} diff --git a/Chinchilla.lua b/Chinchilla.lua index f30b526..790acc0 100755 --- a/Chinchilla.lua +++ b/Chinchilla.lua @@ -45,10 +45,23 @@ function Chinchilla:Minimap_OnMouseUp(this, button, ...) end end + +function Chinchilla:IsRetail() + -- One... + return WOW_PROJECT_ID == WOW_PROJECT_MAINLINE +end + function Chinchilla:IsClassic() + -- Two... return WOW_PROJECT_ID == WOW_PROJECT_CLASSIC end +function Chinchilla:IsBurningCrusade() + -- Five! + return WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC +end + + function Chinchilla:OpenConfig() AceConfigDialog:Open("Chinchilla") end @@ -208,7 +221,7 @@ function Chinchilla:OnEnable() MinimapBorderTop:Hide() MinimapZoneTextButton:Hide() - if self:IsClassic() then + if self:IsClassic() or self:IsBurningCrusade() then MinimapToggleButton:Hide() end @@ -224,7 +237,7 @@ function Chinchilla:OnDisable() MinimapBorderTop:Show() MinimapZoneTextButton:Show() - if self:IsClassic() then + if self:IsClassic() or self:IsBurningCrusade() then MinimapToggleButton:Show() end diff --git a/Chinchilla.toc b/Chinchilla.toc index 10a1645..be5c14e 100755 --- a/Chinchilla.toc +++ b/Chinchilla.toc @@ -1,9 +1,6 @@ -#@retail@ ## Interface: 90005 -#@end-retail@ -#@non-retail@ -# ## Interface: 11306 -#@end-non-retail@ +## Interface-Classic: 11307 +## Interface-BCC: 20501 ## Title: Chinchilla Minimap ## Notes: Minimap addon of awesomeness. *chewing sound*. It'll nibble your hay pellets. ## Notes-frFR: Minicarte incroyablement incroyable. *bruit de mastication*. Il va grignoter votre foin. diff --git a/Modules/Appearance.lua b/Modules/Appearance.lua index fe12924..4bad43b 100755 --- a/Modules/Appearance.lua +++ b/Modules/Appearance.lua @@ -90,7 +90,7 @@ function Appearance:OnEnable() -- Removes the circular "waffle-like" texture that shows when using a non-circular minimap in the blue quest objective area. -- Thank you Funkeh` for the code! - if not Chinchilla:IsClassic() then + if Chinchilla:IsRetail() then Minimap:SetArchBlobRingScalar(0) Minimap:SetArchBlobRingAlpha(0) Minimap:SetQuestBlobRingScalar(0) @@ -108,8 +108,11 @@ function Appearance:OnDisable() MinimapBorder:Show() Minimap:SetAlpha(1) - if Chinchilla:IsClassic() then Minimap:SetMaskTexture("Textures\\MinimapMask") - else Minimap:SetMaskTexture(186178) end + if Chinchilla:IsClassic() or Chinchilla:IsBurningCrusade() then + Minimap:SetMaskTexture("Textures\\MinimapMask") + else + Minimap:SetMaskTexture(186178) + end for _, v in ipairs(cornerTextures) do v:Hide() @@ -119,7 +122,7 @@ function Appearance:OnDisable() Chinchilla:GetModule("MoveButtons"):Update() end - if not Chinchilla:IsClassic() then + if Chinchilla:IsRetail() then Minimap:SetArchBlobRingScalar(1) Minimap:SetArchBlobRingAlpha(1) Minimap:SetQuestBlobRingScalar(1) @@ -236,7 +239,7 @@ function Appearance:SetScale(value) Minimap:SetScale(value) - if Chinchilla:IsClassic() then + if Chinchilla:IsClassic() or Chinchilla:IsBurningCrusade() then QuestWatchFrame:GetSize() else ObjectiveTrackerFrame:GetSize() diff --git a/Modules/MoveButtons.lua b/Modules/MoveButtons.lua index b228f39..67c8ec0 100755 --- a/Modules/MoveButtons.lua +++ b/Modules/MoveButtons.lua @@ -250,6 +250,17 @@ function MoveButtons:OnInitialize() zoomIn = MinimapZoomIn, zoomOut = MinimapZoomOut, } + elseif Chinchilla:IsBurningCrusade() then + buttons = { + map = MiniMapWorldMapButton, + mail = MiniMapMailFrame, + dayNight = GameTimeFrame, + clock = TimeManagerClockButton, + track = MiniMapTracking, + voice = MiniMapVoiceChatFrame, + zoomIn = MinimapZoomIn, + zoomOut = MinimapZoomOut, + } else buttons = { difficulty = MiniMapInstanceDifficulty, @@ -282,12 +293,12 @@ end function MoveButtons:OnEnable() self:SetLocked() self:Update() - - if not Chinchilla:IsClassic() and not Chinchilla:IsHooked("QueueStatusFrame_Update") then + + if Chinchilla:IsRetail() and not Chinchilla:IsHooked("QueueStatusFrame_Update") then Chinchilla:SecureHook("QueueStatusFrame_Update", PositionLFD) end - - if not Chinchilla:IsClassic() then + + if Chinchilla:IsRetail() then self:RegisterEvent("GARRISON_SHOW_LANDING_PAGE") end end diff --git a/Modules/Position.lua b/Modules/Position.lua index 4c6fa2f..fc352b4 100755 --- a/Modules/Position.lua +++ b/Modules/Position.lua @@ -24,7 +24,7 @@ function Position:OnInitialize() } }) - if Chinchilla:IsClassic() then + if Chinchilla:IsClassic() or Chinchilla:IsBurningCrusade() then nameToFrame = { minimap = Minimap, durability = DurabilityFrame, @@ -156,7 +156,7 @@ function Position:OnEnable() self:SetFramePosition('questWatch') self:SetFramePosition('ticketStatus') - if not Chinchilla:IsClassic() then + if Chinchilla:IsRetail() then self:SetFramePosition('boss') self:SetFramePosition('vehicleSeats') end @@ -173,7 +173,7 @@ function Position:OnEnable() self:SecureHook(DurabilityFrame, "SetPoint", "DurabilityFrame_SetPoint") self:SecureHook(TicketStatusFrame, "SetPoint", "TicketStatusFrame_SetPoint") - if Chinchilla:IsClassic() then + if Chinchilla:IsClassic() or Chinchilla:IsBurningCrusade() then self:SecureHook(QuestWatchFrame, "SetPoint", "WatchFrame_SetPoint") else self:SecureHook(VehicleSeatIndicator, "SetPoint", "VehicleSeatIndicator_SetPoint") @@ -199,7 +199,7 @@ function Position:OnDisable() self:SetFramePosition('questWatch') self:SetFramePosition('ticketStatus') - if not Chinchilla:IsClassic() then + if Chinchilla:IsRetail() then self:SetFramePosition('boss') self:SetFramePosition('vehicleSeats') @@ -316,7 +316,7 @@ function Position:SetMinimapPosition(point, x, y) lastQuadrant = quadrant - if Chinchilla:IsClassic() then + if Chinchilla:IsClassic() or Chinchilla:IsBurningCrusade() then QuestWatchFrame:GetSize() else ObjectiveTrackerFrame:GetSize() @@ -508,7 +508,7 @@ function Position:UpdateClamp(info, value) end end - if Chinchilla:IsClassic() then + if Chinchilla:IsClassic() or Chinchilla:IsBurningCrusade() then QuestWatchFrame:GetSize() else ObjectiveTrackerFrame:GetSize() diff --git a/Modules/QuestTracker.lua b/Modules/QuestTracker.lua index 42a983c..43cb020 100644 --- a/Modules/QuestTracker.lua +++ b/Modules/QuestTracker.lua @@ -1,5 +1,5 @@ -if Chinchilla:IsClassic() then return end +if Chinchilla:IsClassic() or Chinchilla:IsBurningCrusade() then return end local QuestTracker = Chinchilla:NewModule("QuestTracker") local L = LibStub("AceLocale-3.0"):GetLocale("Chinchilla") diff --git a/Modules/ShowHide.lua b/Modules/ShowHide.lua index b8cb93a..2766a8f 100755 --- a/Modules/ShowHide.lua +++ b/Modules/ShowHide.lua @@ -37,6 +37,17 @@ function ShowHide:OnInitialize() zoomOut = "MinimapZoomOut", clock = "TimeManagerClockButton", } + elseif Chinchilla:IsBurningCrusade() then + frames = { + north = "MinimapNorthTag", + map = "MiniMapWorldMapButton", + mail = "MiniMapMailFrame", + dayNight = "GameTimeFrame", + track = "MiniMapTracking", + zoomIn = "MinimapZoomIn", + zoomOut = "MinimapZoomOut", + clock = "TimeManagerClockButton", + } else frames = { boss = "Chinchilla_BossAnchor", @@ -82,7 +93,7 @@ function ShowHide:OnInitialize() end function ShowHide:OnEnable() - if not Chinchilla:IsClassic() then + if Chinchilla:IsRetail() then self:RegisterEvent("CALENDAR_ACTION_PENDING", "UpdateCalendar") self:RegisterEvent("CALENDAR_UPDATE_PENDING_INVITES", "UpdateCalendar") end @@ -207,7 +218,7 @@ function ShowHide:GetOptions() order = 1, get = get, set = "UpdateMouseover", }, - calendarInviteOnly = not Chinchilla:IsClassic() and { + calendarInviteOnly = Chinchilla:IsRetail() and { name = L["Unread Invites Only"], desc = L["Only show the calendar when you have unread invites waiting for you."], type = 'toggle', diff --git a/Modules/TrackingDots.lua b/Modules/TrackingDots.lua index 2e15a96..4c227d5 100755 --- a/Modules/TrackingDots.lua +++ b/Modules/TrackingDots.lua @@ -8,7 +8,7 @@ TrackingDots.desc = L["Change how the tracking dots look on the minimap."] local blipFile = "" local blizzardBlips = "Interface\\MiniMap\\ObjectIconsAtlas" local trackingDotStyles = {} -local prefix = Chinchilla:IsClassic() and "Classic-" or "Blip-" +local prefix = Chinchilla:IsRetail() and "Blip-" or "Classic-" function TrackingDots:AddTrackingDotStyle(english, localized, texture) if type(english) ~= "string" then