Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Fix testimony recording#197

Open
Lernos wants to merge 2 commits intoAttorneyOnline:masterfrom
Lernos:fix-testimony-recording
Open

Fix testimony recording#197
Lernos wants to merge 2 commits intoAttorneyOnline:masterfrom
Lernos:fix-testimony-recording

Conversation

@Lernos
Copy link
Contributor

@Lernos Lernos commented May 19, 2022

Okay, so testimony recording, or editing and replaying rather, is broken when it comes to pairing. That's because relevant pairing information such as the paired character's sprites, is defined AFTER we check if the text starts with /add or /amend or whatever, and /add and /amend pass "args" into the testimony, not "send_args". This results in paired sprites being recorded wrong, essentially your partner will be a missing sprite. The only solution I could think of was to define these variables BEFORE the IC commands and actually define send_args right then and there as well as a LIST, which will contain the pairing info, and which we'll pass into the testimony. Then send_args gets redefined as a tuple again, as it should, and passed into IC chat. Is there a more elegant way? Perhaps. Do I know of it? No. Does it work the way it is? Yes.

Comment on lines +559 to +567
send_args = [msg_type, pre, folder, anim, text,
pos, sfx, anim_type, cid, sfx_delay,
button, self.client.evi_list[evidence],
flip, ding, color, showname, charid_pair,
other_folder, other_emote, offset_pair,
other_offset, other_flip, nonint_pre,
sfx_looping, screenshake, frames_shake,
frames_realization, frames_sfx,
additive, effect]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the chat args should be turned into a dataclass, it is becoming a hot mess

return
text = '~~-- ' + text + ' --'
send_args[4] = text
color = 3 # orange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to write the color to the recording as well

Copy link
Contributor Author

@Lernos Lernos Jun 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, because the recording doesn't ever replay the testimony title the way it was said, instead the person who issues the /examine command in IC "says" the title which is passed in plain text, and the orange color is automatically applied to that

elif text.startswith('/testify '): # Start a new testimony in this area.
part = text.split(' ')
text = ' '.join(part[1:]) # remove command
send_args[4] = text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this line meaningful if send_args[4] is modified immediately afterward again

if not self.client.area.start_examination(self.client):
return
text = '~~-- ' + self.client.area.testimony.title + ' --'
send_args[4] = text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this line meaningful if nothing is done with send_args here, it will be overshadowed by a new send_args below

Comment on lines +799 to +801
else:
self.send_command('MS', *self.testimony.statements[self.examine_index])
return True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else:
self.send_command('MS', *self.testimony.statements[self.examine_index])
return True
self.send_command('MS', *self.testimony.statements[self.examine_index])
return True

ah yes, good old bounds checking. no need for else here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants