Page MenuHomeFeedback Tracker

Get topmost display command
New, NormalPublic

Description

Requesting command that returns the topmost UI display

The command could be called "GetActiveDisplay"

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

The command should return the latest/active dialog created with createDialog

Additional Information

allDisplays can't do this because the displays returned are in random order

Event Timeline

gc8 created this task.Sep 1 2024, 2:13 PM
gc8 updated the task description. (Show Details)Sep 1 2024, 2:15 PM
dedmen added a subscriber: dedmen.Sep 5 2024, 11:05 AM

allDisplays can't do this because the displays returned are in random order

But would the more obvious fix, not be to return them in-order?

Also random order?
You not knowing the order, does not mean its random.
Looking at the code its
Options (+children), UserDialog (+children), Map, ChatChannel, Chat, VoiceChat, extra displays (in reversed order)

How about we just fix that command to show correct order?
Children renders before parent. Additionally each display can have a "message box" which renders after the display itself.

So it should be

  • "Main" UI (This is completely missing in allDisplays command?)
  • (If userdialog is !ForceOnTop) UserDialogChildren, UserDialog
  • OptionsChildren, OptionsDialog
  • (If userdialog is ForceOnTop) UserDialogChildren, UserDialog
  • Extra displays in reverse order (and each's children first)
  • ChatChannel
  • Chat
  • VoiceChat
  • WarningMessage
  • Scoretable

But is it about rendering or simulation order.
In simulation, the "last" child of a display, is the only one that gets simulated.

Order is

  • WarningMessage
  • VoiceChat
  • Chat
  • Extra displays, in forward order. And it aborts after the first display it finds
  • Scoretable, if its open
  • UserDialog if exists else UavMapTermianl if exists else map if exists
  • options UI (If scoretable is not open)

Wow this is a mess huh?

If we were to implement a command that returns the "Active" display. We anyway have to write the code to check all displays in the correct order.
It would be much simpler to make allDisplays return in that order.

It is not clear what you mean by "topmost".
To me, topmost means the one that renders at the top. Which means render order.
But you called the command "active", which to me means is the one that has input focus, if you press a button, then that display is where it goes to. Which means simulation order.
And also there might be displays over top of the one that has input focus, that get simulated first, but don't actually accept any input.

gc8 added a comment.EditedSep 5 2024, 2:16 PM

Having allDisplays return in correct order would work for me. What I meant by topmost was the rendering order and I thought this would be same as input focus. The reason I need the topmost display is so that I can add new controls to it via ctrlCreate so that those controls wont get hidden behind UI elements from other displays