new module registry to warn players about new modules

This commit is contained in:
Meow
2026-03-23 14:41:40 +01:00
parent 424952c3fc
commit a95aeeb637
5 changed files with 120 additions and 4 deletions
+24
View File
@@ -139,6 +139,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Modern:SetText("Modern")
f.Modern:SetScript("OnClick", function()
_G["pfUI_config"] = CopyTable(pfUI_profiles["Modern"])
pfUI_init.selected_profile = "Modern"
pfUI:LoadConfig()
ReloadUI()
end)
@@ -152,6 +153,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Nostalgia:SetText("Nostalgia")
f.Nostalgia:SetScript("OnClick", function()
_G["pfUI_config"] = CopyTable(pfUI_profiles["Nostalgia"])
pfUI_init.selected_profile = "Nostalgia"
pfUI:LoadConfig()
ReloadUI()
end)
@@ -165,6 +167,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Legacy:SetText("Legacy")
f.Legacy:SetScript("OnClick", function()
_G["pfUI_config"] = CopyTable(pfUI_profiles["Legacy"])
pfUI_init.selected_profile = "Legacy"
pfUI:LoadConfig()
ReloadUI()
end)
@@ -178,6 +181,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Slim:SetText("Slim")
f.Slim:SetScript("OnClick", function()
_G["pfUI_config"] = CopyTable(pfUI_profiles["Slim"])
pfUI_init.selected_profile = "Slim"
pfUI:LoadConfig()
ReloadUI()
end)
@@ -307,6 +311,26 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
-- finalize dialog
pfUI.firstrun:AddStep("finalize", function()
-- Set default positions for new modules based on the active profile.
-- Only write positions that haven't been saved yet (don't override user preferences).
local function SetDefaultPosition(name, anchor, xpos, ypos)
if not pfUI_config.position[name] then
pfUI_config.position[name] = {
anchor = anchor,
parent = "UIParent",
xpos = xpos,
ypos = ypos,
}
end
end
local positions = (pfUI_profiles[pfUI_init.selected_profile or "Modern"] or pfUI_profiles["Modern"]).new_module_positions
or pfUI_profiles["Modern"].new_module_positions
for frameName, pos in pairs(positions) do
SetDefaultPosition(frameName, pos.anchor, pos.xpos, pos.ypos)
end
local f = CreateFirstRunPage()
f.text:SetText(T["Your interface is now set up.\n\nFor advanced configuration, just open the |cff33ffccpf|rUI settings via the escape menu or type \"|cffffffaa/pfui|r\" into the chat.\n\n Have a nice trip!\n\n|cffaaaaaa- Shagu"])
return f
+3 -2
View File
@@ -1,3 +1,4 @@
pfUI:RegisterNewModule("marktracking", "Mark Tracker")
pfUI:RegisterModule("marktracking", "vanilla:tbc", function ()
-- Requires mark1-mark8 unit tokens (Turtle WoW / Nampower)
if not UnitExists("mark1") and not UnitExists("mark8") then
@@ -94,9 +95,9 @@ pfUI:RegisterModule("marktracking", "vanilla:tbc", function ()
pfUI.marktracking = CreateFrame("Frame", "pfMarkTracking", UIParent)
pfUI.marktracking:SetFrameStrata("MEDIUM")
if GROW == "up" then
pfUI.marktracking:SetPoint("BOTTOM", UIParent, "CENTER", 0, 0)
pfUI.marktracking:SetPoint("LEFT", UIParent, "LEFT", 6, -5)
else
pfUI.marktracking:SetPoint("TOP", UIParent, "CENTER", 0, 0)
pfUI.marktracking:SetPoint("LEFT", UIParent, "LEFT", 6, -5)
end
pfUI.marktracking:SetWidth(TOTAL_ROW_WIDTH)
pfUI.marktracking:SetHeight(8 * (ROW_HEIGHT + 1) + border * 2 - 1)
+3 -2
View File
@@ -1,3 +1,4 @@
pfUI:RegisterNewModule("swingtimer", "Swing Timer")
pfUI:RegisterModule("swingtimer", "vanilla:tbc", function ()
local rawborder, border = GetBorderSize()
@@ -102,7 +103,7 @@ pfUI:RegisterModule("swingtimer", "vanilla:tbc", function ()
-- Mainhand bar
pfUI.swingtimer.mainhand = CreateFrame("StatusBar", "pfSwingTimerMainhand", UIParent)
pfUI.swingtimer.mainhand:SetPoint("CENTER", UIParent, "CENTER", 0, -100)
pfUI.swingtimer.mainhand:SetPoint("BOTTOM", UIParent, "CENTER", -189, 103)
pfUI.swingtimer.mainhand:SetWidth(sw_width)
pfUI.swingtimer.mainhand:SetHeight(sw_height)
pfUI.swingtimer.mainhand:SetMinMaxValues(0, 1)
@@ -218,7 +219,7 @@ pfUI:RegisterModule("swingtimer", "vanilla:tbc", function ()
-- Ranged bar
pfUI.swingtimer.ranged = CreateFrame("Frame", "pfSwingTimerRanged", UIParent)
pfUI.swingtimer.ranged:SetPoint("CENTER", UIParent, "CENTER", 0, -120)
pfUI.swingtimer.ranged:SetPoint("BOTTOM", UIParent, "CENTER", -189, 83)
pfUI.swingtimer.ranged:SetWidth(sw_width)
pfUI.swingtimer.ranged:SetHeight(sw_height)
pfUI.swingtimer.ranged:Hide()