1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Moving Command Buttons

Discussion in 'Triggers & Scripts' started by Blazing_Legion, Feb 15, 2020.

  1. Blazing_Legion

    Blazing_Legion

    Joined:
    Sep 27, 2011
    Messages:
    138
    Resources:
    0
    Resources:
    0
    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 (Text):
    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
     
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,689
    Resources:
    1
    Spells:
    1
    Resources:
    1
  3. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,233
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
  4. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,689
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I understood the OP to mean moving the entire command card, not moving icons around within the command card.
     
  5. Blazing_Legion

    Blazing_Legion

    Joined:
    Sep 27, 2011
    Messages:
    138
    Resources:
    0
    Resources:
    0
  6. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,444
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    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.
    Code (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)
     
     
  7. Blazing_Legion

    Blazing_Legion

    Joined:
    Sep 27, 2011
    Messages:
    138
    Resources:
    0
    Resources:
    0
    Thanks Tasyen. I tried this as soon as I got up and seems to solve the problem.