diff options
author | german77 <juangerman-13@hotmail.com> | 2021-06-26 10:38:39 -0500 |
---|---|---|
committer | MonsterDruide1 <5958456@gmail.com> | 2021-09-18 23:22:42 +0200 |
commit | 9bb6580d89efb76534d9395bc052459d5f58e7c4 (patch) | |
tree | aab812da6162e4f9ac305c80e245409d2781d8a2 /src/input_common/tas/tas_input.cpp | |
parent | f078b15565c8cab08587b8f8629d878615705cfb (diff) |
input_common/tas: overwrite file dialog
Diffstat (limited to 'src/input_common/tas/tas_input.cpp')
-rw-r--r-- | src/input_common/tas/tas_input.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/input_common/tas/tas_input.cpp b/src/input_common/tas/tas_input.cpp index baeb18c229..eb3327520c 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( |