Thread: Reporting Bots
View Single Post
10/08/17, 03:15 PM   #5
Drummerx04
AddOn Author - Click to view addons
Join Date: Sep 2017
Posts: 54
Originally Posted by Baertram View Post
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:
  1. HELP_CUSTOMER_SERVICE_ASK_FOR_HELP_KEYBOARD_FRAGMENT:RegisterCallback("StateChange",  function(oldState, newState)
  2. -[[ possible states are:
  3.                 SCENE_FRAGMENT_SHOWN = "shown"
  4.                 SCENE_FRAGMENT_HIDDEN = "hidden"
  5.                 SCENE_FRAGMENT_SHOWING = "showing"
  6.                 SCENE_FRAGMENT_HIDING = "hiding"
  7.             ]]--
  8. if newState == SCENE_FRAGMENT_SHOWN then
  9.    local descCtrl = WINDOW_MANAGER:GetControlByName("ZO_Help_Ask_For_Help_Keyboard_ControlDetailsTextLineFieldText", "")
  10. if descCtrl  ~= nil then
  11.  descCtrl:SetText("Hello World")
  12. end
  13. end
  14. 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:
  1. 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:
  1. 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.

Last edited by Drummerx04 : 10/08/17 at 03:59 PM.
  Reply With Quote