From 65ac06d587e4374ca0479576d49a4cd170dd4244 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 18 Mar 2007 04:16:49 +0000 Subject: [PATCH] * Added support for changing profiles on commandline. --- Clique.lua | 26 ++++++++++++++++++++++++++ Localization.en.lua | 1 + 2 files changed, 27 insertions(+) diff --git a/Clique.lua b/Clique.lua index a5cea57..bbb5a3a 100644 --- a/Clique.lua +++ b/Clique.lua @@ -57,6 +57,8 @@ function Clique:Enable() -- Register for dongle events self:RegisterMessage("DONGLE_PROFILE_CHANGED") self:RegisterMessage("DONGLE_PROFILE_DELETED") + self:RegisterMessage("DONGLE_PROFILE_RESET") + self:RegisterEvent("PLAYER_REGEN_ENABLED") self:RegisterEvent("PLAYER_REGEN_DISABLED") @@ -79,6 +81,7 @@ function Clique:Enable() -- Create our slash command self.cmd = self:InitializeSlashCommand("Clique commands", "CLIQUE", "clique") self.cmd:RegisterSlashHandler("debug - Enables extra messages for debugging purposes", "debug", "ShowAttributes") + self.cmd:InjectDBCommands(self.db, "copy", "delete", "list", "reset", "set") end function Clique:EnableFrames() @@ -298,6 +301,29 @@ function Clique:DONGLE_PROFILE_CHANGED(event, db, parent, svname, profileKey) end end +function Clique:DONGLE_PROFILE_RESET(event, db, parent, svname, profileKey) + if db == self.db then + for name,set in pairs(self.clicksets) do + self:RemoveClickSet(set) + end + self:RemoveClickSet(self.ooc) + + self.profile = self.db.profile + self.clicksets = self.profile.clicksets + self.editSet = self.clicksets[L.CLICKSET_DEFAULT] + self.profileKey = profileKey + + -- Refresh the profile editor if it exists + self.textlistSelected = nil + self:TextListScrollUpdate() + self:ListScrollUpdate() + self:UpdateClicks() + + self:PLAYER_REGEN_ENABLED() + end +end + + function Clique:DONGLE_PROFILE_DELETED(event, db, parent, svname, profileKey) if db == self.db then self:PrintF(L.PROFILE_DELETED, profileKey) diff --git a/Localization.en.lua b/Localization.en.lua index 24d863a..a39d79f 100644 --- a/Localization.en.lua +++ b/Localization.en.lua @@ -46,6 +46,7 @@ local L = Clique.Locals L.APPLY_QUEUE = "Out of combat. Applying all queued changes." L.PROFILE_CHANGED = "Profile has changed to '%s'." L.PROFILE_DELETED = "Profile '%s' has been deleted." + L.PROFILE_CHANGED = "Your profile '%s' has been reset." L.ACTION_ACTIONBAR = "Change ActionBar" L.ACTION_ACTION = "Action Button" -- 1.7.9.5