Skip to content

Commit

Permalink
Bug Fix: Group editing would sometimes lead to visual artifacts
Browse files Browse the repository at this point in the history
Merge Master
  • Loading branch information
GoldenGnu committed Apr 26, 2024
2 parents 8276ce8 + 0b67390 commit 3b0cb1f
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 214 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public class StockpileGroupSettings {
private final Set<String> uniqueGroups = new TreeSet<>();
//Groups expanded or collapsed
private final Map<String, Boolean> groupExpanded = new HashMap<>();
//Stockpile expanded or collapsed (when group is collapsed)
private final Map<Stockpile, Boolean> stockpileExpanded = new HashMap<>();
//The first stockpile in each group (IgnoreItem stockpile)
private final Map<String, Stockpile> groupFirst = new HashMap<>();

Expand Down Expand Up @@ -102,22 +100,6 @@ public void setGroupExpanded(String group, boolean expanded) {
groupExpanded.put(group, expanded);
}

public Boolean isStockpileExpanded(Stockpile stockpile) {
return stockpileExpanded.getOrDefault(stockpile, true);
}

public void setStockpileExpanded(Stockpile stockpile, boolean expanded) {
System.out.println("Setting: " + stockpile.getName() + " to " + (expanded ? "expanded" : "collapsed"));
stockpileExpanded.put(stockpile, expanded);
}

public void setStockpilesExpanded(List<Stockpile> stockpiles, boolean expanded) {
System.out.println("Setting all stockpiles to " + (expanded ? "expanded" : "collapsed"));
for (Stockpile stockpile : stockpiles) {
stockpileExpanded.put(stockpile, expanded);
}
}

public boolean isGroupFirst(Stockpile stockpile) {
String group = getGroup(stockpile);
Stockpile first = groupFirst.get(group);
Expand Down
Loading

0 comments on commit 3b0cb1f

Please sign in to comment.