Thread: Reporting Bots
View Single Post
10/08/17, 07:21 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,982
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.

Last edited by Baertram : 10/08/17 at 07:25 AM.
  Reply With Quote