Skip to content

Commit

Permalink
Visualization: use caps-lock and shift symbols to denote ButtonToMode…
Browse files Browse the repository at this point in the history
…Actions
  • Loading branch information
bwRavencl committed Aug 15, 2023
1 parent 034c7dd commit 2105ce1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/de/bwravencl/controllerbuddy/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
import de.bwravencl.controllerbuddy.input.Profile;
import de.bwravencl.controllerbuddy.input.ScanCode;
import de.bwravencl.controllerbuddy.input.action.AxisToRelativeAxisAction;
import de.bwravencl.controllerbuddy.input.action.ButtonToModeAction;
import de.bwravencl.controllerbuddy.input.action.IAction;
import de.bwravencl.controllerbuddy.input.action.IActivatableAction;
import de.bwravencl.controllerbuddy.input.action.ILongPressAction;
Expand Down Expand Up @@ -2150,8 +2151,14 @@ public void windowOpened(final WindowEvent e) {
}

private void addTSpanElement(final List<? extends IAction<?>> actions, final boolean bold, final Node parentNode) {
addTSpanElement(actions.stream().map(action -> action.getDescription(input)).distinct()
.collect(Collectors.joining(", ")), bold, parentNode);
addTSpanElement(actions.stream().map(action -> {
var description = action.getDescription(input);

if (action instanceof final ButtonToModeAction buttonToModeAction)
description = (buttonToModeAction.isToggle() ? "⇪" : "⇧") + " " + description;

return description;
}).distinct().collect(Collectors.joining(", ")), bold, parentNode);
}

private void addTSpanElement(final String textContent, final boolean bold, final Node parentNode) {
Expand Down

0 comments on commit 2105ce1

Please sign in to comment.