Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
opussf committed Dec 6, 2024
2 parents 1ddf95a + 6d803ee commit 4092526
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
28 changes: 7 additions & 21 deletions src/XH.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,29 +231,15 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">

</Frames>
<Scripts>
<OnLoad>
XH.OnLoad()
</OnLoad>
<OnUpdate>
XH["OnUpdate"]( elapsed )
</OnUpdate>
<OnEvent>
XH[event]( ... )
</OnEvent>
<OnLoad>XH.OnLoad()</OnLoad>
<OnUpdate>XH.OnUpdate()</OnUpdate>
<OnEvent>XH[event]( ... )</OnEvent>

<OnMouseDown>
XH_OnDragStart();
</OnMouseDown>
<OnMouseUp>
XH_OnDragStop();
</OnMouseUp>
<OnMouseDown>XH.OnDragStart()</OnMouseDown>
<OnMouseUp>XH.OnDragStop()</OnMouseUp>

<OnEnter>
XH_OnEnter();
</OnEnter>
<OnLeave>
XH_OnLeave();
</OnLeave>
<OnEnter>XH.OnEnter()</OnEnter>
<OnLeave>XH.OnLeave()</OnLeave>
</Scripts>
</Frame>
<Frame name="XHInstanceList" parent="UIParent">
Expand Down
14 changes: 12 additions & 2 deletions src/XHUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4092526

Please sign in to comment.