forked from GitHub-Mirrors/foundry-sw5e
Merge pull request #138 from unrealkakeman89/cyr-power-point-ui
More UI changes
This commit is contained in:
commit
f9bc405787
10 changed files with 72 additions and 56 deletions
|
@ -764,8 +764,13 @@
|
||||||
"SW5E.PowerComponents": "Power Components",
|
"SW5E.PowerComponents": "Power Components",
|
||||||
"SW5E.PowerCreate": "Create Power",
|
"SW5E.PowerCreate": "Create Power",
|
||||||
"SW5E.PowerDC": "Power DC",
|
"SW5E.PowerDC": "Power DC",
|
||||||
|
"SW5E.UniversalPowerDC": "Universal Power DC",
|
||||||
|
"SW5E.LightPowerDC": "Light Power DC",
|
||||||
|
"SW5E.DarkPowerDC": "DarkPower DC",
|
||||||
|
"SW5E.TechPowerDC": "Tech Power DC",
|
||||||
"SW5E.PowerDetails": "Power Details",
|
"SW5E.PowerDetails": "Power Details",
|
||||||
"SW5E.PowerEffects": "Power Effects",
|
"SW5E.PowerEffects": "Power Effects",
|
||||||
|
"SW5E.PowersKnown": "Powers Known",
|
||||||
"SW5E.PowerLevel": "Power Level",
|
"SW5E.PowerLevel": "Power Level",
|
||||||
"SW5E.PowerLevel0": "At-Will",
|
"SW5E.PowerLevel0": "At-Will",
|
||||||
"SW5E.PowerLevel1": "1st Level",
|
"SW5E.PowerLevel1": "1st Level",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* Basic Structure */
|
/* Basic Structure */
|
||||||
/* ----------------------------------------- */
|
/* ----------------------------------------- */
|
||||||
.sw5e.sheet.actor.npc {
|
.sw5e.sheet.actor.npc {
|
||||||
min-width: 600px;
|
min-width: 872px;
|
||||||
min-height: 680px;
|
min-height: 680px;
|
||||||
|
|
||||||
.header-exp {
|
.header-exp {
|
||||||
|
|
|
@ -917,13 +917,14 @@
|
||||||
.resource-items {
|
.resource-items {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
column-gap: 24px;
|
||||||
|
|
||||||
.resource {
|
.resource {
|
||||||
h1 {
|
h1 {
|
||||||
border: none;
|
border: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Russo One";
|
font-family: "Russo One";
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
@ -1070,7 +1071,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nav.sheet-navigation {
|
nav.sheet-navigation {
|
||||||
grid-template-columns: repeat(4, 1fr);
|
grid-template-columns: repeat(6, 1fr);
|
||||||
}
|
}
|
||||||
.tab.attributes {
|
.tab.attributes {
|
||||||
.traits-resources {
|
.traits-resources {
|
||||||
|
|
|
@ -231,7 +231,6 @@ export default class ActorSheet5e extends ActorSheet {
|
||||||
const sections = {
|
const sections = {
|
||||||
"atwill": -20,
|
"atwill": -20,
|
||||||
"innate": -10,
|
"innate": -10,
|
||||||
"pact": 0.5
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Label power slot uses headers
|
// Label power slot uses headers
|
||||||
|
@ -275,19 +274,6 @@ export default class ActorSheet5e extends ActorSheet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pact magic users have cantrips and a pact magic section
|
|
||||||
if ( levels.pact && levels.pact.max ) {
|
|
||||||
if ( !powerbook["0"] ) registerSection("power0", 0, CONFIG.SW5E.powerLevels[0]);
|
|
||||||
const l = levels.pact;
|
|
||||||
const config = CONFIG.SW5E.powerPreparationModes.pact;
|
|
||||||
registerSection("pact", sections.pact, config, {
|
|
||||||
prepMode: "pact",
|
|
||||||
value: l.value,
|
|
||||||
max: l.max,
|
|
||||||
override: l.override
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Iterate over every power item, adding powers to the powerbook by section
|
// Iterate over every power item, adding powers to the powerbook by section
|
||||||
powers.forEach(power => {
|
powers.forEach(power => {
|
||||||
const mode = power.data.preparation.mode || "prepared";
|
const mode = power.data.preparation.mode || "prepared";
|
||||||
|
|
|
@ -42,24 +42,27 @@ export default class ActorSheet5eNPCNew extends ActorSheet5e {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Start by classifying items into groups for rendering
|
// Start by classifying items into groups for rendering
|
||||||
let [powers, other] = data.items.reduce((arr, item) => {
|
let [forcepowers, techpowers, other] = data.items.reduce((arr, item) => {
|
||||||
item.img = item.img || DEFAULT_TOKEN;
|
item.img = item.img || DEFAULT_TOKEN;
|
||||||
item.isStack = Number.isNumeric(item.data.quantity) && (item.data.quantity !== 1);
|
item.isStack = Number.isNumeric(item.data.quantity) && (item.data.quantity !== 1);
|
||||||
item.hasUses = item.data.uses && (item.data.uses.max > 0);
|
item.hasUses = item.data.uses && (item.data.uses.max > 0);
|
||||||
item.isOnCooldown = item.data.recharge && !!item.data.recharge.value && (item.data.recharge.charged === false);
|
item.isOnCooldown = item.data.recharge && !!item.data.recharge.value && (item.data.recharge.charged === false);
|
||||||
item.isDepleted = item.isOnCooldown && (item.data.uses.per && (item.data.uses.value > 0));
|
item.isDepleted = item.isOnCooldown && (item.data.uses.per && (item.data.uses.value > 0));
|
||||||
item.hasTarget = !!item.data.target && !(["none",""].includes(item.data.target.type));
|
item.hasTarget = !!item.data.target && !(["none",""].includes(item.data.target.type));
|
||||||
if ( item.type === "power" ) arr[0].push(item);
|
if ( item.type === "power" && ["lgt", "drk", "uni"].includes(item.data.school) ) arr[0].push(item);
|
||||||
else arr[1].push(item);
|
else if ( item.type === "power" && ["tec"].includes(item.data.school) ) arr[1].push(item);
|
||||||
|
else arr[2].push(item);
|
||||||
return arr;
|
return arr;
|
||||||
}, [[], []]);
|
}, [[], [], []]);
|
||||||
|
|
||||||
// Apply item filters
|
// Apply item filters
|
||||||
powers = this._filterItems(powers, this._filters.powerbook);
|
forcepowers = this._filterItems(forcepowers, this._filters.forcePowerbook);
|
||||||
|
techpowers = this._filterItems(techpowers, this._filters.techPowerbook);
|
||||||
other = this._filterItems(other, this._filters.features);
|
other = this._filterItems(other, this._filters.features);
|
||||||
|
|
||||||
// Organize Powerbook
|
// Organize Powerbook
|
||||||
const powerbook = this._preparePowerbook(data, powers);
|
const forcePowerbook = this._preparePowerbook(data, forcepowers);
|
||||||
|
const techPowerbook = this._preparePowerbook(data, techpowers);
|
||||||
|
|
||||||
// Organize Features
|
// Organize Features
|
||||||
for ( let item of other ) {
|
for ( let item of other ) {
|
||||||
|
@ -73,7 +76,8 @@ export default class ActorSheet5eNPCNew extends ActorSheet5e {
|
||||||
|
|
||||||
// Assign and return
|
// Assign and return
|
||||||
data.features = Object.values(features);
|
data.features = Object.values(features);
|
||||||
data.powerbook = powerbook;
|
data.forcePowerbook = forcePowerbook;
|
||||||
|
data.techPowerbook = techPowerbook;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1542,13 +1542,14 @@ input[type="reset"]:disabled {
|
||||||
.sw5e.sheet.actor .swalt-sheet .tab.tech-powerbook .resource-items {
|
.sw5e.sheet.actor .swalt-sheet .tab.tech-powerbook .resource-items {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
column-gap: 24px;
|
||||||
}
|
}
|
||||||
.sw5e.sheet.actor .swalt-sheet .tab.force-powerbook .resource-items .resource h1,
|
.sw5e.sheet.actor .swalt-sheet .tab.force-powerbook .resource-items .resource h1,
|
||||||
.sw5e.sheet.actor .swalt-sheet .tab.tech-powerbook .resource-items .resource h1 {
|
.sw5e.sheet.actor .swalt-sheet .tab.tech-powerbook .resource-items .resource h1 {
|
||||||
border: none;
|
border: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Russo One";
|
font-family: "Russo One";
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
@ -1697,7 +1698,7 @@ input[type="reset"]:disabled {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.sw5e.sheet.actor.npc .swalt-sheet nav.sheet-navigation {
|
.sw5e.sheet.actor.npc .swalt-sheet nav.sheet-navigation {
|
||||||
grid-template-columns: repeat(4, 1fr);
|
grid-template-columns: repeat(6, 1fr);
|
||||||
}
|
}
|
||||||
.sw5e.sheet.actor.npc .swalt-sheet .tab.attributes .traits-resources {
|
.sw5e.sheet.actor.npc .swalt-sheet .tab.attributes .traits-resources {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
2
sw5e.css
2
sw5e.css
|
@ -1827,7 +1827,7 @@
|
||||||
/* Basic Structure */
|
/* Basic Structure */
|
||||||
/* ----------------------------------------- */
|
/* ----------------------------------------- */
|
||||||
.sw5e.sheet.actor.npc {
|
.sw5e.sheet.actor.npc {
|
||||||
min-width: 600px;
|
min-width: 872px;
|
||||||
min-height: 680px;
|
min-height: 680px;
|
||||||
}
|
}
|
||||||
.sw5e.sheet.actor.npc .header-exp {
|
.sw5e.sheet.actor.npc .header-exp {
|
||||||
|
|
|
@ -74,7 +74,8 @@
|
||||||
<nav class="sheet-navigation root-tabs" data-group="primary">
|
<nav class="sheet-navigation root-tabs" data-group="primary">
|
||||||
<button class="item active" data-tab="attributes">{{ localize "SW5E.Attributes" }}</button>
|
<button class="item active" data-tab="attributes">{{ localize "SW5E.Attributes" }}</button>
|
||||||
<button class="item" data-tab="features">{{ localize "SW5E.Features" }}</button>
|
<button class="item" data-tab="features">{{ localize "SW5E.Features" }}</button>
|
||||||
<button class="item" data-tab="powerbook">{{ localize "SW5E.Powerbook" }}</button>
|
<button class="item" data-tab="force-powerbook">{{ localize "SW5E.ForcePowerbook" }}</button>
|
||||||
|
<button class="item" data-tab="tech-powerbook">{{ localize "SW5E.TechPowerbook" }}</button>
|
||||||
<button class="item" data-tab="effects">{{ localize "SW5E.Effects" }}</button>
|
<button class="item" data-tab="effects">{{ localize "SW5E.Effects" }}</button>
|
||||||
<button class="item" data-tab="biography">{{ localize "SW5E.Biography" }}</button>
|
<button class="item" data-tab="biography">{{ localize "SW5E.Biography" }}</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -82,7 +83,7 @@
|
||||||
{{!-- NPC Sheet Body --}}
|
{{!-- NPC Sheet Body --}}
|
||||||
<section class="sheet-body">
|
<section class="sheet-body">
|
||||||
<section class="tab attributes core" data-group="primary" data-tab="attributes">
|
<section class="tab attributes core" data-group="primary" data-tab="attributes">
|
||||||
<section class="panel abilities">
|
<section class="panel abilities">
|
||||||
{{!-- Ability Scores --}}
|
{{!-- Ability Scores --}}
|
||||||
<section class="scores">
|
<section class="scores">
|
||||||
<h1>Ability Scores</h1>
|
<h1>Ability Scores</h1>
|
||||||
|
@ -171,13 +172,14 @@
|
||||||
{{> "systems/sw5e/templates/actors/newActor/parts/swalt-features.html" sections=features}}
|
{{> "systems/sw5e/templates/actors/newActor/parts/swalt-features.html" sections=features}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{!-- Powerbook Tab --}}
|
{{!-- Powerbook Tabs --}}
|
||||||
<div class="tab powerbook flexcol" data-group="primary" data-tab="powerbook">
|
<section class="tab force-powerbook" data-group="primary" data-tab="force-powerbook">
|
||||||
{{> "systems/sw5e/templates/actors/newActor/parts/swalt-force-powerbook.html"}}
|
{{> "systems/sw5e/templates/actors/newActor/parts/swalt-force-powerbook.html"}}
|
||||||
</div>
|
</section>
|
||||||
<div class="tab powerbook flexcol" data-group="primary" data-tab="powerbook">
|
|
||||||
|
<section class="tab tech-powerbook" data-group="primary" data-tab="tech-powerbook">
|
||||||
{{> "systems/sw5e/templates/actors/newActor/parts/swalt-tech-powerbook.html"}}
|
{{> "systems/sw5e/templates/actors/newActor/parts/swalt-tech-powerbook.html"}}
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
{{!-- Effects Tab --}}
|
{{!-- Effects Tab --}}
|
||||||
<div class="tab effects flexcol" data-group="primary" data-tab="effects">
|
<div class="tab effects flexcol" data-group="primary" data-tab="effects">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<section class="panel">
|
<section class="panel">
|
||||||
<section class="resource-items">
|
<section class="resource-items">
|
||||||
<div class="resource">
|
<div class="resource">
|
||||||
<h1>Force Points</h1>
|
<h1>{{localize "SW5E.ConsumableForce"}}</h1>
|
||||||
|
|
||||||
<div class="attribute-value">
|
<div class="attribute-value">
|
||||||
<input name="data.attributes.force.points.value" type="text" value="{{data.attributes.force.points.value}}" data-dtype="Number" placeholder="0" class="value-number" />
|
<input name="data.attributes.force.points.value" type="text" value="{{data.attributes.force.points.value}}" data-dtype="Number" placeholder="0" class="value-number" />
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="resource">
|
<div class="resource">
|
||||||
<h1>Universal Power DC</h1>
|
<h1>{{localize "SW5E.UniversalPowerDC"}}</h1>
|
||||||
|
|
||||||
<div class="attribute-value">
|
<div class="attribute-value">
|
||||||
<div></div>
|
<div></div>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="resource">
|
<div class="resource">
|
||||||
<h1>Light Power DC</h1>
|
<h1>{{localize "SW5E.LightPowerDC"}}</h1>
|
||||||
|
|
||||||
<div class="attribute-value">
|
<div class="attribute-value">
|
||||||
<div></div>
|
<div></div>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="resource">
|
<div class="resource">
|
||||||
<h1>Dark Power DC</h1>
|
<h1>{{localize "SW5E.DarkPowerDC"}}</h1>
|
||||||
|
|
||||||
<div class="attribute-value">
|
<div class="attribute-value">
|
||||||
<div></div>
|
<div></div>
|
||||||
|
@ -43,23 +43,24 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="resource">
|
<div class="resource">
|
||||||
<h1>Powers Known</h1>
|
{{#if isNPC}}
|
||||||
|
<h1>{{localize "SW5E.PowercasterLevel"}}</h1>
|
||||||
|
|
||||||
|
<div class="attribute-value">
|
||||||
|
<div></div>
|
||||||
|
<input class="powercasting-level" type="text" name="data.details.powerForceLevel" value="{{data.details.powerForceLevel}}" data-dtype="Number" placeholder="0" />
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<h1>{{localize "SW5E.PowersKnown"}}</h1>
|
||||||
|
|
||||||
<div class="attribute-value">
|
<div class="attribute-value">
|
||||||
<div></div>
|
<div></div>
|
||||||
<span>{{data.attributes.force.known.max}}</span>
|
<span>{{data.attributes.force.known.max}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{#if isNPC}}
|
|
||||||
<div class="force-powercasting-ability">
|
|
||||||
<label>{{localize "SW5E.PowercasterLevel"}}
|
|
||||||
<input class="powercasting-level" type="text" name="data.details.powerLevel" value="{{data.details.powerLevel}}" data-dtype="Number" placeholder="0" />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<ul class="filter-list" data-filter="forcePowerbook">
|
<ul class="filter-list" data-filter="forcePowerbook">
|
||||||
<li class="filter-title">{{localize "SW5E.Filter"}}</li>
|
<li class="filter-title">{{localize "SW5E.Filter"}}</li>
|
||||||
<li class="filter-item" data-filter="action">{{localize "SW5E.Action"}}</li>
|
<li class="filter-item" data-filter="action">{{localize "SW5E.Action"}}</li>
|
||||||
|
|
|
@ -1,32 +1,47 @@
|
||||||
<section class="panel">
|
<section class="panel">
|
||||||
<section class="resource-items">
|
<section class="resource-items">
|
||||||
<div class="resource">
|
<div class="resource">
|
||||||
<h1>Tech Points</h1>
|
<h1>{{localize "SW5E.ConsumableTech"}}</h1>
|
||||||
|
|
||||||
<div class="attribute-value">
|
<div class="attribute-value">
|
||||||
<input name="data.attributes.tech.points.value" type="text" value="{{data.attributes.tech.points.value}}" data-dtype="Number" placeholder="0" class="value-number" />
|
<input name="data.attributes.tech.points.value" type="text" value="{{data.attributes.tech.points.value}}" data-dtype="Number" placeholder="0" class="value-number" />
|
||||||
<span class="value-separator">/</span>
|
<span class="value-separator">/</span>
|
||||||
<input name="data.attributes.tech.points.max" type="text" value="{{data.attributes.tech.points.max}}" data-dtype="Number" placeholder="0" class="value-number" />
|
<input name="data.attributes.tech.points.max" type="text" value="{{data.attributes.tech.points.max}}" data-dtype="Number" placeholder="0" class="value-number" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<footer class="attribute-footer">
|
||||||
|
<input name="data.attributes.tech.points.temp" type="text" placeholder="+Temp" value="{{data.attributes.tech.points.temp}}" data-dtype="Number" />
|
||||||
|
<input name="data.attributes.tech.points.tempmax" type="text" placeholder="+Max" value="{{data.attributes.tech.points.tempmax}}" data-dtype="Number" />
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="resource">
|
<div class="resource">
|
||||||
<h1>Universal Power DC</h1>
|
<h1>{{localize "SW5E.TechPowerDC"}}</h1>
|
||||||
|
|
||||||
<div class="attribute-value">
|
<div class="attribute-value">
|
||||||
<div></div>
|
<div></div>
|
||||||
<span>{{data.attributes.powerTechDC}}</span>
|
<span>{{data.attributes.powerTechDC}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
|
|
||||||
{{#if isNPC}}
|
<div class="resource">
|
||||||
<div class="tech-powercasting-ability">
|
{{#if isNPC}}
|
||||||
<label>{{localize "SW5E.PowercasterLevel"}}
|
<h1>{{localize "SW5E.PowercasterLevel"}}</h1>
|
||||||
<input class="powercasting-level" type="text" name="data.details.powerLevel" value="{{data.details.powerLevel}}" data-dtype="Number" placeholder="0" />
|
|
||||||
</label>
|
<div class="attribute-value">
|
||||||
|
<div></div>
|
||||||
|
<input class="powercasting-level" type="text" name="data.details.powerTechLevel" value="{{data.details.powerTechLevel}}" data-dtype="Number" placeholder="0" />
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<h1>{{localize "SW5E.PowersKnown"}}</h1>
|
||||||
|
|
||||||
|
<div class="attribute-value">
|
||||||
|
<div></div>
|
||||||
|
<span>{{data.attributes.tech.known.max}}</span>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
</section>
|
||||||
|
|
||||||
<ul class="filter-list" data-filter="techPowerbook">
|
<ul class="filter-list" data-filter="techPowerbook">
|
||||||
<li class="filter-title">{{localize "SW5E.Filter"}}</li>
|
<li class="filter-title">{{localize "SW5E.Filter"}}</li>
|
||||||
|
@ -37,6 +52,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="group-list-header group-grid-powers">
|
<div class="group-list-header group-grid-powers">
|
||||||
|
<div></div>
|
||||||
<div class="item-detail item-uses"></div>
|
<div class="item-detail item-uses"></div>
|
||||||
<div class="item-detail item-school">{{localize "SW5E.PowerSchool"}}</div>
|
<div class="item-detail item-school">{{localize "SW5E.PowerSchool"}}</div>
|
||||||
<div class="item-detail item-action">{{localize "SW5E.PowerUsage"}}</div>
|
<div class="item-detail item-action">{{localize "SW5E.PowerUsage"}}</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue