| 29 | import javafx.collections.ObservableList; |
| 30 | |
| 31 | public class MetaCheat extends Cheats { |
| 32 | public enum SearchType { |
| 33 | VALUE, TEXT, CHANGE |
| 34 | } |
| 35 | |
| 36 | public enum SearchChangeType { |
| 37 | NO_CHANGE, ANY_CHANGE, LESS, GREATER, AMOUNT |
| 38 | } |
| 39 | |
| 40 | public static class SearchResult { |
| 41 | |
| 42 | int address; |
| 43 | int lastObservedValue = 0; |
| 44 | |
| 45 | private SearchResult(int address, int val) { |
| 46 | this.address = address; |
| 47 | lastObservedValue = val; |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public String toString() { |
| 52 | return Integer.toHexString(address) + ": " + lastObservedValue + " (" + Integer.toHexString(lastObservedValue) + ")"; |
| 53 | } |
| 54 | |
| 55 | public int getAddress() { |
| 56 | return address; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | MetacheatUI ui; |
| 61 | |
| 62 | public int fadeRate = 1; |
| 63 | public int lightRate = 30; |
| 64 | public int historyLength = 10; |
| 65 | |
| 66 | private int startAddress = 0; |
| 67 | private int endAddress = 0x0BFFF; |
| 68 | private final StringProperty startAddressProperty = new SimpleStringProperty(Integer.toHexString(startAddress)); |
| 69 | private final StringProperty endAddressProperty = new SimpleStringProperty(Integer.toHexString(endAddress)); |
| 70 | private boolean byteSized = true; |
| 71 | private SearchType searchType = SearchType.VALUE; |
| 72 | private SearchChangeType searchChangeType = SearchChangeType.NO_CHANGE; |
| 73 | private final BooleanProperty signedProperty = new SimpleBooleanProperty(false); |
| 74 | private final StringProperty searchValueProperty = new SimpleStringProperty("0"); |
| 75 | private final StringProperty changeByProperty = new SimpleStringProperty("0"); |
| 76 | private final ObservableList<DynamicCheat> cheatList = FXCollections.observableArrayList(); |
| 77 | private final ObservableList<SearchResult> resultList = FXCollections.observableArrayList(); |
| 78 | private final ObservableList<State> snapshotList = FXCollections.observableArrayList(); |
| 79 | |
| 80 | public MetaCheat() { |
| 81 | addNumericValidator(startAddressProperty); |
| 82 | addNumericValidator(endAddressProperty); |
| 83 | addNumericValidator(searchValueProperty); |
| 84 | addNumericValidator(changeByProperty); |
| 85 | startAddressProperty.addListener((prop, oldVal, newVal) -> { |
| 86 | startAddress = Math.max(0, Math.min(65535, parseInt(newVal))); |
| 87 | }); |
| 88 | endAddressProperty.addListener((prop, oldVal, newVal) -> { |
nothing calls this directly
no test coverage detected