Skip to content

Commit db61621

Browse files
cscoder69claude
andcommitted
Setup guide: the icon's whole look on one page with a default button; preview width known up front
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7db87fa commit db61621

3 files changed

Lines changed: 28 additions & 26 deletions

File tree

‎CLAUDE.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ live in game after `/reload`.
9393
- **Setup guide** (`BuildWizard`, `ShowWizard`, `/cqi setup`): shown 3 s after login the first time on
9494
a character (`root.setupSeen[charKey]`; chars from before it existed are marked seen on update).
9595
Page 1 = logo (`icons/logo.tga`, made by `tools/make_logo_tga.ps1`), greeting, "Use default
96-
settings" / "Configure". Configure = Icon, What to show, Where (anchor + X/Y), Done, each beside
96+
settings" / "Configure". Configure = Look (icon, size, anchor, X/Y, float, glow + "Use default";
97+
the user wants it all on one page), What to show, Done, each beside
9798
its own live preview (`previews` list: `BuildPreview` can make several). Any close marks it seen.
9899
Texts are English only until the user approves the layout.
99100
- **Icon anchor** (`anchor`, `objectAnchor`): top/bottom/left/right of the plate; side anchors use

‎CSCoder_QuestIndicator.lua‎

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,8 +1465,8 @@ end
14651465
-- setup guide); all of them follow every change.
14661466
local previews = {}
14671467

1468-
local function BuildPreview(pane)
1469-
local p = {}
1468+
local function BuildPreview(pane, width)
1469+
local p = { width = width } -- known width: anchored frames can report 0 before the first layout
14701470
previews[#previews + 1] = p
14711471
local heading = pane:CreateFontString(nil, "ARTWORK", "GameFontNormal")
14721472
heading:SetPoint("TOPLEFT", 2, 0)
@@ -1538,7 +1538,7 @@ local function ApplyPlateGeometry(p)
15381538
if geom and geom.eff then ratio = geom.eff / p.box:GetEffectiveScale() end
15391539
-- A big plate (or a small UI scale) would fill the box and push side-anchored icons out of
15401540
-- view: then the whole scene shrinks, plate and icon together, so proportions still match.
1541-
local boxWidth = geom and geom.w and p.box:GetWidth()
1541+
local boxWidth = geom and geom.w and (p.width or p.box:GetWidth())
15421542
if boxWidth and boxWidth > 0 then ratio = math.min(ratio, boxWidth * 0.45 / geom.w) end
15431543
if geom then
15441544
p.plate:SetSize(geom.w * ratio, geom.h * ratio)
@@ -2059,7 +2059,7 @@ local function BuildPanel()
20592059
local pane = CreateFrame("Frame", nil, window)
20602060
pane:SetPoint("TOPLEFT", 14, -12)
20612061
pane:SetPoint("BOTTOMRIGHT", -14, 14)
2062-
BuildPreview(pane)
2062+
BuildPreview(pane, PREVIEW_WIDTH - 28)
20632063
window:Hide()
20642064

20652065
local function PlaceWindow()
@@ -2256,7 +2256,7 @@ local function BuildWizard()
22562256
local previewPane = CreateFrame("Frame", nil, f)
22572257
previewPane:SetSize(370, 360)
22582258
previewPane:SetPoint("TOPRIGHT", -28, -50)
2259-
BuildPreview(previewPane)
2259+
BuildPreview(previewPane, 370)
22602260

22612261
dropdownHost = f -- the guide's dropdown lists open over the guide, not the hidden panel
22622262
local pages = {}
@@ -2293,13 +2293,24 @@ local function BuildWizard()
22932293
configure:SetPoint("BOTTOMLEFT", welcome, "BOTTOM", 8, 40)
22942294
Loc(configure, "WIZ_CONFIGURE")
22952295

2296-
-- 2. Icon.
2297-
local iconPage = NewPage()
2298-
AddWizardText(iconPage, "WIZ_ICON_TITLE", "WIZ_ICON_TEXT")
2299-
AddIconPicker(iconPage, 28, -136)
2300-
AddSlider(iconPage, "ICON_SIZE", "scale", 0.5, 3.0, 0.05, 32, -206, "%.2f")
2301-
AddCheck(iconPage, "FLOAT", "WIZ_FLOAT_TIP", "bounce", 28, -268)
2302-
AddCheck(iconPage, "GLOW_SECTION", "WIZ_GLOW_TIP", "glow", 28, -318)
2296+
-- 2. The icon's whole look on one page: icon, size, side of the plate, X/Y, float, glow.
2297+
local lookPage = NewPage()
2298+
AddWizardText(lookPage, "WIZ_LOOK_TITLE", "WIZ_LOOK_TEXT")
2299+
AddIconPicker(lookPage, 28, -112)
2300+
local lookDefault = CreateFrame("Button", nil, lookPage, "UIPanelButtonTemplate")
2301+
lookDefault:SetSize(130, 24)
2302+
lookDefault:SetPoint("TOPLEFT", 300, -124)
2303+
Loc(lookDefault, "WIZ_LOOK_DEFAULT")
2304+
lookDefault:SetScript("OnClick", function()
2305+
ResetKeys({ "style", "scale", "anchor", "offsetX", "offset", "bounce", "glow" })
2306+
AfterReset()
2307+
end)
2308+
AddSlider(lookPage, "ICON_SIZE", "scale", 0.5, 3.0, 0.05, 32, -172, "%.2f")
2309+
AddAnchorMenu(lookPage, "anchor", "offsetX", "offset", 32, -216, Always)
2310+
AddSlider(lookPage, "POS_X", "offsetX", -POSITION_RANGE, POSITION_RANGE, 1, 32, -272, "%d")
2311+
AddSlider(lookPage, "POS_Y", "offset", -POSITION_RANGE, POSITION_RANGE, 1, 32, -314, "%d")
2312+
AddCheck(lookPage, "FLOAT", nil, "bounce", 28, -358)
2313+
AddCheck(lookPage, "GLOW_SECTION", nil, "glow", 220, -358)
23032314

23042315
-- 3. What to show.
23052316
local showPage = NewPage()
@@ -2309,13 +2320,6 @@ local function BuildWizard()
23092320
AddCheck(showPage, "PROGRESS", "PROGRESS_TIP", "progress", 28, -226)
23102321
AddCheck(showPage, "SOUND", "SOUND_TIP", "sound", 28, -276)
23112322

2312-
-- 4. Where it shows.
2313-
local placePage = NewPage()
2314-
AddWizardText(placePage, "WIZ_PLACE_TITLE", "WIZ_PLACE_TEXT")
2315-
AddAnchorMenu(placePage, "anchor", "offsetX", "offset", 32, -136, Always)
2316-
AddSlider(placePage, "POS_X", "offsetX", -POSITION_RANGE, POSITION_RANGE, 1, 32, -196, "%d")
2317-
AddSlider(placePage, "POS_Y", "offset", -POSITION_RANGE, POSITION_RANGE, 1, 32, -240, "%d")
2318-
23192323
-- 5. Done.
23202324
local donePage = NewPage()
23212325
AddWizardText(donePage, "WIZ_DONE_TITLE", "WIZ_DONE_TEXT")

‎Locales.lua‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,16 +821,13 @@ local wizardText = {
821821
WIZ_WELCOME_TEXT = "Thanks for installing |cffffd200CS.Coder - Quest Indicator|r.\n\nA floating |cffffd200!|r marks every mob and item you still need for your quests, with your progress (8/12) right beside it.\n\nStart right away with the default settings, or take a minute to make it yours.",
822822
WIZ_USE_DEFAULT = "Use default settings",
823823
WIZ_CONFIGURE = "Configure",
824-
WIZ_ICON_TITLE = "Pick your icon",
825-
WIZ_ICON_TEXT = "This is how quest mobs and items will be marked. Click the icon to try others: the preview on the right shows the result right away.",
826-
WIZ_FLOAT_TIP = "The icon gently bobs up and down.",
827-
WIZ_GLOW_TIP = "A soft light behind the icon.",
824+
WIZ_LOOK_TITLE = "Your icon",
825+
WIZ_LOOK_TEXT = "Choose the icon, its size and where it sits. The preview follows every change.",
826+
WIZ_LOOK_DEFAULT = "Use default",
828827
WIZ_SHOW_TITLE = "What to show",
829828
WIZ_SHOW_TEXT = "Choose what the addon marks for you.",
830829
WIZ_MOBS_TIP = "An icon over every mob you still need for a quest.",
831830
WIZ_ITEMS_TIP = "An icon over the nearest quest item in the world.",
832-
WIZ_PLACE_TITLE = "Where it shows",
833-
WIZ_PLACE_TEXT = "Pick the side of the nameplate the icon sits on, then fine-tune it with X and Y.",
834831
WIZ_DONE_TITLE = "All set!",
835832
WIZ_DONE_TEXT = "Your quest indicator is ready. Good hunting!\n\nType |cff00ff00/cqi|r or click the minimap button at any time for the full options: fonts, colors, profiles and much more.\n\nWant to see this guide again? Type |cff00ff00/cqi setup|r.",
836833
WIZ_STEP = "Step %d of %d",

0 commit comments

Comments
 (0)