From 65022378e8110eed65bdc329447acb4cf5455a06 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Fri, 5 Jan 2007 04:55:08 +0000 Subject: [PATCH] Altered options GUI to fit more in the Blizzard style, using the same framework Changed the buff edit screen logic to work in a different way If you navigate from the buff edit screen using the tabs, then you'll get bad things =). Dont' do that. --- PerfectRaid.xml | 184 ++++++++++++++++------------------------------- PerfectRaid_Aggro.lua | 5 +- PerfectRaid_Buffs.lua | 27 +++---- PerfectRaid_Hacks.lua | 5 +- PerfectRaid_Options.lua | 44 ++++++------ PerfectRaid_Range.lua | 4 +- 6 files changed, 102 insertions(+), 167 deletions(-) diff --git a/PerfectRaid.xml b/PerfectRaid.xml index 95ad56a..f62faba 100644 --- a/PerfectRaid.xml +++ b/PerfectRaid.xml @@ -1,134 +1,90 @@ - + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - table.insert(UISpecialFrames,self:GetName()) - self.Title = getglobal(self:GetName().."Title") - local title = self:CreateTitleRegion() - title:SetPoint("TOPLEFT", self, "TOPLEFT", 5, 0) - title:SetPoint("TOPRIGHT", self, "TOPRIGHT", -5, 0) - title:SetHeight(20) + local name = self:GetName() + table.insert(UISpecialFrames,name) + self.Title = getglobal(name.."Title") + + PlaySound("UChatScrollButton"); + - - \ No newline at end of file diff --git a/PerfectRaid_Aggro.lua b/PerfectRaid_Aggro.lua index 7d202da..6490464 100644 --- a/PerfectRaid_Aggro.lua +++ b/PerfectRaid_Aggro.lua @@ -30,6 +30,7 @@ ---------------------------------------------------------------------------]] local Aggro = PerfectRaid:NewModule("PerfectRaid-Aggro") +local L = PerfectRaidLocals local frames,aggro local victims = {} @@ -145,13 +146,13 @@ function Aggro:CreateOptions(opt) table.insert(options.widgets, slider) local cancel = CreateFrame("Button", "PRAggro_Cancel", options, "PRButtonTemplate") - cancel.Label:SetText(L["Cancel"]) + cancel:SetText(L["Cancel"]) cancel:SetPoint("BOTTOMRIGHT", 0, 5) cancel:SetScript("OnClick", function() self:OnShow() end) cancel:Show() local save = CreateFrame("Button", "PRAggro_Save", options, "PRButtonTemplate") - save.Label:SetText(L["Save"]) + save:SetText(L["Save"]) save:SetPoint("BOTTOMRIGHT", cancel, "BOTTOMLEFT", -10, 0) save:SetScript("OnClick", function() self:SaveOptions() end) save:Show() diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua index 35e56ef..735e943 100644 --- a/PerfectRaid_Buffs.lua +++ b/PerfectRaid_Buffs.lua @@ -144,19 +144,19 @@ function Buffs:CreateOptions(opt) self:CreateListFrame(options, 10) local delete = CreateFrame("Button", "PRBuffs_Delete", options, "PRButtonTemplate") - delete.Label:SetText(L["Delete"]) + delete:SetText(L["Delete"]) delete:SetPoint("BOTTOMRIGHT", 0, 5) delete:SetScript("OnClick", function() self:DeleteEntry() end) delete:Show() local edit = CreateFrame("Button", "PRBuffs_Edit", options, "PRButtonTemplate") - edit.Label:SetText(L["Edit"]) + edit:SetText(L["Edit"]) edit:SetPoint("BOTTOMRIGHT", delete, "BOTTOMLEFT", -10, 0) edit:SetScript("OnClick", function() self:EditEntry() end) edit:Show() local add = CreateFrame("Button", "PRBuffs_Add", options, "PRButtonTemplate") - add.Label:SetText(L["Add"]) + add:SetText(L["Add"]) add:SetPoint("BOTTOMRIGHT", edit, "BOTTOMLEFT", -10, 0) add:SetScript("OnClick", function() self:AddEntry() end) add:Show() @@ -265,20 +265,14 @@ function Buffs:CreateListFrame(parent, num) end function Buffs:CreateEditFrame(parent) - local frame = CreateFrame("Frame", "PROptions_Buffs_Edit", PROptions_Buffs) + local frame = CreateFrame("Frame", "PROptions_Buffs_Edit", PROptions) local name = "PROptions_Buffs_Edit" -- frame:SetPoint("TOPLEFT", 15, -25) -- frame:SetPoint("BOTTOMRIGHT", -15, 15) - frame:SetAllPoints() + frame:SetAllPoints(PROptions_Buffs) frame:SetFrameLevel(frame:GetFrameLevel() + 1) frame:Hide() - local bg = frame:CreateTexture(nil, "ARTWORK") - bg:SetAllPoints() - bg:SetTexture(0.2, 0.2, 0.2) - - PROptions_Buffs:SetScript("OnHide", function() self:CancelEntry() end) - local buffname = CreateFrame("EditBox", name.."BuffName", frame, "InputBoxTemplate") local font = buffname:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") font:SetText(L["Buff Name:"]) @@ -430,20 +424,20 @@ function Buffs:CreateEditFrame(parent) checks[11]:SetPoint("TOPLEFT", checks[6], "BOTTOMLEFT", 0, -20) checks[11]:Show() - for i=12,13 do + for i=12,12 do checks[i] = makeCheck(self.conditions[i]) checks[i]:SetPoint("TOPLEFT", checks[i-1], "TOPRIGHT", 60, 0) checks[i]:Show() end local cancel = CreateFrame("Button", "PRBuffs_EditCancel", PROptions_Buffs_Edit, "PRButtonTemplate") - cancel.Label:SetText(L["Cancel"]) + cancel:SetText(L["Cancel"]) cancel:SetPoint("BOTTOMRIGHT", 0, 5) cancel:SetScript("OnClick", function() self:CancelEntry() end) cancel:Show() local save = CreateFrame("Button", "PRBuffs_EditSave", PROptions_Buffs_Edit, "PRButtonTemplate") - save.Label:SetText(L["Save"]) + save:SetText(L["Save"]) save:SetPoint("BOTTOMRIGHT", cancel, "BOTTOMLEFT", -10, 0) save:SetScript("OnClick", function() self:SaveEntry() end) save:Show() @@ -470,6 +464,7 @@ function Buffs:EditEntry() local options = PROptions_Buffs_Edit options.editEntry = entry + PROptions_Buffs:Hide() options:Show() options.buffname:SetText(entry.buffname) options.groupname:SetText(entry.groupname or "") @@ -598,6 +593,7 @@ function Buffs:CancelEntry() local options = PROptions_Buffs_Edit options:Hide() options.editEntry = nil + PROptions_Buffs:Show() end function Buffs:EnableButtons() @@ -623,10 +619,7 @@ Buffs.conditions = { ["Warlock"] = function(u,c) return c == "WARLOCK" end, ["Mage"] = function(u,c) return c == "MAGE" end, ["Mana"] = function(u,c) return c == "DRUID" or c == "PRIEST" or c == "PALADIN" or c == "SHAMAN" or c == "MAGE" or c == "WARLOCK" or c == "HUNTER" end, - ["Caster"] = function(u,c) return c == "MAGE" or c == "WARLOCK" or c == "SHAMAN" or c == "DRUID" end, - ["Melee"] = function(u,c) return c == "WARRIOR" or c == "ROGUE" end, ["Healer"] = function(u,c) return c == "PRIEST" or c == "SHAMAN" or c == "DRUID" or c == "PALADIN" end, - ["NonTank"] = function(u,c) return c ~= "WARRIOR" end, } local work = {} diff --git a/PerfectRaid_Hacks.lua b/PerfectRaid_Hacks.lua index ce475bc..88d9e76 100644 --- a/PerfectRaid_Hacks.lua +++ b/PerfectRaid_Hacks.lua @@ -30,6 +30,7 @@ ---------------------------------------------------------------------------]] local Hacks = PerfectRaid:NewModule("PerfectRaid-Hacks") +local L = PerfectRaidLocals local frames function Hacks:Initialize() @@ -71,13 +72,13 @@ function Hacks:CreateOptions(opt) end) local cancel = CreateFrame("Button", "PRHacks_Cancel", options, "PRButtonTemplate") - cancel.Label:SetText(L["Cancel"]) + cancel:SetText(L["Cancel"]) cancel:SetPoint("BOTTOMRIGHT", 0, 5) cancel:SetScript("OnClick", function() self:OnShow() end) cancel:Show() local save = CreateFrame("Button", "PRHacks_Save", options, "PRButtonTemplate") - save.Label:SetText(L["Save"]) + save:SetText(L["Save"]) save:SetPoint("BOTTOMRIGHT", cancel, "BOTTOMLEFT", -10, 0) save:SetScript("OnClick", function() self:SaveOptions() end) save:Show() diff --git a/PerfectRaid_Options.lua b/PerfectRaid_Options.lua index 2595f87..ed8a735 100644 --- a/PerfectRaid_Options.lua +++ b/PerfectRaid_Options.lua @@ -52,8 +52,8 @@ end function Options:CreateOptions() local frame = CreateFrame("Frame", "PROptions", UIParent, "PROptionsTemplate") - frame:SetHeight(300) - frame:SetWidth(450) + frame:SetHeight(375) + frame:SetWidth(600) frame:SetPoint("CENTER", 0, 0) for name,module in PerfectRaid:IterateModules() do @@ -61,12 +61,6 @@ function Options:CreateOptions() module:CreateOptions(self) end end - - local button = CreateFrame("Button", "PROptionsClose", PROptions, "UIPanelCloseButton") - button:SetHeight(25) - button:SetWidth(25) - button:SetPoint("TOPRIGHT", -5, 3) - button:SetScript("OnClick", function() PROptions:Hide() end) end local tabs = {} @@ -74,36 +68,42 @@ function Options:AddOptionsTab(title, frame) local num = #tabs + 1 local name = "PROptionsTab"..num local tab = CreateFrame("Button", name, PROptions, "PRTabTemplate") - + tab.idx = num + if num == 1 then - tab:SetPoint("TOPLEFT", PROptions, "BOTTOMLEFT", 10, 12) + tab:SetPoint("CENTER", PROptions, "BOTTOMLEFT", 50, -8) else local prev = getglobal("PROptionsTab"..num-1) - tab:SetPoint("TOPLEFT", prev, "TOPRIGHT", 3, 0) + tab:SetPoint("TOPLEFT", prev, "TOPRIGHT", -16, 0) end - tab.Name:SetText(title) + tab:SetText(title) tab.frame = frame - local width = tab.Name:GetWidth() - tab:SetWidth(width + 30) tab:Show() + tab.frame:SetPoint("TOPLEFT", PROptions, "TOPLEFT", 20, -30) + tab.frame:SetPoint("BOTTOMRIGHT", PROptions, "BOTTOMRIGHT", -15, 10) + tab.frame:Hide() + table.insert(tabs, tab) + PanelTemplates_SetNumTabs(PROptions, num) + PanelTemplates_SetTab(PROptions, 1) + self:TabOnClick(PROptionsTab1) end local tabselected function Options:TabOnClick(tab) if tabselected then - tabselected.Left:SetTexture("Interface\\AddOns\\PerfectRaid\\images\\OrangeTheme\\TabLeftInactive") - tabselected.Middle:SetTexture("Interface\\AddOns\\PerfectRaid\\images\\OrangeTheme\\TabMiddleInactive") - tabselected.Right:SetTexture("Interface\\AddOns\\Perfectraid\\images\\OrangeTheme\\TabRightInactive") tabselected.frame:Hide() end - tab.Left:SetTexture("Interface\\AddOns\\PerfectRaid\\images\\OrangeTheme\\TabLeft") - tab.Middle:SetTexture("Interface\\AddOns\\PerfectRaid\\images\\OrangeTheme\\TabMiddle") - tab.Right:SetTexture("Interface\\AddOns\\Perfectraid\\images\\OrangeTheme\\TabRight") - tab.frame:SetPoint("TOPLEFT", 15, -25) - tab.frame:SetPoint("BOTTOMRIGHT", -15, 15) tab.frame:Show() tabselected = tab + PanelTemplates_SetTab(PROptions, tab.idx) end + +--[[ +Cide: local dialogBackdrop = { bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", +[5:51pm] Cide: edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", +[5:51pm] Cide: tile = true, tileSize = 32, edgeSize = 32, +[5:51pm] Cide: insets = { left = 11, right = 12, top = 12, bottom = 11 }}; +--]] \ No newline at end of file diff --git a/PerfectRaid_Range.lua b/PerfectRaid_Range.lua index ccaec02..c718ea5 100644 --- a/PerfectRaid_Range.lua +++ b/PerfectRaid_Range.lua @@ -134,13 +134,13 @@ function Range:CreateOptions(opt) table.insert(options.widgets, slider) local cancel = CreateFrame("Button", "PRRange_Cancel", options, "PRButtonTemplate") - cancel.Label:SetText(L["Cancel"]) + cancel:SetText(L["Cancel"]) cancel:SetPoint("BOTTOMRIGHT", 0, 5) cancel:SetScript("OnClick", function() self:OnShow() end) cancel:Show() local save = CreateFrame("Button", "PRRange_Save", options, "PRButtonTemplate") - save.Label:SetText(L["Save"]) + save:SetText(L["Save"]) save:SetPoint("BOTTOMRIGHT", cancel, "BOTTOMLEFT", -10, 0) save:SetScript("OnClick", function() self:SaveOptions() end) save:Show() -- 1.7.9.5