Skip to content

Commit

Permalink
Ficha DnD5e v1.2.4
Browse files Browse the repository at this point in the history
* Bug fixes
  • Loading branch information
ViniciusDinizLima committed Dec 14, 2024
1 parent c55b218 commit 996e44f
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 164 deletions.
202 changes: 98 additions & 104 deletions Plugins/Sheets/DnD5e/equipamento.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<!-- Equipamentos e Ataques -->
<flowLayout name="flwPartEquipAttack" class="tile" height="250" autoHeight="true" frameStyle="frames/panel5/frame.xml">
<flowPart name="layEquipAttackLeft" height="250" width="240">
<layout g="col" g-width="3" name="layEquipAttackLeft" g-min-height="250">
<label align="top" autoSize="true" text="@@DnD5e.tab.equipament.equip.title" fontSize="12" vertTextAlign="center" horzTextAlign="center" fontStyle="bold"/>
<recordList name="rclEquips" align="client" field="equipamentos.ataques" templateForm="frmEquipamentoItem" minQt="1" hitTest="true"
margins="{top=5, bottom=5}">
Expand All @@ -52,129 +52,123 @@
</event>
</recordList>
<button align="bottom" text="@@DnD5e.tab.equipament.btn.newItem" onClick="self.rclEquips.selectedNode = self.rclEquips:append(); self.rclEquips.selectedForm.editName:setFocus();"/>
</flowPart>
<flowPart name="layEquipAttackRight" height="250" width="900">
</layout>
<layout g="col" g-width="9" name="layEquipAttackRight" g-min-height="250" g-cnt-gutter="5" g-cnt-line-spacing="5">
<dataScopeBox name="dataEquipAttackDetails" align="client" frameStyle="frames/panel5/frame.xml" margins="{left=10}" enabled="false">
<event name="onNodeReady">
self.imgEquipAttackImg:setVisible(false);
self.cbOptAtaqueMunicao:setItems(common.getNomeContadores(sheet, {""}));
</event>
<event name="onNodeUnready"> self.imgEquipAttackImg:setVisible(true); </event>

<flowLayout align="top" height="250" autoHeight="true" maxControlsPerLine="2">
<flowPart height="230" width="255">
<layout name="layEquipAttackImg" align="left" width="100">
<image name="imgEquipAttackImg" align="client" url="https://clipartart.com/images/cross-sword-clipart.png" showProgress="false" animate='true'/>
<image align="client" field="imagem" showProgress="false" editable="true" animate='true'/>
</layout>
<layout name="layEquipAttackImg" g="col" g-width="2" g-vert-tile="true">
<image name="imgEquipAttackImg" align="client" url="https://clipartart.com/images/cross-sword-clipart.png" showProgress="false" animate='true'/>
<image align="client" field="imagem" showProgress="false" editable="true" animate='true'/>
</layout>

<layout name="layEquipPropriedades" align="left" width="150" margins="{left=5}">
<label text="@@DnD5e.tab.equipament.atack.lab.property" align="top" class="tituloCampo" horzTextAlign="center"/>
<recordList name="rclProps" align="client" field="listaPropriedades" templateForm="frmText">
<event name="onItemRemoved">
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil then
if equip.tabPropriedades == nil then equip.tabPropriedades = {}; end;
equip.tabPropriedades[node.texto] = nil;
<layout name="layEquipPropriedades" g="col" g-width="2" g-vert-tile="true" margins="{left=5}">
<label text="@@DnD5e.tab.equipament.atack.lab.property" align="top" class="tituloCampo" horzTextAlign="center"/>
<recordList name="rclProps" align="client" field="listaPropriedades" templateForm="frmText">
<event name="onItemRemoved">
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil then
if equip.tabPropriedades == nil then equip.tabPropriedades = {}; end;
equip.tabPropriedades[node.texto] = nil;

equip.propriedades = common.concat(equip.tabPropriedades, ", ");
end;
</event>
</recordList>
<button align="bottom" text="@@DnD5e.tab.equipament.btn.property"><event name="onClick">
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil then
if equip.tabPropriedades == nil then equip.tabPropriedades = {}; end;
equip.propriedades = common.concat(equip.tabPropriedades, ", ");
end;
</event>
</recordList>
<button align="bottom" text="@@DnD5e.tab.equipament.btn.property" fontSize="11"><event name="onClick">
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil then
if equip.tabPropriedades == nil then equip.tabPropriedades = {}; end;

local other = LANG("DnD5e.tabControl.tab.other")
local other = LANG("DnD5e.tabControl.tab.other")

local choices = {};
for prop,_ in pairs(common.armas_propriedades) do if not equip.tabPropriedades[prop] then table.insert(choices, prop); end; end;
table.sort(choices)
table.insert(choices, other)
local choices = {};
for prop,_ in pairs(common.armas_propriedades) do if not equip.tabPropriedades[prop] then table.insert(choices, prop); end; end;
table.sort(choices)
table.insert(choices, other)

Dialogs.choose(LANG("DnD5e.tab.equipament.selProp"), choices,
function(selected, selectedIndex, selectedText)
if(selected) then
if selectedText == other then
Dialogs.inputQuery(LANG("DnD5e.tab.equipament.textCaption"), LANG("DnD5e.tab.equipament.textPrompt"), "" , function(text)
Dialogs.inputQuery(LANG("DnD5e.tab.equipament.hintCaption"), LANG("DnD5e.tab.equipament.hintPrompt"), "" , function(hint)
local node = self.rclProps:append()
node.texto = text
node.hint = hint
end)
end)
else
local node = self.rclProps:append()
node.texto = selectedText;
node.hint = common.armas_propriedades[selectedText];
Dialogs.choose(LANG("DnD5e.tab.equipament.selProp"), choices,
function(selected, selectedIndex, selectedText)
if(selected) then
if selectedText == other then
Dialogs.inputQuery(LANG("DnD5e.tab.equipament.textCaption"), LANG("DnD5e.tab.equipament.textPrompt"), "" , function(text)
Dialogs.inputQuery(LANG("DnD5e.tab.equipament.hintCaption"), LANG("DnD5e.tab.equipament.hintPrompt"), "" , function(hint)
local node = self.rclProps:append()
node.texto = text
node.hint = hint
end)
end)
else
local node = self.rclProps:append()
node.texto = selectedText;
node.hint = common.armas_propriedades[selectedText];

equip.tabPropriedades[selectedText] = true;
equip.propriedades = common.concat(equip.tabPropriedades, ", ");
end
end;
equip.tabPropriedades[selectedText] = true;
equip.propriedades = common.concat(equip.tabPropriedades, ", ");
end
)
end;
</event></button>
<dataLink field="propriedades"><event name="onChange">
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil and equip.propriedades ~= nil then
if equip.tabPropriedades == nil then equip.tabPropriedades = {}; end;
end;
end
)
end;
</event></button>
<dataLink field="propriedades"><event name="onChange">
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil and equip.propriedades ~= nil then
if equip.tabPropriedades == nil then equip.tabPropriedades = {}; end;

if self.rclProps ~= nil and common.concat(equip.tabPropriedades) == "" then
for propriedade in string.gmatch((equip.propriedades or ""), "[^,%s]+") do
if common.armas_propriedades[propriedade] ~= nil then
equip.tabPropriedades[propriedade] = true;
local node = self.rclProps:append();
node.texto = propriedade;
node.hint = common.armas_propriedades[propriedade];
end;
end;
if self.rclProps ~= nil and common.concat(equip.tabPropriedades) == "" then
for propriedade in string.gmatch((equip.propriedades or ""), "[^,%s]+") do
if common.armas_propriedades[propriedade] ~= nil then
equip.tabPropriedades[propriedade] = true;
local node = self.rclProps:append();
node.texto = propriedade;
node.hint = common.armas_propriedades[propriedade];
end;
equip.propriedades = common.concat(equip.tabPropriedades, ", ");
end;
</event></dataLink>
</layout>
</flowPart>
end;
equip.propriedades = common.concat(equip.tabPropriedades, ", ");
end;
</event></dataLink>
</layout>

<flowPart height="230" width="600">
<layout height="230" width="600" class="contentLayout" name="layPrincipal" margins="{left=5}">
<flowLayout class="tile" align="top" height="15" name="optAtaqueLegenda" horzAlign="justify">
<optAtaqueLegenda text=" " height="15" width="20"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.range" height="15" minWidth="80" maxWidth="150"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.attack" height="15" minWidth="110" maxWidth="200"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.damage" height="15" minWidth="80" maxWidth="170"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.type" height="15" minWidth="80" maxWidth="180"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.ammunition" height="15" minWidth="100" maxWidth="200"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.ammunitionAmount" height="15" minWidth="25" maxWidth="50"/>
<optAtaqueLegenda text=" " height="25" width="25"/>
</flowLayout>
<optAtaque name="optAtaquePadrao" align="top" enabled="false" checked="true" alcanceOuNome="alcance"/>
<horzLine align="top" strokeColor="lightGray" opacity="0.3" margins="{top=2}"/>
<recordList name="rclOptsAttack" align="client" field="optsAttack" templateForm="frmOptAtaque">
<event name="onItemAdded"> form.cbOptAtaqueMunicao:setItems(common.getNomeContadores(sheet, {""})); </event>
</recordList>
<button align="bottom" text="@@DnD5e.tab.equipament.btn.addAttackOption" onClick="self.rclOptsAttack:append();" margins="{left=200, right=200}"/>
<dataLink field="contadoresMudaram">
<event name="onChange">
if sheet ~= nil and self ~= nil and sheet.contadoresMudaram then
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil then
local optsAttack = NDB.getChildNodes(equip.optsAttack);
for i=1,#optsAttack,1 do
optsAttack[i].contadoresMudaram = true;
optsAttack[i].contadoresMudaram = false;
end;
end;
<layout g="col" g-width="8" g-vert-tile="true" class="contentLayout" name="layPrincipal" margins="{left=5}">
<flowLayout class="tile" align="top" height="15" name="optAtaqueLegenda" horzAlign="justify">
<optAtaqueLegenda text=" " height="15" width="20"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.range" height="15" minWidth="80" maxWidth="150"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.attack" height="15" minWidth="110" maxWidth="200"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.damage" height="15" minWidth="80" maxWidth="170"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.type" height="15" minWidth="80" maxWidth="180"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.ammunition" height="15" minWidth="100" maxWidth="200"/>
<optAtaqueLegenda text="@@DnD5e.tab.equipament.atack.lab.ammunitionAmount" height="15" minWidth="25" maxWidth="50"/>
<optAtaqueLegenda text=" " height="25" width="25"/>
</flowLayout>
<optAtaque name="optAtaquePadrao" align="top" enabled="false" checked="true" alcanceOuNome="alcance"/>
<horzLine align="top" strokeColor="lightGray" opacity="0.3" margins="{top=2}"/>
<recordList name="rclOptsAttack" align="client" field="optsAttack" templateForm="frmOptAtaque">
<event name="onItemAdded"> form.cbOptAtaqueMunicao:setItems(common.getNomeContadores(sheet, {""})); </event>
</recordList>
<button align="bottom" text="@@DnD5e.tab.equipament.btn.addAttackOption" onClick="self.rclOptsAttack:append();" margins="{left=150, right=150}" fontSize="11"/>
<dataLink field="contadoresMudaram">
<event name="onChange">
if sheet ~= nil and self ~= nil and sheet.contadoresMudaram then
local equip = self.dataEquipAttackDetails.node;
if equip ~= nil then
local optsAttack = NDB.getChildNodes(equip.optsAttack);
for i=1,#optsAttack,1 do
optsAttack[i].contadoresMudaram = true;
optsAttack[i].contadoresMudaram = false;
end;
</event>
</dataLink>
</layout>
</flowPart>
</flowLayout>
end;
end;
</event>
</dataLink>
</layout>
</dataScopeBox>
</flowPart>
</layout>
</flowLayout>

<flowLineBreak/>
Expand Down
2 changes: 2 additions & 0 deletions Plugins/Sheets/DnD5e/lang/en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ DnD5e.spells.attack.melee=Melee
DnD5e.spells.attack.ranger=Ranged
DnD5e.spells.damage.none=None
DnD5e.spells.damage=Damage
DnD5e.spells.uses.total=Total
DnD5e.spells.uses.spent=Spent
DnD5e.spells.resistance.none=None
DnD5e.spells.resistance.str=Strength
DnD5e.spells.resistance.dex=Dexterity
Expand Down
14 changes: 8 additions & 6 deletions Plugins/Sheets/DnD5e/lang/pt.lang
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ DnD5e.features.personalityTraits=TRAÇOS DE PERSONALIDADE
DnD5e.features.ideals=IDEAIS
DnD5e.features.bonds=VÍNCULOS
DnD5e.features.weaknesses=FRAQUEZAS
DnD5e.features.featurestraits=TRAÇOS
DnD5e.features.featurestraits=PROFICIÊNCIAS
DnD5e.features.featuresclass=CARACTERÍSTICAS DE CLASSE
DnD5e.features.featuresrace=CARACTERÍSTICAS DE RAÇA
DnD5e.features.featuresrace=TRAÇOS RACIAIS
DnD5e.features.featuresfeats=TALENTOS
DnD5e.features.languages=IDIOMAS
DnD5e.features.faction=FACÇÃO
DnD5e.features.factionSymbol=SÍMBOLO DA FACÇÃO
DnD5e.features.alliesOrganizations=ALIADOS E ORGANIZAÇÕES
DnD5e.features.characterStory=HISTÓRIA DOS PERSONAGENS

DnD5e.tabControl.tab.front=Frente
DnD5e.tabControl.tab.feature=Caracteristicas e Talentos
DnD5e.tabControl.tab.equipment=Equipamento
DnD5e.tabControl.tab.front=Atributos
DnD5e.tabControl.tab.feature=Características
DnD5e.tabControl.tab.equipment=Equipamentos
DnD5e.tabControl.tab.spells=Magias
DnD5e.tabControl.tab.counter=Contadores
DnD5e.tabControl.tab.annotations=Anotações
Expand Down Expand Up @@ -113,7 +113,7 @@ DnD5e.frente.lab.deathteste=TESTE CONTRA MORTE
DnD5e.skills.athletics=Atletismo
DnD5e.skills.acrobatics=Acrobacia
DnD5e.skills.stealth=Furtividade
DnD5e.skills.sleighthand=Prestidigitaçào
DnD5e.skills.sleighthand=Prestidigitação
DnD5e.skills.arcana=Arcanismo
DnD5e.skills.history=História
DnD5e.skills.investigation=Investigação
Expand Down Expand Up @@ -152,6 +152,8 @@ DnD5e.spells.attack.melee=Corpo-a-Corpo
DnD5e.spells.attack.ranger=Distância
DnD5e.spells.damage.none=Nenhum
DnD5e.spells.damage=Dano
DnD5e.spells.uses.total=Total
DnD5e.spells.uses.spent=Gasto
DnD5e.spells.resistance.none=Nenhum
DnD5e.spells.resistance.str=Força
DnD5e.spells.resistance.dex=Destreza
Expand Down
2 changes: 2 additions & 0 deletions Plugins/Sheets/DnD5e/magias.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
<flowPart class="magicHeader" frameStyle="frames/magicHeader/header1.xml">
<label frameRegion="RegiaoSmallTitulo" text="$(level)" class="magicLevelNumber"/>
<edit frameRegion="RegiaoConteudo1" class="magicLevelInformation" field="magias.espacosTotais$(level)"/>
<dataLink field="magias.espacosTotais$(level)" defaultValue="@@DnD5e.spells.uses.total"/>
<edit frameRegion="RegiaoConteudo2" class="magicLevelInformation" field="magias.espacosGastos$(level)"/>
<dataLink field="magias.espacosGastos$(level)" defaultValue="@@DnD5e.spells.uses.spent"/>
</flowPart>
</template>

Expand Down
4 changes: 2 additions & 2 deletions Plugins/Sheets/DnD5e/module.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module sdkVersion="3.7c">
<module sdkVersion="3.7b">
<!--O id identifica seu módulo globalmente. Deve ser único, conter apenas caracteres alfanuméricos, underlines, pontos e deve conter ao menos 5 caracteres e um máximo de 40. Uma vez definido o ID, você não deve alterar ele ;) -->
<id>br.com.rrpg.DnD5_SDK3</id>
<!--version é a versão do seu módulo. Quando for lançar uma nova versão do seu módulo, altere aqui =) -->
<version>1.2.3</version>
<version>1.2.4</version>

<settings>
<automaticStringLocalization>true</automaticStringLocalization>
Expand Down
Binary file modified Plugins/Sheets/DnD5e/output/DnD5e.rpk
Binary file not shown.
Loading

0 comments on commit 996e44f

Please sign in to comment.