From 9bb6580d89efb76534d9395bc052459d5f58e7c4 Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 26 Jun 2021 10:38:39 -0500 Subject: input_common/tas: overwrite file dialog --- src/input_common/tas/tas_input.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/input_common/tas/tas_input.cpp') diff --git a/src/input_common/tas/tas_input.cpp b/src/input_common/tas/tas_input.cpp index baeb18c22..eb3327520 100644 --- a/src/input_common/tas/tas_input.cpp +++ b/src/input_common/tas/tas_input.cpp @@ -102,7 +102,7 @@ void Tas::LoadTasFile(size_t player_index) { LOG_INFO(Input, "TAS file loaded! {} frames", frame_no); } -void Tas::WriteTasFile() { +void Tas::WriteTasFile(std::string file_name) { std::string output_text; for (size_t frame = 0; frame < record_commands.size(); frame++) { if (!output_text.empty()) { @@ -113,7 +113,7 @@ void Tas::WriteTasFile() { WriteCommandAxis(line.l_axis) + " " + WriteCommandAxis(line.r_axis); } const size_t bytes_written = Common::FS::WriteStringToFile( - Common::FS::GetYuzuPathString(Common::FS::YuzuPath::TASDir) + "record.txt", + Common::FS::GetYuzuPathString(Common::FS::YuzuPath::TASDir) + file_name, Common::FS::FileType::TextFile, output_text); if (bytes_written == output_text.size()) { LOG_INFO(Input, "TAS file written to file!"); @@ -189,18 +189,8 @@ void Tas::UpdateThread() { if (is_recording) { record_commands.push_back(last_input); } - if (!is_recording && !record_commands.empty()) { - WriteTasFile(); - needs_reset = true; - refresh_tas_fle = true; - record_commands.clear(); - } if (needs_reset) { current_command = 0; - if (refresh_tas_fle) { - LoadTasFiles(); - refresh_tas_fle = false; - } needs_reset = false; LoadTasFiles(); LOG_DEBUG(Input, "tas_reset done"); @@ -306,10 +296,8 @@ void Tas::Reset() { needs_reset = true; } -void Tas::Record() { +bool Tas::Record() { is_recording = !is_recording; -<<<<<<< HEAD -======= return is_recording; } @@ -326,7 +314,6 @@ void Tas::SaveRecording(bool overwrite_file) { } needs_reset = true; record_commands.clear(); ->>>>>>> 773d268db (config: disable pause on load) } InputCommon::ButtonMapping Tas::GetButtonMappingForDevice( -- cgit v1.2.3