From 9c792439572f447adee7d6bb8b24bef6c241968a Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Tue, 3 Feb 2009 22:57:52 +0000 Subject: [PATCH] Added a development mode to assist in getting multiple bars working correctly --- NinjaPanel.lua | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/NinjaPanel.lua b/NinjaPanel.lua index 2d24fd6..2ec217c 100644 --- a/NinjaPanel.lua +++ b/NinjaPanel.lua @@ -19,8 +19,32 @@ eventFrame:SetScript("OnEvent", function(self, event, arg1, ...) self:UnregisterEvent("ADDON_LOADED") NinjaPanel:SpawnPanel("NinjaPanelTop", "TOP") - --NinjaPanel:SpawnPanel("NinjaPanelBottom", "BOTTOM") + if db.DEVELOPMENT then + -- Spawn all four bars so we can test + NinjaPanel:SpawnPanel("NinjaPanelBottom", "BOTTOM") + NinjaPanel:SpawnPanel("NinjaPanelRight", "RIGHT") + NinjaPanel:SpawnPanel("NinjaPanelLeft", "LEFT") + + -- Create two plugins for each bar in order to test drag/drop + ldb:NewDataObject("TopOne", { type = "data source", text = "Top One" }) + ldb:NewDataObject("TopTwo", { type = "data source", text = "Top Two" }) + ldb:NewDataObject("BottomOne", { type = "data source", text = "Bottom One"}) + ldb:NewDataObject("BottomTwo", { type = "data source", text = "Bottom Two"}) + ldb:NewDataObject("LeftOne", { type = "launcher", icon = "Interface\\Icons\\Spell_Nature_StormReach"}) + ldb:NewDataObject("LeftTwo", { type = "launcher", icon = "Interface\\Icons\\Spell_Nature_StormReach"}) + ldb:NewDataObject("RightOne", { type = "launcher", icon = "Interface\\Icons\\Spell_Nature_StormReach"}) + ldb:NewDataObject("RightTwo", { type = "launcher", icon = "Interface\\Icons\\Spell_Nature_StormReach"}) + end + NinjaPanel:ScanForPlugins() + + if db.DEVELOPMENT then + db.plugins["TopOne"].panel = "NinjaPanelTop" + db.plugins["TopTwo"].panel = "NinjaPanelTop" + db.plugins["BottomOne"].panel = "NinjaPanelBottom" + db.plugins["BottomTwo"].panel = "NinjaPanelBottom" + NinjaPanel:UpdatePanels() + end end end) @@ -61,7 +85,7 @@ function NinjaPanel:SpawnPanel(name, position) panel:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) panel:SetHeight(16) panel.bg:SetTexture(1, 1, 1, 0.8) - panel.bg:SetGradient("VERTICAL", 0, 0, 0, 0.2, 0.2, 0.2) + panel.bg:SetGradient("VERTICAL", 0.2, 0.2, 0.2, 0, 0, 0) panel.bg:SetPoint("BOTTOMLEFT") panel.bg:SetPoint("BOTTOMRIGHT") panel.bg:SetHeight(15) @@ -74,8 +98,39 @@ function NinjaPanel:SpawnPanel(name, position) if jostle then jostle:RegisterBottom(panel) end + elseif position == "RIGHT" then + -- TODO: Fix the colors and gradients here + panel:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", 0, 0) + panel:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) + panel:SetWidth(16) + panel.bg:SetTexture(1, 1, 1, 0.8) + panel.bg:SetGradient("VERTICAL", 0.2, 0.2, 0.2, 0, 0, 0) + panel.bg:SetPoint("TOPRIGHT") + panel.bg:SetPoint("BOTTOMRIGHT") + panel.bg:SetWidth(15) + panel.border:SetTexture(1, 1, 1, 0.8) + panel.border:SetGradient("VERTICAL", 203 / 255, 161 / 255, 53 / 255, 0, 0, 0) + panel.border:SetPoint("TOPRIGHT", panel.bg, "TOPLEFT", 0, 0) + panel.border:SetPoint("BOTTOMRIGHT", panel.bg, "BOTTOMLEFT", 0, 0) + panel.border:SetWidth(1) + elseif position == "LEFT" then + -- TODO: Fix the colors and gradients here + panel:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 0, 0) + panel:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0) + panel:SetWidth(16) + panel.bg:SetTexture(1, 1, 1, 0.8) + panel.bg:SetGradient("HORIZONTAL", 0, 0, 0, 0.2, 0.2, 0.2) + panel.bg:SetPoint("TOPLEFT") + panel.bg:SetPoint("BOTTOMLEFT") + panel.bg:SetWidth(15) + panel.border:SetTexture(1, 1, 1, 0.8) + panel.border:SetGradient("VERTICAL", 203 / 255, 161 / 255, 53 / 255, 0, 0, 0) + panel.border:SetPoint("TOPLEFT", panel.bg, "TOPRIGHT", 0, 0) + panel.border:SetPoint("BOTTOMLEFT", panel.bg, "BOTTOMRIGHT", 0, 0) + panel.border:SetWidth(1) end + -- TODO: Add the panel methods here panel.plugins = {} table.insert(self.panels, panel) -- 1.7.9.5