Jump to content

Hijack the notifications section of the hud?


RedxYeti

Recommended Posts

I was wondering if I could use ui.invoke() to use the notifications in the top left for my own use.

 

I don't own Adobe flash nor do I really want to learn how to make a widget for hudframework when all I need is a message to show up longer than a debug notification, but not stop the game.

Link to comment
Share on other sites

How does it not support strings?

 

Also no, unless you reverse engineer the HUD framework. Unfortunately we do not have the same level of transparency in UI code, as we did for Skyrim. The function you want to invoke to is simply missing in the HUD framework.

 

Edit: actually I was wrong about transparency. Scrivener07 did it some 2 years ago. But I don't how he's related to the "official" HUD framework and/or script extender team.

 

https://github.com/F4CF/Interface

 

Maybe ask on their Discord channel?

Link to comment
Share on other sites

It is possible you could find some solution but it's unchartered waters and you will have to do some digging into HUDmenu.swf and its many scripts. I believe HUDmessageItemData and HUDmessageItem are the ones to investigate as well as their corresponding sprite container, HUDMessageItemInternal_mc or PromptMessage_mc. And I think Set() will need to be involved more than Invoke().

 

There are some public actionscript elements exposed to you:

 

public var messageText:String

public var isWarning:Boolean

public var isRadioStation:Boolean

public function HUDMessageItemData(param1:String, param2:Boolean, param3:Boolean)

public function get data()
public function set data(param1:HUDMessageItemData)
override public function redrawUIComponent()
But mostly it's Private and Protected. You will likely end up doing more experimentation than actual creation.
Link to comment
Share on other sites

I figured it out using the ShowAsHelpMessage-option. Try it?

; cgf "menu.MessageInject" in console
Function MessageInject() Global ; ...or MessageInject(String someString), and then replace 1234, 5678 with someString
CloseConsole() ; convenience function

; this is an empty message from Fallout4.esm
Message Msg = Short(0x48328) as Message ; short is also a convenience function

; initiate the message. Params are in the wiki.
Msg.ShowAsHelpMessage("Jump", 15, 0, 0)

; To set text without creating var arrays, this doesn't shrink/grow the textfield to fit but you you have other possibilities, see last comment.
String SimpleSetText = UI.Set("HUDMenu", "root1.HUDNotificationsGroup_mc.TutorialText_mc.TutorialText_tf.text", "1234")

; Better way to set. Shrinks/grows box to fit text. You must create a var array first even if just one element.
String BetterSetText = UI.Invoke("HUDMenu", "root1.HUDNotificationsGroup_mc.TutorialText_mc.SetText", VarArray(1, "5687")) ; conv. function

; if you for some reason need to check what text is currently in this "movieclip":
String GetText = UI.Get("HUDMenu", "root1.HUDNotificationsGroup_mc.TutorialText_mc.TutorialText_tf.text")

; if it has been played once as helpmessage, it needs to be reset before reuse
Message.ResetHelpMessage("Jump")

; It is also possible to manipulate other parameters than ".text" within TutorialText_tf. For instance ".textHeight". Include a float in your var array to specify size. Use UI.Set()
EndFunction
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...