Skip to content

Commit

Permalink
[Classic] Fixes for 1.14.4 (Classic Hardcore Launch)
Browse files Browse the repository at this point in the history
  • Loading branch information
EsreverWoW committed Aug 25, 2023
1 parent 1002ddb commit 87fd910
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 254 deletions.
2 changes: 1 addition & 1 deletion ShestakUI/Core/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ T.Wrath341 = T.Wrath and T.toc >= 30401
T.HiDPI = GetScreenHeight() / T.screenHeight < 0.75

-- BETA
if T.newPatch or T.Wrath341 then
if T.newPatch or T.Classic then
GetContainerNumSlots = _G.GetContainerNumSlots or C_Container.GetContainerNumSlots
GetContainerNumFreeSlots = _G.GetContainerNumFreeSlots or C_Container.GetContainerNumFreeSlots
GetContainerItemLink = _G.GetContainerItemLink or C_Container.GetContainerItemLink
Expand Down
4 changes: 1 addition & 3 deletions ShestakUI/Core/Kill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ frame:SetScript("OnEvent", function(_, _, addon)
end

if C.bag.enable then
if T.Classic and not T.Wrath341 then
SetInsertItemsLeftToRight(false)
elseif T.Wrath341 then
if T.Classic then
C_Container.SetInsertItemsLeftToRight(false)
else
C_Container.SetSortBagsRightToLeft(true)
Expand Down
33 changes: 10 additions & 23 deletions ShestakUI/Core/Panels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,26 +220,13 @@ toppanel.bcr:SetTexture(C.media.blank)

local r, g, b = unpack(C.media.classborder_color)

if T.Classic and not T.Wrath341 then
toppanel.bgl:SetGradientAlpha("HORIZONTAL", r, g, b, 0, r, g, b, 0.1)
toppanel.bgr:SetGradientAlpha("HORIZONTAL", r, g, b, 0.1, r, g, b, 0)
toppanel.tbl:SetGradientAlpha("HORIZONTAL", 0, 0, 0, 0, 0, 0, 0, 1)
toppanel.tcl:SetGradientAlpha("HORIZONTAL", r, g, b, 0, r, g, b, 1)
toppanel.tbr:SetGradientAlpha("HORIZONTAL", 0, 0, 0, 1, 0, 0, 0, 0)
toppanel.tcr:SetGradientAlpha("HORIZONTAL", r, g, b, 1, r, g, b, 0)
toppanel.bbl:SetGradientAlpha("HORIZONTAL", 0, 0, 0, 0, 0, 0, 0, 1)
toppanel.bcl:SetGradientAlpha("HORIZONTAL", r, g, b, 0, r, g, b, 1)
toppanel.bbr:SetGradientAlpha("HORIZONTAL", 0, 0, 0, 1, 0, 0, 0, 0)
toppanel.bcr:SetGradientAlpha("HORIZONTAL", r, g, b, 1, r, g, b, 0)
else
toppanel.bgl:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0), CreateColor(r, g, b, 0.1))
toppanel.bgr:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0.1), CreateColor(r, g, b, 0))
toppanel.tbl:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 0), CreateColor(0, 0, 0, 1))
toppanel.tcl:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0), CreateColor(r, g, b, 1))
toppanel.tbr:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 1), CreateColor(0, 0, 0, 0))
toppanel.tcr:SetGradient("HORIZONTAL", CreateColor(r, g, b, 1), CreateColor(r, g, b, 0))
toppanel.bbl:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 0), CreateColor(0, 0, 0, 1))
toppanel.bcl:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0), CreateColor(r, g, b, 1))
toppanel.bbr:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 1), CreateColor(0, 0, 0, 0))
toppanel.bcr:SetGradient("HORIZONTAL", CreateColor(r, g, b, 1), CreateColor(r, g, b, 0))
end
toppanel.bgl:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0), CreateColor(r, g, b, 0.1))
toppanel.bgr:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0.1), CreateColor(r, g, b, 0))
toppanel.tbl:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 0), CreateColor(0, 0, 0, 1))
toppanel.tcl:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0), CreateColor(r, g, b, 1))
toppanel.tbr:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 1), CreateColor(0, 0, 0, 0))
toppanel.tcr:SetGradient("HORIZONTAL", CreateColor(r, g, b, 1), CreateColor(r, g, b, 0))
toppanel.bbl:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 0), CreateColor(0, 0, 0, 1))
toppanel.bcl:SetGradient("HORIZONTAL", CreateColor(r, g, b, 0), CreateColor(r, g, b, 1))
toppanel.bbr:SetGradient("HORIZONTAL", CreateColor(0, 0, 0, 1), CreateColor(0, 0, 0, 0))
toppanel.bcr:SetGradient("HORIZONTAL", CreateColor(r, g, b, 1), CreateColor(r, g, b, 0))
39 changes: 18 additions & 21 deletions ShestakUI/Libs/LiteStats/LiteStats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -648,27 +648,24 @@ if friends.enabled then
end
local clientTags = {}

if T.Classic and not T.Wrath341 then
clientTags = {
[BNET_CLIENT_D3] = "Diablo 3",
[BNET_CLIENT_D2] = "Diablo 2: Resurrected",
[BNET_CLIENT_WTCG] = "Hearthstone",
[BNET_CLIENT_HEROES] = "Heroes of the Storm",
[BNET_CLIENT_OVERWATCH] = "Overwatch",
[BNET_CLIENT_SC] = "StarCraft",
[BNET_CLIENT_SC2] = "StarCraft 2",
[BNET_CLIENT_DESTINY2] = "Destiny 2",
[BNET_CLIENT_COD] = "Call of Duty: Black Ops 4",
[BNET_CLIENT_WC3] = "Warcraft 3: Reforged",
[BNET_CLIENT_ARCADE] = "Arcade Collection",
[BNET_CLIENT_CRASH4] = "Crash Bandicoot 4",
[BNET_CLIENT_COD] = "COD: Black Ops 4",
[BNET_CLIENT_COD_MW] = "COD: Modern Warfare",
[BNET_CLIENT_COD_MW2] = "COD: Modern Warfare 2",
[BNET_CLIENT_COD_BOCW] = "COD: Cold War",
["BSAp"] = COMMUNITIES_PRESENCE_MOBILE_CHAT
}
end
clientTags = {
["D3"] = "Diablo 3",
["OSI"] = "Diablo 2: Resurrected",
["ANBS"] = "Diablo Immortal",
["WTCG"] = "Hearthstone",
["Hero"] = "Heroes of the Storm",
["Pro"] = "Overwatch",
["S1"] = "StarCraft",
["S2"] = "StarCraft 2",
["W3"] = "Warcraft 3: Reforged",
["RTRO"] = "Arcade Collection",
["WLBY"] = "Crash Bandicoot 4",
["VIPR"] = "COD: Black Ops 4",
["LAZR"] = "COD: Modern Warfare 2",
["ZEUS"] = "COD: Cold War",
["GRY"] = "Warcraft Arclight Rumble",
["BSAp"] = COMMUNITIES_PRESENCE_MOBILE_CHAT
}
Inject("Friends", {
OnLoad = function(self) RegEvents(self, "PLAYER_LOGIN PLAYER_ENTERING_WORLD GROUP_ROSTER_UPDATE FRIENDLIST_UPDATE BN_FRIEND_LIST_SIZE_CHANGED BN_FRIEND_ACCOUNT_ONLINE BN_FRIEND_ACCOUNT_OFFLINE BN_FRIEND_INFO_CHANGED BN_FRIEND_ACCOUNT_ONLINE BN_FRIEND_ACCOUNT_OFFLINE BN_FRIEND_INFO_CHANGED") end,
OnEvent = function(self, event)
Expand Down
21 changes: 7 additions & 14 deletions ShestakUI/Modules/ActionBars/Bindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -352,21 +352,14 @@ SlashCmdList.MOUSEOVERBIND = function()
end

local function registermacro()
if T.Classic and not T.Wrath341 then
for i = 1, MAX_ACCOUNT_MACROS do
local b = _G["MacroButton"..i]
b:HookScript("OnEnter", function(self) bind:Update(self, "MACRO") end)
end
else
hooksecurefunc(MacroFrame, "Update", function(frame)
for _, button in next, {frame.MacroSelector.ScrollBox.ScrollTarget:GetChildren()} do
if button and not button.hook then
button:HookScript("OnEnter", function(self) bind:Update(button, "MACRO") end)
button.hook = true
end
hooksecurefunc(MacroFrame, "Update", function(frame)
for _, button in next, {frame.MacroSelector.ScrollBox.ScrollTarget:GetChildren()} do
if button and not button.hook then
button:HookScript("OnEnter", function(self) bind:Update(button, "MACRO") end)
button.hook = true
end
end)
end
end
end)

MacroFrameTab1:HookScript("OnMouseUp", function() localmacros = 0 end)
MacroFrameTab2:HookScript("OnMouseUp", function() localmacros = 1 end)
Expand Down
3 changes: 0 additions & 3 deletions ShestakUI/Modules/Blizzard/Bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,6 @@ function Stuffing:BagFrameSlotNew(p, slot)
ret.frame:StyleButton()
ret.frame:SetTemplate("Default")
ret.frame:SetNormalTexture(0)
if T.Classic and not T.Wrath341 then
ret.frame:SetCheckedTexture(0)
end

ret.icon = _G[ret.frame:GetName().."IconTexture"]
ret.icon:CropIcon()
Expand Down
7 changes: 1 addition & 6 deletions ShestakUI/Modules/Blizzard/CombatText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,7 @@ for i = 1, numf do
f:SetPoint("CENTER", 0, 0)
f:SetMovable(true)
f:SetResizable(true)
if T.Mainline or T.Wrath341 then
f:SetResizeBounds(128, 128, 768, 768)
else
f:SetMinResize(128, 128)
f:SetMaxResize(768, 768)
end
f:SetResizeBounds(128, 128, 768, 768)
f:SetClampedToScreen(true)
f:SetClampRectInsets(0, 0, C.font.combat_text_font_size, 0)
f:SetInsertMode(C.combattext.direction and 2 or 1)
Expand Down
4 changes: 1 addition & 3 deletions ShestakUI/Modules/Cooldowns/PulseCD.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,14 @@ local function OnUpdate(_, update)
elseif v[2] == "item" then
getCooldownDetails = memoize(function()
local start, duration, enabled
if T.Wrath341 then
if T.Classic then
if v[4] == "action" then
start, duration, enabled = GetActionCooldown(v[5])
elseif v[4] == "inventory" then
start, duration, enabled = GetInventoryItemCooldown("player", v[5])
elseif v[4] == "container" then
start, duration, enabled = C_Container.GetContainerItemCooldown(v[5], v[6])
end
else
start, duration, enabled = GetItemCooldown(i)
end
return {
name = GetItemInfo(i),
Expand Down
85 changes: 24 additions & 61 deletions ShestakUI/Modules/Skins/Blizzard/Macro.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,83 +65,46 @@ local function LoadSkin()
MacroNewButton:SetPoint("RIGHT", MacroExitButton, "LEFT", -3, 0)

-- Regular scroll bar
if T.Classic and not T.Wrath341 then
T.SkinScrollBar(MacroButtonScrollFrame)
T.SkinScrollBar(MacroButtonScrollFrameScrollBar)
T.SkinScrollBar(MacroFrameScrollFrameScrollBar)
T.SkinScrollBar(MacroPopupScrollFrameScrollBar)
else
T.SkinScrollBar(MacroFrame.MacroSelector.ScrollBar)
T.SkinScrollBar(MacroFrameScrollFrameScrollBar)
end
T.SkinScrollBar(MacroFrame.MacroSelector.ScrollBar)
T.SkinScrollBar(MacroFrameScrollFrameScrollBar)

-- Big icon
MacroFrameSelectedMacroButton:StripTextures()
MacroFrameSelectedMacroButton:StyleButton(true)
MacroFrameSelectedMacroButton:GetNormalTexture():SetTexture(0)
MacroFrameSelectedMacroButton:SetTemplate("Default")
if T.Classic and not T.Wrath341 then
MacroFrameSelectedMacroButtonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
MacroFrameSelectedMacroButtonIcon:ClearAllPoints()
MacroFrameSelectedMacroButtonIcon:SetPoint("TOPLEFT", 2, -2)
MacroFrameSelectedMacroButtonIcon:SetPoint("BOTTOMRIGHT", -2, 2)
else
MacroFrameSelectedMacroButton.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
MacroFrameSelectedMacroButton.Icon:ClearAllPoints()
MacroFrameSelectedMacroButton.Icon:SetPoint("TOPLEFT", 2, -2)
MacroFrameSelectedMacroButton.Icon:SetPoint("BOTTOMRIGHT", -2, 2)
end
MacroFrameSelectedMacroButton.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
MacroFrameSelectedMacroButton.Icon:ClearAllPoints()
MacroFrameSelectedMacroButton.Icon:SetPoint("TOPLEFT", 2, -2)
MacroFrameSelectedMacroButton.Icon:SetPoint("BOTTOMRIGHT", -2, 2)

-- Moving text
MacroFrameCharLimitText:ClearAllPoints()
MacroFrameCharLimitText:SetPoint("BOTTOM", MacroFrameTextBackground, 0, -12)

-- Skin all buttons
if T.Classic and not T.Wrath341 then
for i = 1, MAX_ACCOUNT_MACROS do
local b = _G["MacroButton"..i]
local t = _G["MacroButton"..i.."Icon"]
if b then
b:StripTextures()
b:StyleButton(true)
b:SetTemplate("Default")
end

if t then
t:SetTexCoord(0.1, 0.9, 0.1, 0.9)
t:ClearAllPoints()
t:SetPoint("TOPLEFT", 2, -2)
t:SetPoint("BOTTOMRIGHT", -2, 2)
hooksecurefunc(MacroFrame.MacroSelector.ScrollBox, "Update", function()
for _, button in next, {MacroFrame.MacroSelector.ScrollBox.ScrollTarget:GetChildren()} do
if button.Icon and not button.isSkinned then
button:StripTextures()
button:StyleButton(true)
button:SetTemplate("Default")
button.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
button.Icon:ClearAllPoints()
button.Icon:SetPoint("TOPLEFT", 2, -2)
button.Icon:SetPoint("BOTTOMRIGHT", -2, 2)
button.isSkinned = true
end
end
else
hooksecurefunc(MacroFrame.MacroSelector.ScrollBox, "Update", function()
for _, button in next, {MacroFrame.MacroSelector.ScrollBox.ScrollTarget:GetChildren()} do
if button.Icon and not button.isSkinned then
button:StripTextures()
button:StyleButton(true)
button:SetTemplate("Default")
button.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
button.Icon:ClearAllPoints()
button.Icon:SetPoint("TOPLEFT", 2, -2)
button.Icon:SetPoint("BOTTOMRIGHT", -2, 2)
button.isSkinned = true
end
end
end)
end
end)

-- Icon selection frame
if T.Classic and not T.Wrath341 then
T.SkinIconSelectionFrame(MacroPopupFrame, NUM_MACRO_ICONS_SHOWN, nil, "MacroPopup")
else
MacroPopupFrame:HookScript("OnShow", function(frame)
if not frame.isSkinned then
T.SkinIconSelectionFrame(frame, nil, nil, "MacroPopup")
frame.isSkinned = true
end
end)
end
MacroPopupFrame:HookScript("OnShow", function(frame)
if not frame.isSkinned then
T.SkinIconSelectionFrame(frame, nil, nil, "MacroPopup")
frame.isSkinned = true
end
end)
end

T.SkinFuncs["Blizzard_MacroUI"] = LoadSkin
6 changes: 1 addition & 5 deletions ShestakUI/Modules/Skins/Blizzard_Vanilla/ItemText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ local function LoadSkin()

T.SkinScrollBar(ItemTextScrollFrameScrollBar)

if T.Wrath341 then
ItemTextPageText:SetTextColor("P", 1, 1, 1)
else
ItemTextPageText:SetTextColor(1, 1, 1)
end
ItemTextPageText:SetTextColor("P", 1, 1, 1)
ItemTextPageText.SetTextColor = T.dummy
end

Expand Down
34 changes: 9 additions & 25 deletions ShestakUI/Modules/Tooltip/MultiItemRef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,16 @@ local ShowTip = function(tip, link)
shown = nil
end

if T.Classic and not T.Wrath341 then
local _SetItemRef = SetItemRef
function SetItemRef(...)
local link = ...
local handled = strsplit(":", link)
if not IsModifiedClick() and handled and types[handled] and not shown then
local tip = CreateTip(link)
if tip then
ShowTip(tip, link)
end
else
return _SetItemRef(...)
local SetHyperlink = _G.ItemRefTooltip.SetHyperlink
function _G.ItemRefTooltip:SetHyperlink(link, ...)
local handled = strsplit(":", link)
if not InCombatLockdown() and not IsModifiedClick() and handled and types[handled] and not shown then
local tip = CreateTip(link)
if tip then
ShowTip(tip, link)
end
return
end
else
local SetHyperlink = _G.ItemRefTooltip.SetHyperlink
function _G.ItemRefTooltip:SetHyperlink(link, ...)
local handled = strsplit(":", link)
if not InCombatLockdown() and not IsModifiedClick() and handled and types[handled] and not shown then
local tip = CreateTip(link)
if tip then
ShowTip(tip, link)
end
return
end

SetHyperlink(self, link, ...)
end
SetHyperlink(self, link, ...)
end
Loading

0 comments on commit 87fd910

Please sign in to comment.