• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Lua] Moving the hero button frame

Oli

Oli

Level 3
Joined
Aug 9, 2015
Messages
33
Hi,

I am having problems with moving the ORIGIN_HERO_BUTTON_FRAME. I have been trying using Taysen's method however the script would not work for me:

Lua:
BlzEnableUIAutoPosition(false)
local frame = BlzGetOriginFrame(ORIGIN_FRAME_HERO_BUTTON, 0)
BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPLEFT, 0.1, 0.55)
-- Move 2.Button
local frame = BlzGetOriginFrame(ORIGIN_FRAME_HERO_BUTTON, 1)
BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPLEFT, 0.3, 0.25)

I can not find instances regarding HERO_BAR or HERO_BUTTON_FRAME in wc3 .fdf files using the casc viewer, are they hidden somewhere unaccessable or am i just blind?

I am aware UI Utils allows you to move hero buttons, however there is no lua version of it.
 

Oli

Oli

Level 3
Joined
Aug 9, 2015
Messages
33
Thank you very much! For anyone wondering the final code working in my case would be:

(using TotalInitLite):


Lua:
do
    function func()
        BlzEnableUIAutoPosition(false)
        local frame = BlzGetOriginFrame(ORIGIN_FRAME_HERO_BUTTON, 0)
        BlzFrameClearAllPoints(frame)
        BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPLEFT, 0.1, 0.55)
        -- Move 2.Button
        local frame = BlzGetOriginFrame(ORIGIN_FRAME_HERO_BUTTON, 1)
        BlzFrameClearAllPoints(frame)
        BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPLEFT, 0.3, 0.25)
    end

    OnGameStart(function()
        func()
    end)
end
 
Top