• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Reach Game Menu and Message Log from custom button

Status
Not open for further replies.
Level 9
Joined
Mar 26, 2017
Messages
376
I am making a custom UI that will replace all existing UI elements.

I also want to replace the F buttons in the top left, but I am currently stuck. As I see it there are three options that would work for my implementation:

1.Use BlzFrameSetVisible to show the menu popup as soon as the custom button is clicked.
-Unfortunately, I do not know how to reach this frame, if it is reachable at all.

2.Edit the current existing F button by changing the ControlBackdrop and ControlPushBackdrop with SetTexture, SetSize and SetPosition commands.
-I also don't know how to reach these frames. They are not children of ORIGIN_FRAME_SYSTEM_BUTTON.

3.Activate the menu by forcing an F-press when the custom button is clicked.
-I do not know how to do F-presses with ForceUIKey, if possible at all.
 
Last edited:
You have another option BlzFrameClick(frame) which works onto hidden frames (sadly it does not work well for checkboxes). In a button context it should only be used for the triggering player. A FRAMEEVENT_CONTROL_CLICK will still run for all players.
Beware that you do not mention a frame the first time in a GetLocalPlayer block.

BlzFrameClick can be quite usefull to enforce the game to create frames, which are only created when needed. For example quest frames, they don't exist until someone entered the quest Dialog.
An jass example using that to extend the textarea inside the questdialog. First it enforces opening the Questdialog then it enforces to hide it again by clicking the close button. After that it changes the quest frames removing all space taken by the top list in the quest info text.
JASS:
function QuestCheck takes nothing returns nothing
  call BlzFrameClick(BlzGetFrameByName("UpperButtonBarQuestsButton", 0))
  call BlzFrameClick(BlzGetFrameByName("QuestAcceptButton", 0))
  call BlzFrameSetSize(BlzGetFrameByName("QuestItemListContainer", 0), 0.01, 0.01)
  call BlzFrameSetSize(BlzGetFrameByName("QuestItemListScrollBar", 0), 0.001, 0.001)
endfunction
 
Level 9
Joined
Mar 26, 2017
Messages
376
I didn't think of BlzFrameClick, it works great!

Thank you for the warning for not mentioning frame first in GetLocal. That could be a very nasty bug that creeps into the code. Lucky I do have the habit to store data in variables, rather than repeating function calls anyway :D
 
Status
Not open for further replies.
Top