aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/devmenu/DiffList.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2024-07-20 02:12:42 -0400
committersowgro <tpoke.ferrari@gmail.com>2024-07-20 02:12:42 -0400
commita2b9e7822ccb32061a97de0bcbf400ea28e94d45 (patch)
treec66b692d2ad4deabd7aa469adf46f67387817659 /src/main/java/net/sowgro/npehero/devmenu/DiffList.java
parentaa261bf9490582033bef55afec92673ea36d87cd (diff)
downloadNPEhero-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-xsrc/main/java/net/sowgro/npehero/devmenu/DiffList.java17
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);