From 05f9c2f91d6a0e0ec9b098f09d0e99e40fc7c247 Mon Sep 17 00:00:00 2001 From: opussf Date: Thu, 5 Dec 2024 18:36:36 -0800 Subject: [PATCH 1/3] Cleanup Start --- src/XH.xml | 28 +++++++--------------------- src/XHUI.lua | 8 ++++++-- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/XH.xml b/src/XH.xml index b90589a..27e14c5 100755 --- a/src/XH.xml +++ b/src/XH.xml @@ -231,29 +231,15 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd"> - - XH.OnLoad() - - - XH["OnUpdate"]( elapsed ) - - - XH[event]( ... ) - + XH.OnLoad() + XH.OnUpdate() + XH[event]( ... ) - - XH_OnDragStart(); - - - XH_OnDragStop(); - + XH.OnDragStart() + XH.OnDragStop() - - XH_OnEnter(); - - - XH_OnLeave(); - + XH.OnEnter() + XH.OnLeave() diff --git a/src/XHUI.lua b/src/XHUI.lua index 1294575..56628d9 100644 --- a/src/XHUI.lua +++ b/src/XHUI.lua @@ -12,15 +12,19 @@ function XH.InitBars() XH_SkillBarCD:Hide() end -- Enter function, will be ran on mouseover. -function XH_OnEnter() +function XH.OnEnter() XH.mouseOver = true XH.UpdateBars() end -- Leave function, will be ran on mouseoverleave. -function XH_OnLeave() +function XH.OnLeave() XH.mouseOver = nil XH.UpdateBars() end +function XH.OnDragStart() +end +function XH.OnDragStop() +end function XH.UpdateBars() XH.UpdateXPBarText() From 087e1678ea29340974509a814248abebce4cba4a Mon Sep 17 00:00:00 2001 From: opussf Date: Thu, 5 Dec 2024 18:37:39 -0800 Subject: [PATCH 2/3] test fix --- test/test.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.lua b/test/test.lua index 531cd63..da75beb 100644 --- a/test/test.lua +++ b/test/test.lua @@ -287,13 +287,13 @@ end function test.test_OnEnter_Sets_mouseOver() XH.VARIABLES_LOADED() XH.mouseOver = nil - XH_OnEnter() + XH.OnEnter() assertTrue( XH.mouseOver ) end function test.test_OnLeave_Clears_mouseOver() XH.VARIABLES_LOADED() XH.mouseOver = true - XH_OnLeave() + XH.OnLeave() assertIsNil( XH.mouseOver ) end From a9cd5409ce8393e327fef25e073e96c3b8c19a2c Mon Sep 17 00:00:00 2001 From: opussf Date: Thu, 5 Dec 2024 18:48:06 -0800 Subject: [PATCH 3/3] Drag on rightclick --- src/XHUI.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/XHUI.lua b/src/XHUI.lua index 56628d9..c80e4cf 100644 --- a/src/XHUI.lua +++ b/src/XHUI.lua @@ -22,8 +22,14 @@ function XH.OnLeave() XH.UpdateBars() end function XH.OnDragStart() + button = GetMouseButtonClicked() + if button == "RightButton" then + XHFrame:StartMoving() + return + end end function XH.OnDragStop() + XHFrame:StopMovingOrSizing() end function XH.UpdateBars()