diff --git a/data/tables.lua b/data/tables.lua index 4aad22d..b79f8a0 100644 --- a/data/tables.lua +++ b/data/tables.lua @@ -123,6 +123,7 @@ local darkMode = { ["zoneTextX"] = 4, ["topPanelFont"] = "Prototype", ["textColor"] = false, + ["buffScale"] = 1, }, ["Target"] = { ["noPercent"] = true, @@ -588,6 +589,7 @@ local lightMode = { ["zoneTextX"] = 4, ["zoneTextY"] = -3, ["textColor"] = false, + ["buffScale"] = 1, }, ["Mini"] = { ["miniPetTextMaxShow"] = true, diff --git a/modules/map/map.lua b/modules/map/map.lua index 2126b43..c523280 100644 --- a/modules/map/map.lua +++ b/modules/map/map.lua @@ -39,6 +39,7 @@ DFRL:NewDefaults("Map", { timeX = {-4, "slider", {-50, 50}, nil, "top panel time", 24, "Adjusts horizontal position of the time display", nil, nil}, timeFormat12h = {false, "checkbox", nil, nil, "top panel time", 25, "Use 12-hour AM/PM time format instead of 24-hour", nil, nil}, textColor = {false, "checkbox", nil, nil, "ext. PizzaWorldBuffs", 26, "Colorize the PizzaWorldBuffs Alliance/Horde text", "BUG: slash commands not implemented yet - fix soon", nil}, + buffScale = {1, "slider", {0.3, 2}, nil, "buffs & debuffs", 27, "Adjusts the scale of buff and debuff icons", nil, nil}, }) DFRL:NewMod("Map", 1, function() @@ -187,20 +188,27 @@ DFRL:NewMod("Map", 1, function() end function Setup:Buffs() + local scale = DFRL:GetTempDB("Map", "buffScale") or 1 + BuffButton0:ClearAllPoints() BuffButton0:SetPoint("TOPRIGHT", Setup.topPanel, "TOPLEFT", -50, 0) + BuffButton0:SetScale(scale) BuffButton8:ClearAllPoints() BuffButton8:SetPoint("TOPRIGHT", Setup.topPanel, "TOPLEFT", -50, -50) + BuffButton8:SetScale(scale) TempEnchant1:ClearAllPoints() TempEnchant1:SetPoint("TOPRIGHT", Setup.topPanel, "TOPLEFT", -50, -100) + TempEnchant1:SetScale(scale) BuffButton16:ClearAllPoints() BuffButton16:SetPoint("TOPRIGHT", Setup.topPanel, "TOPLEFT", -50, -150) + BuffButton16:SetScale(scale) BuffButton32:ClearAllPoints() BuffButton32:SetPoint("TOPRIGHT", Setup.topPanel, "TOPLEFT", -50, -200) + BuffButton32:SetScale(scale) end function Setup:Tracker() @@ -791,6 +799,15 @@ DFRL:NewMod("Map", 1, function() Setup.timeText:SetText(localTime) end + callbacks.buffScale = function(value) + local frames = {BuffButton0, BuffButton8, TempEnchant1, BuffButton16, BuffButton32} + for _, frame in ipairs(frames) do + if frame then + frame:SetScale(value) + end + end + end + -- execute callbacks DFRL:NewCallbacks("Map", callbacks) diff --git a/modules/menu/menu.lua b/modules/menu/menu.lua index 1c24993..d084f2a 100644 --- a/modules/menu/menu.lua +++ b/modules/menu/menu.lua @@ -42,7 +42,7 @@ DFRL:NewMod("Menu", 1, function() return origShowUIPanel(frame, force) end - local frames = {OptionsFrame, SoundOptionsFrame, UIOptionsFrame} + local frames = {OptionsFrame} for _, frame in ipairs(frames) do if frame then local origOnShow = frame:GetScript("OnShow") @@ -114,29 +114,15 @@ end) ShopFrame_Toggle() end) - local videoBtn = DFRL.tools.CreateButton(self.menuframe, "Video Options", self.btnw, self.btnh) + local videoBtn = DFRL.tools.CreateButton(self.menuframe, "Options", self.btnw, self.btnh) videoBtn:SetPoint("TOP", donationBtn, "BOTTOM", 0, -self.space) videoBtn:SetScript("OnClick", function() self.menuframe:Hide() ShowUIPanel(OptionsFrame) end) - local soundBtn = DFRL.tools.CreateButton(self.menuframe, "Sound Options", self.btnw, self.btnh) - soundBtn:SetPoint("TOP", videoBtn, "BOTTOM", 0, -self.gap) - soundBtn:SetScript("OnClick", function() - self.menuframe:Hide() - ShowUIPanel(SoundOptionsFrame) - end) - - local uiBtn = DFRL.tools.CreateButton(self.menuframe, "UI Options", self.btnw, self.btnh) - uiBtn:SetPoint("TOP", soundBtn, "BOTTOM", 0, -self.gap) - uiBtn:SetScript("OnClick", function() - self.menuframe:Hide() - ShowUIPanel(UIOptionsFrame) - end) - local keyBtn = DFRL.tools.CreateButton(self.menuframe, "Key Bindings", self.btnw, self.btnh) - keyBtn:SetPoint("TOP", uiBtn, "BOTTOM", 0, -self.space) + keyBtn:SetPoint("TOP", videoBtn, "BOTTOM", 0, -self.space) keyBtn:SetScript("OnClick", function() self.menuframe:Hide() KeyBindingFrame_LoadUI() diff --git a/modules/unit/mini.lua b/modules/unit/mini.lua index fd5f43d..c9d65c9 100644 --- a/modules/unit/mini.lua +++ b/modules/unit/mini.lua @@ -60,6 +60,7 @@ DFRL:NewMod("Mini", 1, function() totManaValueText = nil, petHealthBar = nil, petManaBar = nil, + petXPBar = nil, -- Hunter pet XP bar (PetXPBar merge) totHealthBar = nil, totManaBar = nil, partyHealthBars = {}, @@ -155,6 +156,44 @@ DFRL:NewMod("Mini", 1, function() self.petManaBar:SetFillColor(0, 0, 1) self.petManaBar.max = 100 + -- Hunter pet XP bar (from PetXPBar) -- + -- Border dimensions are computed first so the bar height matches, + -- ensuring the status bar fill covers the full interior of the border frame. + local xpBarWidth = self.petManaBar:GetWidth() * 0.95 -- 95% of mana bar width + local xpBorderWidth = xpBarWidth * 1.2 + local xpBorderHeight = xpBorderWidth / (120 / 18) -- ~12.42px, preserves aspect ratio + + local xpBar = CreateFrame("StatusBar", "PetXPBar", PetFrame, "TextStatusBar") + xpBar:SetWidth(xpBarWidth) + xpBar:SetHeight(xpBorderHeight / 1.25) -- inset within border vertically + xpBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) + xpBar:SetStatusBarColor(1, 0, 1) -- magenta + xpBar:ClearAllPoints() + xpBar:SetPoint("TOP", self.petManaBar, "BOTTOM", 0, -2) + local xpBg = xpBar:CreateTexture(nil, "BACKGROUND") + xpBg:SetAllPoints(xpBar) + xpBg:SetVertexColor(0, 0, 0, 0.5) + -- Border overlay: centered on the bar, offset left by half the extra width + -- so the bar sits in the middle of the border horizontally. + local xpBorder = xpBar:CreateTexture(nil, "OVERLAY") + xpBorder:SetWidth(xpBorderWidth) + xpBorder:SetHeight(xpBorderHeight) + xpBorder:SetTexture([[Interface\CharacterFrame\UI-CharacterFrame-GroupIndicator]]) + xpBorder:SetPoint("CENTER", xpBar, "CENTER", 0, 0) + xpBorder:SetTexCoord(0.0234375, 0.6875, 1.0, 0.0) + xpBar:Hide() -- hidden by default; shown only for hunter pets + self.petXPBar = xpBar + -- End pet XP bar setup -- + + -- Move pet debuffs below the XP bar + for i = 1, 4 do + local debuff = _G["PetFrameDebuff" .. i] + if debuff then + debuff:ClearAllPoints() + debuff:SetPoint("TOPLEFT", xpBar, "BOTTOMLEFT", (i - 1) * 18, -4) + end + end + local petEventFrame = CreateFrame('Frame') petEventFrame:RegisterEvent('UNIT_HEALTH') petEventFrame:RegisterEvent('UNIT_MANA') @@ -217,6 +256,37 @@ DFRL:NewMod("Mini", 1, function() end end + -- Updates the hunter pet XP bar visibility and value. + -- Only shown when HasPetUI() indicates a hunter pet (isHunterPet == 1) below level 60. + -- Debuffs are repositioned below the XP bar when visible, or below the mana bar when hidden. + function Setup:UpdatePetXPBar() + if not self.petXPBar then return end + local hasPetInterface, isHunterPet = HasPetUI() + local showXP = hasPetInterface == 1 and isHunterPet == 1 and (UnitLevel("pet") or 0) < 60 + if showXP then + local curXP, maxXP = GetPetExperience() + if maxXP and maxXP > 0 then + self.petXPBar:SetMinMaxValues(0, maxXP) + self.petXPBar:SetValue(curXP or 0) + self.petXPBar:Show() + else + self.petXPBar:Hide() + showXP = false + end + else + self.petXPBar:Hide() + end + -- Reposition debuffs depending on whether the XP bar is visible + local debuffAnchor = showXP and self.petXPBar or self.petManaBar + for i = 1, 4 do + local debuff = _G["PetFrameDebuff" .. i] + if debuff then + debuff:ClearAllPoints() + debuff:SetPoint("TOPLEFT", debuffAnchor, "BOTTOMLEFT", (i - 1) * 18, -4) + end + end + end + function Setup:TargetOfTargetSetup() self.totHealthBar = CreateStatusBar(TargetofTargetFrame, 60, 13) self.totHealthBar:SetPoint('LEFT', TargetofTargetFrame, 'LEFT', 40, 1) @@ -606,6 +676,7 @@ DFRL:NewMod("Mini", 1, function() self:HookEvents() self.UpdatePetTexts() self:UpdateTargetOfTargetTexts() + self:UpdatePetXPBar() end Setup:Run() @@ -856,6 +927,7 @@ DFRL:NewMod("Mini", 1, function() f:RegisterEvent("UNIT_RAGE") f:RegisterEvent("UNIT_FOCUS") f:RegisterEvent("UNIT_PET") + f:RegisterEvent("UNIT_PET_EXPERIENCE") -- Hunter pet XP (from PetXPBar) f:RegisterEvent("PARTY_MEMBERS_CHANGED") f:RegisterEvent("PLAYER_TARGET_CHANGED") f:RegisterEvent("UNIT_TARGET") @@ -873,6 +945,11 @@ DFRL:NewMod("Mini", 1, function() end end + -- Hunter pet XP bar update (from PetXPBar) + if event == "PLAYER_ENTERING_WORLD" or event == "UNIT_PET" or event == "UNIT_PET_EXPERIENCE" then + Setup:UpdatePetXPBar() + end + if event == "PLAYER_ENTERING_WORLD" or event == "UNIT_PET" or (event == "UNIT_HEALTH" and arg1 == "pet") or (event == "UNIT_MANA" and arg1 == "pet") or