Item ehnance, fixes on actor sheet

This commit is contained in:
2026-03-08 13:23:11 +01:00
parent aaf965c78a
commit 317c4990bc
7 changed files with 162 additions and 127 deletions

View File

@@ -184,8 +184,6 @@
color: #084a74; color: #084a74;
} }
.oathhammer .actor-img { .oathhammer .actor-img {
height: 150px;
width: auto;
border: 2px solid #084a74; border: 2px solid #084a74;
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
@@ -200,45 +198,24 @@
.oathhammer .character-main .character-pc { .oathhammer .character-main .character-pc {
display: flex; display: flex;
gap: 10px; gap: 10px;
align-items: flex-start;
flex: 1; flex: 1;
} }
.oathhammer .character-main .character-left {
min-width: 180px;
max-width: 180px;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.oathhammer .character-main .character-portrait { .oathhammer .character-main .character-portrait {
display: flex; flex-shrink: 0;
justify-content: center; width: 150px;
} }
.oathhammer .character-main .character-resource { .oathhammer .character-main .character-portrait .actor-img {
display: flex; width: 150px;
align-items: center; height: 150px;
flex-wrap: nowrap; -o-object-fit: cover;
gap: 4px; object-fit: cover;
margin-bottom: 2px;
}
.oathhammer .character-main .character-resource div.form-group {
display: contents;
}
.oathhammer .character-main .character-resource input {
min-width: 2.5rem;
max-width: 2.5rem;
text-align: center;
}
.oathhammer .character-main .resource-label {
min-width: 3.5rem;
font-family: "BlueDragon", "Palatino Linotype", serif;
font-size: calc(0.82rem * 0.9);
} }
.oathhammer .character-main .character-right { .oathhammer .character-main .character-right {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px; gap: 5px;
min-width: 0; min-width: 0;
} }
.oathhammer .character-main .character-name { .oathhammer .character-main .character-name {
@@ -326,17 +303,54 @@
font-size: calc(0.82rem * 0.85); font-size: calc(0.82rem * 0.85);
padding: 1px 2px; padding: 1px 2px;
} }
.oathhammer .attributes-stress-row { .oathhammer .character-main .character-stats-band {
display: flex; display: flex;
align-items: flex-start; align-items: stretch;
gap: 6px; gap: 6px;
}
.oathhammer .attributes-stress-row .character-attributes {
flex: 1; flex: 1;
} }
.oathhammer .attributes-stress-row .character-arcane-stress { .oathhammer .character-main .character-stats-band .character-resources {
flex-shrink: 0;
display: flex;
flex-direction: column;
justify-content: space-evenly;
gap: 2px;
padding: 3px 6px;
border: 1px solid #535128;
border-radius: 3px;
background: rgba(0, 0, 0, 0.08);
}
.oathhammer .character-main .character-stats-band .character-resources .character-resource {
display: flex;
align-items: center;
gap: 3px;
white-space: nowrap;
}
.oathhammer .character-main .character-stats-band .character-resources .character-resource div.form-group {
display: contents;
}
.oathhammer .character-main .character-stats-band .character-resources .character-resource input {
width: 2.4rem;
text-align: center;
font-size: calc(0.82rem * 0.85);
padding: 1px 2px;
}
.oathhammer .character-main .character-stats-band .character-resources .character-resource .res-sep {
opacity: 0.5;
font-size: calc(0.82rem * 0.9);
}
.oathhammer .character-main .character-stats-band .character-resources .resource-label {
min-width: 3.8rem;
font-family: "BlueDragon", "Palatino Linotype", serif;
font-size: calc(0.82rem * 0.9);
color: #535128;
}
.oathhammer .character-main .character-stats-band .character-attributes {
flex: 1;
min-width: 0;
}
.oathhammer .character-main .character-stats-band .character-arcane-stress {
flex-shrink: 0; flex-shrink: 0;
width: auto;
} }
.oathhammer .attributes-grid { .oathhammer .attributes-grid {
display: grid; display: grid;

View File

@@ -206,6 +206,7 @@
"StressValue": "Stress", "StressValue": "Stress",
"Attributes": "Attributes", "Attributes": "Attributes",
"Biodata": "Background", "Biodata": "Background",
"Background": "Background",
"Experience": "Experience", "Experience": "Experience",
"Level": "Level", "Level": "Level",
"XP": "Current XP", "XP": "Current XP",

View File

@@ -5,8 +5,6 @@
.oathhammer { .oathhammer {
.actor-img { .actor-img {
height: @portrait-height;
width: auto;
border: 2px solid @color-blue; border: 2px solid @color-blue;
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
@@ -18,59 +16,36 @@
flex-direction: column; flex-direction: column;
gap: 4px; gap: 4px;
// Portrait + right column layout
.character-pc { .character-pc {
display: flex; display: flex;
gap: 10px; gap: 10px;
align-items: flex-start;
flex: 1; flex: 1;
} }
.character-left { // Portrait alone on the left, fixed square
min-width: @left-panel-width;
max-width: @left-panel-width;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.character-portrait { .character-portrait {
display: flex; flex-shrink: 0;
justify-content: center; width: @portrait-height;
}
.character-resource { .actor-img {
display: flex; width: @portrait-height;
align-items: center; height: @portrait-height;
flex-wrap: nowrap; object-fit: cover;
gap: 4px;
margin-bottom: 2px;
// formInput renders a <div class="form-group"> — flatten it so it doesn't break flex row
div.form-group {
display: contents;
}
input {
min-width: 2.5rem;
max-width: 2.5rem;
text-align: center;
} }
} }
.resource-label { // Right column: stacks name, identity bar, stats band
min-width: 3.5rem;
font-family: @font-secondary;
font-size: @font-size-xs;
}
.character-right { .character-right {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px; gap: 5px;
min-width: 0; min-width: 0;
} }
// Row 1: character name
.character-name { .character-name {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -85,6 +60,7 @@
} }
} }
// Row 2: identity bar (lineage + class + level/xp)
.character-identity-bar { .character-identity-bar {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@@ -154,23 +130,66 @@
} }
} }
} }
// Row 3: unified stats band — resources | attributes | arcane stress
.character-stats-band {
display: flex;
align-items: stretch;
gap: 6px;
flex: 1;
// Vital resources: Grit / Luck / Defense / Movement
.character-resources {
flex-shrink: 0;
display: flex;
flex-direction: column;
justify-content: space-evenly;
gap: 2px;
padding: 3px 6px;
border: 1px solid @color-olive;
border-radius: 3px;
background: rgba(0,0,0,0.08);
.character-resource {
display: flex;
align-items: center;
gap: 3px;
white-space: nowrap;
div.form-group { display: contents; }
input {
width: 2.4rem;
text-align: center;
font-size: @font-size-sm;
padding: 1px 2px;
} }
// Attributes + Arcane Stress side by side .res-sep { opacity: 0.5; font-size: @font-size-xs; }
.attributes-stress-row { }
display: flex;
align-items: flex-start;
gap: 6px;
.character-attributes { flex: 1; } .resource-label {
min-width: 3.8rem;
font-family: @font-secondary;
font-size: @font-size-xs;
color: @color-olive;
}
}
// Attributes fieldset
.character-attributes {
flex: 1;
min-width: 0;
}
// Arcane stress compact
.character-arcane-stress { .character-arcane-stress {
flex-shrink: 0; flex-shrink: 0;
width: auto; }
} }
} }
// Attributes grid // Attributes grid (6 columns)
.attributes-grid { .attributes-grid {
display: grid; display: grid;
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);

View File

@@ -132,6 +132,7 @@ export default class OathHammerCharacterSheet extends OathHammerActorSheet {
break break
case "notes": case "notes":
context.tab = context.tabs.notes context.tab = context.tabs.notes
context.enrichedBackground = await foundry.applications.ux.TextEditor.implementation.enrichHTML(doc.system.background, { async: true })
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(doc.system.description, { async: true }) context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(doc.system.description, { async: true })
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(doc.system.notes, { async: true }) context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(doc.system.notes, { async: true })
break break

View File

@@ -5,6 +5,7 @@ export default class OathHammerCharacter extends foundry.abstract.TypeDataModel
const requiredInteger = { required: true, nullable: false, integer: true } const requiredInteger = { required: true, nullable: false, integer: true }
const schema = {} const schema = {}
schema.background = new fields.HTMLField({ required: true, textSearch: true })
schema.description = new fields.HTMLField({ required: true, textSearch: true }) schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.notes = new fields.HTMLField({ required: true, textSearch: true }) schema.notes = new fields.HTMLField({ required: true, textSearch: true })

View File

@@ -1,19 +1,7 @@
<section data-tab="identity" data-group="{{tab.group}}" class="tab {{tab.cssClass}}"> <section data-tab="identity" data-group="{{tab.group}}" class="tab {{tab.cssClass}}">
<fieldset> <fieldset>
<legend>{{localize "OATHHAMMER.Label.Biodata"}}</legend> <legend>{{localize "OATHHAMMER.Label.Background"}}</legend>
<div class="flexrow"> {{formInput systemFields.background enriched=enrichedBackground value=system.background name="system.background" toggled=true}}
<div class="biodata-col">
{{formField systemFields.biodata.fields.alignment value=system.biodata.alignment name="system.biodata.alignment" disabled=isPlayMode}}
{{formField systemFields.biodata.fields.age value=system.biodata.age name="system.biodata.age" disabled=isPlayMode}}
{{formField systemFields.biodata.fields.gender value=system.biodata.gender name="system.biodata.gender" disabled=isPlayMode}}
</div>
<div class="biodata-col">
{{formField systemFields.biodata.fields.height value=system.biodata.height name="system.biodata.height" disabled=isPlayMode}}
{{formField systemFields.biodata.fields.weight value=system.biodata.weight name="system.biodata.weight" disabled=isPlayMode}}
{{formField systemFields.biodata.fields.eyes value=system.biodata.eyes name="system.biodata.eyes" disabled=isPlayMode}}
{{formField systemFields.biodata.fields.hair value=system.biodata.hair name="system.biodata.hair" disabled=isPlayMode}}
</div>
</div>
</fieldset> </fieldset>
{{#if abilities.length}} {{#if abilities.length}}
<fieldset> <fieldset>

View File

@@ -2,40 +2,24 @@
<fieldset> <fieldset>
<legend>{{localize "OATHHAMMER.Label.Character"}}</legend> <legend>{{localize "OATHHAMMER.Label.Character"}}</legend>
<div class="character-pc character-pc-{{ifThen isPlayMode 'play' 'edit'}}"> <div class="character-pc character-pc-{{ifThen isPlayMode 'play' 'edit'}}">
<div class="character-left">
{{!-- Portrait column --}}
<div class="character-portrait"> <div class="character-portrait">
<img class="actor-img" src="{{actor.img}}" data-edit="img" data-action="editImage" data-tooltip="{{actor.name}}" /> <img class="actor-img" src="{{actor.img}}" data-edit="img" data-action="editImage" data-tooltip="{{actor.name}}" />
</div> </div>
<fieldset>
<div class="flexrow character-resource"> {{!-- Right column: name + identity + stats band --}}
<span class="resource-label">{{localize "OATHHAMMER.Label.Grit"}}</span>
{{formInput systemFields.grit.fields.value value=system.grit.value name="system.grit.value" disabled=isPlayMode}}
<span>/</span>
{{formInput systemFields.grit.fields.max value=system.grit.max name="system.grit.max" disabled=isPlayMode}}
</div>
<div class="flexrow character-resource">
<span class="resource-label">{{localize "OATHHAMMER.Label.Luck"}}</span>
{{formInput systemFields.luck.fields.value value=system.luck.value name="system.luck.value" disabled=isPlayMode}}
<span>/</span>
{{formInput systemFields.luck.fields.max value=system.luck.max name="system.luck.max" disabled=isPlayMode}}
</div>
<div class="flexrow character-resource">
<span class="resource-label">{{localize "OATHHAMMER.Label.Defense"}}</span>
<input type="text" value="{{system.defense.value}}" disabled class="defense-display" />
</div>
<div class="flexrow character-resource">
<span class="resource-label">{{localize "OATHHAMMER.Label.Movement"}}</span>
{{formInput systemFields.movement.fields.base value=system.movement.base name="system.movement.base" disabled=isPlayMode}}
</div>
</fieldset>
</div>
<div class="character-right"> <div class="character-right">
{{!-- Row 1: Name + toggle --}}
<div class="character-name"> <div class="character-name">
{{formInput fields.name value=source.name rootId=partId disabled=isPlayMode}} {{formInput fields.name value=source.name rootId=partId disabled=isPlayMode}}
<a class="control" data-action="toggleSheet" data-tooltip="OATHHAMMER.ToggleSheet" data-tooltip-direction="UP"> <a class="control" data-action="toggleSheet" data-tooltip="OATHHAMMER.ToggleSheet" data-tooltip-direction="UP">
<i class="fa-solid fa-user-{{ifThen isPlayMode 'lock' 'pen'}}"></i> <i class="fa-solid fa-user-{{ifThen isPlayMode 'lock' 'pen'}}"></i>
</a> </a>
</div> </div>
{{!-- Row 2: Identity bar (lineage + class + level/xp) --}}
<div class="character-identity-bar"> <div class="character-identity-bar">
<div class="identity-slot lineage-slot {{#unless lineage}}empty{{/unless}}" data-drop-type="lineage"> <div class="identity-slot lineage-slot {{#unless lineage}}empty{{/unless}}" data-drop-type="lineage">
{{#if lineage}} {{#if lineage}}
@@ -72,7 +56,32 @@
{{formInput systemFields.experience.fields.total value=system.experience.total name="system.experience.total" disabled=isPlayMode}} {{formInput systemFields.experience.fields.total value=system.experience.total name="system.experience.total" disabled=isPlayMode}}
</div> </div>
</div> </div>
<div class="attributes-stress-row">
{{!-- Row 3: Unified stats band: resources | attributes | arcane stress --}}
<div class="character-stats-band">
<fieldset class="character-resources">
<div class="character-resource">
<span class="resource-label">{{localize "OATHHAMMER.Label.Grit"}}</span>
{{formInput systemFields.grit.fields.value value=system.grit.value name="system.grit.value" disabled=isPlayMode}}
<span class="res-sep">/</span>
{{formInput systemFields.grit.fields.max value=system.grit.max name="system.grit.max" disabled=isPlayMode}}
</div>
<div class="character-resource">
<span class="resource-label">{{localize "OATHHAMMER.Label.Luck"}}</span>
{{formInput systemFields.luck.fields.value value=system.luck.value name="system.luck.value" disabled=isPlayMode}}
<span class="res-sep">/</span>
{{formInput systemFields.luck.fields.max value=system.luck.max name="system.luck.max" disabled=isPlayMode}}
</div>
<div class="character-resource">
<span class="resource-label">{{localize "OATHHAMMER.Label.Defense"}}</span>
<input type="text" value="{{system.defense.value}}" disabled class="defense-display" />
</div>
<div class="character-resource">
<span class="resource-label">{{localize "OATHHAMMER.Label.Movement"}}</span>
{{formInput systemFields.movement.fields.base value=system.movement.base name="system.movement.base" disabled=isPlayMode}}
</div>
</fieldset>
<fieldset class="character-attributes character-attributes-{{ifThen isPlayMode 'play' 'edit'}}"> <fieldset class="character-attributes character-attributes-{{ifThen isPlayMode 'play' 'edit'}}">
<legend>{{localize "OATHHAMMER.Label.Attributes"}}</legend> <legend>{{localize "OATHHAMMER.Label.Attributes"}}</legend>
<div class="attributes-grid"> <div class="attributes-grid">
@@ -84,6 +93,7 @@
{{/each}} {{/each}}
</div> </div>
</fieldset> </fieldset>
<fieldset class="character-arcane-stress"> <fieldset class="character-arcane-stress">
<legend>{{localize "OATHHAMMER.Label.ArcaneStress"}}</legend> <legend>{{localize "OATHHAMMER.Label.ArcaneStress"}}</legend>
<div class="stress-inputs"> <div class="stress-inputs">
@@ -93,6 +103,7 @@
</div> </div>
</fieldset> </fieldset>
</div> </div>
</div> </div>
</div> </div>
</fieldset> </fieldset>