Skip to content

Commit b5c875e

Browse files
cscoder69claude
andcommitted
v1.2.6: modern APIs only (no deprecated fallbacks)
- Removed the legacy fallbacks IsAddOnLoaded, GetAddOnMetadata, GetQuestLogTitle, GetNumQuestLogEntries and InterfaceOptions_AddCategory; WoW Forever has the modern C_AddOns / C_QuestLog / Settings APIs (checked in game). - Notes on the Reddit code-audit rules; changelog and what's new for 1.2.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d0e7eed commit b5c875e

4 files changed

Lines changed: 37 additions & 25 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CS.Coder - Quest Indicator
22

3+
## v1.2.6
4+
5+
- Cleaner code: the addon now uses only the game's modern functions (no deprecated API left) and creates no unnecessary global variables.
6+
- No change in what you see or how it works.
7+
38
## v1.2.5
49

510
- New **Gameplay** tab in the options.

‎CLAUDE.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CS.Coder - Quest Indicator — notes for Claude (and any dev)
22

3-
Read this first when working on the addon. Last updated 2026-11-11 (v1.2.5 published).
3+
Read this first when working on the addon. Last updated 2026-11-11 (v1.2.6 published).
44

55
## Working with the user
66
- Chat in **Brazilian Portuguese**; code, comments, commits, docs and in-game text in **English**.
@@ -192,6 +192,15 @@ live in game after `/reload`. Second dev PC (notebook, set up 2026-11-11): sourc
192192
commits were reverted. Do not bring it back unless asked (maybe with real artwork).
193193
- `/cqi` opens the options, `/cqi toggle` toggles the addon, `/cqi setup` the guide, `/cqi news` what's new, `/cqi plate` measures the target plate.
194194

195+
## Reddit / code audit rules (2026-11-11)
196+
r/wowaddons (and similar) audit releases with Ketho's WoW API extension: no unnecessary globals, no
197+
severe performance issues, **no deprecated API**, and posts must carry an **"AI Disclaimer:"** (code
198+
written with Claude, icons made with ChatGPT). So: modern APIs only (C_AddOns, C_QuestLog.GetInfo,
199+
Settings) — the legacy fallbacks (IsAddOnLoaded, GetAddOnMetadata, GetQuestLogTitle,
200+
GetNumQuestLogEntries, InterfaceOptions_AddCategory) were removed. Globals written: only
201+
`CSCoderQuestIndicatorDB`, `SLASH_CSCODERQUESTINDICATOR1`, `CSCoderOptionsParent` (shared on purpose)
202+
and frames named `CSCoder_QuestIndicator*`. Check with `luajit -bl <file> | grep GSET`.
203+
195204
## Local checks (run before every hand-off)
196205
LuaJIT (Lua 5.1, same as WoW) is installed: `C:\Users\Claudio\AppData\Local\Programs\LuaJIT\bin\luajit.exe`.
197206
```bash
@@ -242,6 +251,9 @@ whether the mock is missing an API (e.g. it once returned nil for `GetHighlightT
242251
party-objective and secret-value fixes, event batching and other performance work.
243252
- 1.2.5 (2026-11-11): Gameplay tab: quest pickup (auto / button on lists, single quest at once),
244253
auto turn-in (rewards to choose left alone), Shift = manual, never interferes with other addons.
254+
- 1.2.6 (2026-11-11): modern APIs only (deprecated fallbacks removed for the Reddit code audit);
255+
README badges/screenshots, new CurseForge page. The CurseForge app had replaced the dev junction
256+
with its v1.2.5 copy after a power cut: keep this addon unmanaged in the app on dev PCs.
245257

246258
## Quest pickup / Gameplay tab (released in v1.2.5; turn-in confirmed in game, button position not yet)
247259
- Third tab **Gameplay** (Settings | Gameplay | Profiles; built inline in the `builders` list —

‎CSCoder_QuestIndicator.lua‎

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ local SETTINGS_VERSION = 5
6969

7070
-- The addon's version from the .toc (the packager fills it in; a dev copy shows "dev").
7171
local function AddonVersion()
72-
local getMeta = (C_AddOns and C_AddOns.GetAddOnMetadata) or GetAddOnMetadata
72+
local getMeta = C_AddOns and C_AddOns.GetAddOnMetadata
7373
local version = getMeta and getMeta(ADDON, "Version")
7474
if type(version) ~= "string" or version:find("^@") then version = "dev" end
7575
return version
@@ -244,8 +244,7 @@ local function RebuildQuestTitles()
244244
wipe(quests.kindByID)
245245
wipe(quests.levelByTitle)
246246
wipe(quests.levelByID)
247-
local count = (C_QuestLog and C_QuestLog.GetNumQuestLogEntries and C_QuestLog.GetNumQuestLogEntries())
248-
or (GetNumQuestLogEntries and GetNumQuestLogEntries()) or 0
247+
local count = (C_QuestLog and C_QuestLog.GetNumQuestLogEntries and C_QuestLog.GetNumQuestLogEntries()) or 0
249248
for i = 1, count do
250249
local title, isHeader, questID, kind, level = nil, nil, nil, "normal", nil
251250
if C_QuestLog and C_QuestLog.GetInfo then
@@ -258,14 +257,6 @@ local function RebuildQuestTitles()
258257
kind = "group"
259258
end
260259
end
261-
elseif GetQuestLogTitle then
262-
local t, questLevel, tag, header, _, _, frequency, id = GetQuestLogTitle(i)
263-
title, isHeader, questID, level = t, header, id, tonumber(questLevel)
264-
if frequency == true or (tonumber(frequency) or 0) > 0 then
265-
kind = "daily"
266-
elseif (type(tag) == "number" and tag > 1) or (type(tag) == "string" and tag ~= "") then
267-
kind = "group"
268-
end
269260
end
270261
if title and not isHeader then
271262
if kind == "normal" then kind = KindFromTag(questID) or kind end
@@ -423,8 +414,7 @@ do
423414
local tooltips -- Questie's QuestieTooltips module, once found
424415
local function Module()
425416
if tooltips then return tooltips end
426-
local loaded = (C_AddOns and C_AddOns.IsAddOnLoaded and C_AddOns.IsAddOnLoaded("Questie"))
427-
or (IsAddOnLoaded and IsAddOnLoaded("Questie"))
417+
local loaded = C_AddOns and C_AddOns.IsAddOnLoaded and C_AddOns.IsAddOnLoaded("Questie")
428418
if not loaded or type(QuestieLoader) ~= "table" or type(QuestieLoader.ImportModule) ~= "function" then return nil end
429419
local module = QuestieLoader:ImportModule("QuestieTooltips")
430420
if type(module) == "table" and type(module.lookupByKey) == "table" then tooltips = module end
@@ -940,7 +930,6 @@ local function QuestTitle(questID, logIndex)
940930
local info = C_QuestLog.GetInfo(logIndex)
941931
title = info and info.title
942932
end
943-
if not title and GetQuestLogTitle then title = GetQuestLogTitle(logIndex) end
944933
return title or "?"
945934
end
946935

@@ -1064,8 +1053,7 @@ function RestoreObjectCVars()
10641053
end
10651054

10661055
local function IsLoaded(addon)
1067-
if C_AddOns and C_AddOns.IsAddOnLoaded then return C_AddOns.IsAddOnLoaded(addon) end
1068-
return IsAddOnLoaded and IsAddOnLoaded(addon)
1056+
return C_AddOns and C_AddOns.IsAddOnLoaded and C_AddOns.IsAddOnLoaded(addon) or false
10691057
end
10701058

10711059
-- Opens the soft target's nameplate for quest objects only, so NPCs and mailboxes don't get one.
@@ -1234,8 +1222,6 @@ local function GetCSCoderParent()
12341222
if Settings and Settings.RegisterCanvasLayoutCategory then
12351223
parent.category = Settings.RegisterCanvasLayoutCategory(frame, PARENT_NAME)
12361224
Settings.RegisterAddOnCategory(parent.category)
1237-
elseif InterfaceOptions_AddCategory then
1238-
InterfaceOptions_AddCategory(frame)
12391225
end
12401226
_G.CSCoderOptionsParent = parent
12411227
return parent
@@ -2544,7 +2530,7 @@ function ShowDebug()
25442530
local plate = root.plateGeom
25452531
Add("plate", plate and string.format("%.0fx%.0f", plate.w or 0, plate.h or 0) or "none")
25462532
local others = {}
2547-
local isLoaded = (C_AddOns and C_AddOns.IsAddOnLoaded) or IsAddOnLoaded
2533+
local isLoaded = C_AddOns and C_AddOns.IsAddOnLoaded
25482534
for _, name in ipairs({ "ForeverLootSparkles", "Questie", "Plater", "TidyPlates", "Kui_Nameplates", "ElvUI", "OneForAll", "pfQuest" }) do
25492535
if isLoaded and isLoaded(name) then others[#others + 1] = name end
25502536
end
@@ -2743,9 +2729,6 @@ local function BuildSettingsLanding()
27432729
local parent = GetCSCoderParent()
27442730
if Settings and Settings.RegisterCanvasLayoutSubcategory and parent.category then
27452731
settingsCategory = Settings.RegisterCanvasLayoutSubcategory(parent.category, page, SUBTITLE)
2746-
elseif InterfaceOptions_AddCategory then
2747-
page.parent = parent.name
2748-
InterfaceOptions_AddCategory(page)
27492732
end
27502733
end
27512734

@@ -3354,8 +3337,7 @@ do
33543337
-- when we can read it; addons whose whole job is automating quests count as soon as they are
33553338
-- loaded). Every read is guarded.
33563339
local function Loaded(name)
3357-
return (C_AddOns and C_AddOns.IsAddOnLoaded and C_AddOns.IsAddOnLoaded(name))
3358-
or (IsAddOnLoaded and IsAddOnLoaded(name)) or false
3340+
return C_AddOns and C_AddOns.IsAddOnLoaded and C_AddOns.IsAddOnLoaded(name) or false
33593341
end
33603342
local OTHERS = {
33613343
{ "Questie", function(kind)

‎Locales.lua‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,3 +1392,16 @@ local news125 = {
13921392
itIT = B .. "Nuova scheda |cffffd200Gameplay|r nelle opzioni.\n" .. B .. "|cffffd200Raccolta missioni|r (disattivata di base): accetta le missioni dei PNG, automaticamente parlando o con il pulsante |cffffd200Accetta tutte|r nell'elenco del PNG (una missione sola viene accettata subito).\n" .. B .. "|cffffd200Consegna automatica|r (disattivata di base): consegna le missioni completate. Se devi scegliere una ricompensa, scegli tu.\n" .. B .. "Tieni premuto |cffffd200Shift|r quando clicchi un PNG per fare tutto a mano quella volta.\n" .. B .. "Non intralcia mai un altro addon che lo fa già (Questie, Leatrix Plus...).",
13931393
}
13941394
for code, text in pairs(news125) do locales[code].NEWS_TEXT = text end
1395+
1396+
-- What's new 1.2.6: one line added at the end of the 1.2.5 list (players skipping 1.2.5 still see it).
1397+
local news126 = {
1398+
enUS = "Cleaner code: only the game's modern functions are used now.",
1399+
ptBR = "Código mais limpo: agora só as funções modernas do jogo são usadas.",
1400+
esES = "Código más limpio: ahora solo se usan las funciones modernas del juego.",
1401+
deDE = "Saubererer Code: Es werden jetzt nur noch die modernen Funktionen des Spiels genutzt.",
1402+
frFR = "Code plus propre : seules les fonctions modernes du jeu sont utilisées désormais.",
1403+
itIT = "Codice più pulito: ora vengono usate solo le funzioni moderne del gioco.",
1404+
}
1405+
for code, text in pairs(news126) do
1406+
locales[code].NEWS_TEXT = locales[code].NEWS_TEXT .. "\n" .. B .. text
1407+
end

0 commit comments

Comments
 (0)