• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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