implemented specialty selection and auto fill
This commit is contained in:
@@ -21,8 +21,9 @@
|
||||
|
||||
.sheet-main-container select {
|
||||
width: auto;
|
||||
height: 28px;
|
||||
height: 25px;
|
||||
margin: 0px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.sheet-main-container input[type=text] {
|
||||
@@ -111,7 +112,7 @@
|
||||
}
|
||||
|
||||
.sheet-header-right-margin {
|
||||
margin-right: 10px;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.sheet-logo {
|
||||
@@ -171,6 +172,10 @@
|
||||
column-gap: 10px;
|
||||
}
|
||||
|
||||
.sheet-middle textarea {
|
||||
min-height: 6em;
|
||||
}
|
||||
|
||||
.sheet-middle-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -304,6 +309,13 @@
|
||||
min-height: 22px;
|
||||
}
|
||||
|
||||
/*----------------- SPECIALTY SELECTION ------------------*/
|
||||
|
||||
|
||||
.sheet-specialty-selected:not([value="custom"]) ~ .sheet-custom-specialty {
|
||||
display:none;
|
||||
}
|
||||
|
||||
/*----------------- TAB CONTROL ------------------*/
|
||||
|
||||
/*Configure the tab buttons*/
|
||||
|
||||
@@ -15,8 +15,18 @@
|
||||
|
||||
<div class="header-row">
|
||||
<span class="label main-font" data-i18n="specialty">Especialidade</span>
|
||||
<input class="header-right-margin" name="attr_specialty" type="text" title="{@specialty}" />
|
||||
|
||||
|
||||
<select class="header-right-margin" name="attr_specialty_select">
|
||||
<option selected="selected" value="custom" data-i18n="custom">Personalizada</option>
|
||||
<option value="engineering" data-i18n="engineering">Engenharia</option>
|
||||
<option value="scholarship" data-i18n="scholarship">Estudiosa</option>
|
||||
<option value="infiltration" data-i18n="infiltration">Infiltração</option>
|
||||
<option value="military" data-i18n="military">Militar</option>
|
||||
<option value="piloting" data-i18n="piloting">Pilotagem</option>
|
||||
</select>
|
||||
<input class="specialty-selected" type="hidden" name="attr_selected_specialty" value="custom" />
|
||||
<input class="custom-specialty header-right-margin" name="attr_custom_specialty" type="text" title="{@custom_specialty}" />
|
||||
|
||||
<span class="label main-font" data-i18n="origin">Colônia de Origem</span>
|
||||
<input name="attr_origin" type="text" title="{@origin}" />
|
||||
</div>
|
||||
@@ -47,7 +57,7 @@
|
||||
Pilha</button>
|
||||
|
||||
<span class="help" name="act_help" data-i18n-title="help"
|
||||
title="Marque as caixas da Ação, Habilidade da Nacionalidade, Habilidades da Especialidade e dos Pertences para montar a pilha de dados.">
|
||||
title="Marque as caixas da Ação, abilidade da Nacionalidade, abilidades da Especialidade e dos Pertences para montar a pilha de dados.">
|
||||
?</span>
|
||||
</div>
|
||||
|
||||
@@ -304,7 +314,7 @@
|
||||
<div class="die-icon dice-row-margin">
|
||||
|
||||
</div>
|
||||
<textarea name="attr_nationality_hability" type="text" title="{@nationality_hability}"> </textarea>
|
||||
<textarea name="attr_nationality_ability" type="text" title="{@nationality_ability}"> </textarea>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -336,19 +346,19 @@
|
||||
|
||||
<span class="title2 box-title secondary-font" data-i18n="specialty">Especialidade</span>
|
||||
|
||||
<fieldset class="repeating_specialty-habilities">
|
||||
<fieldset class="repeating_specialty-abilities">
|
||||
|
||||
<div class="repeatable-item">
|
||||
<div class="repeatable-dice-row">
|
||||
|
||||
<input class="dice-row-margin" type="checkbox" value="1" name='attr_chk_specialty_hability' />
|
||||
<input type="hidden" value="no" name='attr_generated_value' />
|
||||
<input class="dice-row-margin" type="checkbox" value="1" name='attr_chk_specialty_ability' />
|
||||
<div class="plus dice-row-margin">
|
||||
+
|
||||
</div>
|
||||
<div class="die-icon dice-row-margin">
|
||||
|
||||
</div>
|
||||
<textarea name="attr_special_hability" type="text" title="{@special_hability}"></textarea>
|
||||
<textarea name="attr_special_ability" type="text" title="{@special_ability}"></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -692,11 +702,56 @@
|
||||
|
||||
<!-- end of sheet -->
|
||||
|
||||
<!-- General strings translations for Roll Queries and Sheet Workers-->
|
||||
<div style="display: none;">
|
||||
<span data-i18n="engineering_ability1">Quando estiver consertando ou criando um artefato ou ferramenta mecânica</span>
|
||||
<span data-i18n="engineering_ability2">Se estiver avaliando ou interagindo com um mecanismo</span>
|
||||
<span data-i18n="engineering_ability3">Quando pressionada a agir de forma rápida</span>
|
||||
<span data-i18n="engineering_ability4">Quando puder se expressar através de desenhos e fórmulas</span>
|
||||
<span data-i18n="engineering_ability5">Se teve tempo para se preparar antes da situação</span>
|
||||
|
||||
<span data-i18n="scholarship_ability1">Quando lidar com resquícios de civilizações perdidas</span>
|
||||
<span data-i18n="scholarship_ability2">Se estiver debatendo uma tese</span>
|
||||
<span data-i18n="scholarship_ability3">Se algo totalmente desconhecido e antinatural estiver na Cena</span>
|
||||
<span data-i18n="scholarship_ability4">Ao lidar com linguagens atuais ou esquecidas</span>
|
||||
<span data-i18n="scholarship_ability5">Quando procura por coisas escondidas</span>
|
||||
|
||||
<span data-i18n="infiltration_ability1">Se estiver tentando passar despercebida na Cena</span>
|
||||
<span data-i18n="infiltration_ability2">Se estiver promovendo uma farsa</span>
|
||||
<span data-i18n="infiltration_ability3">Quando estiver tentando invadir ou escapar de um local protegido</span>
|
||||
<span data-i18n="infiltration_ability4">Falar com alguém que nunca conheceu antes</span>
|
||||
<span data-i18n="infiltration_ability5">Quando estiver perseguindo ou fugindo de alguém</span>
|
||||
|
||||
<span data-i18n="military_ability1">Quando estiver sob fogo cruzado</span>
|
||||
<span data-i18n="military_ability2">Ao usar qualquer tipo de equipamento bélico na Cena</span>
|
||||
<span data-i18n="military_ability3">Se estiver em uma situação de risco de falha definitiva da missão</span>
|
||||
<span data-i18n="military_ability4">Quando estiver resistindo a um interrogatório</span>
|
||||
<span data-i18n="military_ability5">Se estiver ferida fisicamente</span>
|
||||
|
||||
<span data-i18n="piloting_ability1">Se estiver pilotando qualquer tipo de veículo mecanizado</span>
|
||||
<span data-i18n="piloting_ability2">Quando estiver se locomovendo em altíssima velocidade</span>
|
||||
<span data-i18n="piloting_ability3">Quando lida com contatos do submundo</span>
|
||||
<span data-i18n="piloting_ability4">Quando estiver auxiliando diretamente uma aliada</span>
|
||||
<span data-i18n="piloting_ability5">Estiver lidando com uma situação “Tudo ou Nada”</span>
|
||||
|
||||
<span data-i18n="military_destiny1">Subjugar um inimigo quando você está em evidente desvantagem.</span>
|
||||
<span data-i18n="military_destiny2">Provocar inimigos perigosos com uma bravata.</span>
|
||||
<span data-i18n="engineering_destiny1">Resolver um problema tendo uma epifania do tipo “Esperem, tive uma ideia!”.</span>
|
||||
<span data-i18n="engineering_destiny2">Explicar um plano complexo usando uma metáfora mecânica.</span>
|
||||
<span data-i18n="infiltration_destiny1">Usar uma frase de efeito ao encontrar um inimigo recorrente.</span>
|
||||
<span data-i18n="infiltration_destiny2">Enganar um grupo grande de pessoas com um truque.</span>
|
||||
<span data-i18n="piloting_destiny1">Ser dada como morta ao desaparecer em alguma proeza e retornar triunfante.</span>
|
||||
<span data-i18n="piloting_destiny2">Tratar um veículo como se fosse uma pessoa.</span>
|
||||
<span data-i18n="scholarship_destiny1">Descrever algo desconhecido com um tom professoral.</span>
|
||||
<span data-i18n="scholarship_destiny2">Apresentar a resposta para um problema citando um livro ou um cientista.</span>
|
||||
|
||||
</div>
|
||||
|
||||
<!--Sheet Workers -->
|
||||
<script type="text/worker">
|
||||
|
||||
const buttonlist = ["profile","journal","configuration"];
|
||||
const generatedAttributeName = "generated_value";
|
||||
|
||||
/*config tabs control */
|
||||
buttonlist.forEach(button => {
|
||||
@@ -707,6 +762,89 @@
|
||||
});
|
||||
});
|
||||
|
||||
/* Delete pre-generated values from a repeating section */
|
||||
function clearGeneratedValues(targetSection) {
|
||||
|
||||
getSectionIDs(targetSection, function(idarray) {
|
||||
let attributes = [];
|
||||
let ids = {};
|
||||
|
||||
for(var i=0; i < idarray.length; i++) {
|
||||
let generatedAttribute = targetSection + "_" + idarray[i] + "_" + generatedAttributeName;
|
||||
|
||||
attributes.push(generatedAttribute);
|
||||
ids[generatedAttribute] = idarray[i];
|
||||
}
|
||||
|
||||
getAttrs(attributes, function(values) {
|
||||
|
||||
attributes.forEach(attribute => {
|
||||
|
||||
let isGenerated = values[attribute];
|
||||
|
||||
if (isGenerated == "yes") {
|
||||
removeRepeatingRow(targetSection + "_" + ids[attribute]);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/* load pre-generated data on repeating section */
|
||||
function loadSpecialtyData(specialty, translationType, targetSection, targetAttribute, quantity) {
|
||||
|
||||
let newRowAttrs = {};
|
||||
|
||||
/* first, clear all pre-generated-values */
|
||||
clearGeneratedValues(targetSection);
|
||||
|
||||
for (let i=1; i <= quantity; i++) {
|
||||
let newId = generateRowID();
|
||||
let translationKey = specialty + "_" + translationType + i;
|
||||
|
||||
newRowAttrs[targetSection + "_" + newId + "_" + generatedAttributeName] = "yes";
|
||||
newRowAttrs[targetSection + "_" + newId + "_" + targetAttribute] = getTranslationByKey(translationKey);
|
||||
}
|
||||
|
||||
console.log("loadingSpecialtyData");
|
||||
console.log(newRowAttrs);
|
||||
|
||||
setAttrs(newRowAttrs);
|
||||
}
|
||||
|
||||
function changeSpecialtySelectedControl(selected) {
|
||||
|
||||
setAttrs(
|
||||
{
|
||||
selected_specialty: selected
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/*specialty selection*/
|
||||
on("change:specialty_select", function(eventInfo) {
|
||||
const selected = eventInfo.newValue;
|
||||
let abilitiesSection = "repeating_specialty-abilities";
|
||||
let destiniesSection = "repeating_destinies";
|
||||
console.log("specialty selected");
|
||||
console.log(selected);
|
||||
|
||||
changeSpecialtySelectedControl(selected);
|
||||
|
||||
if (selected != 'custom') {
|
||||
loadSpecialtyData(selected, "ability", abilitiesSection, "special_ability", 5);
|
||||
loadSpecialtyData(selected, "destiny", destiniesSection, "destiny", 2);
|
||||
|
||||
} else {
|
||||
|
||||
clearGeneratedValues(abilitiesSection);
|
||||
clearGeneratedValues(destiniesSection);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function clearRepeatingSection(targetSection, targetAttr) {
|
||||
let targetObject = new Object();
|
||||
|
||||
@@ -766,7 +904,7 @@
|
||||
clearRepeatingSection('repeating_destinies', 'chk_destiny');
|
||||
}
|
||||
|
||||
clearRepeatingSection('repeating_specialty-habilities', 'chk_specialty_hability');
|
||||
clearRepeatingSection('repeating_specialty-abilities', 'chk_specialty_ability');
|
||||
clearRepeatingSection('repeating_belongings', 'chk_belonging1');
|
||||
clearRepeatingSection('repeating_belongings', 'chk_belonging2');
|
||||
|
||||
@@ -827,7 +965,7 @@
|
||||
});
|
||||
|
||||
/* setting specialty checkboxes listener */
|
||||
on("change:repeating_specialty-habilities:chk_specialty_hability", function(eventInfo) {
|
||||
on("change:repeating_specialty-abilities:chk_specialty_ability", function(eventInfo) {
|
||||
|
||||
const checkedValue = eventInfo.newValue;
|
||||
let target = "specialty-dice";
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
"journal": "Diário",
|
||||
"configuration": "Configuração",
|
||||
"begin-session-button-title": "Prepara a ficha para a nova sessão, limpando todas as caixas de seleção da pilha de dados, incluindo as caixas de Destinos de Heróina",
|
||||
"begin-session": "Iniciar Sessão",
|
||||
"begin-session": "Iniciar\n Sessão",
|
||||
"reset-button-title": "Limpa a pilha de dados para nova rolagem, desmarcando todas as caixas da ficha, com execeção das caixas de Ímpeto e de Destinos de Heróina.",
|
||||
"clearpool": "Limpar Pilha",
|
||||
"help": "Marque as caixas da Ação, Habilidade da Nacionalidade, Habilidades da Especialidade e dos Pertences para montar a pilha de dados.",
|
||||
"clearpool": "Limpar\n Pilha",
|
||||
"help": "Marque as caixas da Ação, abilidade da Nacionalidade, abilidades da Especialidade e dos Pertences para montar a pilha de dados.",
|
||||
"base-dice": "Base",
|
||||
"action": "Ação",
|
||||
"nationality": "Nacionalidade",
|
||||
@@ -30,7 +30,7 @@
|
||||
"ignoring-help": "Se estiver ignorando um pedido de ajuda",
|
||||
"be-safe": "Estar Segura",
|
||||
"stay-hidden": "Manter-se oculta na cena",
|
||||
"against-resistance": "Não agir diretamente contra uma Resistência",
|
||||
"against-resistance": "Não agir diretamente contra uma\n Resistência",
|
||||
"familiar-place": "Agindo em um lugar familiar",
|
||||
"heroine-destinies": "Destinos de Heroína",
|
||||
"name": "Nome",
|
||||
@@ -52,5 +52,47 @@
|
||||
"third-trauma": "3º Trauma",
|
||||
"fourth-trauma": "4º Trauma",
|
||||
"notes": "Anotações",
|
||||
"copyright": "Goddess Save The Queen é um jogo escrito por Carol Neves e Julio Matos."
|
||||
}
|
||||
"copyright": "Goddess Save The Queen é um jogo escrito por Carol Neves e Julio Matos.",
|
||||
"scholar": "Estudiosa",
|
||||
"engineering": "Engenharia",
|
||||
"scholarship": "Estudiosa",
|
||||
"infiltration": "Infiltração",
|
||||
"military": "Militar",
|
||||
"piloting": "Pilotagem",
|
||||
"engineering_ability1": "Quando estiver consertando ou criando um artefato ou ferramenta mecânica",
|
||||
"engineering_ability2": "Se estiver avaliando ou interagindo com um mecanismo",
|
||||
"engineering_ability3": "Quando pressionada a agir de forma rápida",
|
||||
"engineering_ability4": "Quando puder se expressar através de desenhos e fórmulas",
|
||||
"engineering_ability5": "Se teve tempo para se preparar antes da situação",
|
||||
"scholarship_ability1": "Quando lidar com resquícios de civilizações perdidas",
|
||||
"scholarship_ability2": "Se estiver debatendo uma tese",
|
||||
"scholarship_ability3": "Se algo totalmente desconhecido e antinatural estiver na Cena",
|
||||
"scholarship_ability4": "Ao lidar com linguagens atuais ou esquecidas",
|
||||
"scholarship_ability5": "Quando procura por coisas escondidas",
|
||||
"infiltration_ability1": "Se estiver tentando passar despercebida na Cena",
|
||||
"infiltration_ability2": "Se estiver promovendo uma farsa",
|
||||
"infiltration_ability3": "Quando estiver tentando invadir ou escapar de um local protegido",
|
||||
"infiltration_ability4": "Falar com alguém que nunca conheceu antes",
|
||||
"infiltration_ability5": "Quando estiver perseguindo ou fugindo de alguém",
|
||||
"military_ability1": "Quando estiver sob fogo cruzado",
|
||||
"military_ability2": "Ao usar qualquer tipo de equipamento bélico na Cena",
|
||||
"military_ability3": "Se estiver em uma situação de risco de falha definitiva da missão",
|
||||
"military_ability4": "Quando estiver resistindo a um interrogatório",
|
||||
"military_ability5": "Se estiver ferida fisicamente",
|
||||
"piloting_ability1": "Se estiver pilotando qualquer tipo de veículo mecanizado",
|
||||
"piloting_ability2": "Quando estiver se locomovendo em altíssima velocidade",
|
||||
"piloting_ability3": "Quando lida com contatos do submundo",
|
||||
"piloting_ability4": "Quando estiver auxiliando diretamente uma aliada",
|
||||
"piloting_ability5": "Estiver lidando com uma situação “Tudo ou Nada”",
|
||||
"military_destiny1": "Subjugar um inimigo quando você está em evidente desvantagem.",
|
||||
"military_destiny2": "Provocar inimigos perigosos com uma bravata.",
|
||||
"engineering_destiny1": "Resolver um problema tendo uma epifania do tipo “Esperem, tive uma ideia!”.",
|
||||
"engineering_destiny2": "Explicar um plano complexo usando uma metáfora mecânica.",
|
||||
"infiltration_destiny1": "Usar uma frase de efeito ao encontrar um inimigo recorrente.",
|
||||
"infiltration_destiny2": "Enganar um grupo grande de pessoas com um truque.",
|
||||
"piloting_destiny1": "Ser dada como morta ao desaparecer em alguma proeza e retornar triunfante.",
|
||||
"piloting_destiny2": "Tratar um veículo como se fosse uma pessoa.",
|
||||
"scholarship_destiny1": "Descrever algo desconhecido com um tom professoral.",
|
||||
"scholarship_destiny2": "Apresentar a resposta para um problema citando um livro ou um cientista.",
|
||||
"custom": "Personalizada"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user