Skip to content

DefaultUI Coordinate gets stuck at loading state

Summary

Using a coordinate in the DefaultUI causes some visual issue on the button itself. Clicking on the button twice in a row results in the button text changing to Loading... instead of displaying the value of the property.

Steps to reproduce

  1. Add DefaultUI to your bot.
  2. Add a Coordinate setting.
  3. Load up the bot
  4. Press the button twice in a row

Example Code

default @Nullable Coordinate test() {
    return null;
}

What is the current behavior?

After clicking twice on the button, the button text changes to Loading....

What is the expected correct behavior?

The button text should properly show the value its set to.

Relevant logs and/or screenshots

java_YFmGgCVIuI

https://i.imgur.com/JAvPlBG.gif

Possible fixes

In Control.java there is a forCoordinate method that should take care of this logic. Perhaps adding button.setText(property.getValue().toString()); to line 223, however the listener inside that method should already take care of it. Not sure why that is not happening.