Skip to content

Commit 463a84a

Browse files
cscoder69claude
andcommitted
Add dev notes (CLAUDE.md) and tools (API mock, icon and logo generators)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a9a70a2 commit 463a84a

5 files changed

Lines changed: 358 additions & 0 deletions

File tree

‎.pkgmeta‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ package-as: CSCoder_QuestIndicator
22

33
ignore:
44
- media
5+
- tools
56
- README.md
7+
- CLAUDE.md
68
- .github

‎CLAUDE.md‎

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# CS.Coder - Quest Indicator — notes for Claude (and any dev)
2+
3+
Read this first when working on the addon. Last updated 2026-11-08 (v1.1.0 published).
4+
5+
## Working with the user
6+
- Chat in **Brazilian Portuguese**; code, comments, commits, docs and in-game text in **English**.
7+
- The user tests in game and sends screenshots. They like short replies and step-by-step guidance
8+
for web UIs (CurseForge, GitHub), **one step at a time**.
9+
- There is no way to run WoW here: always run the local checks below before saying something works,
10+
and ask the user to `/reload` and send screenshots for anything visual.
11+
- Publish (tag) **only when the user says so** ("publica").
12+
13+
## What it is
14+
A floating, animated "!" over quest mobs (on their nameplates) and over the nearest quest item in
15+
the world. Client: **WoW Forever** (`_forever_`, Interface 16001 = CurseForge "WoW Forever 1.60.1"),
16+
a Classic base with modern APIs (C_NamePlate, C_TooltipInfo, C_QuestLog, Settings API).
17+
18+
## Files
19+
| File | What |
20+
|---|---|
21+
| `CSCoder_QuestIndicator.toc` | `## Version: @project-version@` (the packager fills it from the tag), `X-Curse-Project-ID: 1793185` |
22+
| `Locales.lua` | Panel text. `ns.LANGUAGES` = enUS, ptBR, esES (esMX uses it), deDE, frFR, itIT. Blocks are appended over time (minimap, resets, toggles, switches, v2); later blocks override earlier keys. Unknown game languages fall back to English. |
23+
| `CSCoder_QuestIndicator.lua` | Everything else (sections below). |
24+
| `icons/*.tga` | 5 styles, 128 px, 32-bit uncompressed TGA, top-left origin. Made by `tools/make_icons.ps1`. |
25+
| `media/` | README images only (logo, icon sheet). Ignored by the packager. |
26+
| `tools/` | Dev tools (not packaged): `wowmock.lua`, `make_icons.ps1`, `make_logo.ps1`. |
27+
| `.pkgmeta` | Packager: ignores media, README, .github, tools, CLAUDE.md. |
28+
| `.github/workflows/release.yml` | Tag `v*` → BigWigs packager `-g forever` → CurseForge + GitHub Releases. |
29+
30+
Install: the source folder lives in `D:\Games\CS.Coder\WoW Addons\CSCoder_QuestIndicator\` and is a
31+
**junction** inside `D:\Games\Battlenet\World of Warcraft\_forever_\Interface\AddOns\`, so edits are
32+
live in game after `/reload`.
33+
34+
## Code map (CSCoder_QuestIndicator.lua)
35+
- **Settings:** `DEFAULTS` = per-profile settings. Saved layout:
36+
`CSCoderQuestIndicatorDB = { version, language, profiles = { name = settings }, chars = { "Name - Realm" = profile }, savedCVars }`.
37+
`SETTINGS_VERSION` 5; older flat saves migrate into profile "Default". `db` = active profile, `root` = saved table.
38+
Main switches: `active` (whole addon), `enabled` (mobs), `objects` (items).
39+
- **Quest detection:** tooltip data (`C_TooltipInfo.GetUnit`, QuestObjective lines, `completed`) or a
40+
hidden scanner tooltip; `C_QuestLog.UnitIsRelatedToActiveQuest` when present. Quest kind
41+
(normal/daily/group) from the quest log (frequency, suggestedGroup, tag info) for "color by type".
42+
- **Icons:** one frame type for mobs, the item and the preview. Textures sit on `f.inner`, which the
43+
**bobber** (OnUpdate, cosine wave) moves. Do NOT go back to a looping Translation/BOUNCE animation:
44+
it blinks for one frame at the top.
45+
- **Quest items:** world objects only get a nameplate as the interaction soft target
46+
(`softinteract`, one object, the nearest). The addon opens `SoftTargetNameplateInteract` only for
47+
quest objects ("gate"), sets `SoftTargetIconGameObject`, range and OnlyInRange, saves the player's
48+
originals in `root.savedCVars` and restores them when items are switched off. It re-applies on
49+
`CVAR_UPDATE` because **ForeverLootSparkles** changes the same cvars (it closes the gate for quest
50+
objects when its "Quest objects" option is off — that was a real bug). Cvars can't change in combat
51+
(`pendingCVars`).
52+
- **Options panel** (Options > AddOns > **CS.Coder > Quest Indicator**; the "CS.Coder" parent is shared
53+
through the global `CSCoderOptionsParent` so future CS.Coder addons land under it):
54+
- Left: a box of **four Ace3-style tabs** (game textures `UI-OptionsFrame-ActiveTab/InActiveTab`,
55+
tabs stretched to fill, like BlizzMove): **Display** (Enable addon; Quest mobs ☑ + size, horizontal
56+
offset, height; Quest items ☑ + size, height), **Icon** (style; Float ☑ + height, duration; Glow ☑ +
57+
intensity), **Behavior** (color by quest type, minimap button, In combat dropdown, Language dropdown),
58+
**Profiles** (list, new/copy/rename/delete with confirm, Reset everything). Each tab has "Reset this tab".
59+
- Right: the **live preview, fixed** outside the tabs (mob with fake nameplate on top, crate below).
60+
- **Gates:** controls fade and lock when what they depend on is off (`Gate`, `UpdateGates`). The minimap
61+
checkbox never locks (it is how you turn the addon back on).
62+
- Dropdowns are self-made (UIDropDownMenu differs/deprecated across clients).
63+
- Static texts go through `Loc(object, key)` so a language change relabels live.
64+
- **Minimap button:** left-click options, right-click toggles `active`, drag around the edge; grey when off.
65+
- `/cqi` opens the options, `/cqi toggle` toggles the addon.
66+
67+
## Local checks (run before every hand-off)
68+
LuaJIT (Lua 5.1, same as WoW) is installed: `C:\Users\Claudio\AppData\Local\Programs\LuaJIT\bin\luajit.exe`.
69+
```bash
70+
LJ="/c/Users/Claudio/AppData/Local/Programs/LuaJIT/bin/luajit.exe"
71+
A="D:/Games/CS.Coder/WoW Addons/CSCoder_QuestIndicator"
72+
for f in Locales.lua CSCoder_QuestIndicator.lua; do "$LJ" -e "local f,e=loadfile('$A/$f'); print('$f', f and 'OK' or e)"; done
73+
"$LJ" "$A/tools/wowmock.lua" "$A" # runs the addon on a mocked WoW API, clicks every control
74+
"$LJ" "$A/tools/wowmock.lua" "$A" old # same, starting from an old (v4) saved-variables file
75+
```
76+
Expect `errors: 0` and `unexpected nil globals: none`. When the mock reports an error, first check
77+
whether the mock is missing an API (e.g. it once returned nil for `GetHighlightTexture`,
78+
`GetStringWidth`, `check.Text`) before blaming the addon. The mock can't judge layout.
79+
80+
## Release
81+
- GitHub: **cscoder69/CSCoder_QuestIndicator** (public, MIT). `gh` CLI at `C:\Program Files\GitHub CLI\gh.exe`, logged in as cscoder69.
82+
- CurseForge: project **1793185**, author CSCoder. Repo secret `CF_API_KEY` is set (CurseForge API token).
83+
Keep CurseForge's own "Automatic Packaging" **off** (the GitHub Action does it; both would double-upload).
84+
- Commits publish nothing. To release: bump nothing by hand, just
85+
`git tag -a vX.Y.Z -m "..." && git push origin vX.Y.Z`, then `gh run watch` the "Package and release" run.
86+
New files go through CurseForge moderation.
87+
- A zip for a friend without a release: `git archive` the addon files, replace `@project-version@`
88+
in the .toc, zip with forward-slash paths (see v1.1.0 in the history).
89+
90+
## History
91+
- 1.0.0 (2026-11-08): mob icons, item icon (soft target), options panel. Uploaded by hand.
92+
- 1.1.0 (2026-11-08): options v2 (4 tabs, fixed preview, gates), profiles, 6 languages, color by
93+
quest type, combat fade/hide, minimap button, hand-driven float, ForeverLootSparkles cvar fix.
94+
First release through the GitHub Action (worked first time).
95+
96+
## Ideas the user liked, not done yet
97+
- **Separate look for mobs vs items** (own style, float and glow per kind). Proposed a [Mobs | Items]
98+
selector; after that the user chose the 4-tab layout, and this stayed open — ask before building.
99+
- **Badges** (like ItemTree's "Keep 12" pill): a floating, draggable tracker of objective badges
100+
("Timberling Sprouts 8/12"), or a badge with progress above the mob.
101+
- More: custom icon color, show only on target/mouseover, transparency, hide in dungeons/raids,
102+
sound when an objective completes, keybinding to toggle.
103+
- Translations of any new text: write English first, translate when the layout is approved.

‎tools/make_icons.ps1‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
Add-Type -AssemblyName System.Drawing
2+
$dir = "D:\Games\CS.Coder\WoW Addons\CSCoder_QuestIndicator\icons"
3+
New-Item -ItemType Directory -Force $dir | Out-Null
4+
$prev = Join-Path (Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)) "media"
5+
6+
function Col($a, $r, $g, $b) { [System.Drawing.Color]::FromArgb($a, $r, $g, $b) }
7+
function Grad($top, $bottom) { New-Object System.Drawing.Drawing2D.LinearGradientBrush (New-Object System.Drawing.Rectangle 0, 0, 128, 128), $top, $bottom, 90.0 }
8+
9+
function Save-Tga($bmp, $path) {
10+
$s = $bmp.Width
11+
$fs = [System.IO.File]::Create($path)
12+
$bw = New-Object System.IO.BinaryWriter $fs
13+
$bw.Write([byte[]](0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0)); $bw.Write([uint16]$s); $bw.Write([uint16]$s); $bw.Write([byte]32); $bw.Write([byte]0x28)
14+
for ($y = 0; $y -lt $s; $y++) { for ($x = 0; $x -lt $s; $x++) { $c = $bmp.GetPixel($x, $y); $bw.Write([byte]$c.B); $bw.Write([byte]$c.G); $bw.Write([byte]$c.R); $bw.Write([byte]$c.A) } }
15+
$bw.Close()
16+
}
17+
18+
function New-Canvas {
19+
$b = New-Object System.Drawing.Bitmap 128, 128, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
20+
$g = [System.Drawing.Graphics]::FromImage($b)
21+
$g.SmoothingMode = 'AntiAlias'
22+
$g.Clear([System.Drawing.Color]::Transparent)
23+
return @($b, $g)
24+
}
25+
26+
function Bang($g, $top, $bottom, $outline, $mid, $size, $dy) {
27+
$path = New-Object System.Drawing.Drawing2D.GraphicsPath
28+
$fmt = New-Object System.Drawing.StringFormat
29+
$fmt.Alignment = 'Center'; $fmt.LineAlignment = 'Center'
30+
$path.AddString("!", (New-Object System.Drawing.FontFamily "Arial Black"), 1, $size, (New-Object System.Drawing.RectangleF 0, $dy, 128, 128), $fmt)
31+
$g.DrawPath((New-Object System.Drawing.Pen $outline, 16), $path)
32+
$g.DrawPath((New-Object System.Drawing.Pen $mid, 8), $path)
33+
$g.FillPath((Grad $top $bottom), $path)
34+
$g.Clip = New-Object System.Drawing.Region $path
35+
$g.FillEllipse((New-Object System.Drawing.SolidBrush (Col 160 255 255 240)), 40, 2, 24, 60)
36+
$g.ResetClip()
37+
}
38+
39+
$gold = @((Col 255 255 248 120), (Col 255 240 150 10), (Col 255 20 10 0), (Col 255 120 60 0))
40+
$styles = @{
41+
gold = $gold
42+
blue = @((Col 255 170 230 255), (Col 255 30 120 230), (Col 255 5 10 30), (Col 255 20 60 140))
43+
red = @((Col 255 255 160 140), (Col 255 210 30 20), (Col 255 25 0 0), (Col 255 120 10 0))
44+
}
45+
foreach ($name in $styles.Keys) {
46+
$b, $g = New-Canvas
47+
$p = $styles[$name]
48+
Bang $g $p[0] $p[1] $p[2] $p[3] 132 4
49+
$g.Dispose(); Save-Tga $b "$dir\$name.tga"; $b.Save("$prev\i_$name.png")
50+
}
51+
52+
# Badge: dark round shield with a gold rim and a gold "!"
53+
$b, $g = New-Canvas
54+
$g.FillEllipse((New-Object System.Drawing.SolidBrush (Col 255 15 10 5)), 6, 6, 116, 116)
55+
$g.FillEllipse((Grad (Col 255 255 225 120) (Col 255 150 90 10)), 10, 10, 108, 108)
56+
$g.FillEllipse((Grad (Col 255 60 40 20) (Col 255 20 12 6)), 18, 18, 92, 92)
57+
Bang $g $gold[0] $gold[1] $gold[2] $gold[3] 92 6
58+
$g.Dispose(); Save-Tga $b "$dir\badge.tga"; $b.Save("$prev\i_badge.png")
59+
60+
# Pixel: crisp 16x16 grid drawn at 8x
61+
$b = New-Object System.Drawing.Bitmap 128, 128, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
62+
$g = [System.Drawing.Graphics]::FromImage($b); $g.Clear([System.Drawing.Color]::Transparent)
63+
$px = @("......XXXX......", ".....XYYYOX.....", ".....XYYYOX.....", ".....XYYYOX.....", ".....XYYYOX.....", "......XYOX......", "......XYOX......", "......XYOX......", "......XYOX......", ".......XX.......", "................", "......XXXX......", ".....XYYOOX.....", ".....XYOOOX.....", "......XXXX......", "................")
64+
$pal = @{ 'X' = (Col 255 25 15 5); 'Y' = (Col 255 255 230 90); 'O' = (Col 255 235 140 20) }
65+
for ($r = 0; $r -lt 16; $r++) { for ($c = 0; $c -lt 16; $c++) { $ch = [string]$px[$r][$c]; if ($pal.ContainsKey($ch)) { $g.FillRectangle((New-Object System.Drawing.SolidBrush $pal[$ch]), $c * 8, $r * 8, 8, 8) } } }
66+
$g.Dispose(); Save-Tga $b "$dir\pixel.tga"; $b.Save("$prev\i_pixel.png")
67+
68+
# Contact sheet for review
69+
$sheet = New-Object System.Drawing.Bitmap 680, 140
70+
$sg = [System.Drawing.Graphics]::FromImage($sheet); $sg.Clear((Col 255 40 50 40))
71+
$i = 0
72+
foreach ($n in "gold", "blue", "red", "badge", "pixel") { $img = [System.Drawing.Image]::FromFile("$prev\i_$n.png"); $sg.DrawImage($img, 6 + $i * 135, 6, 128, 128); $img.Dispose(); $i++ }
73+
$sg.Dispose(); $sheet.Save("$prev\icons_sheet.png")
74+
Get-ChildItem $dir | Select-Object -ExpandProperty Name

‎tools/make_logo.ps1‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Add-Type -AssemblyName System.Drawing
2+
$out = "D:\Games\CS.Coder\WoW Addons\CSCoder_QuestIndicator_logo.png"
3+
$S = 400
4+
function Col($a, $r, $g, $b) { [System.Drawing.Color]::FromArgb($a, $r, $g, $b) }
5+
6+
$b = New-Object System.Drawing.Bitmap $S, $S, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
7+
$g = [System.Drawing.Graphics]::FromImage($b)
8+
$g.SmoothingMode = 'AntiAlias'; $g.TextRenderingHint = 'AntiAliasGridFit'
9+
10+
# Background: dark radial vignette with a warm center
11+
$g.Clear((Col 255 12 9 6))
12+
$bg = New-Object System.Drawing.Drawing2D.GraphicsPath
13+
$bg.AddEllipse(-80, -60, $S + 160, $S + 160)
14+
$pb = New-Object System.Drawing.Drawing2D.PathGradientBrush $bg
15+
$pb.CenterColor = (Col 255 70 42 14); $pb.SurroundColors = @((Col 255 10 7 4))
16+
$pb.CenterPoint = New-Object System.Drawing.PointF 200, 180
17+
$g.FillRectangle($pb, 0, 0, $S, $S)
18+
19+
# Soft glow behind the mark
20+
for ($i = 0; $i -lt 14; $i++) {
21+
$r = 170 - $i * 10
22+
$g.FillEllipse((New-Object System.Drawing.SolidBrush (Col 14 255 190 60)), 200 - $r, 175 - $r, $r * 2, $r * 2)
23+
}
24+
25+
# Gold ring
26+
$ring = New-Object System.Drawing.Drawing2D.LinearGradientBrush (New-Object System.Drawing.Rectangle 0, 0, $S, $S), (Col 255 255 230 130), (Col 255 140 80 10), 90.0
27+
$g.FillEllipse((New-Object System.Drawing.SolidBrush (Col 255 15 10 5)), 52, 27, 296, 296)
28+
$g.FillEllipse($ring, 60, 35, 280, 280)
29+
$inner = New-Object System.Drawing.Drawing2D.LinearGradientBrush (New-Object System.Drawing.Rectangle 0, 50, $S, 260), (Col 255 62 40 18), (Col 255 22 13 6), 90.0
30+
$g.FillEllipse($inner, 78, 53, 244, 244)
31+
32+
# The "!"
33+
$path = New-Object System.Drawing.Drawing2D.GraphicsPath
34+
$fmt = New-Object System.Drawing.StringFormat; $fmt.Alignment = 'Center'; $fmt.LineAlignment = 'Center'
35+
$path.AddString("!", (New-Object System.Drawing.FontFamily "Arial Black"), 1, 230, (New-Object System.Drawing.RectangleF 0, 50, $S, 260), $fmt)
36+
$g.DrawPath((New-Object System.Drawing.Pen (Col 255 20 10 0), 22), $path)
37+
$g.DrawPath((New-Object System.Drawing.Pen (Col 255 120 60 0), 10), $path)
38+
$fill = New-Object System.Drawing.Drawing2D.LinearGradientBrush (New-Object System.Drawing.Rectangle 0, 70, $S, 220), (Col 255 255 248 120), (Col 255 240 150 10), 90.0
39+
$g.FillPath($fill, $path)
40+
$g.Clip = New-Object System.Drawing.Region $path
41+
$g.FillEllipse((New-Object System.Drawing.SolidBrush (Col 150 255 255 240)), 168, 60, 40, 150)
42+
$g.ResetClip()
43+
44+
# Title
45+
$tfmt = New-Object System.Drawing.StringFormat; $tfmt.Alignment = 'Center'
46+
$title = New-Object System.Drawing.Drawing2D.GraphicsPath
47+
$title.AddString("QUEST INDICATOR", (New-Object System.Drawing.FontFamily "Arial Black"), 0, 34, (New-Object System.Drawing.RectangleF 0, 328, $S, 50), $tfmt)
48+
$g.DrawPath((New-Object System.Drawing.Pen (Col 255 15 8 0), 7), $title)
49+
$g.FillPath((New-Object System.Drawing.Drawing2D.LinearGradientBrush (New-Object System.Drawing.Rectangle 0, 330, $S, 40), (Col 255 255 236 150), (Col 255 225 150 30), 90.0), $title)
50+
$g.DrawString("CS.Coder", (New-Object System.Drawing.Font "Segoe UI Semibold", 13), (New-Object System.Drawing.SolidBrush (Col 200 230 200 150)), (New-Object System.Drawing.RectangleF 0, 370, $S, 26), $tfmt)
51+
52+
$g.Dispose(); $b.Save($out, [System.Drawing.Imaging.ImageFormat]::Png); $b.Dispose()
53+
$out

0 commit comments

Comments
 (0)