MCPcopy Create free account
hub / github.com/FabricMC/Matcher / init

Method init

src/main/java/matcher/gui/Shortcuts.java:11–28  ·  view source on GitHub ↗
(Gui gui)

Source from the content-addressed store, hash-verified

9
10class Shortcuts {
11 public static void init(Gui gui) {
12 Map<KeyCombination, Runnable> accelerators = gui.getScene().getAccelerators();
13
14 // M - match
15 accelerators.put(new KeyCodeCombination(KeyCode.M), () -> gui.getBottomPane().getMatchButton().fireEvent(new ActionEvent()));
16 // U - unmatch
17 accelerators.put(new KeyCodeCombination(KeyCode.U), () -> {
18 if (!gui.getBottomPane().getUnmatchVarButton().isDisable()) {
19 gui.getBottomPane().getUnmatchVarButton().fireEvent(new ActionEvent());
20 } else if (!gui.getBottomPane().getUnmatchMemberButton().isDisable()) {
21 gui.getBottomPane().getUnmatchMemberButton().fireEvent(new ActionEvent());
22 } else if (!gui.getBottomPane().getUnmatchClassButton().isDisable()) {
23 gui.getBottomPane().getUnmatchClassButton().fireEvent(new ActionEvent());
24 }
25 });
26 // I - ignore (toggle matchable)
27 accelerators.put(new KeyCodeCombination(KeyCode.I), () -> gui.getBottomPane().getMatchableButton().fireEvent(new ActionEvent()));
28 }
29}

Callers 1

startMethod · 0.95

Calls 7

getSceneMethod · 0.80
getMatchButtonMethod · 0.80
getBottomPaneMethod · 0.80
getUnmatchVarButtonMethod · 0.80
getUnmatchClassButtonMethod · 0.80
getMatchableButtonMethod · 0.80

Tested by

no test coverage detected