MCPcopy Create free account
hub / github.com/badvision/jace / memoryViewClicked

Method memoryViewClicked

src/main/java/jace/ui/MetacheatUI.java:392–430  ·  view source on GitHub ↗
(MouseEvent e)

Source from the content-addressed store, hash-verified

390 Tooltip memoryWatchTooltip = new Tooltip();
391
392 private void memoryViewClicked(MouseEvent e) {
393 if (cheatEngine != null) {
394 Watch currentWatch = (Watch) memoryWatchTooltip.getGraphic();
395 if (currentWatch != null) {
396 currentWatch.disconnect();
397 }
398
399 double x = e.getX() / drawScale;
400 double y = e.getY() / drawScale;
401 int col = (int) (x / MEMORY_BOX_TOTAL_SIZE);
402 int row = (int) (y / MEMORY_BOX_TOTAL_SIZE);
403 int addr = cheatEngine.getStartAddress() + row * memoryViewColumns + col;
404 Watch watch = new Watch(addr, this);
405
406 Label addWatch = new Label("Watch >>");
407 addWatch.setOnMouseClicked((mouseEvent) -> {
408 Watch newWatch = addWatch(addr);
409 if (watch.holdingProperty().get()) {
410 newWatch.holdingProperty().set(true);
411 }
412 memoryWatchTooltip.hide();
413 });
414 watch.getChildren().add(addWatch);
415
416 Label addCheat = new Label("Cheat >>");
417 addCheat.setOnMouseClicked((mouseEvent) -> {
418 Platform.runLater(() -> addCheat("Memory View " + Integer.toHexString(addr), addr, watch.getValue()));
419 });
420 watch.getChildren().add(addCheat);
421
422 memoryWatchTooltip.setStyle("-fx-background-color:NAVY");
423 memoryWatchTooltip.onHidingProperty().addListener((prop, oldVal, newVal) -> {
424 watch.disconnect();
425 memoryWatchTooltip.setGraphic(null);
426 });
427 memoryWatchTooltip.setGraphic(watch);
428 memoryWatchTooltip.show(memoryViewContents, e.getScreenX() + 5, e.getScreenY() - 15);
429 }
430 }
431
432 private void processMemoryViewUpdates() {
433 boolean isRunning = Emulator.withComputer(c->c.getMotherboard().isRunning(), false);

Callers

nothing calls this directly

Calls 13

disconnectMethod · 0.95
addWatchMethod · 0.95
holdingPropertyMethod · 0.95
addCheatMethod · 0.95
getValueMethod · 0.95
getXMethod · 0.80
getYMethod · 0.80
getStartAddressMethod · 0.80
setMethod · 0.80
addMethod · 0.80
getMethod · 0.45
getChildrenMethod · 0.45

Tested by

no test coverage detected