Moving away from tree style for the image hflow style, but this works for now I guess

This commit is contained in:
gamer147
2025-11-24 23:08:36 -05:00
parent 6caccf553e
commit 89fae5a5a2

View File

@@ -48,7 +48,7 @@ public class ShopQuestion extends Question {
} }
String buyKey = properties.stringPropertyNames().stream() String buyKey = properties.stringPropertyNames().stream()
.filter(k -> k.startsWith("buy_")) .filter(k -> k.startsWith("buy_") && properties.getProperty(k).equals("true"))
.findFirst() .findFirst()
.orElse(null); .orElse(null);
@@ -132,13 +132,14 @@ public class ShopQuestion extends Question {
form.beginTree("shopItems", 2, header); form.beginTree("shopItems", 2, header);
for (ShopItem item : items) { for (ShopItem item : items) {
String priceCell = "text=\"" + escape(item.getPriceDisplay()) + "\""; String priceCell = "text=\"" + escape(item.getPriceDisplay()) + "\"";
String buyCell = "button{id=\"buy_" + item.getId() + "\";text=\"+1\"}"; String buyCell = "id=\"buy_" + item.getId() + "\";text=\"+1\";checkbox=\"true\"";
form.addTreeRow("i" + item.getId(), item.getName(), item.getDescription(), priceCell, buyCell); form.addTreeRow("i" + item.getId(), item.getName(), item.getDescription(), priceCell, buyCell);
} }
form.endTree(); form.endTree();
form.beginHorizontalFlow(); form.beginHorizontalFlow();
form.addButton("Close", "close"); form.addButton("Close", "close");
form.addButton("Checkout", "checkout");
form.endHorizontalFlow(); form.endHorizontalFlow();
String bml = form.toString(); String bml = form.toString();