Forums » Community Projects

HUD Element Mover

Nov 19, 2016 draugath link
mover.zip

/mover

Allows repositioning the following HUD elements.
    addoncargo
    backradar
    frontradar
    licensewatch
    scaninfo
    selfinfo/groupinfo
    target

Position values can be absolute or percentages. Percentages can be positive or negative. Negative percentages will position the element from the right or bottom edge and adjust for the width or height of the element. -0% is valid.

Moving 'selfinfo' may cause a segfault if used with targetless.
Moving 'target' will cause 'licensewatch' to shift to the top of the screen.

This has received limited testing on Linux only.

Experimental API
mover:IsRegistered(<name>) -> boolean
mover:RegisterElement(<name>, <func>)
mover:UnregisterElement(<name>)

<name> should be a string identifying the <element>
<func> should be a function that sets up the <element>

<element>.GetW() should return the width of the element
<element>.GetH() should return the height of the element

Event: rHUDxscale_Mover
This event is executed by Mover to aid in the proper timing of <element> recreation to hopefully avoid IUP errors when scaling the HUD.

You can use the following function to safely test for Mover during the PLUGINS_LOADED event.

local function IsDeclared(value) return pcall(loadstring("return "..value)) end

if IsDeclared("mover") then
...
end
Nov 21, 2016 draugath link
added support for addoncargo and selfinfo/groupinfo
Nov 21, 2016 neon black link
This is great, draugath! Thank you for adding so much to the community and customizability of the game!
Nov 21, 2016 Darth Nihilus link
I actually had to do this myself to use TargetList and still see my addons and what not. Yours is much cleaner and better written then mine!!! Thanks a bunch man!
Nov 25, 2016 draugath link
added support for target and licensewatch

EDIT:
added experimental API