Jeopardy: add restart template

This commit is contained in:
oddluck 2020-02-20 18:54:55 +00:00
parent c11a721385
commit c7ee084427
2 changed files with 8 additions and 1 deletions

View File

@ -137,6 +137,10 @@ conf.registerChannelValue(Jeopardy.template, 'question',
registry.String("#{{number}} of {{total}}: \x0313({{airdate}}) \x0309[${{points}}] \x0310\x1f{{category}}\x1f: {{clue}}",
_("""The template used to render questions.""")))
conf.registerChannelValue(Jeopardy.template, 'restart',
registry.String("\x0313({{airdate}}) \x0309[${{points}}] \x0310\x1f{{category}}\x1f: {{clue}}",
_("""The template used to render questions when autoRestart is True.""")))
conf.registerChannelValue(Jeopardy.template, 'hint',
registry.String("HINT: {{hint}}{% if time %} | ({{time}} seconds remaining){% endif %}", _("""The template used to render hints.""")))

View File

@ -103,7 +103,10 @@ class Jeopardy(callbacks.Plugin):
self.numHints = hints
self.points = self.registryValue('defaultPointValue')
self.question = ''
self.question_template = Template(self.registryValue("template.question", channel))
if restart:
self.question_template = Template(self.registryValue("template.restart", channel))
else:
self.question_template = Template(self.registryValue("template.question", channel))
self.questions = []
self.reduction = self.registryValue('hintReduction', self.channel)
self.restart = restart