Skip to content

Commit

Permalink
added task export UI widgets and task selector functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
simulatedScience committed Mar 9, 2023
1 parent b30d431 commit a295677
Show file tree
Hide file tree
Showing 3 changed files with 623 additions and 25 deletions.
12 changes: 12 additions & 0 deletions coding/ttr_map_maker/file_browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,17 @@ def browse_json_file(browse_request: str, var: tk.StringVar):
var (tk.StringVar): variable to store the file path in
"""
file_path = tk.filedialog.askopenfilename(filetypes=[(browse_request, "*.json")])
if file_path:
var.set(file_path)

def browse_directory(browse_request: str, var: tk.StringVar):
"""
Open a file dialog to select a directory. The file path is stored in the given variable.
Args:
browse_request (str): text to display in the file dialog
var (tk.StringVar): variable to store the file path in
"""
file_path = tk.filedialog.askdirectory()
if file_path:
var.set(file_path)
11 changes: 0 additions & 11 deletions coding/ttr_map_maker/task_editor_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,17 +1179,6 @@ def delete_task(self, task: TTR_Task, task_index: int):
task_widgets[5].config(command=lambda task=self.task_list[row_index], task_index=row_index: self.delete_task(task, task_index))


def export_task_images(self) -> None:
"""
Export the current task images to the directory given in `self.task_export_dir`.
Exporting is done using the following steps:
- hide all nodes, labels, edges and task indicators
- show background image
"""
raise NotImplementedError("Exporting task images is not implemented yet.")


def add_arrow_button(self, direction: str, parent_frame: tk.Frame, command: Callable) -> tk.Button:
"""
add a button displaying an arrow in the given direction to the given parent frame and bind the command to it.
Expand Down
Loading

0 comments on commit a295677

Please sign in to comment.