Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jaythebusinessgoose committed Dec 24, 2023
1 parent f91d8d5 commit cf7e51b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
13 changes: 9 additions & 4 deletions src/modlunky2/ui/levels/shared/palette_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def delete_tilecode(self, tile_name, tile_code):
if self.secondary_tile_view.tile_code() == tile_code:
self.secondary_tile_view.reset(disable=False)

def update_with_palette(self, new_palette, suggestions, dependency_tiles, biome, lvl):
def update_with_palette(
self, new_palette, suggestions, dependency_tiles, biome, lvl
):
for widget in self.palette.scrollable_frame.winfo_children():
widget.destroy()

Expand Down Expand Up @@ -316,8 +318,12 @@ def update_with_palette(self, new_palette, suggestions, dependency_tiles, biome,
count_col = -1
self.palette.scrollable_frame.rowconfigure(count_row + 1, minsize=15)
count_row += 2
dependency_label = ttk.Label(self.palette.scrollable_frame, text=str(dependency.name) + ":")
dependency_label.grid(row=count_row, column=0, columnspan=5, sticky="nw")
dependency_label = ttk.Label(
self.palette.scrollable_frame, text=str(dependency.name) + ":"
)
dependency_label.grid(
row=count_row, column=0, columnspan=5, sticky="nw"
)
count_row += 1

for tile in dependency.tiles:
Expand Down Expand Up @@ -350,7 +356,6 @@ def update_with_palette(self, new_palette, suggestions, dependency_tiles, biome,
),
)


self.primary_tile_view.enable()
self.secondary_tile_view.enable()
self.new_tile_panel.reset()
Expand Down
3 changes: 2 additions & 1 deletion src/modlunky2/ui/levels/shared/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from modlunky2.levels.level_templates import TemplateSetting
from modlunky2.ui.levels.shared.setrooms import MatchedSetroom


@dataclass
class DependencyPalette:
name: str
tiles: List
tiles: List
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ def tilecode_item(tilecode):
return tilecode_item

return [tilecode_item(tc) for tc in level_tilecodes]

def clear_tile_from_dependencies(tile):
for palette in self.dependency_tile_palette_ref_in_use:
for i in palette.tiles:
Expand Down Expand Up @@ -443,7 +444,9 @@ def register_tile_code(tile):
clear_tile_from_dependencies(tile)
register_tile_code(tile)

self.dependency_tile_palette_ref_in_use.insert(0, DependencyPalette("From " + dependency, tiles))
self.dependency_tile_palette_ref_in_use.insert(
0, DependencyPalette("From " + dependency, tiles)
)

level = LevelFile.from_path(Path(lvl_path))
tiles = get_level_tilecodes(level)
Expand Down Expand Up @@ -979,7 +982,6 @@ def use_dependency_tile(self, tile, dependency):
self.populate_tilecode_palette()
self.changes_made()


def add_tilecode(
self,
tile,
Expand Down

0 comments on commit cf7e51b

Please sign in to comment.