# HG changeset patch # User Nenue # Date 1450487538 18000 # Node ID ac644fc860cc3b2fdfdcc136b1f207600222fa67 # Parent 247118593c66a1c466ad8b8ffa53402466b31982 ResizeBounds set Min/Maximize moved into lua diff -r 247118593c66 -r ac644fc860cc Devian.lua --- a/Devian.lua Fri Dec 18 19:48:10 2015 -0500 +++ b/Devian.lua Fri Dec 18 20:12:18 2015 -0500 @@ -19,6 +19,9 @@ y = -150, height = 500, width = 600, + font = [[Interface\Addons\Devian\font\SourceCodePro-Regular.ttf]], + fontsize = 13, + fontoutline = 'NONE', } cherry = "This is probably the first time, so:\n /dvn 2 to save your regular addon list\n /dvn 1 to save your development addon list\n /dvn to switch between the two\n /dvc to toggle print() frame" end @@ -133,10 +136,10 @@ f:SetPoint('CENTER', UIParent, 'CENTER', db.x, db.y) f:SetSize(db.width, db.height) f:Lower() - f.console:SetFont([[Interface\Addons\Turok\Media\font\SourceCodePro-Regular.ttf]], 13, 'NONE') f.console:SetFading(false) f.console:SetTimeVisible(2147483647) + f.console:SetFont(db.font, db.fontsize, db.fontoutline) --f:SetJustifyH('LEFT') @@ -189,6 +192,25 @@ DEVIAN_FRAME.console:AddMessage(table.concat(buffer, ' ')) table.wipe(buffer) end +function D:ToggleMinMax() + if DEVIAN_FRAME.minimized then + self:Maximize() + else + self:Minimize() + end +end +function D:Minimize() + DEVIAN_FRAME.sizer:ClearAllPoints() + DEVIAN_FRAME:SetHeight(20) + DEVIAN_FRAME.minimized = true + return DEVIAN_FRAME.console:Hide() +end +function D:Maximize() + DEVIAN_FRAME.sizer:ClearAllPoints() + DEVIAN_FRAME:SetHeight(DevianDB.height) + DEVIAN_FRAME.minimized = nil + return DEVIAN_FRAME.console:Show() +end function D:OnEnable() if db.enabled then @@ -199,6 +221,7 @@ end end + function D:OnInitialize() if not db[PLAYER_REALM] then @@ -226,6 +249,7 @@ db.console = (db.console == false) and true or false if db.console then DEVIAN_FRAME:Show() + D:Maximize() else DEVIAN_FRAME:Hide() end diff -r 247118593c66 -r ac644fc860cc Devian.xml --- a/Devian.xml Fri Dec 18 19:48:10 2015 -0500 +++ b/Devian.xml Fri Dec 18 20:12:18 2015 -0500 @@ -5,6 +5,10 @@ + + + + if button == 'LeftButton' then @@ -16,19 +20,7 @@ if button == 'RightButton' then - if not self.minimized then - self.sizer:ClearAllPoints() - self.sizer:SetPoint('TOPRIGHT') - self:SetHeight(20) - self.minimized = true - return self.console:Hide() - else - self.sizer:ClearAllPoints() - self.sizer:SetPoint('BOTTOMRIGHT') - self:SetHeight(DevianDB.height) - self.minimized = nil - return self.console:Show() - end + return Devian:ToggleMinMax() end self:StopMovingOrSizing() Devian:SavePos() @@ -65,12 +57,12 @@ - - + @@ -97,7 +89,7 @@ -