From 3e991b46fe23c372a53ec59879bbfda305562f04 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Tue, 17 Nov 2009 01:29:09 -0600 Subject: [PATCH] Added enter and escape handlers to most everything --- WeightsWatcher.xml | 42 ++++++++++++++++++++++++++++++++++-------- config.lua | 10 ++++++++++ 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/WeightsWatcher.xml b/WeightsWatcher.xml index ac4e096..7aa8d06 100644 --- a/WeightsWatcher.xml +++ b/WeightsWatcher.xml @@ -122,7 +122,7 @@ - + @@ -175,6 +175,9 @@ changeFocus(self:GetParent()) + + self:ClearFocus() + @@ -475,6 +478,11 @@ + + + changeFocus(self.scrollFrame.stats[#(self.scrollFrame.stats)]) + + + + + table.insert(UISpecialFrames, self:GetName()); + + @@ -626,6 +639,20 @@ self:GetParent().createButton:Enable() end + + if StaticPopup_Visible("WW_WEIGHT_EXISTS") then + StaticPopup_Hide("WW_WEIGHT_EXISTS") + else + self:GetParent().createButton:Click() + end + + + if StaticPopup_Visible("WW_WEIGHT_EXISTS") then + StaticPopup_Hide("WW_WEIGHT_EXISTS") + else + self:GetParent().cancelButton:Click() + end + + + + self.editBox:SetFocus() + + diff --git a/config.lua b/config.lua index 68defa3..8dd43fa 100644 --- a/config.lua +++ b/config.lua @@ -156,6 +156,16 @@ function changeFocus(currentStatFrame) end end +function selectWeight(class, name) + for _, classFrame in ipairs(ww_config.leftPanel.scrollFrame.categories) do + if classFrame.class == class then + local children = {classFrame:GetChildren()} + configSelectWeight(children[classFrame:GetNumChildren()]) + break + end + end +end + --opens a new config pane to edit stat weights function configSelectWeight(weightFrame) local empty -- 1.7.9.5