From 68e23dbb9936798e85c26df3425f26bf36f2af59 Mon Sep 17 00:00:00 2001 From: Luke Saward <55454721+LukeSaward1@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:06:29 +0000 Subject: [PATCH] Allow user to open recordings folder in-tool (#356) --- rtil/src/threads/ue/rebo/rebo_init.rs | 7 +++++++ tool/misc.re | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/rtil/src/threads/ue/rebo/rebo_init.rs b/rtil/src/threads/ue/rebo/rebo_init.rs index 80e5765..74d3fe8 100644 --- a/rtil/src/threads/ue/rebo/rebo_init.rs +++ b/rtil/src/threads/ue/rebo/rebo_init.rs @@ -114,6 +114,7 @@ pub fn create_config(rebo_stream_tx: Sender) -> ReboConfig { .add_function(disable_collision) .add_function(exit_water) .add_function(open_maps_folder) + .add_function(open_recordings_folder) .add_function(set_lighting_casts_shadows) .add_function(set_sky_light_enabled) .add_function(set_time_dilation) @@ -1306,6 +1307,12 @@ fn open_maps_folder() { log!("Error opening maps folder in file manager: {}", err); } } +#[rebo::function("Tas::open_recordings_folder")] +fn open_recordings_folder() { + if let Err(err) = opener::open(&recording_path()) { + log!("Error opening recordings folder in file manager: {}", err); + } +} #[rebo::function("Tas::set_lighting_casts_shadows")] fn set_lighting_casts_shadows(value: bool) { UWorld::set_lighting_casts_shadows(value); diff --git a/tool/misc.re b/tool/misc.re index 666c6bc..fe38ff0 100644 --- a/tool/misc.re +++ b/tool/misc.re @@ -62,6 +62,10 @@ fn create_misc_menu() -> Ui { enter_ui(create_tas_delete_recording_menu()); } }), + UiElement::Button(UiButton { + label: Text { text: "Open Recordings Folder" }, + onclick: fn(label: Text) { Tas::open_recordings_folder(); }, + }), UiElement::Button(UiButton { label: TAS_LABEL, onclick: fn(label: Text) {