- Joined
- Jul 12, 2010
- Messages
- 1,737
Alright so after reading this tutorial from Tasyen and converting it to jass I'm having problems with creating an additional click-able glue button frame on top of it.
But my problem is that the gluebutton is on top of the hover frame and prevents the tooltip from showing OR it's the other way around.
Code:
Map Download: Here
Perhaps I'm using the wrong frame types?
+rep to anybody that can help, thanks!
JASS:
local framehandle click = BlzCreateFrameByType("GLUEBUTTON" , "ClickButton" , BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
Code:
JASS:
function CreateItems takes nothing returns nothing
//------------Item 1-------------------
local framehandle Item1 = BlzCreateFrameByType("BACKDROP", "Item1", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
local framehandle Item1Hover = BlzCreateFrameByType("FRAME", "FaceFrame", Item1,"", 0)
local framehandle Item1tooltip = BlzCreateFrame("BoxedText", Item1, 1, 1)
//------------Item 2-------------------
local framehandle Item2 = BlzCreateFrameByType("BACKDROP", "Item2", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
local framehandle Item2Hover = BlzCreateFrameByType("FRAME", "FaceFrame", Item2,"", 0)
local framehandle Item2tooltip = BlzCreateFrame("BoxedText", Item2, 2, 2)
//------------Item 3-------------------
local framehandle Item3 = BlzCreateFrameByType("BACKDROP", "Item3", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
local framehandle Item3Hover = BlzCreateFrameByType("FRAME", "FaceFrame", Item3,"", 0)
local framehandle Item3tooltip = BlzCreateFrame("BoxedText", Item3, 3, 3)
//------------End of Locals------------
//------------Item 1 Settings----------
call BlzFrameSetAllPoints(Item1Hover, Item1)
call BlzFrameSetTooltip(Item1Hover, Item1tooltip)
call BlzFrameSetSize(Item1, 0.04, 0.04)
call BlzFrameSetAbsPoint(Item1, FRAMEPOINT_CENTER, 0.5, 0.3)
// call BlzFrameSetAbsPoint(Item1tooltip, FRAMEPOINT_CENTER, 0.2, 0.3)
call BlzFrameSetPoint(Item1tooltip, FRAMEPOINT_BOTTOM, Item1, FRAMEPOINT_TOP, 0.0, 0.0)
call BlzFrameSetSize(Item1tooltip, 0.15, 0.08)
call BlzFrameSetText(BlzGetFrameByName("BoxedTextValue", 1), "This items gives good Attack Damage bonus.")
call BlzFrameSetText(BlzGetFrameByName("BoxedTextTitle", 1), "Claws of Attack")
call BlzFrameSetTexture(Item1, "ReplaceableTextures\\CommandButtons\\BTNClawsOfAttack",0, true)
//------------Item 2 Settings----------
call BlzFrameSetAllPoints(Item2Hover, Item2)
call BlzFrameSetTooltip(Item2Hover, Item2tooltip)
call BlzFrameSetSize(Item2, 0.04, 0.04)
call BlzFrameSetAbsPoint(Item2, FRAMEPOINT_CENTER, 0.1, 0.4)
// call BlzFrameSetAbsPoint(Item2tooltip, FRAMEPOINT_CENTER, 0.2, 0.3)
call BlzFrameSetPoint(Item2tooltip, FRAMEPOINT_LEFT, Item2, FRAMEPOINT_RIGHT, 0.0, 0.0)
call BlzFrameSetSize(Item2tooltip, 0.15, 0.04)
call BlzFrameSetText(BlzGetFrameByName("BoxedTextValue", 2), "This gem is shiny!")
call BlzFrameSetText(BlzGetFrameByName("BoxedTextTitle", 2), "Green Gem")
call BlzFrameSetTexture(Item2, "ReplaceableTextures\\CommandButtons\\BTNGem",0, true)
//------------Item 3 Settings----------
call BlzFrameSetAllPoints(Item3Hover, Item3)
call BlzFrameSetTooltip(Item3Hover, Item3tooltip)
call BlzFrameSetSize(Item3, 0.04, 0.04)
call BlzFrameSetAbsPoint(Item3, FRAMEPOINT_CENTER, 0.2, 0.3)
// call BlzFrameSetAbsPoint(Item3tooltip, FRAMEPOINT_CENTER, 0.2, 0.3)
call BlzFrameSetPoint(Item3tooltip, FRAMEPOINT_LEFT, Item3, FRAMEPOINT_RIGHT, 0.0, 0.0)
call BlzFrameSetSize(Item3tooltip, 0.15, 0.08)
call BlzFrameSetText(BlzGetFrameByName("BoxedTextValue", 3), "Makes you run faster.")
call BlzFrameSetText(BlzGetFrameByName("BoxedTextTitle", 3), "Boots of Speed")
call BlzFrameSetTexture(Item3, "ReplaceableTextures\\CommandButtons\\BTNBootsOfSpeed",0, true)
//-------------------------------------
endfunction
//===========================================================================
function InitTrig_Items takes nothing returns nothing
set gg_trg_Items = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Items, 0.50 )
call TriggerAddAction( gg_trg_Items, function CreateItems)
call BlzLoadTOCFile("war3mapimported\\BoxedText.toc")
endfunction
JASS:
function clicked takes nothing returns nothing
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 5.00, "Click." )
call BlzFrameSetEnable(BlzGetTriggerFrame(), false) //disable the clicked button
call BlzFrameSetEnable(BlzGetTriggerFrame(), true) //enable it again.
endfunction
function Trig_Melee_Initialization_Actions takes nothing returns nothing
local trigger trig01 = CreateTrigger()
local framehandle click = BlzCreateFrameByType("GLUEBUTTON" , "ClickButton" , BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(click, 0.04, 0.04)
call BlzFrameSetAbsPoint(click, FRAMEPOINT_CENTER, 0.5, 0.3)
call BlzTriggerRegisterFrameEvent(trig01, click , FRAMEEVENT_CONTROL_CLICK)
call TriggerAddAction(trig01, function clicked )
endfunction
//===========================================================================
function InitTrig_glue_button takes nothing returns nothing
set gg_trg_glue_button = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_glue_button,0.60 )
call TriggerAddAction( gg_trg_glue_button, function Trig_Melee_Initialization_Actions )
endfunction
Map Download: Here
Perhaps I'm using the wrong frame types?
+rep to anybody that can help, thanks!