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..c80e4cf 100644 --- a/src/XHUI.lua +++ b/src/XHUI.lua @@ -12,15 +12,25 @@ 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() + button = GetMouseButtonClicked() + if button == "RightButton" then + XHFrame:StartMoving() + return + end +end +function XH.OnDragStop() + XHFrame:StopMovingOrSizing() +end function XH.UpdateBars() XH.UpdateXPBarText() 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