Skip to content

Commit

Permalink
update RandomTile logic (fixes #116)
Browse files Browse the repository at this point in the history
  • Loading branch information
egocarib committed Jun 24, 2024
1 parent 419a6ce commit ddb89d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hagadias/qudobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hagadias/tilepainter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 4 additions & 4 deletions hagadias/tilestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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__(
Expand Down Expand Up @@ -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())

Expand Down Expand Up @@ -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__(
Expand Down

0 comments on commit ddb89d4

Please sign in to comment.