-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLabelMate.lua
32 lines (30 loc) · 1.04 KB
/
LabelMate.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--LabelMate--
--For use of changing hotkey labels--
local replace = string.gsub
local function updatehotkey(self, actionButtonType)
local hotkey = _G[self:GetName() .. 'HotKey']
local text = hotkey:GetText()
text = replace(text, 's%-', 'S')
text = replace(text, 'a%-', 'A')
text = replace(text, 'c%-', 'C')
text = replace(text, 'Mouse Button ', 'M')
text = replace(text, 'Mouse Wheel Up', 'MU')
text = replace(text, 'Mouse Wheel Down', 'MD')
text = replace(text, 'Middle Mouse', 'M3')
text = replace(text, 'Num Pad ', 'N')
text = replace(text, 'Page Up', 'PU')
text = replace(text, 'Page Down', 'PD')
text = replace(text, 'Spacebar', 'SpB')
text = replace(text, 'Insert', 'Ins')
text = replace(text, 'Home', 'Hm')
text = replace(text, 'Delete', 'Del')
if hotkey:GetText() == RANGE_INDICATOR then
hotkey:SetText('')
else
hotkey:SetText(text)
end
end
hooksecurefunc("ActionButton_UpdateHotkeys", updatehotkey)