Scenario: a Panel (simulating a text entry dialogue box) with:
- a GuiTextField into which to enter a value
- a GuiLabel with the "OK" text and a suitable background colour (simulating an "OK" button)
Operation:
- The user clicks on the GuiTextField and enter some text
- with the cursor in the GuiTextField, the user clicks the "OK" button
these are the generated event for 2. (in this order):
- PlayerGuiElementClickEvent for the click on the "OK" button
- PlayerGuiInputEvent for the text input loosing focus.
Managing event 1 usually entails closing the "dialogue box", which results in event 2 not being processed at all and the entered text to be lost (in the best case, if the relevant listener has been removed; in the worst case, it might generate an exception as the "dialogue box" pieces no longer exist).
Would it be possible to have the PlayerGuiInputEvent before the PlayerGuiElementClickEvent? This also once that "real" GUI buttons are added to the API?
(So far, I am working around this by requiring two clicks in a row on the "OK" button, but it cannot be a definitive solution.)