Files
Brues 967487e283 Utilizing ClassicAPI 1.6.0
commit d63057474083aa67fda2aa28ee6301334ffc4fdf
Author: Brues <5278969+brues-code@users.noreply.github.com>
Date:   Mon Jul 6 00:59:17 2026 -0500

    Use C_Map.GetMapOverlays instead of hardcoded pfMapOverlayData

    ClassicAPI's C_Map.GetMapOverlays reads WorldMapOverlay.dbc directly and
    returns the full overlay list for a zone (explored + unexplored) — the
    data vanilla's GetMapOverlayInfo withholds. mapreveal now iterates it
    straight (named fields: textureName/texturePath/width/height/offsets),
    dropping unpack_hash and the pfMapOverlayData tables entirely.

    Also fixes the explored-check: it compared the full texture path against
    GetMapOverlayInfo's bare-name keys, so the magnifying glass never
    suppressed on explored overlays. Now matches on the bare name.

    Removes ~870 lines of hand-measured overlay data (base + Turtle).

commit ad12c8209a80cd1211fe08e83f7013d24b5efd2d
Author: Brues <5278969+brues-code@users.noreply.github.com>
Date:   Sun Jul 5 23:45:09 2026 -0500

    utilize HookScript from ClassicAPI
2026-07-09 00:56:06 -05:00

109 lines
4.3 KiB
Lua

pfUI:RegisterSkin("Books", function ()
StripTextures(ItemTextFrame)
CreateBackdrop(ItemTextFrame, nil, nil, .75)
CreateBackdropShadow(ItemTextFrame)
ItemTextFrame.backdrop:SetPoint("TOPLEFT", 12, -12)
ItemTextFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72)
ItemTextFrame:SetHitRectInsets(12,30,12,72)
EnableMovable(ItemTextFrame)
SkinCloseButton(ItemTextCloseButton, ItemTextFrame.backdrop, -6, -6)
ItemTextScrollFrame:SetWidth(292)
ItemTextPageText:SetWidth(282)
ItemTextPageText:ClearAllPoints()
ItemTextPageText:SetPoint("TOPLEFT", 4, -15)
ItemTextTitleText:ClearAllPoints()
ItemTextTitleText:SetPoint("TOP", ItemTextFrame.backdrop, "TOP", 0, -10)
StripTextures(ItemTextScrollFrame)
CreateBackdrop(ItemTextScrollFrame, nil, true, .75)
SkinScrollbar(ItemTextScrollFrameScrollBar)
ItemTextScrollFrame:ClearAllPoints()
ItemTextScrollFrame:SetPoint("TOPRIGHT", -66, -46)
-- add new background
local bg = ItemTextScrollFrame:CreateTexture(nil, "BORDER")
bg:SetAllPoints()
bg:SetTexCoord(.1,1,0,1)
bg:SetTexture("Interface\\Stationery\\StationeryTest1")
-- assign material backgrounds to the default one
ItemTextMaterialTopLeft.SetTexture = function(self, texture)
bg:SetTexture(texture)
end
ItemTextMaterialTopLeft.Hide = function()
bg:SetTexture("Interface\\Stationery\\StationeryTest1")
end
-- disable meterial backgrounds
ItemTextMaterialTopLeft.Show = function() return end
ItemTextMaterialTopRight.Show = function() return end
ItemTextMaterialBotLeft.Show = function() return end
ItemTextMaterialBotRight.Show = function() return end
ItemTextMaterialTopLeft:Hide()
ItemTextMaterialTopRight:Hide()
ItemTextMaterialBotLeft:Hide()
ItemTextMaterialBotRight:Hide()
ItemTextCurrentPage:ClearAllPoints()
ItemTextCurrentPage:SetPoint("TOP", ItemTextScrollFrame, "BOTTOM", 0, -10)
local orig_SetText = ItemTextCurrentPage.SetText
ItemTextCurrentPage.SetText = function(self, text)
text = format(PAGE_NUMBER, text)
orig_SetText(self, text)
end
ItemTextCurrentPage:SetFontObject("GameFontWhite")
SkinArrowButton(ItemTextPrevPageButton, "left", 18)
ItemTextPrevPageButton:ClearAllPoints()
ItemTextPrevPageButton:SetPoint("TOPLEFT", ItemTextScrollFrame, "BOTTOMLEFT", 0, -6)
SkinArrowButton(ItemTextNextPageButton, "right", 18)
ItemTextNextPageButton:ClearAllPoints()
ItemTextNextPageButton:SetPoint("TOPRIGHT", ItemTextScrollFrame, "BOTTOMRIGHT", 0, -6)
ItemTextNextPageButton.Show = function(self) self:Enable() end
ItemTextNextPageButton.Hide = function(self) self:Disable() end
ItemTextPrevPageButton.Show = function(self) self:Enable() end
ItemTextPrevPageButton.Hide = function(self) self:Disable() end
do -- do not hide the scrollbar
ItemTextScrollFrame:Show()
ItemTextScrollFrameScrollBar:Show()
ItemTextScrollFrameScrollBarScrollUpButton:Show()
ItemTextScrollFrameScrollBarScrollDownButton:Show()
ItemTextScrollFrame.Show = function(self) end
ItemTextScrollFrame.Hide = function(self) end
ItemTextScrollFrameScrollBar.Show = function(self) self.thumb:Show() end
ItemTextScrollFrameScrollBar.Hide = function(self) self.thumb:Hide() end
ItemTextScrollFrameScrollBarScrollUpButton.Show = function(self) if self:GetParent():GetValue() ~= 0 then self:Enable() end end
ItemTextScrollFrameScrollBarScrollUpButton.Hide = function(self) self:Disable() end
ItemTextScrollFrameScrollBarScrollDownButton.Show = function(self) self:Enable() end
ItemTextScrollFrameScrollBarScrollDownButton.Hide = function(self) self:Disable() end
local first
ItemTextFrame:HookScript("OnShow", function()
if not first then -- it is necessary to update the scrollbar when you first open the frame
ItemTextScrollFrameScrollBar:Show()
ItemTextScrollFrameScrollBar:Hide()
ItemTextScrollFrameScrollBarScrollUpButton:Show()
ItemTextScrollFrameScrollBarScrollUpButton:Hide()
ItemTextScrollFrameScrollBarScrollDownButton:Show()
ItemTextScrollFrameScrollBarScrollDownButton:Hide()
first = true
end
end)
end
CreateBackdrop(ItemTextStatusBar, nil, true)
ItemTextStatusBar:DisableDrawLayer("OVERLAY")
ItemTextStatusBar:SetStatusBarTexture(pfUI.media["img:bar"])
ItemTextStatusBar:SetHeight(12)
ItemTextStatusBar:ClearAllPoints()
ItemTextStatusBar:SetPoint("BOTTOM", ItemTextScrollFrame, "BOTTOM", 0, 50)
end)