From c6bbccb6c355fcebc3328ead662cf6cc967d8222 Mon Sep 17 00:00:00 2001
From: Tim Van Baak
Date: Thu, 30 Jan 2020 23:28:57 -0800
Subject: [PATCH] Add chars_per_player setting
---
amanuensis/resources/lexicon.json | 1 +
amanuensis/server/forms.py | 6 ++++++
amanuensis/templates/lexicon/settings.html | 1 +
3 files changed, 8 insertions(+)
diff --git a/amanuensis/resources/lexicon.json b/amanuensis/resources/lexicon.json
index c55f920..289e5a0 100644
--- a/amanuensis/resources/lexicon.json
+++ b/amanuensis/resources/lexicon.json
@@ -20,6 +20,7 @@
"open": false,
"password": null,
"max_players": 4,
+ "chars_per_player": 1,
"joined": []
},
"publish": {
diff --git a/amanuensis/server/forms.py b/amanuensis/server/forms.py
index a6684f5..df7f2be 100644
--- a/amanuensis/server/forms.py
+++ b/amanuensis/server/forms.py
@@ -70,6 +70,10 @@ class LexiconConfigForm(FlaskForm):
"Maximum number of players",
widget=NumberInput(),
validators=[DataRequired()])
+ joinCharsPerPlayer = IntegerField(
+ "Characters per player",
+ widget=NumberInput(),
+ validators=[DataRequired()])
# Publish
publishNotifyEditorOnReady = BooleanField(
"Notify the editor when a player marks an article as ready")
@@ -137,6 +141,7 @@ class LexiconConfigForm(FlaskForm):
self.joinOpen.data = lexicon.join.open
self.joinPassword.data = lexicon.join.password
self.joinMaxPlayers.data = lexicon.join.max_players
+ self.joinCharsPerPlayer.data = lexicon.join.chars_per_player
self.publishNotifyEditorOnReady.data = lexicon.publish.notify.editor_on_ready
self.publishNotifyPlayerOnReject.data = lexicon.publish.notify.player_on_reject
self.publishNotifyPlayerOnAccept.data = lexicon.publish.notify.player_on_accept
@@ -171,6 +176,7 @@ class LexiconConfigForm(FlaskForm):
l.join.open = self.joinOpen.data
l.join.password = self.joinPassword.data
l.join.max_players = self.joinMaxPlayers.data
+ l.join.chars_per_player = self.joinCharsPerPlayer.data
l.publish.notify.editor_on_ready = self.publishNotifyEditorOnReady.data
l.publish.notify.player_on_reject = self.publishNotifyPlayerOnReject.data
l.publish.notify.player_on_accept = self.publishNotifyPlayerOnAccept.data
diff --git a/amanuensis/templates/lexicon/settings.html b/amanuensis/templates/lexicon/settings.html
index dae5b75..4e79e62 100644
--- a/amanuensis/templates/lexicon/settings.html
+++ b/amanuensis/templates/lexicon/settings.html
@@ -71,6 +71,7 @@
{{ form.joinPassword(autocomplete="off") }}
{{ form.joinPassword.label }}
{{ number_setting(form.joinMaxPlayers) }}
+ {{ number_setting(form.joinCharsPerPlayer) }}
Turn Publishing