BlzGetOriginFrame
- Parameters
frameType originframetypeindex integerValues that are too high return the frame from the last valid index.
- comment
Get a
framehandleby specifying a specificoriginframetypeand index (in most cases it should be 0 (first index), however it can go above 0 when using originframetypes such asORIGIN_FRAME_HERO_BUTTON)The one with indices above 0 are:
// The ability buttons at the right bottom corner ORIGIN_FRAME_COMMAND_BUTTON <0 to 11> // The clickable hero icons at the left of the screen ORIGIN_FRAME_HERO_BUTTON <0 to 6> // See above for the following: ORIGIN_FRAME_HERO_HP_BAR <0 to 6> ORIGIN_FRAME_HERO_MANA_BAR <0 to 6> ORIGIN_FRAME_HERO_BUTTON_INDICATOR <0 to 6> // Item inventory buttons ORIGIN_FRAME_ITEM_BUTTON <0 to 5> // The buttons altering the minimap // 0 = Signal // 1 = Terrain // 2 = Ally filter // 3 = Creep filter // 4 = Formation ORIGIN_FRAME_MINIMAP_BUTTON <0 to 4> // Indices: // 0 = Menu // 1 = Allies // 2 = Log // 3 = Quest ORIGIN_FRAME_SYSTEM_BUTTON <0 to 3>Here is a basic example that creates a custom timerdialog window:
set GameUI = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0) set UIMain = BlzCreateFrame("TimerDialog", GameUI, 0, 0) call BlzFrameSetPoint(UIMain, FRAMEPOINT_CENTER, GameUI, FRAMEPOINT_CENTER, 0.25, 0.055) call BlzFrameSetSize(UIMain, 0.3, 0.7)Take a look at the .fdf files in the game’s CASC or point 1.3 (refer to this document’s table of contents for reference) it should give you some ideas.
- note
The first time a frame enters the map script it takes a handle ID. Never acquire an origin frame for the first time inside a
GetLocalPlayer()block: reserve it for all players first. After that, local show/hide code can reuse the cached handle.- note
Some default frames are created only after local UI activity. Quest dialog frames appear after opening the quest dialog, chat frames only exist in multiplayer, and portrait text appears after selecting a unit. Avoid these frames or force their creation for all players before acquiring their handles.
- patch
1.31.0.11889
- Source
- common.j (raise an issue to discuss on Github or submit a PR)
- return type
framehandle- Source code
native BlzGetOriginFrame takes originframetype frameType, integer index returns framehandle