RC-71 | Glory | Display & Input

This commit is contained in:
Oliver-Akins 2024-12-30 22:13:44 -07:00
parent 05f111682e
commit 31a47a99dd
5 changed files with 67 additions and 13 deletions

View file

@ -31,6 +31,35 @@
{{rc-options fate.selected fate.options localize=true}}
</select>
</div>
{{#if meta.editable}}
<label
for="{{meta.idp}}-glory"
class="glory-label col-header"
>
{{ rc-i18n "RipCrypt.common.glory" }}
</label>
<input
id="{{meta.idp}}-glory"
type="number"
class="glory row-alt"
name="system.level.glory"
value="{{level.glory}}"
min="0"
>
{{else}}
<div
id="{{meta.idp}}-glory-label"
class="glory-label label col-header"
>
{{ rc-i18n "RipCrypt.common.glory" }}
</div>
<div
class="glory row-alt input"
aria-describedby="{{meta.idp}}-glory-label"
>
{{ level.glory }}
</div>
{{/if}}
{{!-- * Weapons --}}
<table class="weapons">

View file

@ -50,6 +50,15 @@
padding-left: var(--col-gap);
}
.glory-label {
grid-column: 2 / span 1;
grid-row: 4 / span 1;
}
.glory {
grid-column: 2 / span 1;
grid-row: 5 / span 1;
}
.fate {
grid-column: 1 / span 1;
grid-row: 4 / span 2;
@ -114,6 +123,7 @@
background: none;
width: 70%;
text-align: center;
padding: 0;
}
> .roll {

View file

@ -1,15 +1,18 @@
.ripcrypt > .window-content input {
all: revert;
box-sizing: border-box;
border: none;
outline: none;
font-family: inherit;
font-size: inherit;
position: relative;
background: none;
.ripcrypt > .window-content {
input, .input {
all: revert;
box-sizing: border-box;
border: none;
outline: none;
font-family: inherit;
font-size: inherit;
position: relative;
background: none;
padding: 2px 4px;
&[type="text"],
&[type="number"] {
border-bottom: 2px dashed purple;
&[type="text"],
&[type="number"] {
border-bottom: 2px dashed purple;
}
}
}

View file

@ -35,7 +35,8 @@
},
"wear": "Wear",
"damage": "Damage",
"guts": "Guts"
"guts": "Guts",
"glory": "Glory"
},
"setting": {
"abbrAccess": {

View file

@ -52,6 +52,7 @@ export class HeroSummaryCardV1 extends GenericSheetMixin(HandlebarsApplicationMi
ctx = await HeroSummaryCardV1.prepareFatePath(ctx);
ctx = await HeroSummaryCardV1.prepareAbilityRow(ctx);
ctx = await HeroSummaryCardV1.prepareSpeed(ctx);
ctx = await HeroSummaryCardV1.prepareLevelData(ctx);
partId = partId.slice(0,1).toUpperCase() + partId.slice(1);
if (this[`_prepare${partId}Context`] != null) {
@ -62,6 +63,16 @@ export class HeroSummaryCardV1 extends GenericSheetMixin(HandlebarsApplicationMi
return ctx;
};
static async prepareLevelData(ctx) {
ctx.level = {
glory: ctx.actor.system.level.glory,
};
if (ctx.meta.limited) {
ctx.level.glory = `?`;
};
return ctx;
};
static async prepareFatePath(ctx) {
ctx.fate = {};
ctx.fate.selected = ctx.actor.system.fate;