• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How can I add Frame Events to the default UI?

Level 24
Joined
Jun 26, 2020
Messages
1,928
Hello, I wanna know if is possible add an event for example when I click the Quest button, because I tried to do that by doing:
Lua:
local t = CreateTrigger()
BlzTriggerRegisterFrameEvent(t, BlzGetFrameByName("QuestAcceptButton", 0), FRAMEEVENT_CONTROL_CLICK)
TriggerAddAction(t, function ()
But it didn't work, it is even possible? @Tasyen
 
it is possible to add frameevents to default frames, when the frame is of a type that can have frame-events. And The target frame needs to exist at the moment you try to add a event.

The quest frames only exist after the quest menu button was clicked and there were quests.

enforce open & close of the quest dialog after your map created quests:
Lua:
BlzFrameClick(BlzGetFrameByName("UpperButtonBarQuestsButton", 0))
BlzFrameClick(BlzGetFrameByName("QuestAcceptButton", 0))
 
Level 3
Joined
Mar 15, 2022
Messages
16
y,在魔兽争霸 3 V1.31.1 中,simplebutton 只能有一个 frameevent。
Does that mean I can't use BlzTriggerRegisterFrameEvent to add mouse input events to inventory, like this.
JASS:
call BlzTriggerRegisterFrameEvent(gg_trg_UIOriginInventoryEnter, BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0), FRAMEEVENT_MOUSE_ENTER)
or
JASS:
call BlzTriggerRegisterFrameEvent(gg_trg_UIOriginInventoryEnter, BlzGetFrameByName("InventoryButton_0", 0), FRAMEEVENT_MOUSE_ENTER)
 
Last edited:
one approach is:
you add for each item button an unique empty tooltip.
Then you use the player mouse event, you check if one of the item buttons tooltips is visible and BlzSendSyncData. In the BlzSendSyncData event you (un)equip the item for trigger Player.

Some other approach:
you could move all normal picked up items into your custom bag and a buttonClick in the custom UI would equip it. This avoids the problem but is a bit ugly for the player.
 
Level 3
Joined
Mar 15, 2022
Messages
16
Is the code right?
I moved my mouse over the Inventory Button, but the tooltip doesn't seem to work.
JASS:
set ToolTip0 = BlzCreateFrameByType("TEXT", "OriginItemButton0Tooltip", BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0),"", 0)
call BlzFrameSetAllPoints(ToolTip0, BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0))
call BlzFrameSetTooltip(BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0), ToolTip0)
call BlzFrameSetText(ToolTip0, "This is a test text")
 
Last edited:
this code would be right. But it does not work for simpleframes, whch the item Buttons are. simplebuttons only accept simpleframes as tooltips.

part of the simpleframe example from UI: Frames and Tooltips
Lua:
local icon = BlzCreateFrameByType("SIMPLESTATUSBAR", "", BlzGetFrameByName("ConsoleUI", 0), "", 0)
        BlzFrameClearAllPoints(icon)
        BlzFrameSetPoint(icon, FRAMEPOINT_BOTTOM, simpleFrame, FRAMEPOINT_TOP, 0, 0.006)
        BlzFrameSetSize(icon, 0.04, 0.04)
        BlzFrameSetTexture(icon, "ReplaceableTextures\\CommandButtons\\BTNPriest", 0, false)
        BlzFrameSetValue(icon, 100)
        BlzFrameSetTooltip(simpleFrame, icon)
        -- SimpleFrameTooltip is not hidden by calling BlzFrameSetTooltip, hide it
        BlzFrameSetVisible(icon, false)
 
Top