Originally Posted by Baertram
Just checked ingame:
If the "report player" screen is shown the variable SCENE_MANAGER.currentScene.name = "helpCustomerSupport".
Scene = HELP_CUSTOMER_SUPPORT_SCENE
One fragment of this scene (SCENE_MANAGER.currentScene.fragments) is (within keyboard mode! Did not check the gamepad mode!)
HELP_CUSTOMER_SERVICE_ASK_FOR_HELP_KEYBOARD_FRAGMENT
So you could try to check if this fragment is only active as the "report player" interaction was executed (or maybe too if the /bug report is started).
You could use the callback funciton on "fragment_shown" state, as shown in the thread that I've linked above, to check for the edit controls are not hidden.
The edit control names are
Player name to report (CT_LABEL)
ZO_Help_Ask_For_Help_Keyboard_ControlDetailsTextLineFieldText
Description text (CT_LABEL)
ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText
You are able to change the text in the description field by using something like this:
ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText:SetText("Hello world")
This worked for me.
Example code:
Lua Code:
HELP_CUSTOMER_SERVICE_ASK_FOR_HELP_KEYBOARD_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState) -[[ possible states are: SCENE_FRAGMENT_SHOWN = "shown" SCENE_FRAGMENT_HIDDEN = "hidden" SCENE_FRAGMENT_SHOWING = "showing" SCENE_FRAGMENT_HIDING = "hiding" ]]-- if newState == SCENE_FRAGMENT_SHOWN then local descCtrl = WINDOW_MANAGER:GetControlByName("ZO_Help_Ask_For_Help_Keyboard_ControlDetailsTextLineFieldText", "") if descCtrl ~= nil then descCtrl:SetText("Hello World") end end end) -- function
If this doesn't work maybe try to add a small delay via function zo_callLater(function(), delayInMilliseconds) for testing purposes before the control get's assigned to descCtrl. Sometimes the controls are not always "there" already if a sene or fragment is shown.
|
Okay, I finally had some time to poke through this problem with your guidance.
You were extremely close with your Controls, specifically
Lua Code:
ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText:SetText()
on this control actually sets the gray text that disappears when you go to type in a report...
However, some poking around revealed its parent
Lua Code:
ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyField:SetText("")
this control actually sets the white text (The actual description field) that I needed and automatically activates the submit button (which still needs to be pressed for now).
Even better, no delay or extra callbacks are even required. I can just call up the report window and instantly set the control fields.
Your insight and guidance was invaluable, now that I have an idea how to poke around existing GUI environments, things are going to get more interesting for sure.