# HG changeset patch # User madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09 # Date 1367623498 0 # Node ID adba10dfa908c11a779c99e16aef481b9de4cd96 # Parent a710bedc1ec4f78bf391fcd0fa0da022d4fa9aa9 Implemented the "Defaults" button for the key bindings options subpage. diff -r a710bedc1ec4 -r adba10dfa908 CyborgMMO7.lua --- a/CyborgMMO7.lua Fri May 03 23:24:53 2013 +0000 +++ b/CyborgMMO7.lua Fri May 03 23:24:58 2013 +0000 @@ -430,6 +430,15 @@ CyborgMMO_SetCyborgHeadButton(true) end +function CyborgMMO_SetDefaultKeyBindings() + for mode=1,RAT7.MODES do + for button=1,RAT7.BUTTONS do + local k = (mode - 1) * RAT7.BUTTONS + button + CyborgMMO_ProfileKeyBindings[k] = CyborgMMO_DefaultKeyBindings[k] + CyborgMMO_SetBindingButtonText(string.format("CyborgMMO_OptionPageRebindMouseRow%XMode%d", button, mode)) + end + end +end function CyborgMMO_SetupModeCallbacks(modeNum) local fn = function() diff -r a710bedc1ec4 -r adba10dfa908 Localisation.lua --- a/Localisation.lua Fri May 03 23:24:53 2013 +0000 +++ b/Localisation.lua Fri May 03 23:24:58 2013 +0000 @@ -437,7 +437,11 @@ 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] +CyborgMMO_DefaultKeyBindings = DefaultKeyBindings[locale] or DefaultKeyBindings[default_locale] +CyborgMMO_ProfileKeyBindings = {} +for k,v in pairs(CyborgMMO_DefaultKeyBindings) do + CyborgMMO_ProfileKeyBindings[k] = v +end if locale ~= default_locale then setmetatable(CyborgMMO_StringTable, {__index=StringTables[default_locale]}) diff -r a710bedc1ec4 -r adba10dfa908 OptionPage.xml --- a/OptionPage.xml Fri May 03 23:24:53 2013 +0000 +++ b/OptionPage.xml Fri May 03 23:24:58 2013 +0000 @@ -494,6 +494,7 @@ self.name = "Rebind keys" self.parent = CyborgMMO_OptionPage + self.default = CyborgMMO_SetDefaultKeyBindings InterfaceOptions_AddCategory(self)