diff options
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); |