From 70920fbf6e319fbe7bd9020651590995c61d0d22 Mon Sep 17 00:00:00 2001 From: JayTheBusinessGoose Date: Thu, 21 Dec 2023 02:14:20 -0700 Subject: [PATCH] Add some padding to the randomize buttons. --- .../multi_room/multi_room_editor_tab.py | 9 ++++----- .../multi_room/options_panel.py | 20 ++++++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/modlunky2/ui/levels/vanilla_levels/multi_room/multi_room_editor_tab.py b/src/modlunky2/ui/levels/vanilla_levels/multi_room/multi_room_editor_tab.py index 7037e3a4..56468b34 100644 --- a/src/modlunky2/ui/levels/vanilla_levels/multi_room/multi_room_editor_tab.py +++ b/src/modlunky2/ui/levels/vanilla_levels/multi_room/multi_room_editor_tab.py @@ -178,7 +178,7 @@ def image_for_tile_code(self, tile_code): self.tile_image_map[tile_name] = new_tile_image return new_tile_image - def use_roommap_at(self, index, fresh = False): + def use_roommap_at(self, index, fresh=False): if self.lvl is None: return @@ -247,7 +247,9 @@ def open_lvl(self, lvl, biome, tile_palette_map, room_templates): self.default_draw_map = find_roommap(room_templates) # self.template_draw_map = find_roommap(room_templates) - self.use_roommap_at(self.modlunky_config.default_custom_room_maps.get(self.lvl), True) + self.use_roommap_at( + self.modlunky_config.default_custom_room_maps.get(self.lvl), True + ) def redraw(self): self.canvas.clear() @@ -522,7 +524,6 @@ def select_random_room_at(mi, r, c): if template_item is None: return - valid_rooms = [ index for index, room in enumerate(template_item.template.rooms) @@ -547,8 +548,6 @@ def select_random_room_at(mi, r, c): else: select_random_room_at(map_index, row, col) - - self.options_panel.set_templates(self.template_draw_map, self.room_templates) self.redraw() diff --git a/src/modlunky2/ui/levels/vanilla_levels/multi_room/options_panel.py b/src/modlunky2/ui/levels/vanilla_levels/multi_room/options_panel.py index aa5c29db..a3964ef6 100644 --- a/src/modlunky2/ui/levels/vanilla_levels/multi_room/options_panel.py +++ b/src/modlunky2/ui/levels/vanilla_levels/multi_room/options_panel.py @@ -116,13 +116,19 @@ def __init__( self.room_combobox["state"] = "readonly" self.room_combobox.bind("<>", lambda _: self.select_room()) - randomize_room_button = ttk.Button(room_combo_container, text="Random", command=self.random_room) - randomize_room_button.grid(row=0, column=1, sticky="w") + randomize_room_button = ttk.Button( + room_combo_container, text="Random", command=self.random_room + ) + randomize_room_button.grid(row=0, column=1, sticky="w", padx=10) template_setting_row += 1 - randomize_all_button = ttk.Button(self.template_container, text="Randomize All", command=self.randomize_all) - randomize_all_button.grid(row=template_setting_row, column=0, sticky="w") + randomize_all_button = ttk.Button( + self.template_container, text="Randomize All", command=self.randomize_all + ) + randomize_all_button.grid( + row=template_setting_row, column=0, sticky="w", pady=10 + ) template_setting_row += 1 @@ -352,7 +358,11 @@ def select_room(self): ) def random_room(self): - self.on_select_random_room(self.current_template_map_index, self.current_template_row, self.current_template_column) + self.on_select_random_room( + self.current_template_map_index, + self.current_template_row, + self.current_template_column, + ) def randomize_all(self): self.on_select_random_room()