Skip to content

Commit

Permalink
Add initial support for Cataclysm Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
Snakybo committed Apr 29, 2024
1 parent fc2d8af commit f6bb182
Show file tree
Hide file tree
Showing 9 changed files with 5,325 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ The format of this changelog is based on [Keep a Changelog](https://keepachangel
* The MINOR component is used whenever a version has backwards-compatible profile changes. This also indicates that the user can not switch back to a previous MINOR version without using a backup.
* The PATCH component is used for versions that do not contain profile format changes. Users can freely switch between PATCH versions without risk of data loss.

## [Unreleased]

### Added

* Add support for Cataclysm Classic 4.4.0

## [1.14.6] - 2024-04-07

### Added
Expand Down
4 changes: 3 additions & 1 deletion Clicked/Clicked_Wrath.toc → Clicked/Clicked_Cata.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 30403
## Interface: 40400
## Title: Clicked
## Author: Snakybo
## Version: @project-version@
Expand Down Expand Up @@ -44,6 +44,8 @@ Config\Bindings.lua
Config\ImportFrame.lua
Config\ExportFrame.lua
Config\Blacklist.lua
Config\KeyLayouts.lua
Config\KeyVisualizer.lua
Debug\StatusOutput.lua

# Skinning
Expand Down
18 changes: 8 additions & 10 deletions Clicked/Config/Bindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3318,18 +3318,16 @@ local function DrawHeader(container)
end

-- Visualize button
if not Addon:IsWotLK() then -- TODO: Remove when WOTLK supports texture slicing
local function OnClick()
Addon.KeyVisualizer:Open()
end
local function OnClick()
Addon.KeyVisualizer:Open()
end

local widget = AceGUI:Create("Button") --[[@as AceGUIButton]]
widget:SetText(Addon.L["Show on keyboard"])
widget:SetCallback("OnClick", OnClick)
widget:SetAutoWidth(true)
local widget = AceGUI:Create("Button") --[[@as AceGUIButton]]
widget:SetText(Addon.L["Show on keyboard"])
widget:SetCallback("OnClick", OnClick)
widget:SetAutoWidth(true)

line:AddChild(widget)
end
line:AddChild(widget)
end

--- @param container AceGUIContainer
Expand Down
5 changes: 1 addition & 4 deletions Clicked/Core/BindingProcessor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,7 @@ local function ReloadBindings(delayFrame)
Clicked:ProcessActiveBindings()

Addon:BindingConfig_Redraw()

if not Addon:IsWotLK() then -- TODO: Remove when WOTLK supports texture slicing
Addon.KeyVisualizer:Redraw()
end
Addon.KeyVisualizer:Redraw()
end

-- Public addon API
Expand Down
2 changes: 1 addition & 1 deletion Clicked/Core/Clicked.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ local function HandleChatCommand(input)
Addon:OpenSettingsMenu("Clicked")
elseif args[1] == "dump" then
Addon:StatusOutput_Open()
elseif (args[1] == "viz" or args[1] == "visualizer") and not Addon:IsWotLK() then -- TODO: Remove when WOTLK supports texture slicing
elseif (args[1] == "viz" or args[1] == "visualizer") then
Addon.KeyVisualizer:Open()
end
end
Expand Down
12 changes: 10 additions & 2 deletions Clicked/Core/Init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,22 @@ function Addon:IsWotLK()
return WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC
end

--- Check if the game client is running the Cataclysm version of the API.
---
--- @return boolean
function Addon:IsCata()
return WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC
end

--- Check if the client version is at least the specified version, for example `IsAtLeast("BC")` will return `true` on both the BC and Retail versions of the
--- game, but `false` on Classic.
---
--- @param version "RETAIL"|"CLASSIC"|"BC"|"WOTLK"
--- @param version "RETAIL"|"CLASSIC"|"BC"|"WOTLK"|"CATA"
--- @return boolean
function Addon:IsGameVersionAtleast(version)
local isRetail = Addon:IsRetail()
local isWOTLK = isRetail or Addon:IsWotLK()
local isCata = isRetail or Addon:IsCata()
local isWOTLK = isCata or Addon:IsWotLK()
local isBC = isWOTLK or Addon:IsBC()
local isClassic = isBC or Addon:IsClassic()

Expand Down
5 changes: 4 additions & 1 deletion Clicked/Core/LocaleUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ if Addon:IsGameVersionAtleast("WOTLK") then
table.insert(allClasses, "DEATHKNIGHT")
end

if Addon:IsGameVersionAtleast("RETAIL") then
if Addon:IsGameVersionAtleast("CATA") then
table.insert(allRaces, 9) -- Goblin
table.insert(allRaces, 22) -- Worgen
end

if Addon:IsGameVersionAtleast("RETAIL") then
table.insert(allRaces, 24) -- Pandaren
table.insert(allRaces, 27) -- Nightborne
table.insert(allRaces, 28) -- HighmountainTauren
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Interface: 30403
## Interface: 40400
## Title: ClickedMedia
## Author: Snakybo
## Version: @project-version@
## Notes: Icon data for Clicked.
## Dependencies: Clicked
## LoadOnDemand: 1

MediaWOTLK.lua
MediaCata.lua
Loading

0 comments on commit f6bb182

Please sign in to comment.