Init
This commit is contained in:
32
Modules/ButtonIndicators.lua
Normal file
32
Modules/ButtonIndicators.lua
Normal file
@ -0,0 +1,32 @@
|
||||
--------------------------------------------------------------------------------
|
||||
-- # MODULES > BUTTON INDICATORS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local f = CreateFrame('Frame')
|
||||
f:RegisterEvent('PLAYER_ENTERING_WORLD')
|
||||
f:SetScript('OnEvent', function(self, event)
|
||||
hooksecurefunc('ActionButton_UpdateRangeIndicator', function(self, checksRange, inRange)
|
||||
local icon = self.icon
|
||||
|
||||
if self.action then
|
||||
local normalTexture = self.NormalTexture
|
||||
if not normalTexture then return end
|
||||
|
||||
local isUsable, notEnoughMana = IsUsableAction(self.action)
|
||||
if isUsable then
|
||||
icon:SetVertexColor(1, 1, 1)
|
||||
normalTexture:SetVertexColor(1, 1, 1)
|
||||
elseif notEnoughMana then
|
||||
icon:SetVertexColor(0.2, 0.2, 1)
|
||||
normalTexture:SetVertexColor(0.2, 0.2, 1)
|
||||
else
|
||||
icon:SetVertexColor(0.5, 0.5, 0.5)
|
||||
normalTexture:SetVertexColor(0.5, 0.5, 0.5)
|
||||
end
|
||||
|
||||
if checksRange and not inRange then
|
||||
icon:SetVertexColor(1, 0, 0)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
57
Modules/HotKeys.lua
Normal file
57
Modules/HotKeys.lua
Normal file
@ -0,0 +1,57 @@
|
||||
--------------------------------------------------------------------------------
|
||||
-- # MODULES > HOT KEYS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local f = CreateFrame('Frame')
|
||||
f:RegisterEvent('PLAYER_ENTERING_WORLD')
|
||||
f:RegisterEvent('UPDATE_BINDINGS')
|
||||
f:SetScript('OnEvent', function(self, event)
|
||||
local gsub = string.gsub
|
||||
local function UpdateHotkey(self)
|
||||
local alpha = 0.75
|
||||
local hotkey = _G[self:GetName()..'HotKey']
|
||||
local text = hotkey:GetText()
|
||||
if not text then return end
|
||||
|
||||
text = gsub(text, '(s%-)', 'S')
|
||||
text = gsub(text, '(a%-)', 'A')
|
||||
text = gsub(text, '(а%-)', 'A')
|
||||
text = gsub(text, '(c%-)', 'C')
|
||||
text = gsub(text, '(Mouse Button )', 'M')
|
||||
text = gsub(text, '(Кнопка мыши )', 'M')
|
||||
text = gsub(text, KEY_BUTTON3, 'M3')
|
||||
text = gsub(text, KEY_PAGEUP, 'PU')
|
||||
text = gsub(text, KEY_PAGEDOWN, 'PD')
|
||||
text = gsub(text, KEY_SPACE, 'SpB')
|
||||
text = gsub(text, KEY_INSERT, 'Ins')
|
||||
text = gsub(text, KEY_HOME, 'Hm')
|
||||
text = gsub(text, KEY_DELETE, 'Del')
|
||||
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_NUMLOCK, 'NuL')
|
||||
text = gsub(text, KEY_MOUSEWHEELDOWN, 'MWD')
|
||||
text = gsub(text, KEY_MOUSEWHEELUP, 'MWU')
|
||||
|
||||
hotkey:SetText(text)
|
||||
hotkey:SetAlpha(alpha)
|
||||
end
|
||||
|
||||
for i = 1, 12 do
|
||||
UpdateHotkey(_G['ActionButton'..i]) -- main bar
|
||||
UpdateHotkey(_G['MultiBarBottomLeftButton'..i]) -- bottom right bar
|
||||
UpdateHotkey(_G['MultiBarBottomRightButton'..i]) -- bottom left bar
|
||||
UpdateHotkey(_G['MultiBarLeftButton'..i]) -- right bar
|
||||
UpdateHotkey(_G['MultiBarRightButton'..i]) -- left bar
|
||||
UpdateHotkey(_G['MultiBar5Button'..i]) -- multi bar 5 (added in Dragonflight)
|
||||
UpdateHotkey(_G['MultiBar6Button'..i]) -- multi bar 6 (added in Dragonflight)
|
||||
UpdateHotkey(_G['MultiBar7Button'..i]) -- multi bar 7 (added in Dragonflight)
|
||||
end
|
||||
for i = 1, 10 do
|
||||
UpdateHotkey(_G['StanceButton'..i])
|
||||
UpdateHotkey(_G['PetActionButton'..i])
|
||||
end
|
||||
UpdateHotkey(ExtraActionButton1)
|
||||
end)
|
19
Modules/MacroNames.lua
Normal file
19
Modules/MacroNames.lua
Normal file
@ -0,0 +1,19 @@
|
||||
--------------------------------------------------------------------------------
|
||||
-- # MODULES > MACRO NAMES
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local f = CreateFrame('Frame')
|
||||
f:RegisterEvent('PLAYER_ENTERING_WORLD')
|
||||
f:SetScript('OnEvent', function(self, event)
|
||||
local macroNamesAlpha = 0
|
||||
for i = 1, 12 do
|
||||
_G['ActionButton'..i..'Name']:SetAlpha(macroNamesAlpha) -- main bar
|
||||
_G['MultiBarBottomRightButton'..i..'Name']:SetAlpha(macroNamesAlpha) -- bottom right bar
|
||||
_G['MultiBarBottomLeftButton'..i..'Name']:SetAlpha(macroNamesAlpha) -- bottom left bar
|
||||
_G['MultiBarRightButton'..i..'Name']:SetAlpha(macroNamesAlpha) -- right bar
|
||||
_G['MultiBarLeftButton'..i..'Name']:SetAlpha(macroNamesAlpha) -- left bar
|
||||
_G['MultiBar5Button'..i..'Name']:SetAlpha(macroNamesAlpha) -- multi bar 5 (added in Dragonflight)
|
||||
_G['MultiBar6Button'..i..'Name']:SetAlpha(macroNamesAlpha) -- multi bar 6 (added in Dragonflight)
|
||||
_G['MultiBar7Button'..i..'Name']:SetAlpha(macroNamesAlpha) -- multi bar 7 (added in Dragonflight)
|
||||
end
|
||||
end)
|
37
Modules/Style.lua
Normal file
37
Modules/Style.lua
Normal file
@ -0,0 +1,37 @@
|
||||
if IsAddOnLoaded("Masque") ~= true then return end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- # MODULES > STYLE
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local Masque = LibStub('Masque', true)
|
||||
assert(Masque, 'Masque not found')
|
||||
|
||||
local group = Masque:Group('KlazBars')
|
||||
|
||||
local function AddActionBarButtons()
|
||||
for _, name in pairs({
|
||||
'PetActionButton',
|
||||
'PossessButton',
|
||||
'StanceButton',
|
||||
'ActionButton',
|
||||
'MultiBarBottomLeftButton',
|
||||
'MultiBarBottomRightButton',
|
||||
'MultiBarLeftButton',
|
||||
'MultiBarRightButton',
|
||||
'MultiBar5Button',
|
||||
'MultiBar6Button',
|
||||
'MultiBar7Button',
|
||||
}) do
|
||||
for i = 1, 12 do
|
||||
local button = _G[name..i]
|
||||
if button then group:AddButton(button) end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local f = CreateFrame('Frame')
|
||||
f:RegisterEvent('PLAYER_ENTERING_WORLD')
|
||||
f:SetScript('OnEvent', function(self, event)
|
||||
AddActionBarButtons()
|
||||
end)
|
Reference in New Issue
Block a user