-
Notifications
You must be signed in to change notification settings - Fork 51
Fix testimony recording #197
base: master
Are you sure you want to change the base?
Conversation
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] |
There was a problem hiding this comment.
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
if not self.client.area.start_testimony(self.client, text): | ||
return | ||
text = '~~-- ' + text + ' --' | ||
send_args[4] = text | ||
color = 3 # orange |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
color = 3 # orange | ||
elif text.startswith('/examine'): # Start an examination of this area's testimony. | ||
if not self.client.area.start_examination(self.client): | ||
return | ||
text = '~~-- ' + self.client.area.testimony.title + ' --' | ||
send_args[4] = text |
There was a problem hiding this comment.
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
else: | ||
self.send_command('MS', *self.testimony.statements[self.examine_index]) | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.