From ba22fcf75a5c40e11ffab8676b7503db08a2600d Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 5 Mar 2018 22:58:34 +0100 Subject: [PATCH] gui: add function to handle global variables --- modules/gui.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/gui.lua b/modules/gui.lua index f886664e..8d57010b 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -59,6 +59,22 @@ pfUI:RegisterModule("gui", function () end end + if category == "GVAR" then + category = {} + category[config] = tostring(_G[config] or 0) + + ufunc = function() + _G[config] = this:GetChecked() and 1 or nil + UIOptionsFrame_Save() + + -- refresh elements + MultiActionBar_Update() + MultiActionBar_UpdateGridVisibility(); + UIParent_ManageFramePositions(); + UpdateMicroButtons() + end + end + frame.category = category frame.config = config