From 42b40237e11ba054d11fdc68c8bbff256a538e03 Mon Sep 17 00:00:00 2001 From: opussf Date: Fri, 27 Oct 2023 13:23:21 -0700 Subject: [PATCH] Allow the user to reset the position (and size) of the UI List. One of the great things about books is sometimes there are fantastic pictures. --- src/INEEDUI.lua | 9 +++++++++ test/wowStubs.lua | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/INEEDUI.lua b/src/INEEDUI.lua index cb00f54..3b8f03d 100644 --- a/src/INEEDUI.lua +++ b/src/INEEDUI.lua @@ -236,3 +236,12 @@ end function INEED.UIListOnDragStop() INEEDUIListFrame:StopMovingOrSizing() end +function INEED.UIReset() + INEEDUIListFrame:SetSize( 250, 12 ) + INEEDUIListFrame:ClearAllPoints() + INEEDUIListFrame:SetPoint("CENTER", "$parent", "CENTER") +end +INEED.CommandList["reset"] = { + ["func"] = INEED.UIReset, + ["help"] = {"", "Reset the position of the UI"}, +} diff --git a/test/wowStubs.lua b/test/wowStubs.lua index df9ed22..22e9822 100644 --- a/test/wowStubs.lua +++ b/test/wowStubs.lua @@ -394,6 +394,8 @@ Frame = { ["SetHeight"] = function(self, value) self.height = value; end, ["GetHeight"] = function(self) return( self.height ); end, ["CreateFontString"] = function(self, ...) return(CreateFontString(...)) end, + ["SetSize"] = function(self, x, y) end, + ["ClearAllPoints"] = function(self) end, ["SetMinMaxValues"] = function(self, min, max) self.min=min; self.max=max; end, ["SetValue"] = function(self, value) self.value=value end,