Skip to content

Commit

Permalink
some NPCs have color/bgcolor/bordercolor tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-kane committed Apr 6, 2024
1 parent a48a483 commit dfe27cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/coh_npc_voices/npc_chatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ def tail(self):
if self.npc_speak and lstring[0] == "[NPC]":
name, dialog = " ".join(lstring[1:]).split(":", maxsplit=1)
log.debug(f'Adding {name}/{dialog} to reading queue')
dialog = re.sub(r"<color [#a-zA-Z0-9]+>", "", dialog).strip()
dialog = re.sub(r"<bgcolor [#a-zA-Z0-9]+>", "", dialog).strip()
dialog = re.sub(r"<bordercolor [#a-zA-Z0-9]+>", "", dialog).strip()

self.tts_queue.put((name, dialog, 'npc'))

elif self.team_speak and lstring[0] == "[Team]":
Expand Down Expand Up @@ -243,8 +247,8 @@ def tail(self):
'system'
))

#else:
# log.debug(f'tag {lstring[0]} not classified.')
else:
log.debug(f'tag {lstring[0]} not classified.')


def main() -> None:
Expand Down
Binary file modified voices.db
Binary file not shown.

0 comments on commit dfe27cd

Please sign in to comment.