Skip to content

Commit

Permalink
Fix/initial fix df10 0 2 (#1)
Browse files Browse the repository at this point in the history
* Split into mainline/wrath.toc's

* Comment out non-working code

* Remove scroll zoom because its baked into wow now. Fix hideBags. Fix hideMicroButtons. Fix hideZoom

* Fix order of chainStyle. Fix hidePvpIcons. Fix custom player chain.
  • Loading branch information
thehamsti authored Nov 26, 2022
1 parent b46c522 commit 9bd85a7
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 140 deletions.
182 changes: 91 additions & 91 deletions Modules/actionbars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,38 @@ module.optionsTable = {
type = "header",
name = "Buttons",
},
extraButtons = {
order = 7,
type = "toggle",
name = "Extra Buttons",
desc = "Moves the 12th button on each of the right side actionbars down to the bottom bars. WIP: Not working yet",
width = "full",
},
-- extraButtons = {
-- order = 7,
-- type = "toggle",
-- name = "Extra Buttons",
-- desc = "Moves the 12th button on each of the right side actionbars down to the bottom bars. WIP: Not working yet",
-- width = "full", -- WIP
-- },
hideMacroNames = {
order = 8,
type = "toggle",
name = "Hide Macro Names",
width = "full",
},
hideKeyBinds = {
order = 9,
type = "toggle",
name = "Hide Key Binds",
width = "full",
},
shortKeybindText = {
order = 10,
type = "toggle",
name = "Short Key Bind Text",
desc = "(e.g. 'Mousewheel Up' -> 'WU')",
width = "full",
},
altKeybindFont = {
order = 11,
type = "toggle",
name = "Alternate Key Bind Font",
width = "full",
},
-- hideKeyBinds = {
-- order = 9,
-- type = "toggle",
-- name = "Hide Key Binds",
-- width = "full",
-- },
-- shortKeybindText = {
-- order = 10,
-- type = "toggle",
-- name = "Short Key Bind Text",
-- desc = "(e.g. 'Mousewheel Up' -> 'WU')",
-- width = "full",
-- },
-- altKeybindFont = {
-- order = 11,
-- type = "toggle",
-- name = "Alternate Key Bind Font",
-- width = "full",
-- },
}

local eventHandler = CreateFrame("Frame", nil, UIParent)
Expand Down Expand Up @@ -184,87 +184,87 @@ function module:OnLoad()
tinsert(buttons, _G["MultiBarRightButton"..i])
end

if db.hideKeyBinds then
local function updateHotkeys(self)
self.HotKey:Hide()
end
-- if db.hideKeyBinds then
-- local function updateHotkeys(self)
-- self.HotKey:Hide()
-- end

for _, button in pairs(buttons) do
hooksecurefunc(button, "UpdateHotkeys", updateHotkeys)
end
-- for _, button in pairs(buttons) do
-- hooksecurefunc(button, "UpdateHotkeys", updateHotkeys)
-- end

hooksecurefunc("ActionButton_UpdateRangeIndicator", updateHotkeys)
hooksecurefunc("PetActionButton_SetHotkeys", updateHotkeys)
end
-- hooksecurefunc("ActionButton_UpdateRangeIndicator", updateHotkeys)
-- hooksecurefunc("PetActionButton_SetHotkeys", updateHotkeys)
-- end

if db.shortKeybindText then
local function updateHotkeys(self)
local hotkey = self.HotKey
local text = hotkey:GetText()
-- if db.shortKeybindText then
-- local function updateHotkeys(self)
-- local hotkey = self.HotKey
-- local text = hotkey:GetText()

text = gsub(text, "(s%-)", "S")
text = gsub(text, "(a%-)", "A")
text = gsub(text, "(c%-)", "C")
text = gsub(text, "(st%-)", "C")
-- text = gsub(text, "(s%-)", "S")
-- text = gsub(text, "(a%-)", "A")
-- text = gsub(text, "(c%-)", "C")
-- text = gsub(text, "(st%-)", "C")

for i = 1, 30 do
text = gsub(text, _G["KEY_BUTTON"..i], "M"..i)
end
-- for i = 1, 30 do
-- text = gsub(text, _G["KEY_BUTTON"..i], "M"..i)
-- end

for i = 1, 9 do
text = gsub(text, _G["KEY_NUMPAD"..i], "Nu"..i)
end
-- for i = 1, 9 do
-- text = gsub(text, _G["KEY_NUMPAD"..i], "Nu"..i)
-- end

text = gsub(text, KEY_NUMPADDECIMAL, "Nu.")
text = gsub(text, KEY_NUMPADDIVIDE, "Nu/")
text = gsub(text, KEY_NUMPADMINUS, "Nu-")
text = gsub(text, KEY_NUMPADMULTIPLY, "Nu*")
text = gsub(text, KEY_NUMPADPLUS, "Nu+")
-- text = gsub(text, KEY_NUMPADDECIMAL, "Nu.")
-- text = gsub(text, KEY_NUMPADDIVIDE, "Nu/")
-- text = gsub(text, KEY_NUMPADMINUS, "Nu-")
-- text = gsub(text, KEY_NUMPADMULTIPLY, "Nu*")
-- text = gsub(text, KEY_NUMPADPLUS, "Nu+")

text = gsub(text, KEY_MOUSEWHEELUP, "WU")
text = gsub(text, KEY_MOUSEWHEELDOWN, "WD")
text = gsub(text, KEY_NUMLOCK, "NuL")
text = gsub(text, KEY_PAGEUP, "PU")
text = gsub(text, KEY_PAGEDOWN, "PD")
text = gsub(text, KEY_SPACE, "_")
text = gsub(text, KEY_INSERT, "Ins")
text = gsub(text, KEY_HOME, "Hm")
text = gsub(text, KEY_DELETE, "Del")
text = gsub(text, "Capslock", "Caps")
-- text = gsub(text, KEY_MOUSEWHEELUP, "WU")
-- text = gsub(text, KEY_MOUSEWHEELDOWN, "WD")
-- text = gsub(text, KEY_NUMLOCK, "NuL")
-- text = gsub(text, KEY_PAGEUP, "PU")
-- text = gsub(text, KEY_PAGEDOWN, "PD")
-- text = gsub(text, KEY_SPACE, "_")
-- text = gsub(text, KEY_INSERT, "Ins")
-- text = gsub(text, KEY_HOME, "Hm")
-- text = gsub(text, KEY_DELETE, "Del")
-- text = gsub(text, "Capslock", "Caps")

hotkey:SetText(text)
end
-- hotkey:SetText(text)
-- end

for _, button in pairs(buttons) do
hooksecurefunc(button, "UpdateHotkeys", updateHotkeys)
end
-- for _, button in pairs(buttons) do
-- hooksecurefunc(button, "UpdateHotkeys", updateHotkeys)
-- end

hooksecurefunc("ActionButton_UpdateRangeIndicator", updateHotkeys)
hooksecurefunc("PetActionButton_SetHotkeys", updateHotkeys)
end
-- hooksecurefunc("ActionButton_UpdateRangeIndicator", updateHotkeys)
-- hooksecurefunc("PetActionButton_SetHotkeys", updateHotkeys)
-- end

if db.altKeybindFont then
-- RANGE_INDICATOR = "*"
-- if db.altKeybindFont then
-- -- RANGE_INDICATOR = "*"

local function updateHotkeys(self)
local hotkey = self.HotKey
local text = hotkey:GetText()
-- local function updateHotkeys(self)
-- local hotkey = self.HotKey
-- local text = hotkey:GetText()

if not self.XarModded then
self.XarModded = true
hotkey:SetFontObject("Game11Font_o1")
hotkey:ClearAllPoints()
hotkey:SetPoint("TOPRIGHT", -1, -3)
end
end
-- if not self.XarModded then
-- self.XarModded = true
-- hotkey:SetFontObject("Game11Font_o1")
-- hotkey:ClearAllPoints()
-- hotkey:SetPoint("TOPRIGHT", -1, -3)
-- end
-- end

for _, button in pairs(buttons) do
hooksecurefunc(button, "UpdateHotkeys", updateHotkeys)
end
-- for _, button in pairs(buttons) do
-- hooksecurefunc(button, "UpdateHotkeys", updateHotkeys)
-- end

hooksecurefunc("ActionButton_UpdateRangeIndicator", updateHotkeys)
hooksecurefunc("PetActionButton_SetHotkeys", updateHotkeys)
end
-- hooksecurefunc("ActionButton_UpdateRangeIndicator", updateHotkeys)
-- hooksecurefunc("PetActionButton_SetHotkeys", updateHotkeys)
-- end

if db.hideMacroNames then
for _, button in pairs(buttons) do
Expand Down
68 changes: 34 additions & 34 deletions Modules/interface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.defaultSettings = {
hideGlow = false,
hideEffects = false,
hideZoom = false,
scrollZoom = false,
sellGrays = false,
repair = false,
dampeningDisplay = false,
Expand Down Expand Up @@ -88,13 +87,6 @@ module.optionsTable = {
name = "Hide Zoom Buttons",
width = "full",
},
scrollZoom = {
order = 11,
type = "toggle",
name = "Enable Scroll Wheel Zooming",
desc = "Zoom in & out on minimap using mousewheel",
width = "full",
},
header_automation = {
order = 12,
type = "header",
Expand Down Expand Up @@ -139,7 +131,6 @@ function module:XaryuSettings()
db.hideGlow = true
db.hideEffects = true
db.hideZoom = true
db.scrollZoom = true
db.sellGrays = true
db.repair = true
db.dampeningDisplay = true
Expand All @@ -161,37 +152,46 @@ function module:OnLoad()
end

if db.hideBags then
MicroButtonAndBagsBar:Hide()
-- Hide backpack symbol
MainMenuBarBackpackButton:Hide()
-- Hide toggle
BagBarExpandToggle:Hide()
-- Loop through all bag buttons
for i = 0, 3 do
local bagButton = _G["CharacterBag"..i.."Slot"]
bagButton:Hide()
end
-- Hide reagent bag
CharacterReagentBag0Slot:Hide()

end

if db.hideMicroButtons then
local tframe = CreateFrame("FRAME")
tframe:Hide()

hooksecurefunc("UpdateMicroButtonsParent", function()
for i=1, #MICRO_BUTTONS do
_G[MICRO_BUTTONS[i]]:SetParent(tframe)
end
end)

UpdateMicroButtonsParent(tframe)
local micro_buttons_to_hide = {
"CharacterMicroButton",
"SpellbookMicroButton",
"TalentMicroButton",
"AchievementMicroButton",
"QuestLogMicroButton",
"GuildMicroButton",
"LFDMicroButton",
"CollectionsMicroButton",
"EJMicroButton",
"StoreMicroButton",
"MainMenuMicroButton"
}
-- Hide all micro buttons - Character, Spellbook, Talent, Achievement, Quest, Guild, LFD, Collections, Store, MainMenu
for i = 1, #micro_buttons_to_hide do
local button = _G[micro_buttons_to_hide[i]]
button:SetScript("OnShow", button.Hide)
button.Show = function () end
button:Hide()
end
end

if db.hideZoom then
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
end

if db.scrollZoom then
Minimap:EnableMouseWheel(true)

Minimap:SetScript("OnMouseWheel", function(self, arg1)
if arg1 > 0 then
Minimap_ZoomIn()
else
Minimap_ZoomOut()
end
end)
Minimap.ZoomIn:SetAlpha(0)
Minimap.ZoomOut:SetAlpha(0)
end

SetCVar("ffxGlow", db.hideGlow and 0 or 1)
Expand Down
46 changes: 33 additions & 13 deletions Modules/unitframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ module.optionsTable = {
type = "select",
name = "Style",
values = {
"Elite",
"Rare",
"Elite",
"Rare Elite",
},
set = function(info, val)
Expand Down Expand Up @@ -117,15 +117,23 @@ function module:OnLoad()
end

if db.hidePvpIcons then
PlayerPVPIcon:SetAlpha(0)
PlayerPrestigeBadge:SetAlpha(0)
PlayerPrestigePortrait:SetAlpha(0)
TargetFrameTextureFramePVPIcon:SetAlpha(0)
TargetFrameTextureFramePrestigeBadge:SetAlpha(0)
TargetFrameTextureFramePrestigePortrait:SetAlpha(0)
FocusFrameTextureFramePVPIcon:SetAlpha(0)
FocusFrameTextureFramePrestigeBadge:SetAlpha(0)
FocusFrameTextureFramePrestigePortrait:SetAlpha(0)
-- Set contextuals
local playerFrameTargetContextual = PlayerFrame_GetPlayerFrameContentContextual()
local targetFrameContextual = TargetFrame.TargetFrameContent.TargetFrameContentContextual
-- TargetFrame.TargetFrameContent.TargetFrameContentContextual.PrestigePortrait:SetAlpha(0)
--local targetFrameTargetContextual = TargetFrame_GetTargetFrameContentContextual();
-- Self
playerFrameTargetContextual.PVPIcon:SetAlpha(0)
playerFrameTargetContextual.PrestigePortrait:SetAlpha(0)
playerFrameTargetContextual.PrestigeBadge:SetAlpha(0)
-- Target frames
--TargetFrame.TargetFrameContent.TargetFrameContentContextual.PVPIcon:SetAlpha(0)
TargetFrame.TargetFrameContent.TargetFrameContentContextual.PrestigePortrait:SetAlpha(0)
TargetFrame.TargetFrameContent.TargetFrameContentContextual.PrestigeBadge:SetAlpha(0)
-- Focus frames
--TargetFrame.FocusFrame.PVPIcon:SetAlpha(0)
--TargetFrame.FocusFrame.PrestigePortrait:SetAlpha(0)
--TargetFrame.FocusFrame.PrestigeBadge:SetAlpha(0)
end

if db.combatIndicator then
Expand Down Expand Up @@ -192,10 +200,22 @@ function module.SetChainStyle()
local chain = db.chainStyle

if chain == 1 then -- Rare
PlayerFrameTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Rare")
-- Set rare texture to player frame
PlayerFrame.PlayerFrameContainer.FrameTexture:SetAtlas("ui-hud-unitframe-target-portraiton-boss-rare-silver", TextureKitConstants.UseAtlasSize);
PlayerFrame.PlayerFrameContainer.FrameTexture:SetTexCoord(1, 0, 1, 0);

PlayerFrame.PlayerFrameContainer.FrameTexture:SetPoint("TOPLEFT", 11, -8);
elseif chain == 2 then -- Elite
PlayerFrameTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Elite")
-- Set rare texture to player frame
PlayerFrame.PlayerFrameContainer.FrameTexture:SetAtlas("UI-HUD-UnitFrame-Target-PortraitOn-Boss-Gold", TextureKitConstants.UseAtlasSize);
PlayerFrame.PlayerFrameContainer.FrameTexture:SetTexCoord(1, 0, 1, 0);

PlayerFrame.PlayerFrameContainer.FrameTexture:SetPoint("TOPLEFT", 11, -8);
elseif chain == 3 then -- Rare Elite
PlayerFrameTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Rare-Elite")
-- Set rare texture to player frame
PlayerFrame.PlayerFrameContainer.FrameTexture:SetAtlas("UI-HUD-UnitFrame-Target-PortraitOn-Boss-Gold-Winged", TextureKitConstants.UseAtlasSize);
PlayerFrame.PlayerFrameContainer.FrameTexture:SetTexCoord(1, 0, 1, 0);

PlayerFrame.PlayerFrameContainer.FrameTexture:SetPoint("TOPLEFT", -8, -8);
end
end
4 changes: 2 additions & 2 deletions XarMods.toc → XarMods_Mainline.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 90205
## Interface: 100002
## Title: |cff00c0ffXarMods|r
## Author: Stako
## Author: Stako, Hamsti
## Version: 1.2
## SavedVariables: XarModsDB

Expand Down
Loading

0 comments on commit 9bd85a7

Please sign in to comment.