HowPinging @Tasyen
What I want to know is how I can move the animated portrait and command buttonsMyPad already did with the @.
Here, read this. It may help you understand what you're trying to do (whatever it is, exactly). There is a lot of information.
The Big UI-Frame Tutorial
www.hiveworkshop.com
function ReposMenuButtons2 takes nothing returns nothing
local framehandle fh = BlzGetFrameByName("UpperButtonBarMenuButton",0)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_RIGHT, 0.5, 0.5)
endfunction
Could you tell me the names of framesyou get a framehandle to the wanted frame, unbind current position, then move it.
example from UI: Positionate Frames
you would replace BlzGetFrameByName("UpperButtonBarMenuButton",0) with something else to get the command button / animated portrait.JASS:function ReposMenuButtons2 takes nothing returns nothing local framehandle fh = BlzGetFrameByName("UpperButtonBarMenuButton",0) call BlzFrameClearAllPoints(fh) call BlzFrameSetAbsPoint(fh, FRAMEPOINT_RIGHT, 0.5, 0.5) endfunction
There is a section in the tutorial only about moving such default UI frames, with short code snippets, (it has examples for command button and animated portrait):
[JASS/AI] - The Big UI-Frame Tutorial. 3. Access Frames - Move Default UI
I'm using 1.31("CommandButton_0", 0)
("CommandButton_1", 0)
("CommandButton_10", 0)
("CommandButton_11", 0)
("CommandButton_2", 0)
("CommandButton_3", 0)
("CommandButton_4", 0)
("CommandButton_5", 0)
("CommandButton_6", 0)
("CommandButton_7", 0)
("CommandButton_8", 0)
("CommandButton_9", 0)
BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0)
if GetLocalizedString("REFORGED") == "REFORGED" then
// runs in Not Reforged
BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 0)
else
// runs in Reforged (Warcraft 3 V1.32+)
BlzGetFrameByName("CommandButton_0", 0)
endif
I was trying but it doesn't work for me, could you please create a sample mapk, then the name version don't work for your Warcraft 3 version.
BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 0)
BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 1)
BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 2)
...
BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 11)
The name versions for command buttons were added in Warcraft 3 V1.32.x and should be used for moving them. But in V1.31.x you just use the Origin version. If you want your ui modification work in both versions you could get the version do an if and use the suited approach for the game version currently running your map. Or just don't care for other versions (makes it less work)
JASS:if GetLocalizedString("REFORGED") == "REFORGED" then // runs in Not Reforged BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 0) else // runs in Reforged (Warcraft 3 V1.32+) BlzGetFrameByName("CommandButton_0", 0) endif
function GetCommandButton takes integer index returns framehandle
if GetLocalizedString("REFORGED") == "REFORGED" then
// runs in Not Reforged
return BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, index)
else
// runs in Reforged (Warcraft 3 V1.32+)
return BlzGetFrameByName("CommandButton_" + I2S(index), 0)
endif
endfunction
function Test takes nothing returns nothing
local framehandle fh
// ORIGIN_FRAME_PORTRAIT needs either call BlzHideOriginFrames(true) or call BlzEnableUIAutoPosition(false) to be moveable
call BlzEnableUIAutoPosition(false)
set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.4, 0.3)
set fh=GetCommandButton(0)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.4, 0.22)
set fh=GetCommandButton(1)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.44, 0.22)
set fh=GetCommandButton(2)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.48, 0.22)
endfunction
Frame "SIMPLEFRAME" "ConsoleUI" {
DecorateFileNames,
Texture {
File "ConsoleTexture03",
Width 0.256,
Height 0.176,
TexCoord 0, 1, 0.3125, 1,
AlphaMode "ALPHAKEY",
Anchor BOTTOMRIGHT,-0.032,0.0,
}
}
Frame "SIMPLEFRAME" "SimpleInventoryBar" {
UseActiveContext,
SetAllPoints,
Frame "SIMPLEBUTTON" "InventoryButton_0" INHERITS "InventoryButtonTemplate" {
SetPoint TOPLEFT, "SimpleInventoryBar", TOPRIGHT, 0.0187, -0.0021,
}
Frame "SIMPLEBUTTON" "InventoryButton_1" INHERITS "InventoryButtonTemplate" {
SetPoint TOPLEFT, "SimpleInventoryBar", TOPRIGHT, 0.0587, -0.0021,
}
Frame "SIMPLEBUTTON" "InventoryButton_2" INHERITS "InventoryButtonTemplate" {
SetPoint TOPLEFT, "SimpleInventoryBar", TOPRIGHT, 0.0187, -0.0403,
}
Frame "SIMPLEBUTTON" "InventoryButton_3" INHERITS "InventoryButtonTemplate" {
SetPoint TOPLEFT, "SimpleInventoryBar", TOPRIGHT, 0.0587, -0.0403,
}
Frame "SIMPLEBUTTON" "InventoryButton_4" INHERITS "InventoryButtonTemplate" {
SetPoint TOPLEFT, "SimpleInventoryBar", TOPRIGHT, 0.0187, -0.0784,
}
Frame "SIMPLEBUTTON" "InventoryButton_5" INHERITS "InventoryButtonTemplate" {
SetPoint TOPLEFT, "SimpleInventoryBar", TOPRIGHT, 0.0587, -0.0784,
}
Frame "TEXT" "InventoryText"{
Width 0.07125,
Height 0.01125,
DecorateFileNames,
SetPoint TOPLEFT, "SimpleInventoryBar", TOPRIGHT, 0.0187, 0.015,
Text "INVENTORY",
FrameFont "MasterFont", 0.0109, "",
FontFlags "FIXEDSIZE",
FontColor 0.99 0.827 0.070 1.0,
FontShadowColor 0.0 0.0 0.0 0.9,
FontShadowOffset 0.001 -0.001,
FontJustificationH JUSTIFYCENTER,
}
}