Skip to content

Commit

Permalink
Add zoom slider to the single room editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaythebusinessgoose committed Dec 23, 2023
1 parent 5d50ae8 commit 5cc29e2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/modlunky2/ui/levels/vanilla_levels/vanilla_level_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,37 @@ def toggle_panel_hidden():
self.editor_tab.columnconfigure(7, minsize=50)
self.editor_tab.columnconfigure(8, minsize=0)

self.current_zoom_value = tk.DoubleVar()

def zoom_changed(_):
self.mag = int(self.current_zoom_value.get())
for tile in self.tile_palette_ref_in_use:
tile_name = tile[0].split(" ", 2)[0]
tile[1] = ImageTk.PhotoImage(
self.texture_fetcher.get_texture(
tile_name,
self.lvl_biome,
self.lvl,
self.mag,
)
)
self.canvas.set_zoom(self.mag)
self.room_select(None)

self.slider_zoom = tk.Scale(
self.editor_tab,
from_=2,
to=100,
length=300,
orient="horizontal",
variable=self.current_zoom_value,
command=zoom_changed,
showvalue=0,
width=17,
)
self.slider_zoom.set(self.mag)
self.slider_zoom.grid(row=0, column=6, sticky="nw", padx=2)

self.level_settings_bar = LevelSettingsBar(self.editor_tab, self.setting_flip)
self.level_settings_bar.grid(row=4, column=1, columnspan=8, sticky="news")

Expand Down

0 comments on commit 5cc29e2

Please sign in to comment.