Skip to content

Commit

Permalink
feat(effects and localization): added translates for effects
Browse files Browse the repository at this point in the history
  • Loading branch information
SouOWendel committed Oct 26, 2023
1 parent cda490f commit 77db14d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
8 changes: 7 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"ordemparanormal.ability.plural": "Abilities",

"ordemparanormal.OrdemActorSheet": "Agent's Sheet",


"ordemparanormal.tab": {
"skills": "Skills",
Expand Down Expand Up @@ -68,10 +67,17 @@
"ordemparanormal.attPre": "Presence",
"ordemparanormal.attFor": "Strength",

"ordemparanormal.newItem": "Novo(a)",

"ordemparanormal.effectCreate": "Create Effect",
"ordemparanormal.effectToggle": "Toggle Effect",
"ordemparanormal.effectEdit": "Edit Effect",
"ordemparanormal.effectDelete": "Delete Effect",
"ordemparanormal.temporaryEffects": "Temporary Effects",
"ordemparanormal.passiveEffects": "Passive Effects",
"ordemparanormal.inactiveEffects": "Inactive Effects",
"ordemparanormal.newEffect": "New Effect",
"ordemparanormal.sourceEffect": "Source",

"ordemparanormal.Add": "Add",

Expand Down
7 changes: 7 additions & 0 deletions lang/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,17 @@
"ordemparanormal.attPre": "Presença",
"ordemparanormal.attFor": "Força",

"ordemparanormal.newItem": "Novo(a)",

"ordemparanormal.effectCreate": "Criar Efeito",
"ordemparanormal.effectToggle": "Trocar Efeito",
"ordemparanormal.effectEdit": "Editar Efeito",
"ordemparanormal.effectDelete": "Deletar Efeito",
"ordemparanormal.temporaryEffects": "Efeitos Temporários",
"ordemparanormal.passiveEffects": "Efeitos Passivos",
"ordemparanormal.inactiveEffects": "Efeitos Inativos",
"ordemparanormal.newEffect": "Novo Efeito",
"ordemparanormal.sourceEffect": "Fonte",

"ordemparanormal.add": "Adicionar",

Expand Down
8 changes: 4 additions & 4 deletions module/helpers/effects.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function onManageActiveEffect(event, owner) {
case 'create':
return owner.createEmbeddedDocuments('ActiveEffect', [
{
label: 'New Effect',
label: game.i18n.localize('ordemparanormal.newEffect'),
icon: 'icons/svg/aura.svg',
origin: owner.uuid,
'duration.rounds':
Expand All @@ -41,17 +41,17 @@ export function prepareActiveEffectCategories(effects) {
const categories = {
temporary: {
type: 'temporary',
label: 'Temporary Effects',
label: game.i18n.localize('ordemparanormal.temporaryEffects'),
effects: [],
},
passive: {
type: 'passive',
label: 'Passive Effects',
label: game.i18n.localize('ordemparanormal.passiveEffects'),
effects: [],
},
inactive: {
type: 'inactive',
label: 'Inactive Effects',
label: game.i18n.localize('ordemparanormal.inactiveEffects'),
effects: [],
},
};
Expand Down
13 changes: 7 additions & 6 deletions module/sheets/actor-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class OrdemActorSheet extends ActorSheet {
context.optionClass = CONFIG.ordemparanormal.dropdownClass;
context.optionTrilhas = CONFIG.ordemparanormal.dropdownTrilha;
context.optionOrigins = CONFIG.ordemparanormal.dropdownOrigins;
// CONFIG.ActiveEffect.legacyTransferral = true;

// Prepara os dados do Agente e seus Items.
if (actorData.type == 'agent') {
Expand All @@ -67,11 +68,11 @@ export class OrdemActorSheet extends ActorSheet {
// Prepare active effects
context.effects = prepareActiveEffectCategories(this.actor.effects);

// TODO: pendente
// for (const i of context.items) {
// console.log(i);
// }
// console.log(context.effects);
// TODO: terminar a migração dos efeitos de itens para efeitos de ator.
for (const i of context.items) {
console.log(i);
}
console.log(context.effects);

return context;
}
Expand Down Expand Up @@ -326,7 +327,7 @@ export class OrdemActorSheet extends ActorSheet {
// Grab any data associated with this control.
const data = duplicate(header.dataset);
// Initialize a default name.
const name = `New ${type.capitalize()}`;
const name = game.i18n.localize('ordemparanormal.newItem') + ' ' + game.i18n.localize('TYPES.Item.' + type);
// Prepare the item object.
const itemData = {
name: name,
Expand Down
4 changes: 2 additions & 2 deletions templates/actor/parts/actor-effects.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ol class="items-list effects-list">
{{#each effects as |section sid|}}
<li class="items-header flexrow" data-effect-type="{{section.type}}">
<h3 class="item-name effect-name flexrow">{{localize section.label}}</h3>
<div class="effect-source">Source</div>
<h4 class="item-name effect-name flexrow">{{localize section.label}}</h4>
<div class="effect-source">{{localize "ordemparanormal.sourceEffect"}}</div>
<div class="effect-source">{{localize "ordemparanormal.duration"}}</div>
<div class="item-controls effect-controls flexrow">
<a class="effect-control" data-action="create" title="{{localize 'ordemparanormal.EffectCreate'}}">
Expand Down

0 comments on commit 77db14d

Please sign in to comment.