Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] JASS UI Natives?

Discussion in 'Triggers & Scripts' started by aple, Jan 31, 2020.

  1. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    811
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    I see in this thread, you now have complete control over WC3's default UI. What's used in this thread is for Lua, though, not JASS. Is there a list of the JASS natives for this somewhere?

    Edit: For the most part, solved here. A full list can be found in Common.j by searching for those functions.
     
    Last edited: Feb 1, 2020
  2. Chaosy

    Chaosy

    Tutorial Reviewer

    Joined:
    Jun 9, 2011
    Messages:
    11,065
    Resources:
    18
    Icons:
    1
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    18
    To be clear, the functions are the same in both jass and lua.
    The only difference is certain syntax keywords.

    lua:
    for i=0,11 do
    HideOriginUI(ORIGIN_FRAME_MINIMAP, i)
    HideOriginUI(ORIGIN_FRAME_ITEM_BUTTON, i)
    HideOriginUI(ORIGIN_FRAME_COMMAND_BUTTON, i)
    HideOriginUI(ORIGIN_FRAME_SYSTEM_BUTTON, i)
    HideOriginUI(ORIGIN_FRAME_PORTRAIT, i)
    HideOriginUI(ORIGIN_FRAME_MINIMAP, i)
    HideOriginUI(ORIGIN_FRAME_MINIMAP_BUTTON, i)
    HideOriginUI(ORIGIN_FRAME_TOOLTIP, i)
    HideOriginUI(ORIGIN_FRAME_UBERTOOLTIP, i)
    HideOriginUI(ORIGIN_FRAME_TOP_MSG, i)
    HideUI("ResourceBarFrame", i)
    HideUI("ConsoleUI", i)
    end

    jass
    local int i = 0
    loop
    exitwhen i <= 11​
    call HideOriginUI(ORIGIN_FRAME_MINIMAP, i)
    call HideOriginUI(ORIGIN_FRAME_ITEM_BUTTON, i)
    call HideOriginUI(ORIGIN_FRAME_COMMAND_BUTTON, i)
    call HideOriginUI(ORIGIN_FRAME_SYSTEM_BUTTON, i)
    call HideOriginUI(ORIGIN_FRAME_PORTRAIT, i)
    call HideOriginUI(ORIGIN_FRAME_MINIMAP, i)
    call HideOriginUI(ORIGIN_FRAME_MINIMAP_BUTTON, i)
    call HideOriginUI(ORIGIN_FRAME_TOOLTIP, i)
    call HideOriginUI(ORIGIN_FRAME_UBERTOOLTIP, i)
    call HideOriginUI(ORIGIN_FRAME_TOP_MSG, i)
    call HideUI("ResourceBarFrame", i)
    call HideUI("ConsoleUI", i)
    set i = i + 1​
    endloop

    As you can see you write loops differently but the functions are the same
     
  3. Blarto

    Blarto

    Joined:
    Jan 17, 2010
    Messages:
    150
    Resources:
    1
    Spells:
    1
    Resources:
    1
    common.j

    Its very hard to decipher though. There are some examples (i managed to create 1 button and put it middle screen and catch the events using those examples).
     
  4. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    811
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    Weird, I'm definitely updated, as I can see the Reforged graphics in the Editor, but JassHelper gives me an error, "Undeclared Function HideOriginUI"
     
  5. Blarto

    Blarto

    Joined:
    Jan 17, 2010
    Messages:
    150
    Resources:
    1
    Spells:
    1
    Resources:
    1
    because its not the same as lua i think. this is false.

    All Jass functions start with a "Blz" prefix.

    I.e BlzHideOriginUI. Edit: this is false too. I didnt pay attention to this being a user defined function.

    You have to open the casc archive and get the common.j file (i cant upload it because thats breach of copyright)
     
    Last edited: Jan 31, 2020
  6. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    811
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    Can't find "HideOriginUI" or "BlzHideOriginUI" in either Common.j or Blizzard.j
     
  7. Drake53

    Drake53

    Joined:
    Jan 1, 2018
    Messages:
    449
    Resources:
    0
    Resources:
    0
    HideUI and HideOriginUI are not natives, but functions declared by the user in the linked post. In lua the natives will still have Blz prefix.

    You should use [code=lua] and [jass]
     
  8. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    811
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    The specific functions I am looking for are BlzGetOriginFrame to get the frame (using for instance ORIGIN_FRAME_PORTRAIT) as well as BlzGetFrameByName (for searching for "CommandButton_0" or "ConsoleUIBackdrop" for instance like in the thread I linked), and then BlzFrameSetVisible to enable or disable it.

    There is also a BlzHideOriginFrames native function that hides most of the default UI frames.
     
    Last edited: Feb 1, 2020
  9. Kazeon

    Kazeon

    Joined:
    Oct 12, 2011
    Messages:
    3,296
    Resources:
    38
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    3
    JASS:
    4
    Resources:
    38
    All UI natives are available here plus convenience