mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
length requirement for custom roles
This commit is contained in:
@@ -455,6 +455,14 @@ function initializeRemainingEventListeners(deckManager) {
|
||||
let description = document.getElementById("role-description").value.trim();
|
||||
let team = document.getElementById("role-alignment").value.toLowerCase().trim();
|
||||
if (!deckManager.getCustomRoleOption(name)) { // confirm there is no existing custom role with the same name
|
||||
if (name.length > 40) {
|
||||
toast('Your name is too long (max 40 characters).', "error", true);
|
||||
return;
|
||||
}
|
||||
if (description.length > 500) {
|
||||
toast('Your description is too long (max 500 characters).', "error", true);
|
||||
return;
|
||||
}
|
||||
deckManager.addToCustomRoleOptions({role: name, description: description, team: team});
|
||||
updateCustomRoleOptionsList(deckManager, document.getElementById("deck-select"))
|
||||
ModalManager.dispelModal("add-role-modal", "add-role-modal-background");
|
||||
|
||||
@@ -138,7 +138,7 @@ form {
|
||||
|
||||
select {
|
||||
padding: 10px;
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
font-family: 'signika-negative', sans-serif;
|
||||
background-color: transparent;
|
||||
color: #d7d7d7;
|
||||
|
||||
Reference in New Issue
Block a user