Mercurial > wow > cyborg-mmo7
changeset 29:e8a004a4177b
Merged the ProfileKeyBindings and WowCommands variables (they were pointing at the same value).
author | madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09 |
---|---|
date | Thu, 25 Apr 2013 01:31:06 +0000 |
parents | d18ce89b6d09 |
children | ea423ee3a8c1 |
files | CyborgMMO7.lua Localisation.lua OptionView.lua RatPageModel.lua |
diffstat | 4 files changed, 9 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/CyborgMMO7.lua Thu Apr 25 01:31:01 2013 +0000 +++ b/CyborgMMO7.lua Thu Apr 25 01:31:06 2013 +0000 @@ -80,20 +80,12 @@ end end -function CyborgMMO_LoadWowCommands() - if not CyborgMMO_ProfileKeyBindings then - CyborgMMO_ProfileKeyBindings = CyborgMMO_DefaultWowCommands - end - CyborgMMO_WowCommands = CyborgMMO_ProfileKeyBindings -end - function CyborgMMO_GetSaveData() if VarsLoaded then if not CyborgMMO7SaveData then CyborgMMO7SaveData = {} CyborgMMO7SaveData[SaveName] = {} end - CyborgMMO_LoadWowCommands() return CyborgMMO7SaveData[SaveName] end return nil @@ -102,7 +94,6 @@ function CyborgMMO_SetSaveData(data, index) if VarsLoaded then CyborgMMO_GetSaveData()[index] = data - CyborgMMO_ProfileKeyBindings = CyborgMMO_WowCommands end end
--- a/Localisation.lua Thu Apr 25 01:31:01 2013 +0000 +++ b/Localisation.lua Thu Apr 25 01:31:06 2013 +0000 @@ -56,7 +56,7 @@ }, } -local DefaultWowCommands = { +local DefaultKeyBindings = { ["enUS"] = { "ALT-CTRL-NUMPAD1", "ALT-CTRL-NUMPAD2", @@ -440,9 +440,11 @@ local default_locale = 'enUS' CyborgMMO_Mode = Modes[locale] or Modes[default_locale] -CyborgMMO_DefaultWowCommands = DefaultWowCommands[locale] or DefaultWowCommands[default_locale] CyborgMMO_StringTable = StringTables[locale] or StringTables[default_locale] +-- key bindings are saved and will be replaced by SavedVariables +CyborgMMO_ProfileKeyBindings = DefaultKeyBindings[locale] or DefaultKeyBindings[default_locale] + if locale ~= default_locale then setmetatable(CyborgMMO_StringTable, {__index=StringTables[default_locale]}) end
--- a/OptionView.lua Thu Apr 25 01:31:01 2013 +0000 +++ b/OptionView.lua Thu Apr 25 01:31:06 2013 +0000 @@ -39,16 +39,12 @@ local buttonStr = CyborgMMO_StringTable[("CyborgMMO_OptionPageRebindMouseRow"..index.."Name")] CyborgMMO_BindingFrameButtonName:SetText(buttonStr.." Mode "..mode) - CyborgMMO_BindingFrameKey:SetText(CyborgMMO_StringTable["CyborgMMO_CurrentBinding"].." "..CyborgMMO_WowCommands[CyborgMMO_GetButtonIndex(lastButton)]) + CyborgMMO_BindingFrameKey:SetText(CyborgMMO_StringTable["CyborgMMO_CurrentBinding"].." "..CyborgMMO_ProfileKeyBindings[CyborgMMO_GetButtonIndex(lastButton)]) CyborgMMO_BindingFrame:Show() end function CyborgMMO_SetBindingButtonText(name) - if not CyborgMMO_WowCommands then - CyborgMMO_LoadWowCommands() - end - - local binding = CyborgMMO_WowCommands[CyborgMMO_GetButtonIndex(name)] + local binding = CyborgMMO_ProfileKeyBindings[CyborgMMO_GetButtonIndex(name)] getglobal(name):SetText(binding) end @@ -83,7 +79,7 @@ end function CyborgMMO_SetNewKeybind(keyOrButton) - CyborgMMO_WowCommands[CyborgMMO_GetButtonIndex(lastButton)] = keyOrButton + CyborgMMO_ProfileKeyBindings[CyborgMMO_GetButtonIndex(lastButton)] = keyOrButton CyborgMMO_SetBindingButtonText(lastButton) CyborgMMO_BindingFrame:Hide() CyborgMMO_RatPageModel:LoadData()
--- a/RatPageModel.lua Thu Apr 25 01:31:01 2013 +0000 +++ b/RatPageModel.lua Thu Apr 25 01:31:06 2013 +0000 @@ -121,7 +121,7 @@ self.data[mode][button] = object if object then - object:SetBinding(CyborgMMO_WowCommands[((mode-1)*RAT7.BUTTONS)+button]) + object:SetBinding(CyborgMMO_ProfileKeyBindings[((mode-1)*RAT7.BUTTONS)+button]) if("callback" == object.Type) then CyborgMMO_DPrint("trying to set texture") local slot = getglobal("CyborgMMO_MainPageSlotListSlot"..button) @@ -129,7 +129,7 @@ end else CyborgMMO_DPrint("clearing "..button) - CyborgMMO_ClearBinding(CyborgMMO_WowCommands[((mode-1)*RAT7.BUTTONS)+button]) + CyborgMMO_ClearBinding(CyborgMMO_ProfileKeyBindings[((mode-1)*RAT7.BUTTONS)+button]) end end