From 67eff7a97772766a351e9110a1df7220e1888737 Mon Sep 17 00:00:00 2001 From: d87 Date: Fri, 15 Nov 2019 17:38:16 +0700 Subject: [PATCH] Fixed console commands --- .luacheckrc | 3 ++- NugPlateAuras.lua | 19 +++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 5ed3a18..195f79a 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -109,5 +109,6 @@ globals = { "InterfaceOptionsFrame", "CopyTable", "GetSpellInfo", - "CreateFramePool" + "CreateFramePool", + "InterfaceOptionsFrame_OpenToCategory", } diff --git a/NugPlateAuras.lua b/NugPlateAuras.lua index f7a6067..91c0812 100644 --- a/NugPlateAuras.lua +++ b/NugPlateAuras.lua @@ -428,22 +428,17 @@ end local helpMessage = { - "|cff00ff00/ncf lock|r", - "|cff00ff00/ncf unlock|r", - "|cff00ff00/ncf direction|r ", + "|cff00ff00/npa gui|r", } NugPlateAuras.Commands = { - ["unlock"] = function(v) - NugPlateAuras.anchor:Show() - end, - ["lock"] = function(v) - NugPlateAuras.anchor:Hide() - end, - ["direction"] = function(v) - NCFDB.direction = string.upper(v) - NugPlateAuras:UpdateSettings() + ["gui"] = function(v) + if not NugPlateAuras.optionsPanel then + NugPlateAuras.optionsPanel = NugPlateAuras:CreateGUI() + end + InterfaceOptionsFrame_OpenToCategory("NugPlateAuras") + InterfaceOptionsFrame_OpenToCategory("NugPlateAuras") end, }