summaryrefslogtreecommitdiff
path: root/src/input_common/drivers/tas_input.cpp
diff options
context:
space:
mode:
authorGravatar liamwhite2023-01-10 15:26:36 -0500
committerGravatar GitHub2023-01-10 15:26:36 -0500
commit9f974ea8189c255ff3ab8fcad6ae310a5e50d296 (patch)
tree865bd949208a7dad04a4eb45e9f353588df589d6 /src/input_common/drivers/tas_input.cpp
parentmacOS: Make Yuzu show up in the Launchpad Games folder (#9594) (diff)
parentTAS: Show all script lengths for multiplayer (diff)
downloadyuzu-9f974ea8189c255ff3ab8fcad6ae310a5e50d296.tar.gz
yuzu-9f974ea8189c255ff3ab8fcad6ae310a5e50d296.tar.xz
yuzu-9f974ea8189c255ff3ab8fcad6ae310a5e50d296.zip
Merge pull request #9565 from MonsterDruide1/tas-multiplayer-lengths
TAS: Show all script lengths for multiplayer
Diffstat (limited to '')
-rw-r--r--src/input_common/drivers/tas_input.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp
index f3ade90da..f3cb14c56 100644
--- a/src/input_common/drivers/tas_input.cpp
+++ b/src/input_common/drivers/tas_input.cpp
@@ -156,10 +156,12 @@ void Tas::RecordInput(u64 buttons, TasAnalog left_axis, TasAnalog right_axis) {
156 }; 156 };
157} 157}
158 158
159std::tuple<TasState, size_t, size_t> Tas::GetStatus() const { 159std::tuple<TasState, size_t, std::array<size_t, PLAYER_NUMBER>> Tas::GetStatus() const {
160 TasState state; 160 TasState state;
161 std::array<size_t, PLAYER_NUMBER> lengths{0};
161 if (is_recording) { 162 if (is_recording) {
162 return {TasState::Recording, 0, record_commands.size()}; 163 lengths[0] = record_commands.size();
164 return {TasState::Recording, record_commands.size(), lengths};
163 } 165 }
164 166
165 if (is_running) { 167 if (is_running) {
@@ -168,7 +170,11 @@ std::tuple<TasState, size_t, size_t> Tas::GetStatus() const {
168 state = TasState::Stopped; 170 state = TasState::Stopped;
169 } 171 }
170 172
171 return {state, current_command, script_length}; 173 for (size_t i = 0; i < PLAYER_NUMBER; i++) {
174 lengths[i] = commands[i].size();
175 }
176
177 return {state, current_command, lengths};
172} 178}
173 179
174void Tas::UpdateThread() { 180void Tas::UpdateThread() {