diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2024-07-20 02:12:42 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2024-07-20 02:12:42 -0400 |
commit | a2b9e7822ccb32061a97de0bcbf400ea28e94d45 (patch) | |
tree | c66b692d2ad4deabd7aa469adf46f67387817659 /src/main/java/net/sowgro/npehero/devmenu/DiffList.java | |
parent | aa261bf9490582033bef55afec92673ea36d87cd (diff) | |
download | NPEhero-a2b9e7822ccb32061a97de0bcbf400ea28e94d45.tar.gz NPEhero-a2b9e7822ccb32061a97de0bcbf400ea28e94d45.tar.bz2 NPEhero-a2b9e7822ccb32061a97de0bcbf400ea28e94d45.zip |
Begin level validation and more refactoring
Diffstat (limited to 'src/main/java/net/sowgro/npehero/devmenu/DiffList.java')
-rwxr-xr-x | src/main/java/net/sowgro/npehero/devmenu/DiffList.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/net/sowgro/npehero/devmenu/DiffList.java b/src/main/java/net/sowgro/npehero/devmenu/DiffList.java index 7c5a435..e27e90d 100755 --- a/src/main/java/net/sowgro/npehero/devmenu/DiffList.java +++ b/src/main/java/net/sowgro/npehero/devmenu/DiffList.java @@ -15,24 +15,27 @@ import net.sowgro.npehero.main.Sound; public class DiffList extends Pane { - /* - * this class is a layout class, most of its purpose is to place UI elements like Buttons within Panes like VBoxes. - * the creation of these UI elements are mostly not commented due to their repetitive and self explanatory nature. - * style classes are defined in the style.css file. - */ + public DiffList(Level level, Pane prev) { //sets up table view: requires special getters, setters and constructors to work TableView<Difficulty> diffs = new TableView<>(); TableColumn<Difficulty,String> titleCol = new TableColumn<>("Name"); - TableColumn<Difficulty,Boolean> validCol = new TableColumn<>("Valid?"); + TableColumn<Difficulty,String> validCol = new TableColumn<>("Valid?"); diffs.getColumns().add(titleCol); diffs.getColumns().add(validCol); titleCol.setCellValueFactory(data -> new ReadOnlyStringWrapper(data.getValue().title)); - validCol.setCellValueFactory(data -> new ReadOnlyBooleanWrapper(data.getValue().isValid)); + validCol.setCellValueFactory(data -> { + if (data.getValue().isValid) { + return new ReadOnlyStringWrapper("Yes"); + } + else { + return new ReadOnlyStringWrapper("No"); + } + }); diffs.setItems(level.difficulties.list); |