Skip to content

Commit

Permalink
v0.5.13
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Apr 13, 2024
1 parent c8a0031 commit 79b0dce
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DarkMode.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Interface-Cata: 40400
## Interface: 100206

## Version: 0.5.12
## Version: 0.5.13
## Title: DarkMode by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Cata.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 40400
## Version: 0.5.12
## Version: 0.5.13
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_TBC.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 20504
## Version: 0.5.12
## Version: 0.5.13
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 11502
## Version: 0.5.12
## Version: 0.5.13
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Wrath.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 30403
## Version: 0.5.12
## Version: 0.5.13
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
4 changes: 2 additions & 2 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
local DMUi = {
["ActionButtons"] = {"ActionButton", "MultiBarBottomLeftButton", "MultiBarBottomRightButton", "MultiBarLeftButton", "MultiBarRightButton", "ActionBar7Button", "ActionBar8Button", "ActionBar9Button", "ActionBar10Button", "MultiBar5Button", "MultiBar6Button", "MultiBar7Button", "StanceButton", "PetActionButton", "BT4Button", "BT4StanceButton", "BT4PetButton", "DominosActionButton"},
["Minimap"] = {"CalendarButtonFrame", "MiniMapBattlefieldBorder", "MinimapBorder", "MinimapBorderTop", "TimeManagerClockButton", "MinimapCompassTexture", "MinimapCluster.BorderTop",},
["UnitFrames"] = {"PlayerFrameTexture", "TargetFrameTextureFrameTexture", "FocusFrameTextureFrameTexture", "TargetFrameToTTextureFrameTexture", "FocusFrameToTTextureFrameTexture", "PetFrameTexture", "PlayerFrame.PlayerFrameContainer.AlternatePowerFrameTexture", "PlayerFrame.PlayerFrameContainer.FrameTexture", "TargetFrame.TargetFrameContainer.FrameTexture", "FocusFrame.TargetFrameContainer.FrameTexture", "PartyMemberFrame1Texture", "PartyMemberFrame2Texture", "PartyMemberFrame3Texture", "PartyMemberFrame4Texture", "PartyFrame.MemberFrame1.Texture", "PartyFrame.MemberFrame2.Texture", "PartyFrame.MemberFrame3.Texture", "PartyFrame.MemberFrame4.Texture", "CompactPartyFrameBorderFrame", "CompactRaidFrameContainerBorderFrame", "CompactRaidGroup1BorderFrame", "CompactRaidGroup2BorderFrame", "CompactRaidGroup3BorderFrame", "CompactRaidGroup4BorderFrame", "CompactRaidGroup5BorderFrame", "CompactRaidGroup6BorderFrame", "CompactRaidGroup7BorderFrame", "CompactRaidGroup8BorderFrame"},
["UnitFrames"] = {"PlayerFrameAlternateManaBar", "PlayerFrameTexture", "TargetFrameTextureFrameTexture", "FocusFrameTextureFrameTexture", "TargetFrameToTTextureFrameTexture", "FocusFrameToTTextureFrameTexture", "PetFrameTexture", "PlayerFrame.PlayerFrameContainer.AlternatePowerFrameTexture", "PlayerFrame.PlayerFrameContainer.FrameTexture", "TargetFrame.TargetFrameContainer.FrameTexture", "FocusFrame.TargetFrameContainer.FrameTexture", "PartyMemberFrame1Texture", "PartyMemberFrame2Texture", "PartyMemberFrame3Texture", "PartyMemberFrame4Texture", "PartyFrame.MemberFrame1.Texture", "PartyFrame.MemberFrame2.Texture", "PartyFrame.MemberFrame3.Texture", "PartyFrame.MemberFrame4.Texture", "CompactPartyFrameBorderFrame", "CompactRaidFrameContainerBorderFrame", "CompactRaidGroup1BorderFrame", "CompactRaidGroup2BorderFrame", "CompactRaidGroup3BorderFrame", "CompactRaidGroup4BorderFrame", "CompactRaidGroup5BorderFrame", "CompactRaidGroup6BorderFrame", "CompactRaidGroup7BorderFrame", "CompactRaidGroup8BorderFrame"},
["Tooltips"] = {"DropDownList1MenuBackdrop.NineSlice", "DropDownList2MenuBackdrop.NineSlice", "DropDownList3MenuBackdrop.NineSlice", "DropDownList4MenuBackdrop.NineSlice", "GameTooltip.NineSlice", "ItemRefTooltip.NineSlice", "ShoppingTooltip1.NineSlice", "ShoppingTooltip2.NineSlice", "WhatsTrainingTooltip.NineSlice"},
["Artworks"] = {"MirrorTimer1", "MirrorTimer2", "MirrorTimer3", "MainMenuBar.BorderArt", "MainMenuBarTextureExtender", "MainMenuBarTexture0", "MainMenuBarTexture1", "MainMenuBarTexture2", "MainMenuBarTexture3", "MainMenuExpBar", "ReputationWatchBar.StatusBar", "MainStatusTrackingBarContainer.BarFrameTexture", "SecondaryStatusTrackingBarContainer.BarFrameTexture", "MainMenuBarMaxLevelBar", "BT4BarBlizzardArt", "BT4BarBlizzardArt.nineSliceParent", "BlizzardArtLeftCap", "BlizzardArtRightCap", "CompactRaidFrameManager", "CharacterReagentBag0SlotNormalTexture", "CharacterBag0SlotNormalTexture", "CharacterBag1SlotNormalTexture", "CharacterBag2SlotNormalTexture", "CharacterBag3SlotNormalTexture", "MainMenuBarBackpackButtonNormalTexture"},
["Gryphons"] = {"MA_LeftEndCap", "MA_RightEndCap", "MainMenuBar.EndCaps", "MainMenuBarLeftEndCap", "MainMenuBarRightEndCap"},
Expand Down Expand Up @@ -230,4 +230,4 @@ local DMIgnoreTextureNames = {}
DMIgnoreTextureNames["ContainerFrame1Portrait"] = true
function DarkMode:GetIgnoreTextureName(name)
return DMIgnoreTextureNames[name] or false
end
end
121 changes: 120 additions & 1 deletion libs/D4Lib/D4Lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,123 @@ for i, v in pairs(chatChannels) do
ChatFrame_AddMessageEventFilter(i, FixIconChat)
end

ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", FixIconChat)
ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", FixIconChat)
if D4:GetWoWBuild() == "CLASSIC" then
-- FIX HEALTH
TargetFrameTextureFrame:CreateFontString("TargetFrameHealthBarText", "BORDER", "TextStatusBarText")
TargetFrameHealthBarText:SetPoint("CENTER", TargetFrameTextureFrame, "CENTER", -50, 3)
TargetFrameTextureFrame:CreateFontString("TargetFrameHealthBarTextLeft", "BORDER", "TextStatusBarText")
TargetFrameHealthBarTextLeft:SetPoint("LEFT", TargetFrameTextureFrame, "LEFT", 8, 3)
TargetFrameTextureFrame:CreateFontString("TargetFrameHealthBarTextRight", "BORDER", "TextStatusBarText")
TargetFrameHealthBarTextRight:SetPoint("RIGHT", TargetFrameTextureFrame, "RIGHT", -110, 3)
TargetFrameTextureFrame:CreateFontString("TargetFrameManaBarText", "BORDER", "TextStatusBarText")
TargetFrameManaBarText:SetPoint("CENTER", TargetFrameTextureFrame, "CENTER", -50, -8)
TargetFrameTextureFrame:CreateFontString("TargetFrameManaBarTextLeft", "BORDER", "TextStatusBarText")
TargetFrameManaBarTextLeft:SetPoint("LEFT", TargetFrameTextureFrame, "LEFT", 8, -8)
TargetFrameTextureFrame:CreateFontString("TargetFrameManaBarTextRight", "BORDER", "TextStatusBarText")
TargetFrameManaBarTextRight:SetPoint("RIGHT", TargetFrameTextureFrame, "RIGHT", -110, -8)
TargetFrameHealthBar.LeftText = TargetFrameHealthBarTextLeft
TargetFrameHealthBar.RightText = TargetFrameHealthBarTextRight
TargetFrameManaBar.LeftText = TargetFrameManaBarTextLeft
TargetFrameManaBar.RightText = TargetFrameManaBarTextRight
UnitFrameHealthBar_Initialize("target", TargetFrameHealthBar, TargetFrameHealthBarText, true)
UnitFrameManaBar_Initialize("target", TargetFrameManaBar, TargetFrameManaBarText, true)
if FocusFrame then
UnitFrameHealthBar_Initialize("focus", FocusFrameHealthBar, FocusFrameHealthBarText, true)
UnitFrameManaBar_Initialize("focus", FocusFrameManaBar, FocusFrameManaBarText, true)
end

local function TextStatusBar_UpdateTextStringWithValues(statusFrame, textString, value, valueMin, valueMax)
if statusFrame.LeftText and statusFrame.RightText then
statusFrame.LeftText:SetText("")
statusFrame.RightText:SetText("")
statusFrame.LeftText:Hide()
statusFrame.RightText:Hide()
end

if (tonumber(valueMax) ~= valueMax or valueMax > 0) and not statusFrame.pauseUpdates then
statusFrame:Show()
if (statusFrame.cvar and GetCVar(statusFrame.cvar) == "1" and statusFrame.textLockable) or statusFrame.forceShow then
textString:Show()
elseif statusFrame.lockShow > 0 and (not statusFrame.forceHideText) then
textString:Show()
else
textString:SetText("")
textString:Hide()

return
end

if value == 0 and statusFrame.zeroText then
textString:SetText(statusFrame.zeroText)
statusFrame.isZero = 1
textString:Show()

return
end

statusFrame.isZero = nil
local valueDisplay = value
local valueMaxDisplay = valueMax
if statusFrame.numericDisplayTransformFunc then
valueDisplay, valueMaxDisplay = statusFrame.numericDisplayTransformFunc(value, valueMax)
else
valueDisplay = AbbreviateLargeNumbers(value)
valueMaxDisplay = AbbreviateLargeNumbers(valueMax)
end

local shouldUsePrefix = statusFrame.prefix and (statusFrame.alwaysPrefix or not (statusFrame.cvar and GetCVar(statusFrame.cvar) == "1" and statusFrame.textLockable))
local displayMode = GetCVar("statusTextDisplay")
if statusFrame.showNumeric then
displayMode = "NUMERIC"
end

if statusFrame.disablePercentages and displayMode == "PERCENT" then
displayMode = "NUMERIC"
end

if valueMax <= 0 or displayMode == "NUMERIC" or displayMode == "NONE" then
if shouldUsePrefix then
textString:SetText(statusFrame.prefix .. " " .. valueDisplay .. " / " .. valueMaxDisplay)
else
textString:SetText(valueDisplay .. " / " .. valueMaxDisplay)
end
elseif displayMode == "BOTH" then
if statusFrame.LeftText and statusFrame.RightText then
if not statusFrame.disablePercentages and (not statusFrame.powerToken or statusFrame.powerToken == "MANA") then
statusFrame.LeftText:SetText(math.ceil((value / valueMax) * 100) .. "%")
statusFrame.LeftText:Show()
end

statusFrame.RightText:SetText(valueDisplay)
statusFrame.RightText:Show()
textString:Hide()
else
valueDisplay = valueDisplay .. " / " .. valueMaxDisplay
if not statusFrame.disablePercentages then
valueDisplay = "(" .. math.ceil((value / valueMax) * 100) .. "%) " .. valueDisplay
end
end

textString:SetText(valueDisplay)
elseif displayMode == "PERCENT" then
valueDisplay = math.ceil((value / valueMax) * 100) .. "%"
if shouldUsePrefix then
textString:SetText(statusFrame.prefix .. " " .. valueDisplay)
else
textString:SetText(valueDisplay)
end
end
else
textString:Hide()
textString:SetText("")
if not statusFrame.alwaysShow then
statusFrame:Hide()
else
statusFrame:SetValue(0)
end
end
end

hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", TextStatusBar_UpdateTextStringWithValues)
end
6 changes: 3 additions & 3 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

D4:SetVersion(AddonName, 136122, "0.5.12")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.12"))
D4:SetVersion(AddonName, 136122, "0.5.13")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.13"))
DMSettings.CloseButton:SetScript(
"OnClick",
function()
Expand Down Expand Up @@ -479,4 +479,4 @@ function DarkMode:InitDMSettings()
DMSettings:ClearAllPoints()
DMSettings:SetPoint(dbp1, UIParent, dbp3, dbp4, dbp5)
end
end
end

0 comments on commit 79b0dce

Please sign in to comment.