From ddb89d4ee5f31f6c12d133b97072dfc76698acfe Mon Sep 17 00:00:00 2001 From: egocarib Date: Mon, 24 Jun 2024 07:44:16 -0500 Subject: [PATCH] update RandomTile logic (fixes #116) --- hagadias/qudobject.py | 2 +- hagadias/tilepainter.py | 4 ++-- hagadias/tilestyle.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hagadias/qudobject.py b/hagadias/qudobject.py index b93ea06..8b1e487 100644 --- a/hagadias/qudobject.py +++ b/hagadias/qudobject.py @@ -146,7 +146,7 @@ def has_tile(self) -> bool: if self.name in ["ScrapCape", "CatacombWall"]: return True # special cases, not sure why they're marked as BaseObjects return False - if self.part_Render_Tile or self.part_RandomTile is not None: + if self.part_Render_Tile or self.builder_RandomTile is not None: return True if self.tag_PaintedFence and self.tag_PaintedFence_Value != "*delete": return True diff --git a/hagadias/tilepainter.py b/hagadias/tilepainter.py index 7097d03..52752dd 100644 --- a/hagadias/tilepainter.py +++ b/hagadias/tilepainter.py @@ -134,8 +134,8 @@ def _apply_primer(self): # determine tile filepath self.file = self.obj.part_Render_Tile - if self.obj.part_RandomTile: - self.file = self.obj.part_RandomTile_Tiles.split(",")[0] + if self.obj.builder_RandomTile: + self.file = self.obj.builder_RandomTile_Tiles.split(",")[0] # apply special initial tile properties to certain objects and parts if ( diff --git a/hagadias/tilestyle.py b/hagadias/tilestyle.py index 18a92ea..bacbcc4 100644 --- a/hagadias/tilestyle.py +++ b/hagadias/tilestyle.py @@ -490,7 +490,7 @@ def __init__(self, _painter): super().__init__( _painter, _priority=30, _modifies=RenderProps.FILE, _allows=RenderProps.NONFILE ) - random_tiles = self.object.part_RandomTile_Tiles + random_tiles = self.object.builder_RandomTile_Tiles self._tiles = [] if random_tiles is None else random_tiles.split(",") def _modification_count(self) -> int: @@ -508,7 +508,7 @@ def _apply_modification(self, index: int) -> StyleMetadata: class StyleFracti(TileStyle): - """Styles for the RandomTile part.""" + """Styles for the RandomTile builder.""" def __init__(self, _painter): super().__init__( @@ -576,7 +576,7 @@ def __init__(self, _painter): else: self._volume = int_or_default(self.object.part_LiquidVolume_Volume, 0) self._liquids = liquids.split(",") - random_tiles = self.object.part_RandomTile_Tiles + random_tiles = self.object.builder_RandomTile_Tiles self._tiles = [] if random_tiles is None else random_tiles.split(",") self._tiles.insert(0, self.painter.get_painted_liquid_path()) @@ -845,7 +845,7 @@ class StyleArspliceHyphae(TileStyle): """Styles for Arsplice Hyphae. Similar to Harvestable, except for a few unique things: Has two objects (Arsplice Hyphae A and Arsplice Hyphae B) which each contain a subset of the sprites, and also includes variable tiles (all other Harvestables permute colors only). This - also supercedes the RandomTile part on Arsplice Hyphae to avoid additional complexity.""" + also supercedes the RandomTile builder on Arsplice Hyphae to avoid additional complexity.""" def __init__(self, _painter): super().__init__(