Skip to content

Commit

Permalink
Allow visual debugging from any thread (#412)
Browse files Browse the repository at this point in the history
* This fix to the visual debugger allows this `visualizeMask()` method to be used from any thread.

* Update shared/src/main/java/com/faforever/neroxis/visualization/VisualDebugger.java

yep

Co-authored-by: Sheikah45 <[email protected]>

* Update VisualDebugger.java

Fixing syntax

---------

Co-authored-by: Sheikah45 <[email protected]>
  • Loading branch information
clivepaterson and Sheikah45 authored Aug 17, 2024
1 parent b76b0aa commit 9fa3979
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ public static void visualizeMask(Mask<?, ?> mask, String method) {
}

public static void visualizeMask(Mask<?, ?> mask, String method, String line) {
createGui();
String name = mask.getVisualName();
name = name == null ? mask.getName() : name;
updateList(name + " " + method + " " + line, mask.immutableCopy());
Mask<?, ?> copyOfmask = mask.immutableCopy();
SwingUtilities.invokeLater(() -> {
createGui();
String name = copyOfmask.getVisualName();
name = name == null ? copyOfmask.getName() : name;
updateList(name + " " + method + " " + line, copyOfmask.immutableCopy());
}
);
}

public static void createGui() {
Expand Down

0 comments on commit 9fa3979

Please sign in to comment.