From a5ee56c3f803afbdda07bae9cd330e0d4a75d75a Mon Sep 17 00:00:00 2001 From: shagu Date: Wed, 15 Feb 2017 20:24:20 +0100 Subject: [PATCH] add support for pfUI-UnitFrames --- Plugins/Clique_pfUI.lua | 38 ++++++++++++++++++++++++++++++++++++++ Plugins/Plugins.xml | 1 + 2 files changed, 39 insertions(+) create mode 100644 Plugins/Clique_pfUI.lua diff --git a/Plugins/Clique_pfUI.lua b/Plugins/Clique_pfUI.lua new file mode 100644 index 0000000..1bf10a4 --- /dev/null +++ b/Plugins/Clique_pfUI.lua @@ -0,0 +1,38 @@ +--[[--------------------------------------------------------------------------------- + This is a template for the plugin/module system for Clique. + + Plugins are typically used to tie Clique to a specific set of unit frames, but + can also be used to add functionality to the system through a manner of hooks. + + Plugins are registered with Clique with a shortname that is used for all slash + commands. In addition they are required to have a fullname parameter that is + used in all display messages +----------------------------------------------------------------------------------]] + +local Plugin = Clique:NewModule("pfUI") +Plugin.fullname = "pfUI UnitFrames" +Plugin.url = "https://github.com/shagu/pfUI" + +function Plugin:Test() + return pfUI +end + +function Plugin:OnEnable() + pfUI.uf.ClickActionOld = pfUI.uf.ClickAction + pfUI.uf.ClickAction = Plugin.OnClick +end + +function Plugin:OnDisable() + pfUI.uf.ClickAction = pfUI.uf.ClickActionOld +end + +function Plugin:OnClick() + local button = arg1 + local label = this.label or "" + local id = this.id or "" + local unit = label .. id + + if not Clique:OnClick(button, unit) then + pfUI.uf:ClickActionOld(button) + end +end diff --git a/Plugins/Plugins.xml b/Plugins/Plugins.xml index 963b0e6..bffcae9 100644 --- a/Plugins/Plugins.xml +++ b/Plugins/Plugins.xml @@ -34,4 +34,5 @@