diff --git a/BeStride.lua b/BeStride.lua index faf4298..17253d9 100644 --- a/BeStride.lua +++ b/BeStride.lua @@ -42,48 +42,52 @@ local defaults = { profile = { settings = { - ["emptyrandom"] = true, --ER - ["hasmount"] = false, --HM - ["enablenew"] = false, --ENABLENEW - ["useflyingmount"] = false, - ["forceflyingmount"] = false, --FFM - ["nodismountwhileflying"] = false, --NDWF - ["flyingbroom"] = false, - ["telaari"] = true, - ["repair"] = { - ["use"] = false, - ["force"] = false, - ["durability"] = 20, + migrated = false, + bindingsMigrated = false, + mount = { + emptyrandom = true, --ER + hasmount = false, --HM + enablenew = false, --ENABLENEW + useflyingmount = false, + forceflyingmount = false, --FFM + nodismountwhileflying = false, --NDWF + flyingbroom = false, + telaari = true, + repair = { + use = false, + force = false, + durability = 20, + }, }, - ["classes"] = { - ["deathknight"] = { - ["wraithwalk"] = true, + classes = { + deathknight = { + wraithwalk = true, }, - ["druid"] = { - ["flightform"] = true, - ["traveltotravel"] = false, - ["flightformpriority"] = false, - ["mountedtoflightform"] = false, + druid = { + flightform = true, + traveltotravel = false, + flightformpriority = false, + mountedtoflightform = false, }, - ["mage"] = { - ["blink"] = true, - ["slowfall"] = true, + mage = { + blink = true, + slowfall = true, }, - ["monk"] = { - ["roll"] = true, - ["zenflight"] = true, + monk = { + roll = true, + zenflight = true, }, - ["paladin"] = { - ["steed"] = true, + paladin = { + steed = true, }, - ["priest"] = { - ["levitate"] = true, + priest = { + levitate = true, }, - ["rogue"] = { - ["sprint"] = true, + rogue = { + sprint = true, }, - ["shaman"] = { - ["ghostwolf"] = true, + shaman = { + ghostwolf = true, }, }, }, @@ -112,13 +116,9 @@ function BeStride:OnInitialize() ["passenger"] = nil, } - --self.buttons["mount"] = BeStride_ABMountMount self.buttons["regular"] = BeStride:CreateActionButton('Regular') - --self.buttons["ground"] = BeStride_ABGroundMount self.buttons["ground"] = BeStride:CreateActionButton('Ground') - --self.buttons["repair"] = BeStride_ABRepairMount self.buttons["repair"] = BeStride:CreateActionButton('Repair') - --self.buttons["passenger"] = BeStride_ABPassengerMount self.buttons["passenger"] = BeStride:CreateActionButton('Passenger') local className,classFilename,classID = UnitClass("player") @@ -152,7 +152,7 @@ function BeStride:OnEnable() self:RegisterEvent("UPDATE_BINDINGS", "UpdateBindings") self:RegisterEvent("NEW_MOUNT_ADDED", "NewMount") - BeStride:UpdateBindings() + --BeStride:UpdateBindings() BeStride:Upgrade() end @@ -161,7 +161,7 @@ function BeStride:NewMount(...) table.foreach(args,function (k,v) print("Arg: " .. k) end) end -function BeStride:UpdateBindings() +function BeStride:UpdateOverrideBindings() BeStride:SetKeyBindingsOverrides(self.buttons["regular"]) BeStride:SetKeyBindingsOverrides(self.buttons["ground"]) BeStride:SetKeyBindingsOverrides(self.buttons["passenger"]) @@ -173,47 +173,64 @@ end function BeStride:Upgrade() local db = LibStub("AceDB-3.0"):New("BestrideDB") - if db.profile.settings then + + if self.db.profile.settings.bindingsMigrated == false then + table.foreach({BeStride_ABRegularMount,BeStride_ABGroundMount,BeStride_ABPassengerMount,BeStride_ABRepairMount},function (key,button) + BeStride_Debug:Debug("Start Set Bindings: " .. button:GetName()) + local primaryKey,secondaryKey = GetBindingKey(button:GetName()) + if primaryKey then + SetBindingClick(primaryKey,button:GetName()) + end + + if secondaryKey then + SetBindingClick(secondaryKey,button:GetName()) + end + BeStride_Debug:Debug("End Set Bindings") + end) + end + self.db.profile.settings.bindingsMigrated = true + + if db.profile.settings and self.db.profile.settings.migrated == false then print("Old Settings Exist, Upgrading") table.foreach(db.profile.settings,function (key,value) if key == "HM" then - self.db.profile.settings.hasmount = value + self.db.profile.settings.mount.hasmount = value elseif key == "ER" then - self.db.profile.settings.emptyrandom = value + self.db.profile.settings.mount.emptyrandom = value elseif key == "FBP" then - self.db.profile.settings.flyingbroom = value + self.db.profile.settings.mount.flyingbroom = value elseif key == "TTT" then - self.db.profile.settings.druid.traveltotravel = value + self.db.profile.settings.mount.druid.traveltotravel = value elseif key == "MTFF" then - self.db.profile.settings.druid.mountedtoflightform = value + self.db.profile.settings.mount.druid.mountedtoflightform = value elseif key == "NDWF" then - self.db.profile.settings.nodismountwhileflying = value + self.db.profile.settings.mount.nodismountwhileflying = value elseif key == "FFM" then - self.db.profile.settings.useflyingmount = value + self.db.profile.settings.mount.useflyingmount = value elseif key == "URM" then - self.db.profile.settings.repair.use = value + self.db.profile.settings.mount.repair.use = value elseif key == "ENABLENEW" then - self.db.profile.settings.enablenew = value + self.db.profile.settings.mount.enablenew = value elseif key == "TELAARI" then - self.db.profile.settings.telaari = value + self.db.profile.settings.mount.telaari = value elseif key == "DEATHKNIGHT" then - self.db.profile.settings.deathknight.wraithwalk = value + self.db.profile.settings.classes.deathknight.wraithwalk = value elseif key == "PALADIN" then - self.db.profile.settings.paladin.steed = value + self.db.profile.settings.classes.paladin.steed = value elseif key == "SHAMAN" then - self.db.profile.settings.shaman.ghostwolf = value + self.db.profile.settings.classes.shaman.ghostwolf = value elseif key == "MONK" then - self.db.profile.settings.monk.roll = value + self.db.profile.settings.classes.monk.roll = value elseif key == "MONKZENUSE" then - self.db.profile.settings.monk.zenflight = value + self.db.profile.settings.classes.monk.zenflight = value elseif key == "ROGUE" then - self.db.profile.settings.rogue.sprint = value + self.db.profile.settings.classes.rogue.sprint = value elseif key == "PRIEST" then - self.db.profile.settings.levitate = value + self.db.profile.settings.classes.levitate = value elseif key == "MAGE" then - self.db.profile.settings.mage.slowfall = value - self.db.profile.settings.mage.blink = value + self.db.profile.settings.classes.mage.slowfall = value + self.db.profile.settings.classes.mage.blink = value end end) @@ -234,6 +251,8 @@ function BeStride:Upgrade() end end) end + + self.db.profile.settings.migrated = true end function BeStride:SetKeyBindings(button) @@ -276,15 +295,15 @@ function BeStride:ChatCommand(input) elseif input == "map" then BeStride:GetMaps() elseif input == "testpathwalk" then - print("Path: settings.emptyrandom (" .. tostring(BeStride:DBGet("settings.emptyrandom")) ..")") - BeStride:DBSet("settings.emptyrandom",false) - print("Path: settings.emptyrandom (" .. tostring(BeStride:DBGet("settings.emptyrandom")) ..")") - print("Path: settings.repair.durability (" .. tostring(BeStride:DBGet("settings.repair.durability")) ..")") - BeStride:DBSet("settings.repair.durability",50) - print("Path: settings.repair.durability (" .. tostring(BeStride:DBGet("settings.repair.durability")) ..")") - print("Path: settings.repair.dura (" .. tostring(BeStride:DBGet("settings.repair.dura")) ..")") - BeStride:DBSet("settings.repair.dura",50) - print("Path: settings.repair.dura (" .. tostring(BeStride:DBGet("settings.repair.dura")) ..")") + print("Path: settings.mount.emptyrandom (" .. tostring(BeStride:DBGet("settings.emptyrandom")) ..")") + BeStride:DBSet("settings.mount.emptyrandom",false) + print("Path: settings.mount.emptyrandom (" .. tostring(BeStride:DBGet("settings.emptyrandom")) ..")") + print("Path: settings.mount.repair.durability (" .. tostring(BeStride:DBGet("settings.repair.durability")) ..")") + BeStride:DBSet("settings.mount.repair.durability",50) + print("Path: settings.mount.repair.durability (" .. tostring(BeStride:DBGet("settings.repair.durability")) ..")") + print("Path: settings.mount.repair.dura (" .. tostring(BeStride:DBGet("settings.repair.dura")) ..")") + BeStride:DBSet("settings.mount.repair.dura",50) + print("Path: settings.mount.repair.dura (" .. tostring(BeStride:DBGet("settings.repair.dura")) ..")") else BeStride_GUI:Frame(input) end @@ -314,23 +333,24 @@ end function BeStride:DBGet(path,parent) local child,nextPath = strsplit(".",path,2) - if child ~= nil and parent ~= nil and nextPath == nil then - if parent[child] ~= nil then - return parent[child] - else - return nil - end + if child ~= nil and parent ~= nil and parent[child] ~= nil and nextPath == nil then + return parent[child] elseif child ~= nil and parent ~= nil and parent[child] ~= nil and nextPath ~= nil then + --BeStride_Debug:Debug("Return: BeStride:DBGet(" .. nextPath .. "parent[" .. child .. "]" .. ")") return BeStride:DBGet(nextPath,parent[child]) elseif child ~= nil and parent == nil and nextPath == nil then + --BeStride_Debug:Debug("Return: self.db.profile[child]:" .. tostring(self.db.profile[child])) return self.db.profile[child] elseif child ~= nil and parent == nil and nextPath ~= nil then if self.db.profile[child] ~= nil then + --BeStride_Debug:Debug("Return: BeStride:DBGet(" .. nextPath .. ",self.db.profile[" .. child .. "]" .. ")") return BeStride:DBGet(nextPath,self.db.profile[child]) else + BeStride_Debug:Debug("Fatal: self.db.profile[child(" .. child .. ")] == nil") return nil end else + BeStride_Debug:Debug("Fatal: Unmatch") return nil end end @@ -369,22 +389,12 @@ function BeStride:DBSetMount(mountType,mountID,value) self.db.profile.mounts[mountType][mountID] = value end -function BeStride:DBGetSetting(parent,setting) - if parent and self.db.profile.settings[parent] ~= nil and self.db.profile.settings[parent][setting] ~= nil then - return self.db.profile.settings[parent][setting] - elseif self.db.profile.settings[setting] ~= nil then - return self.db.profile.settings[setting] - else - return nil - end +function BeStride:DBGetSetting(setting) + return self:DBGet("settings." .. setting) end -function BeStride:DBSetSetting(parent,setting, value) - if parent and self.db.profile.settings[parent] ~= nil then - self.db.profile.settings[parent][setting] = value - elseif self.db.profile.settings[setting] ~= nil then - self.db.profile.settings[setting] = value - end +function BeStride:DBSetSetting(setting, value) + return self:DBSet("settings." .. setting,value) end function BeStride:DBGetClassSetting(parent,setting) diff --git a/BeStride_Constants.lua b/BeStride_Constants.lua index 7e73276..7b29c5c 100644 --- a/BeStride_Constants.lua +++ b/BeStride_Constants.lua @@ -23,33 +23,33 @@ BeStride_Constants = { }, Classes = { { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.DeathKnight.WraithWalk,class="deathknight",dbvalue="wraithwalk"}, + {name="classes.deathknight.wraithwalk",element="CheckBox",label=BeStride_Locale.Settings.Classes.DeathKnight.WraithWalk,class="deathknight",dbvalue="wraithwalk"}, }, { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.FlightForm,class="druid",dbvalue="flightform", dependants = {"classes.druid.traveltotravel","classes.druid.flightformpriority","classes.druid.mountedtoflightform"}}, - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.TravelToTravel,class="druid",dbvalue="traveltotravel", depends = {"classes.druid.flightform"}}, - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.FlightFormPriority,class="druid",dbvalue="flightformpriority", depends = {"classes.druid.flightform"}}, - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.MountedToFlightForm,class="druid",dbvalue="mountedtoflightform", depends = {"classes.druid.flightform"}}, + {name="classes.druid.flightform",element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.FlightForm,class="druid",dbvalue="flightform", dependants = {"classes.druid.traveltotravel","classes.druid.flightformpriority","classes.druid.mountedtoflightform"}}, + {name="classes.druid.traveltotravel",element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.TravelToTravel,class="druid",dbvalue="traveltotravel", depends = {"classes.druid.flightform"}}, + {name="classes.druid.traveltotravel",element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.FlightFormPriority,class="druid",dbvalue="flightformpriority", depends = {"classes.druid.flightform"}}, + {name="classes.druid.traveltotravel",element="CheckBox",label=BeStride_Locale.Settings.Classes.Druid.MountedToFlightForm,class="druid",dbvalue="mountedtoflightform", depends = {"classes.druid.flightform"}}, }, { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Mage.SlowFall,class="mage",dbvalue="slowfall"}, - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Mage.Blink,class="mage",dbvalue="blink"}, + {name="classes.mage.slowfall",element="CheckBox",label=BeStride_Locale.Settings.Classes.Mage.SlowFall,class="mage",dbvalue="slowfall"}, + {name="classes.mage.blink",element="CheckBox",label=BeStride_Locale.Settings.Classes.Mage.Blink,class="mage",dbvalue="blink"}, }, { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Monk.Roll,class="monk",dbvalue="roll"}, - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Monk.Roll,class="monk",dbvalue="zenflight"}, + {name="classes.monk.roll",element="CheckBox",label=BeStride_Locale.Settings.Classes.Monk.Roll,class="monk",dbvalue="roll"}, + {name="classes.monk.zenflight",element="CheckBox",label=BeStride_Locale.Settings.Classes.Monk.Roll,class="monk",dbvalue="zenflight"}, }, { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Paladin.DivineSteed,class="paladin",dbvalue="steed"}, + {name="classes.paladin.steed",element="CheckBox",label=BeStride_Locale.Settings.Classes.Paladin.DivineSteed,class="paladin",dbvalue="steed"}, }, { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Priest.Levitate,class="priest",dbvalue="levitate"}, + {name="classes.priest.levitate",element="CheckBox",label=BeStride_Locale.Settings.Classes.Priest.Levitate,class="priest",dbvalue="levitate"}, }, { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Rogue.Sprint,class="rogue",dbvalue="sprint"}, + {name="classes.rogue.sprint",element="CheckBox",label=BeStride_Locale.Settings.Classes.Rogue.Sprint,class="rogue",dbvalue="sprint"}, }, { - {element="CheckBox",label=BeStride_Locale.Settings.Classes.Shaman.GhostWolf,class="shaman",dbvalue="ghostwolf"}, + {name="classes.shaman.ghostwolf",element="CheckBox",label=BeStride_Locale.Settings.Classes.Shaman.GhostWolf,class="shaman",dbvalue="ghostwolf"}, }, } } diff --git a/BeStride_GUI.lua b/BeStride_GUI.lua index 95001f5..16e2cc8 100644 --- a/BeStride_GUI.lua +++ b/BeStride_GUI.lua @@ -3,6 +3,7 @@ local AceGUI = LibStub("AceGUI-3.0") local BeStride_Frame = nil BeStride_GUI = { + buttons = {}, elements = {} } @@ -65,7 +66,7 @@ function BeStride_GUI:SelectTab(container, event, group)-- Callback function for elseif group == "classoptions" then BeStride_GUI:DrawClassOptionTab(container) elseif group == "keybinds" then - --BeStride_GUI:DrawKeybindsTab(container) + BeStride_GUI:DrawKeybindsTab(container) elseif group == "profile" then --BeStride_GUI:DrawProfileTab(container) elseif group == "about" then @@ -73,7 +74,7 @@ function BeStride_GUI:SelectTab(container, event, group)-- Callback function for BeStride_GUI:DrawAboutTab(container) end - BeStride_Debug:Debug("Group: " .. group) + --BeStride_Debug:Debug("Group: " .. group) currentTab = group end @@ -173,19 +174,19 @@ function BeStride_GUI:DrawMountOptionTab(container, parent) for name,setting in pairs(BeStride_Constants.Settings.Mount) do local element = nil if setting.element == "CheckBox" then - element = self:CreateSettingCheckBox(setting.name,setting.label,parent,setting.dbvalue) + element = self:CreateSettingCheckBox(setting.name,setting.label,setting.depends) elseif setting.element == "Slider" then - element = self:CreateSettingSlider(setting.name,setting.label,parent,setting.dbvalue,setting.minDurability,setting.maxDurability,setting.increment,setting.disabled) + element = self:CreateSettingSlider(setting.name,setting.label,setting.minDurability,setting.maxDurability,setting.increment,setting.disabled,setting.depends) elseif setting.element == "Group" and setting.children then element = AceGUI:Create("SimpleGroup") element:SetFullWidth(true) for subName,subSetting in pairs(setting.children) do - print(" SubName: " .. subName) + --print(" SubName: " .. subName) local subElement = nil if subSetting.element == "CheckBox" then - subElement = self:CreateSettingCheckBox(subSetting.name,subSetting.label,setting.dbvalue,subSetting.dbvalue) + subElement = self:CreateSettingCheckBox(subSetting.name,subSetting.label,subSetting.depends) elseif subSetting.element == "Slider" then - subElement = self:CreateSettingSlider(subSetting.name,subSetting.label,setting.dbvalue,subSetting.dbvalue,subSetting.minDurability,subSetting.maxDurability,subSetting.increment,subSetting.disabled) + subElement = self:CreateSettingSlider(subSetting.name,subSetting.label,subSetting.minDurability,subSetting.maxDurability,subSetting.increment,subSetting.depends) end element:AddChild(subElement) end @@ -197,38 +198,58 @@ function BeStride_GUI:DrawMountOptionTab(container, parent) end end -function BeStride_GUI:CreateSettingCheckBox(name,label,parent,setting) +function BeStride_GUI:CreateSettingCheckBox(name,label,depends) local element = AceGUI:Create("CheckBox") element:SetLabel(label) - element:SetValue(BeStride:DBGetSetting(parent,setting)) + element:SetValue(BeStride:DBGetSetting(name)) element:SetFullWidth(true) - element:SetCallback("OnValueChanged",function (container) BeStride:DBSetSetting(parent,setting,container:GetValue()) end) + element:SetCallback("OnValueChanged",function (container) BeStride:DBSetSetting(name,container:GetValue()) end) - if setting.depends then + if depends ~= nil then local disabled = nil - for key,value in pairs(setting.depends) do + for key,value in pairs(depends) do if disabled == nil then - disabled = self.elements[value]:GetValue() + print("Depends Value: " .. tostring(BeStride:DBGetSetting(value))) + disabled = BeStride:DBGetSetting(value) + else - bit.band(disabled,self.elements[value]:GetValue()) + print("Depends Value: " .. tostring(BeStride:DBGetSetting(value))) + disabled = bit.band(disabled,BeStride:DBGetSetting(value)) end + print("DisabledCheck: " .. name .. ":" .. tostring(disabled)) end - element.SetDisabled(disabled) + element:SetDisabled(not disabled) end - print("Setting: " .. tostring(name) .. " Label: " .. label) self.elements[name] = element return element end -function BeStride_GUI:CreateSettingSlider(name,label,parent,setting,minValue,maxValue,increment,disabled) +function BeStride_GUI:CreateSettingSlider(name,label,minValue,maxValue,increment,depends) local element = AceGUI:Create("Slider") element:SetLabel(label) - element:SetValue(BeStride:DBGetSetting(parent,setting)) + element:SetValue(BeStride:DBGetSetting(name)) element:SetFullWidth(true) element:SetSliderValues(minValue,maxValue,increment) - element:SetCallback("OnMouseUp",function (container) BeStride:DBSetSetting(parent,setting,container:GetValue()) end) + element:SetCallback("OnMouseUp",function (container) BeStride:DBSetSetting(name,container:GetValue()) end) + if depends ~= nil then + local disabled = nil + for key,value in pairs(depends) do + if disabled == nil then + print("Depends Value: " .. tostring(BeStride:DBGetSetting(value))) + disabled = BeStride:DBGetSetting(value) + + else + print("Depends Value: " .. tostring(BeStride:DBGetSetting(value))) + disabled = bit.band(disabled,BeStride:DBGetSetting(value)) + end + print("DisabledCheck: " .. name .. ":" .. tostring(disabled)) + end + + element:SetDisabled(not disabled) + end + self.elements[name] = element return element end @@ -240,9 +261,9 @@ function BeStride_GUI:DrawClassOptionTab(container) for name,setting in pairs(classSetting) do if setting.element == "CheckBox" then - element = self:CreateClassSettingCheckBox(setting.label,setting.class,setting.dbvalue) + element = self:CreateClassSettingCheckBox(setting.name,setting.label) elseif setting.element == "Slider" then - element = self:CreateClassSettingSlider(setting.label,setting.class,setting.dbvalue,setting.minDurability,setting.maxDurability,setting.increment) + element = self:CreateClassSettingSlider(setting.name,setting.label,setting.minDurability,setting.maxDurability,setting.increment) end if element ~= nil then @@ -253,12 +274,12 @@ function BeStride_GUI:DrawClassOptionTab(container) end) end -function BeStride_GUI:CreateClassSettingCheckBox(label,parent,setting) +function BeStride_GUI:CreateClassSettingCheckBox(name,label) local element = AceGUI:Create("CheckBox") element:SetLabel(label) - element:SetValue(BeStride:DBGetClassSetting(parent,setting)) + element:SetValue(BeStride:DBGetSetting(name)) element:SetFullWidth(true) - element:SetCallback("OnValueChanged",function (container) BeStride:DBSetClassSetting(parent,setting,container:GetValue()) end) + element:SetCallback("OnValueChanged",function (container) BeStride:DBSetSetting(name,container:GetValue()) end) return element end @@ -266,14 +287,46 @@ end function BeStride_GUI:CreateClassSettingSlider(label,parent,setting,minValue,maxValue,increment,disabled) local element = AceGUI:Create("Slider") element:SetLabel(label) - element:SetValue(BeStride:DBGetClassSetting(parent,setting)) + element:SetValue(BeStride:DBGetSetting(name)) element:SetFullWidth(true) element:SetSliderValues(minValue,maxValue,increment) - element:SetCallback("OnMouseUp",function (container) BeStride:DBSetClassSetting(parent,setting,container:GetValue()) end) + element:SetCallback("OnMouseUp",function (container) BeStride:DBSetSetting(name,container:GetValue()) end) return element end +function BeStride_GUI:DrawKeybindsTab(container) + container:SetLayout("Flow") + + self.buttons[BeStride_ABRegularMount:GetName()] = AceGUI:Create("Keybinding") + self.buttons[BeStride_ABGroundMount:GetName()] = AceGUI:Create("Keybinding") + self.buttons[BeStride_ABPassengerMount:GetName()] = AceGUI:Create("Keybinding") + self.buttons[BeStride_ABRepairMount:GetName()] = AceGUI:Create("Keybinding") + + self.buttons[BeStride_ABRegularMount:GetName()]:SetLabel(BINDING_NAME_BeStride_ABRegularMount) + self.buttons[BeStride_ABRegularMount:GetName()]:SetKey(GetBindingKey("CLICK BeStride_ABRegularMount")) + self.buttons[BeStride_ABRegularMount:GetName()]:SetCallback("OnKeyChanged",function() BeStride_GUI:UpdateBinding(BeStride_ABRegularMount,self.buttons[BeStride_ABRegularMount:GetName()]:GetKey()) end) + container:AddChild(self.buttons[BeStride_ABRegularMount:GetName()]) + + self.buttons[BeStride_ABGroundMount:GetName()]:SetLabel(BINDING_NAME_BeStride_ABGroundMount) + self.buttons[BeStride_ABGroundMount:GetName()]:SetKey(GetBindingKey("CLICK BeStride_ABGroundMount")) + self.buttons[BeStride_ABGroundMount:GetName()]:SetCallback("OnKeyChanged",function() BeStride_GUI:UpdateBinding(BeStride_ABGroundMount,self.buttons[BeStride_ABGroundMount:GetName()]:GetKey()) end) + container:AddChild(self.buttons[BeStride_ABGroundMount:GetName()]) + + self.buttons[BeStride_ABPassengerMount:GetName()]:SetLabel(BINDING_NAME_BeStride_ABPassengerMount) + self.buttons[BeStride_ABPassengerMount:GetName()]:SetKey(GetBindingKey("CLICK BeStride_ABPassengerMount")) + self.buttons[BeStride_ABPassengerMount:GetName()]:SetCallback("OnKeyChanged",function() BeStride_GUI:UpdateBinding(BeStride_ABPassengerMount,self.buttons[BeStride_ABPassengerMount:GetName()]:GetKey()) end) + container:AddChild(self.buttons[BeStride_ABPassengerMount:GetName()]) + + self.buttons[BeStride_ABRepairMount:GetName()]:SetLabel(BINDING_NAME_BeStride_ABRepairMount) + self.buttons[BeStride_ABRepairMount:GetName()]:SetKey(GetBindingKey("CLICK BeStride_ABRepairMount")) + self.buttons[BeStride_ABRepairMount:GetName()]:SetCallback("OnKeyChanged",function() BeStride_GUI:UpdateBinding(BeStride_ABRepairMount,self.buttons[BeStride_ABRepairMount:GetName()]:GetKey()) end) + container:AddChild(self.buttons[BeStride_ABRepairMount:GetName()]) +end + +function BeStride_GUI:UpdateBinding(button,key) +end + function BeStride_GUI:DrawAboutTab(container) container:SetLayout("Flow") local about = AceGUI:Create("Label") diff --git a/BeStride_Logic.lua b/BeStride_Logic.lua index 36222df..b6c70d4 100644 --- a/BeStride_Logic.lua +++ b/BeStride_Logic.lua @@ -298,7 +298,7 @@ function BeStride_Logic:CanBroom() end function BeStride_Logic:CanBroomSetting() - return self.db.profile.settings["flyingbroom"] + return BeStride:DBGet("settings.mount.flyingbroom") end -- Check whether we need to repair diff --git a/localization/en-US.lua b/localization/en-US.lua index ca290f8..21883b2 100644 --- a/localization/en-US.lua +++ b/localization/en-US.lua @@ -1,5 +1,5 @@ _G["BINDING_HEADER_BESTRIDE_TITLE"] = "BeStride" -_G["BINDING_NAME_BeStride_ABMount"] = "Mount Button" +_G["BINDING_NAME_BeStride_ABRegularMount"] = "Mount Button" _G["BINDING_NAME_BeStride_ABGroundMount"] = "Force Ground Mount Button" _G["BINDING_NAME_BeStride_ABRepairMount"] = "Force Repair Mount Button" _G["BINDING_NAME_BeStride_ABPassengerMount"] = "Force Passenger Mount Button"