Mercurial > wow > cyborg-mmo7
diff OptionView.lua @ 5:8428fa7cf0e4
Updated the profile to use macros and rename all the variables and functions with the prefix CyborgMMO. Added a tooltip to inform the user to assign the profile.
author | madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09 |
---|---|
date | Tue, 29 May 2012 10:26:40 +0000 |
parents | d186f8cd5000 |
children | 6cb9a2936580 |
line wrap: on
line diff
--- a/OptionView.lua Mon May 28 15:54:52 2012 +0000 +++ b/OptionView.lua Tue May 29 10:26:40 2012 +0000 @@ -37,20 +37,20 @@ mode = mode + 1 index = index - 13 end - local buttonStr = StringTable[("CyborgMMO_OptionPageRebindMouseRow"..index.."Name")] + local buttonStr = CyborgMMO_StringTable[("CyborgMMO_OptionPageRebindMouseRow"..index.."Name")] getglobal("CyborgMMO_BindingFrameButtonName"):SetText(buttonStr.." Mode "..mode) - getglobal("CyborgMMO_BindingFrameKey"):SetText(StringTable["CyborgMMO_CurrentBinding"].." "..WowCommands[CyborgMMO_GetButtonIndex(lastButton)]) + getglobal("CyborgMMO_BindingFrameKey"):SetText(CyborgMMO_StringTable["CyborgMMO_CurrentBinding"].." "..CyborgMMO_WowCommands[CyborgMMO_GetButtonIndex(lastButton)]) CyborgMMO_BindingFrame:Show() end function CyborgMMO_GetBindingButtonText(name) - if(nil == WowCommands) then + if(nil == CyborgMMO_WowCommands) then CyborgMMO_LoadWowCommands(); end - local binding = WowCommands[CyborgMMO_GetButtonIndex(name)] + local binding = CyborgMMO_WowCommands[CyborgMMO_GetButtonIndex(name)] getglobal(name):SetText(binding) end @@ -61,6 +61,27 @@ return (CyborgMMO_GetNumberFromHexLetter(rowStr) + ((CyborgMMO_GetNumberFromHexLetter(modeStr) - 1) * 13)) end +function CyborgMMO_ShowProfileTooltip(self) + local red, green, blue, _ = self:GetVertexColor() + if((red == 0) and (green == 0) and (blue == 0)) then + GameTooltip:SetOwner(self:GetParent(), "ANCHOR_RIGHT"); + GameTooltip:SetText(CyborgMMO_StringTable["CyborgMMO_ToolTipLine1"], nil, nil, nil, nil, 1); + GameTooltip:AddLine(nil, 0.8, 1.0, 0.8); + GameTooltip:AddLine(CyborgMMO_StringTable["CyborgMMO_ToolTipLine2"], 0.8, 1.0, 0.8); + GameTooltip:AddLine(nil, 0.8, 1.0, 0.8); + GameTooltip:AddLine(CyborgMMO_StringTable["CyborgMMO_ToolTipLine3"], 0.8, 1.0, 0.8); + GameTooltip:AddLine(CyborgMMO_StringTable["CyborgMMO_ToolTipLine4"], 0.8, 1.0, 0.8); + GameTooltip:AddLine(CyborgMMO_StringTable["CyborgMMO_ToolTipLine5"], 0.8, 1.0, 0.8); + GameTooltip:AddLine(nil, 0.8, 1.0, 0.8); + GameTooltip:AddLine(CyborgMMO_StringTable["CyborgMMO_ToolTipLine6"], 0.8, 1.0, 0.8); + GameTooltip:Show(); + end +end + +function CyborgMMO_HideProfileTooltip(self) + GameTooltip:Hide(); +end + function CyborgMMO_GetNumberFromHexLetter(str) local number = 0 if("A" == str) then @@ -82,8 +103,8 @@ end function CyborgMMO_SetNewKeybind(keyOrButton) - local previous = WowCommands[CyborgMMO_GetButtonIndex(lastButton)] - WowCommands[CyborgMMO_GetButtonIndex(lastButton)] = keyOrButton; + local previous = CyborgMMO_WowCommands[CyborgMMO_GetButtonIndex(lastButton)] + CyborgMMO_WowCommands[CyborgMMO_GetButtonIndex(lastButton)] = keyOrButton; CyborgMMO_GetBindingButtonText(lastButton); CyborgMMO_BindingFrame:Hide() CyborgMMO_RatPageModel.Instance().LoadData()