Skip to content

Commit

Permalink
Merge pull request #38 from way-zer/3.0
Browse files Browse the repository at this point in the history
fix UnlockableContent.Stats
  • Loading branch information
way-zer authored Feb 23, 2024
2 parents a09bb0c + 39bfedd commit d8b1139
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ object MindustryContentsResolver : ContentsTweaker.NodeCollector {
+CTNode.ObjInfo(it)
+CTNode.AfterHandler {
if (it is UnlockableContent) {
it.stats = Stats()
it.setStats()
it.stats = Stats().apply {
useCategories = it.stats.useCategories
}
}
if (it is Block) {
it.barMap.clear()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ object UIExtResolver : ContentsTweaker.NodeCollector {
private fun CTNodeTypeChecked<Table>.extendTable() {
val obj = objInfo.obj
node.getOrCreate("cellDefaults") += CTNode.ObjInfo(obj.defaults())
node.getOrCreate("row") += CTNode.Modifier { obj.row() }
node.getOrCreate("row") += CTNode.Modifier {
if (obj.cells.peek()?.isEndRow == false)
obj.row()
}
node.getOrCreate("align") += CTNode.Modifier {
val v = if (it.isNumber) it.asInt() else alignMap[it.asString()] ?: error("invalid align: $it")
obj.align(v)
Expand Down

0 comments on commit d8b1139

Please sign in to comment.