Skip to content

Commit

Permalink
Fix the Add Room button.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaythebusinessgoose committed Jan 20, 2024
1 parent 5d10f9c commit 7ebfaa6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/modlunky2/ui/levels/vanilla_levels/levels_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
parent,
on_edit,
reset_canvas,
on_add_room,
on_insert_room,
on_delete_room,
on_duplicate_room,
on_copy_room,
Expand All @@ -46,7 +46,7 @@ def __init__(
self.config = config
self.on_edit = on_edit
self.reset_canvas = reset_canvas
self.on_add_room = on_add_room
self.on_insert_room = on_insert_room
self.on_delete_room = on_delete_room
self.on_duplicate_room = on_duplicate_room
self.on_copy_room = on_copy_room
Expand Down Expand Up @@ -74,8 +74,8 @@ def __init__(
self.popup_menu_child.add_command(
label="Delete Room", command=self.delete_selected
)
self.popup_menu_child.add_command(label="Add Room", command=self.add_room)
self.popup_menu_parent.add_command(label="Add Room", command=self.add_room)
self.popup_menu_child.add_command(label="Add Room", command=self.insert_room)
self.popup_menu_parent.add_command(label="Add Room", command=self.insert_room)
self.popup_menu_parent.add_command(label="Paste Room", command=self.paste)

self.bind("<Button-3>", self.popup) # Button-2 on Aqua
Expand Down Expand Up @@ -179,7 +179,7 @@ def delete_selected(self):
self.delete(item_iid)
self.reset_canvas()

def add_room(self):
def insert_room(self):
item_iid = self.selection()[0]
parent_iid = self.parent(item_iid) # gets selected room
parent = None
Expand All @@ -193,7 +193,7 @@ def add_room(self):
if entry_index == "":
return

new_room = self.on_add_room(self.index(parent))
new_room = self.on_insert_room(self.index(parent))
self.insert(parent, "end", text=new_room.name or "room")

def rename_dialog(self):
Expand Down

0 comments on commit 7ebfaa6

Please sign in to comment.