army sheet : moved some elements

This commit is contained in:
Vlyan
2021-11-28 13:25:02 +01:00
parent 876b02b0c5
commit ac246e3e90
7 changed files with 196 additions and 112 deletions

View File

@@ -13,7 +13,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
template: CONFIG.l5r5e.paths.templates + "actors/army-sheet.html", template: CONFIG.l5r5e.paths.templates + "actors/army-sheet.html",
width: 600, width: 600,
height: 800, height: 800,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "cohort" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "army" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
}); });
} }
@@ -60,7 +60,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
// Check item type and subtype // Check item type and subtype
const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if (!item || item.documentName !== "Item" || !["army_cohort", "army_fortification"].includes(item.data.type)) { if (!item || item.documentName !== "Item" || !["army_cohort", "army_fortification"].includes(item.data.type)) {
console.warn("L5R5E | Wrong type", item.data.type); console.warn("L5R5E | Wrong type", item?.data?.type, item);
return; return;
} }

View File

@@ -661,7 +661,7 @@ export class HelpersL5r5e {
} }
const table = await comp.getName(tableName); const table = await comp.getName(tableName);
if (!table) { if (!table) {
console.log(`L5R5E | Table not found[${tableName}]`); console.log(`L5R5E | Table not found[${tableName}]`, comp, table);
return; return;
} }
return await table.drawMany(retrieve, opt); return await table.drawMany(retrieve, opt);

View File

@@ -29,6 +29,7 @@ export const PreloadTemplates = async function () {
`${tpl}actors/npc/skill.html`, `${tpl}actors/npc/skill.html`,
`${tpl}actors/npc/techniques.html`, `${tpl}actors/npc/techniques.html`,
// *** Actors : Army *** // *** Actors : Army ***
`${tpl}actors/army/army.html`,
`${tpl}actors/army/cohort.html`, `${tpl}actors/army/cohort.html`,
`${tpl}actors/army/fortification.html`, `${tpl}actors/army/fortification.html`,
`${tpl}actors/army/others.html`, `${tpl}actors/army/others.html`,

File diff suppressed because one or more lines are too long

View File

@@ -6,11 +6,80 @@
h1 { h1 {
flex: 1; flex: 1;
} }
.readiness {
flex: 0 0 100%;
display: flex;
flex-wrap: wrap;
ul {
display: flex;
position: relative;
padding: 0.25rem;
height: 80px;
li {
flex: 25%;
display: inline-grid;
strong {
color: $l5r5e-label;
text-align: center;
}
label {
flex: 100%;
}
input {
background: transparent;
border: 0 none;
text-align: center;
}
&:after {
content: "";
width: 2rem;
height: 2rem;
position: relative;
right: calc(50% - 5.5rem);
top: calc(50% - 2.83rem);
background: transparent url("../assets/icons/circle.svg") no-repeat 0 0;
background-size: contain;
opacity: 0.25;
z-index: -1;
}
&:nth-child(1) {
&:after {
transform: rotate(0deg);
}
}
&:nth-child(2) {
&:after {
transform: rotate(90deg);
}
}
&:nth-child(3) {
&:after {
transform: rotate(180deg);
}
}
&:nth-child(4) {
&:after {
transform: rotate(-90deg);
}
}
}
}
align-items: flex-start;
h2 {
flex: 0 0 100%;
}
}
}
}
.tab {
&.army {
.warlord, .warlord,
.commander { .commander {
display: flex; display: flex;
fieldset { fieldset {
flex: content;
margin-top: 0.25rem; margin-top: 0.25rem;
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
strong { strong {
@@ -19,66 +88,72 @@
label { label {
flex: 100%; flex: 100%;
} }
p {
width: 100%;
}
textarea {
height: calc(100% - 22px);
}
} }
} }
.readiness,
.standing { .standing {
align-items: flex-start; flex: 0 0 100%;
display: flex;
flex-wrap: wrap;
h2 { h2 {
flex: 0 0 100%; flex: 0 0 100%;
} }
ul > li {
position: relative;
padding: 0.25rem;
display: flex;
flex-direction: column-reverse;
strong {
text-align: center;
}
input {
background: transparent;
border: 0 none;
text-align: center;
}
&:after {
content: "";
width: 2rem;
height: 2rem;
position: absolute;
right: calc(50% - 0.95rem);
top: calc(50% - 1.6rem);
background: transparent url("../assets/icons/circle.svg") no-repeat 0 0;
background-size: contain;
opacity: 0.25;
}
&:nth-child(1) {
&:after {
transform: rotate(0deg);
}
}
&:nth-child(2) {
&:after {
transform: rotate(90deg);
}
}
&:nth-child(3) {
&:after {
transform: rotate(180deg);
}
}
&:nth-child(4) {
&:after {
transform: rotate(-90deg);
}
}
}
}
.readiness {
ul { ul {
display: flex; display: flex;
flex-wrap: wrap; position: relative;
li { li {
flex: 50%; flex: 33%;
display: inline-grid;
position: relative;
padding: 0.25rem;
flex-direction: column-reverse;
strong {
text-align: center;
}
input {
background: transparent;
border: 0 none;
text-align: center;
}
&:after {
content: "";
width: 2rem;
height: 2rem;
position: absolute;
right: calc(50% - 0.95rem);
top: calc(50% - 0.2rem);
background: transparent url("../assets/icons/circle.svg") no-repeat 0 0;
background-size: contain;
opacity: 0.25;
z-index: -1;
}
&:nth-child(1) {
&:after {
transform: rotate(0deg);
}
}
&:nth-child(2) {
&:after {
transform: rotate(90deg);
}
}
&:nth-child(3) {
&:after {
transform: rotate(180deg);
}
}
} }
} }
} }

View File

@@ -2,87 +2,45 @@
{{!-- Sheet Header --}} {{!-- Sheet Header --}}
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1> <div class="header-fields identity-wrapper">
<div class="header-fields warlord"> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
<fieldset> <div class="readiness">
<p>
<strong>{{localize 'l5r5e.army.warlord'}}</strong>
<input name="data.warlord" type="text" value="{{data.data.warlord}}" />
</p>
<p>
<strong>{{localize 'l5r5e.army.allies_backers'}}</strong>
<textarea type="text" name="data.allies_backers">{{data.data.allies_backers}}</textarea>
</p>
<p>
<strong>{{localize 'l5r5e.army.purpose_mustering'}}</strong>
<textarea type="text" name="data.purpose_mustering">{{data.data.purpose_mustering}}</textarea>
</p>
</fieldset>
<fieldset class="readiness">
<h2>{{localize 'l5r5e.army.battle_readiness.title'}}</h2>
<ul> <ul>
<li>
<strong>{{localize 'l5r5e.army.battle_readiness.strength'}}</strong>
<input name="data.battle_readiness.casualties_strength.max" type="text" value="{{data.data.battle_readiness.casualties_strength.max}}" />
</li>
<li> <li>
<strong>{{localize 'l5r5e.army.battle_readiness.casualties'}}</strong> <strong>{{localize 'l5r5e.army.battle_readiness.casualties'}}</strong>
<input name="data.battle_readiness.casualties_strength.value" type="text" value="{{data.data.battle_readiness.casualties_strength.value}}" /> <input name="data.battle_readiness.casualties_strength.value" type="text" value="{{data.data.battle_readiness.casualties_strength.value}}" />
</li> </li>
<li> <li>
<strong>{{localize 'l5r5e.army.battle_readiness.discipline'}}</strong> <strong>{{localize 'l5r5e.army.battle_readiness.strength'}}</strong>
<input name="data.battle_readiness.panic_discipline.max" type="text" value="{{data.data.battle_readiness.panic_discipline.max}}" /> <input name="data.battle_readiness.casualties_strength.max" type="text" value="{{data.data.battle_readiness.casualties_strength.max}}" />
</li> </li>
<li> <li>
<strong>{{localize 'l5r5e.army.battle_readiness.panic'}}</strong> <strong>{{localize 'l5r5e.army.battle_readiness.panic'}}</strong>
<input name="data.battle_readiness.panic_discipline.value" type="text" value="{{data.data.battle_readiness.panic_discipline.value}}" /> <input name="data.battle_readiness.panic_discipline.value" type="text" value="{{data.data.battle_readiness.panic_discipline.value}}" />
</li> </li>
</ul>
</fieldset>
</div>
<div class="header-fields commander">
<fieldset>
<label>
<strong>{{localize 'l5r5e.army.commander'}}</strong>
<input name="data.commander" type="text" value="{{data.data.commander}}" />
</label>
<label>
<strong>{{localize 'l5r5e.army.commander_abilities'}}</strong>
<textarea type="text" name="data.commander_abilities">{{data.data.commander_abilities}}</textarea>
</label>
<label>
<strong>{{localize 'l5r5e.army.army_abilities'}}</strong>
<textarea type="text" name="data.army_abilities">{{data.data.army_abilities}}</textarea>
</label>
</fieldset>
<fieldset class="standing">
<h2>{{localize 'l5r5e.army.commander_standing'}}</h2>
<ul>
<li> <li>
<strong>{{localize 'l5r5e.social.honor'}}</strong> <strong>{{localize 'l5r5e.army.battle_readiness.discipline'}}</strong>
<input name="data.commander_standing.honor" type="text" value="{{data.data.commander_standing.honor}}" /> <input name="data.battle_readiness.panic_discipline.max" type="text" value="{{data.data.battle_readiness.panic_discipline.max}}" />
</li>
<li>
<strong>{{localize 'l5r5e.social.glory'}}</strong>
<input name="data.commander_standing.glory" type="text" value="{{data.data.commander_standing.glory}}" />
</li>
<li>
<strong>{{localize 'l5r5e.social.status'}}</strong>
<input name="data.commander_standing.status" type="text" value="{{data.data.commander_standing.status}}" />
</li> </li>
</ul> </ul>
</fieldset> </div>
</div> </div>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- Sheet Tab Navigation --}} {{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary"> <nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="army">{{localize 'ACTOR.TypeArmy'}}</a>
<a class="item" data-tab="cohort">{{localize 'l5r5e.army.cohort.title'}}</a> <a class="item" data-tab="cohort">{{localize 'l5r5e.army.cohort.title'}}</a>
<a class="item" data-tab="fortification">{{localize 'l5r5e.army.fortification.title'}}</a> <a class="item" data-tab="fortification">{{localize 'l5r5e.army.fortification.title'}}</a>
<a class="item" data-tab="others">{{localize 'l5r5e.notes'}}</a> <a class="item" data-tab="others">{{localize 'l5r5e.notes'}}</a>
</nav> </nav>
{{!-- Army Tab --}}
<article class="tab army" data-group="primary" data-tab="army">
{{> 'systems/l5r5e/templates/actors/army/army.html'}}
</article>
{{!-- Cohort Tab --}} {{!-- Cohort Tab --}}
<article class="tab cohort" data-group="primary" data-tab="cohort"> <article class="tab cohort" data-group="primary" data-tab="cohort">
{{> 'systems/l5r5e/templates/actors/army/cohort.html'}} {{> 'systems/l5r5e/templates/actors/army/cohort.html'}}

View File

@@ -0,0 +1,50 @@
<div class="header-fields warlord">
<fieldset>
<p>
<strong>{{localize 'l5r5e.army.warlord'}}</strong>
<input name="data.warlord" type="text" value="{{data.data.warlord}}" />
</p>
<p>
<strong>{{localize 'l5r5e.army.allies_backers'}}</strong>
<textarea type="text" name="data.allies_backers">{{data.data.allies_backers}}</textarea>
</p>
<p>
<strong>{{localize 'l5r5e.army.purpose_mustering'}}</strong>
<textarea type="text" name="data.purpose_mustering">{{data.data.purpose_mustering}}</textarea>
</p>
</fieldset>
</div>
<div class="header-fields commander">
<fieldset>
<label>
<strong>{{localize 'l5r5e.army.commander'}}</strong>
<input name="data.commander" type="text" value="{{data.data.commander}}" />
</label>
<div class="standing">
<ul>
<li>
<strong>{{localize 'l5r5e.social.honor'}}</strong>
<input name="data.commander_standing.honor" type="text" value="{{data.data.commander_standing.honor}}" />
</li>
<li>
<strong>{{localize 'l5r5e.social.glory'}}</strong>
<input name="data.commander_standing.glory" type="text" value="{{data.data.commander_standing.glory}}" />
</li>
<li>
<strong>{{localize 'l5r5e.social.status'}}</strong>
<input name="data.commander_standing.status" type="text" value="{{data.data.commander_standing.status}}" />
</li>
</ul>
</div>
<label>
<strong>{{localize 'l5r5e.army.commander_abilities'}}</strong>
<textarea type="text" name="data.commander_abilities">{{data.data.commander_abilities}}</textarea>
</label>
</fieldset>
<fieldset class="army-abilities">
<label>
<strong>{{localize 'l5r5e.army.army_abilities'}}</strong>
<textarea type="text" name="data.army_abilities">{{data.data.army_abilities}}</textarea>
</label>
</fieldset>
</div>