Shakti
09-29-2004, 06:15 PM
Basically, I got tired of looking at ALT, CTR and SHI on all of the additional skill bars in Cosmos, and while it is nice to be able to hide all of the key-binds, a la PopBar, I would prefer to be able to see what key is used in conjunction with the modifiers for that particular skill bar.
At least, this makes sense the way I have my skills set up. If someone uses multiple modifiers on the same bar (God knows why), then this is not helpful.
I would like to see this added as an option in Cosmos. It could be taken a step further, with the full modifier displayed for each skill bar ONCE, and then the key for each button displayed on the button itself.
For now, I just changed the UpdateHotKeys event in each of the three skill bar add-ons.
PopBarButton.lua [L583]
function PopBarButton_UpdateHotkeys(actionButtonType,button )
if ( not actionButtonType ) then
actionButtonType = "POPBARBUTTON";
end
if (not button) then
button = this;
end
local hotkey = getglobal(button:GetName().."HotKey");
local action = PopBarButton_GetBindID(button); --actionButtonType..button:GetID();
if (hotkey) then
if (PopBar_Config.HideKeys==1) then
hotkey:SetText("");
else
if (action) then
-- KHAOS // Don't display modifier keys.
local hotkeytext = KeyBindingFrame_GetLocalizedName(GetBindingKey(act ion), "KEY_");
local plusindex = string.find(hotkeytext, "-", -2);
if ( (string.len(hotkeytext) > 1) and plusindex ) then
hotkeytext = string.sub(hotkeytext, plusindex + 1);
end
hotkey:SetText(hotkeytext);
-- KHAOS::END // Don't display modifier keys.
else
hotkey:SetText("");
end
end
end
end
SecondActionButton.lua [L71]
function SecondActionButton_UpdateHotkeys(actionButtonType)
if ( not actionButtonType ) then
actionButtonType = "SECONDACTIONBUTTON";
end
local hotkey = getglobal(this:GetName().."HotKey");
local action = actionButtonType..this:GetID();
-- KHAOS // Don't display modifier keys.
local hotkeytext = KeyBindingFrame_GetLocalizedName(GetBindingKey(act ion), "KEY_");
local plusindex = string.find(hotkeytext, "-", -2);
if ( (string.len(hotkeytext) > 1) and plusindex ) then
hotkeytext = string.sub(hotkeytext, plusindex + 1);
end
hotkey:SetText(hotkeytext);
-- KHAOS::END // Don't display modifier keys.
end
SideBarButton.lua [L111]
function SideBarButton_UpdateHotkeys(actionButtonType)
if ( not actionButtonType ) then
actionButtonType = string.upper(this:GetParent():GetName()).."ACTIONBUTTON";
end
local hotkey = getglobal(this:GetName().."HotKey");
local curID = this:GetID();
local checkedID = curID - 108;
if ((checkedID < 1) or (checkedID > 6)) then
checkedID = curID - 114;
end
if ((checkedID >= 1) and (checkedID <= 6)) then
local action = actionButtonType..checkedID;
-- KHAOS // Don't display modifier keys.
local hotkeytext = KeyBindingFrame_GetLocalizedName(GetBindingKey(act ion), "KEY_");
local plusindex = string.find(hotkeytext, "-", -2);
if ( (string.len(hotkeytext) > 1) and plusindex ) then
hotkeytext = string.sub(hotkeytext, plusindex + 1);
end
hotkey:SetText(hotkeytext);
-- KHAOS::END // Don't display modifier keys.
end
end
If anyone is inclined to implement this feature in their own install, simply replace the functions in the three files listed. I included line numbers based on the unedited beta distribution.
P.S. My first post here, and really my first time messing with the WoW UI, but expect to see more of me. :)
At least, this makes sense the way I have my skills set up. If someone uses multiple modifiers on the same bar (God knows why), then this is not helpful.
I would like to see this added as an option in Cosmos. It could be taken a step further, with the full modifier displayed for each skill bar ONCE, and then the key for each button displayed on the button itself.
For now, I just changed the UpdateHotKeys event in each of the three skill bar add-ons.
PopBarButton.lua [L583]
function PopBarButton_UpdateHotkeys(actionButtonType,button )
if ( not actionButtonType ) then
actionButtonType = "POPBARBUTTON";
end
if (not button) then
button = this;
end
local hotkey = getglobal(button:GetName().."HotKey");
local action = PopBarButton_GetBindID(button); --actionButtonType..button:GetID();
if (hotkey) then
if (PopBar_Config.HideKeys==1) then
hotkey:SetText("");
else
if (action) then
-- KHAOS // Don't display modifier keys.
local hotkeytext = KeyBindingFrame_GetLocalizedName(GetBindingKey(act ion), "KEY_");
local plusindex = string.find(hotkeytext, "-", -2);
if ( (string.len(hotkeytext) > 1) and plusindex ) then
hotkeytext = string.sub(hotkeytext, plusindex + 1);
end
hotkey:SetText(hotkeytext);
-- KHAOS::END // Don't display modifier keys.
else
hotkey:SetText("");
end
end
end
end
SecondActionButton.lua [L71]
function SecondActionButton_UpdateHotkeys(actionButtonType)
if ( not actionButtonType ) then
actionButtonType = "SECONDACTIONBUTTON";
end
local hotkey = getglobal(this:GetName().."HotKey");
local action = actionButtonType..this:GetID();
-- KHAOS // Don't display modifier keys.
local hotkeytext = KeyBindingFrame_GetLocalizedName(GetBindingKey(act ion), "KEY_");
local plusindex = string.find(hotkeytext, "-", -2);
if ( (string.len(hotkeytext) > 1) and plusindex ) then
hotkeytext = string.sub(hotkeytext, plusindex + 1);
end
hotkey:SetText(hotkeytext);
-- KHAOS::END // Don't display modifier keys.
end
SideBarButton.lua [L111]
function SideBarButton_UpdateHotkeys(actionButtonType)
if ( not actionButtonType ) then
actionButtonType = string.upper(this:GetParent():GetName()).."ACTIONBUTTON";
end
local hotkey = getglobal(this:GetName().."HotKey");
local curID = this:GetID();
local checkedID = curID - 108;
if ((checkedID < 1) or (checkedID > 6)) then
checkedID = curID - 114;
end
if ((checkedID >= 1) and (checkedID <= 6)) then
local action = actionButtonType..checkedID;
-- KHAOS // Don't display modifier keys.
local hotkeytext = KeyBindingFrame_GetLocalizedName(GetBindingKey(act ion), "KEY_");
local plusindex = string.find(hotkeytext, "-", -2);
if ( (string.len(hotkeytext) > 1) and plusindex ) then
hotkeytext = string.sub(hotkeytext, plusindex + 1);
end
hotkey:SetText(hotkeytext);
-- KHAOS::END // Don't display modifier keys.
end
end
If anyone is inclined to implement this feature in their own install, simply replace the functions in the three files listed. I included line numbers based on the unedited beta distribution.
P.S. My first post here, and really my first time messing with the WoW UI, but expect to see more of me. :)