Skip to content

Commit

Permalink
标记为6.12.2版本
Browse files Browse the repository at this point in the history
  • Loading branch information
siweia committed Jul 3, 2021
1 parent 24e1f19 commit 30e03b1
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 33 deletions.
29 changes: 25 additions & 4 deletions Interface/AddOns/NDui/Modules/Chat/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,30 @@ function module:PlayWhisperSound(event)
end
end

local function FixLanguageFilterSideEffects()
HelpFrame:HookScript("OnShow", function()
UIErrorsFrame:AddMessage(DB.InfoColor..L["LanguageFilterTip"])
end)

local OLD_GetFriendGameAccountInfo = C_BattleNet.GetFriendGameAccountInfo
function C_BattleNet.GetFriendGameAccountInfo(...)
local gameAccountInfo = OLD_GetFriendGameAccountInfo(...)
if gameAccountInfo then
gameAccountInfo.isInCurrentRegion = true
end
return gameAccountInfo
end

local OLD_GetFriendAccountInfo = C_BattleNet.GetFriendAccountInfo
function C_BattleNet.GetFriendAccountInfo(...)
local accountInfo = OLD_GetFriendAccountInfo(...)
if accountInfo and accountInfo.gameAccountInfo then
accountInfo.gameAccountInfo.isInCurrentRegion = true
end
return accountInfo
end
end

function module:OnLogin()
fontOutline = C.db["Skins"]["FontOutline"] and "OUTLINE" or ""

Expand Down Expand Up @@ -382,10 +406,7 @@ function module:OnLogin()
if C.db["Chat"]["Freedom"] then
if GetCVar("portal") == "CN" then
ConsoleExec("portal TW")

HelpFrame:HookScript("OnShow", function()
UIErrorsFrame:AddMessage(DB.InfoColor..L["LanguageFilterTip"])
end)
FixLanguageFilterSideEffects()
end
SetCVar("profanityFilter", 0)
else
Expand Down
28 changes: 17 additions & 11 deletions Interface/AddOns/NDui/Modules/Maps/Minimap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -315,25 +315,31 @@ function module:RecycleBin()
end
end

local shownButtons = {}
local function SortRubbish()
if #buttons == 0 then return end

local numShown, lastbutton = 0
wipe(shownButtons)
for index, button in pairs(buttons) do
if next(button) and button:IsShown() then -- fix for fuxking AHDB
button:ClearAllPoints()
if not lastbutton then
button:SetPoint("BOTTOMRIGHT", bin, -3, 3)
elseif mod(index, iconsPerRow) == 1 then
button:SetPoint("BOTTOM", buttons[index - iconsPerRow], "TOP", 0, 3)
else
button:SetPoint("RIGHT", lastbutton, "LEFT", -3, 0)
end
lastbutton = button
numShown = numShown + 1
tinsert(shownButtons, button)
end
end

local lastbutton
for index, button in pairs(shownButtons) do
button:ClearAllPoints()
if not lastbutton then
button:SetPoint("BOTTOMRIGHT", bin, -3, 3)
elseif mod(index, iconsPerRow) == 1 then
button:SetPoint("BOTTOM", shownButtons[index - iconsPerRow], "TOP", 0, 3)
else
button:SetPoint("RIGHT", lastbutton, "LEFT", -3, 0)
end
lastbutton = button
end

local numShown = #shownButtons
local row = numShown == 0 and 1 or B:Round((numShown + rowMult) / iconsPerRow)
local newHeight = row*37 + 3
bin:SetHeight(newHeight)
Expand Down
24 changes: 14 additions & 10 deletions Interface/AddOns/NDui/Modules/Misc/Mail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local B, C, L, DB = unpack(ns)
local M = B:GetModule("Misc")

local wipe, select, pairs, tonumber = wipe, select, pairs, tonumber
local strsplit, strfind = strsplit, strfind
local strsplit, strfind, tinsert = strsplit, strfind, tinsert
local InboxItemCanDelete, DeleteInboxItem, TakeInboxMoney, TakeInboxItem = InboxItemCanDelete, DeleteInboxItem, TakeInboxMoney, TakeInboxItem
local GetInboxNumItems, GetInboxHeaderInfo, GetInboxItem, GetItemInfo = GetInboxNumItems, GetInboxHeaderInfo, GetInboxItem, GetItemInfo
local GetSendMailPrice, GetMoney = GetSendMailPrice, GetMoney
Expand Down Expand Up @@ -99,6 +99,15 @@ function M:ContactButton_Create(parent, index)
return button
end

local function GenerateDataByRealm(realm)
if contactListByRealm[realm] then
for name, color in pairs(contactListByRealm[realm]) do
local r, g, b = strsplit(":", color)
tinsert(contactList, {name = name.."-"..realm, r = r, g = g, b = b})
end
end
end

function M:ContactList_Refresh()
wipe(contactList)
wipe(contactListByRealm)
Expand All @@ -109,16 +118,11 @@ function M:ContactList_Refresh()
contactListByRealm[realm][name] = color
end

local count = 0
GenerateDataByRealm(DB.MyRealm)

for realm, value in pairs(contactListByRealm) do
for name, color in pairs(value) do
count = count + 1
local r, g, b = strsplit(":", color)
if not contactList[count] then contactList[count] = {} end
contactList[count].name = name.."-"..realm
contactList[count].r = r
contactList[count].g = g
contactList[count].b = b
if realm ~= DB.MyRealm then
GenerateDataByRealm(realm)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ C.themes["Blizzard_Collections"] = function()
B.StripTextures(WardrobeTransmogFrame.SpecButton)
B.ReskinArrow(WardrobeTransmogFrame.SpecButton, "down")
WardrobeTransmogFrame.SpecButton:SetPoint("RIGHT", WardrobeTransmogFrame.ApplyButton, "LEFT", -3, 0)
B.ReskinCheck(WardrobeTransmogFrame.ToggleSecondaryAppearanceCheckbox)

local modelScene = WardrobeTransmogFrame.ModelScene
modelScene.ClearAllPendingButton:DisableDrawLayer("BACKGROUND")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ local function ShouldHideBackground()
return IsInJailersTower() or instID == 8
end

local function ReskinSpellWidget(spell)
if not spell.bg then
spell.Border:SetAlpha(0)
spell.bg = B.ReskinIcon(spell.Icon)
end

spell.IconMask:Hide()
spell.Text:SetTextColor(1, 1, 1)
end

C.themes["Blizzard_PlayerChoice"] = function()
hooksecurefunc(PlayerChoiceFrame, "TryShow", function(self)
if not self.bg then
Expand Down Expand Up @@ -78,6 +88,9 @@ C.themes["Blizzard_PlayerChoice"] = function()
if widgetContainer and widgetContainer.widgetFrames then
for _, widgetFrame in pairs(widgetContainer.widgetFrames) do
ReskinOptionText(widgetFrame.Text, 1, 1, 1)
if widgetFrame.Spell then
ReskinSpellWidget(widgetFrame.Spell)
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,29 @@ tinsert(C.defaultThemes, function()

hooksecurefunc("Scenario_ChallengeMode_SetUpAffixes", B.AffixesSetup)

-- Block in jail tower
local mawBuffsBlock = ScenarioBlocksFrame.MawBuffsBlock
local bg = B.SetBD(mawBuffsBlock, nil, 20, -10, -20, 10)

local blockContainer = mawBuffsBlock.Container
B.StripTextures(blockContainer)
blockContainer:GetPushedTexture():SetAlpha(0)
blockContainer:GetHighlightTexture():SetAlpha(0)

local blockList = blockContainer.List
B.StripTextures(blockList)
blockList.__bg = bg
local bg = B.SetBD(blockList)
bg:SetPoint("TOPLEFT", 7, -12)
bg:SetPoint("BOTTOMRIGHT", -7, 12)

blockList:HookScript("OnShow", function(self)
self.__bg:SetBackdropBorderColor(1, .8, 0, .7)
end)
blockList:HookScript("OnHide", function(self)
self.__bg:SetBackdropBorderColor(0, 0, 0, 1)
end)

-- Reskin Headers
local headers = {
ObjectiveTrackerBlocksFrame.QuestHeader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ local function ReskinSpellDisplayWidget(self)
end
end

local ignoredWidgetIDs = {
[3246] = true, -- Torghast progressbar
[3273] = true, -- Torghast progressbar
}

tinsert(C.defaultThemes, function()
if not C.db["Skins"]["BlizzardSkins"] then return end

Expand Down Expand Up @@ -127,9 +122,24 @@ tinsert(C.defaultThemes, function()
end
end)

hooksecurefunc(_G.TopScenarioWidgetContainerBlock.WidgetContainer, "UpdateWidgetLayout", function(self)
for _, widgetFrame in pairs(self.widgetFrames) do
if widgetFrame.widgetType == Type_StatusBar then
ReskinWidgetStatusBar(widgetFrame.Bar)
end
end
end)

hooksecurefunc(_G.BottomScenarioWidgetContainerBlock.WidgetContainer, "UpdateWidgetLayout", function(self)
for _, widgetFrame in pairs(self.widgetFrames) do
if widgetFrame.widgetType == Type_SpellDisplay then
ReskinSpellDisplayWidget(widgetFrame)
end
end
end)

-- needs review, might remove this in the future
hooksecurefunc(_G.UIWidgetTemplateStatusBarMixin, "Setup", function(self)
if ignoredWidgetIDs[self.widgetID] then return end
ReskinWidgetStatusBar(self.Bar)
end)
end)
2 changes: 1 addition & 1 deletion Interface/AddOns/NDui/NDui-Mainline.toc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## X-Credits: Elv, Freebaser, Haleth, Haste, Leatrix, lightspark, Loshine, Neavo, p3lim, Paopao001, Qulight, Ray, Rubgrsch, Simpy, Tuller, zork.
## Author: Siweia
## Notes: More than a UI.
## Version: 6.12.1
## Version: 6.12.2
## X-Support: SL
## X-Website: https://github.com/siweia/NDui
## SavedVariables: NDuiADB, NDuiPDB
Expand Down
2 changes: 1 addition & 1 deletion Interface/AddOns/NDui/NDui.toc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
## X-Credits: Elv, Freebaser, Haleth, Haste, Leatrix, lightspark, Loshine, Neavo, p3lim, Paopao001, Qulight, Ray, Rubgrsch, Simpy, Tuller, zork.
## Author: Siweia
## Notes: Empty toc for Curseforge
## Version: 6.12.1
## Version: 6.12.2
## X-Support: SL
## X-Website: https://github.com/siweia/NDui

0 comments on commit 30e03b1

Please sign in to comment.