• 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.

Moving Command Buttons

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
Just got back into modding after reforged came out and trying to play around with the new UI features for a map.
I am trying to move the Command Buttons and succeeding but any action taken or new selection resets them and setting them every 0.03 seconds or so just makes them flicker.
Does anyone know of a solution to this? Thanks, code is below.
Also sorry I forgot how to properly display that.

Code:
For each (Integer TempInt) from 0 to 11, do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        TempInt Not equal to 2
                        TempInt Not equal to 3
            Then - Actions
                Set VariableSet TempReal = ((Real(TempInt)) x 0.07)
                Custom script:   call BlzFrameSetAbsPoint(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, udg_TempInt), FRAMEPOINT_TOPLEFT, udg_TempReal, 0.3)
            Else - Actions
 
For some reason that started with the release of fdf versions for command & item Buttons. Hence I suggest to move them by name instead of origin which doens't have this repos problem.
"CommandButton_0" to "CommandButton_11" each with createcontext 0.
"InventoryButton_0" to "InventoryButton_5" createcontext 0.
Lua:
TimerStart(CreateTimer(),0,false, function()
    for int = 0, 11 do
        BlzFrameSetAbsPoint(BlzGetFrameByName("CommandButton_"..int, 0), FRAMEPOINT_TOPLEFT, 0.05 * int, 0.3)
        BlzFrameSetAbsPoint(BlzGetFrameByName("InventoryButton_"..int, 0), FRAMEPOINT_TOPLEFT, 0.05 * int, 0.26)
    end
end)
 
Status
Not open for further replies.
Top