Get the actor sheet read/writing the character's aspect data

This commit is contained in:
Oliver-Akins 2023-12-16 23:47:07 -07:00
parent 19a59692c4
commit 340f80c5b9
18 changed files with 342 additions and 230 deletions

View file

@ -14,7 +14,8 @@
margin: 0; margin: 0;
} }
.dotdungeon > .window-content label { .dotdungeon > .window-content label {
display: block; display: inline-block;
cursor: pointer;
} }
.dotdungeon > .window-content button, .dotdungeon > .window-content button:hover { .dotdungeon > .window-content button, .dotdungeon > .window-content button:hover {
all: initial; all: initial;
@ -35,6 +36,7 @@
border-style: solid; border-style: solid;
border-color: rgba(0, 0, 0, 0.4); border-color: rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
font-family: sans-serif;
} }
.dotdungeon > .window-content input[type=text]:focus, .dotdungeon > .window-content input[type=text]:active, .dotdungeon > .window-content input[type=text]:focus, .dotdungeon > .window-content input[type=text]:active,
.dotdungeon > .window-content input[type=number]:focus, .dotdungeon > .window-content input[type=number]:focus,
@ -66,6 +68,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
gap: 8px;
} }
.dotdungeon .skill-group { .dotdungeon .skill-group {
display: flex; display: flex;
@ -81,6 +84,43 @@
text-align: center; text-align: center;
} }
.dotdungeon .panel {
display: grid;
grid-template-rows: min-content 1fr;
border: 2px solid black;
background: greenyellow;
}
.dotdungeon .panel__header {
background: black;
color: white;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 4px;
padding: 0 4px;
}
.dotdungeon .panel__header h2 {
all: initial;
display: block;
box-sizing: border-box;
color: inherit;
flex-grow: 1;
font-family: "Pixelify Sans", sans-serif;
font-size: 20px;
}
.dotdungeon .panel__header .icon {
height: 20px;
width: 20px;
aspect-ratio: 1/1;
}
@container (max-width: 400px) {
.dotdungeon .panel__header .icon {
display: none;
visibility: hidden;
}
}
.dotdungeon .actor--pc { .dotdungeon .actor--pc {
display: grid; display: grid;
grid-template-areas: "avatar stats stats" "avatar skills skills" "backpack skills skills" "backpack sync aspect" "backpack weapons aspect" "backpack weapons spells" "backpack roles spells" "summons roles mounts" "summons roles storage"; grid-template-areas: "avatar stats stats" "avatar skills skills" "backpack skills skills" "backpack sync aspect" "backpack weapons aspect" "backpack weapons spells" "backpack roles spells" "summons roles mounts" "summons roles storage";
@ -119,6 +159,13 @@
.dotdungeon .actor--pc .panel--aspect { .dotdungeon .actor--pc .panel--aspect {
grid-area: aspect; grid-area: aspect;
} }
.dotdungeon .actor--pc .panel--aspect .panel__content {
display: grid;
grid-template-rows: min-content min-content min-content 1fr;
height: 100%;
gap: 4px;
padding: 8px;
}
.dotdungeon .actor--pc .panel--weapons { .dotdungeon .actor--pc .panel--weapons {
grid-area: weapons; grid-area: weapons;
} }
@ -137,45 +184,23 @@
.dotdungeon .actor--pc .panel--storage { .dotdungeon .actor--pc .panel--storage {
grid-area: storage; grid-area: storage;
} }
.dotdungeon .panel {
border: 2px solid black;
background: greenyellow;
}
.dotdungeon .panel__header {
background: black;
color: white;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 4px;
}
.dotdungeon .panel__header h2 {
all: initial;
color: inherit;
flex-grow: 1;
padding-left: 8px;
font-family: "Pixelify Sans", sans-serif;
font-size: 20px;
}
.dotdungeon .panel__header .icon {
height: 32px;
width: 32px;
aspect-ratio: 1/1;
}
@container (max-width: 620px) { @container (max-width: 620px) {
.dotdungeon .actor--pc { .dotdungeon .actor--pc {
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-rows: repeat(15, minmax(0, 1fr)); grid-template-rows: repeat(15, min-content);
grid-template-areas: "avatar sync" "avatar skills" "stats skills" "stats skills" "weapons aspect" "weapons aspect" "backpack aspect" "backpack roles" "backpack roles" "backpack roles" "backpack spells" "summons spells" "summons storage" "mounts storage" "mounts storage"; grid-template-areas: "avatar stats" "avatar skills" "sync skills" "weapons skills" "weapons skills" "backpack aspect" "backpack aspect" "backpack roles" "backpack roles" "backpack roles" "backpack spells" "summons spells" "summons storage" "mounts storage" "mounts storage";
} }
.dotdungeon .panel { .dotdungeon .actor--pc .panel {
background: yellowgreen; background: yellowgreen;
} }
.dotdungeon .panel--stats .panel__content { .dotdungeon .actor--pc .panel--stats .panel__content {
flex-wrap: wrap; flex-wrap: wrap;
} }
.dotdungeon .actor--pc .panel--skills .panel__content {
display: flex;
flex-direction: column;
}
} }
@container (max-width: 400px) { @container (max-width: 400px) {
.dotdungeon .actor--pc { .dotdungeon .actor--pc {
@ -183,27 +208,21 @@
grid-template-rows: repeat(12, min-content); grid-template-rows: repeat(12, min-content);
grid-template-areas: "avatar" "stats" "sync" "skills" "aspect" "roles" "backpack" "weapons" "spells" "mounts" "summons" "storage"; grid-template-areas: "avatar" "stats" "sync" "skills" "aspect" "roles" "backpack" "weapons" "spells" "mounts" "summons" "storage";
} }
.dotdungeon .panel { .dotdungeon .actor--pc .panel--skills .skill {
background: blueviolet; flex-direction: column;
}
.dotdungeon .panel__header .icon {
display: none;
visibility: hidden;
} }
} }
.dotdungeon .item--aspect { .dotdungeon .item--aspect {
padding: 4px; padding: 4px;
} }
.dotdungeon .item--aspect input[type=text] { .dotdungeon .item--aspect input[type=text] {
font-family: sans-serif;
font-size: 1.5em; font-size: 1.5em;
height: 1.5em; height: 1.5em;
width: 100%; width: 100%;
} }
.dotdungeon .item--aspect textarea { .dotdungeon .item--aspect textarea {
font-family: sans-serif;
width: 100%; width: 100%;
resize: vertical; resize: vertical;
} }
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../styles/root.scss%22,%22../styles/mixins/_foundry.scss%22,%22../styles/_vars.scss%22,%22../styles/mixins/_partials.scss%22,%22../styles/sheets/partials/stat.scss%22,%22../styles/sheets/partials/skill.scss%22,%22../styles/sheets/actor/mvp.scss%22,%22../styles/mixins/_breakpoints.scss%22,%22../styles/sheets/items/aspect.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAIQ;AAKP;EACC;;AAED;EACC;;AAGD;ECfA;EACA;EACA;EDeC;EACA,aEnBW;EFoBX;;AAGD;EACC;;AAGD;EC1BA;EACA;EACA;ED0BC;EACA;;AAGD;AAAA;AAAA;EChCA;EACA;EACA;EDkCC;EGpCD;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;EAEC;;AHgCD;EACC;;;AAKF;EACC;;AAEA;EACC;EACA,YElDW;;;AEFb;EACC;EACA;EACA;;ACHD;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;;ACdF;EACC;EACA,qBACC;EASD;EACA;EACA;EACA;;AAGC;EACC;;AAED;EACC;;AACA;EACC;EACA;EACA;EACA;EACA;;AAGF;EACC;;AAEA;EACC;EACA;EACA;;AAGF;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAKH;EACC;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA,aJ5FS;EI6FT;;AAGD;EAEC,QADO;EAEP,OAFO;EAGP;;;ACnGH;ED4GC;IACC;IACA;IACA,qBACC;;EAiBF;IACC;;EAGC;IACC;;;AChIJ;EDyIC;IACC;IACA;IACA,qBACC;;EAaF;IACC;;EAGC;IACC;IACA;;;AErKL;EACC;;AAEA;EACC,aNLU;EMMV;EACA;EACA;;AAGD;EACC,aNZU;EMaV;EACA%22,%22file%22:%22root.css%22%7D */ /*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../styles/root.scss%22,%22../styles/mixins/_foundry.scss%22,%22../styles/_vars.scss%22,%22../styles/mixins/_partials.scss%22,%22../styles/sheets/partials/stat.scss%22,%22../styles/sheets/partials/skill.scss%22,%22../styles/sheets/partials/panel.scss%22,%22../styles/mixins/_breakpoints.scss%22,%22../styles/sheets/actor/mvp.scss%22,%22../styles/sheets/items/aspect.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAIQ;AAKP;EACC;;AAED;EACC;;AAGD;ECfA;EACA;EACA;EDeC;EACA,aEnBW;EFoBX;;AAGD;EACC;EACA;;AAGD;EC3BA;EACA;EACA;ED2BC;EACA;;AAGD;AAAA;AAAA;ECjCA;EACA;EACA;EDmCC;EGnCD;EACA;EACA;EACA;EACA;EACA,aDPW;;ACSX;AAAA;AAAA;AAAA;AAAA;EAEC;;AH8BD;EACC;;;AAKF;EACC;;AAEA;EACC;EACA,YElDW;;;AEHb;EACC;EACA;EACA;;ACHD;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;;ACfH;EACC;EACA;EAEA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;ELpBD;EACA;EACA;EKoBE;EACA;EACA,aJzBU;EI0BV;;AAGD;EAEC,QADO;EAEP,OAFO;EAGP;;;AC1BF;EDgCA;IACC;IACA;;;AEtCF;EACC;EACA,qBACC;EASD;EACA;EACA;EACA;;AAGC;EACC;;AAED;EACC;;AACA;EACC;EACA;EACA;EACA;EACA;;AAGF;EACC;;AAEA;EACC;EACA;EACA;;AAGF;EACC;;AAED;EACC;;AAED;EACC;;AACA;EACC;EACA;EACA;EACA;EACA;;AAGF;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;;AD1EF;ECkFC;IACC;IACA;IACA,qBACC;;EAgBD;IACC;;EAGC;IACC;;EAKD;IACC;IACA;;;AD5GL;ECsHC;IACC;IACA;IACA,qBACC;;EAeC;IACC;;;AC/IN;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;EACA%22,%22file%22:%22root.css%22%7D */

View file

@ -36,6 +36,13 @@
.dotdungeon .actor--pc .panel--aspect { .dotdungeon .actor--pc .panel--aspect {
grid-area: aspect; grid-area: aspect;
} }
.dotdungeon .actor--pc .panel--aspect .panel__content {
display: grid;
grid-template-rows: min-content min-content min-content 1fr;
height: 100%;
gap: 4px;
padding: 8px;
}
.dotdungeon .actor--pc .panel--weapons { .dotdungeon .actor--pc .panel--weapons {
grid-area: weapons; grid-area: weapons;
} }
@ -54,45 +61,23 @@
.dotdungeon .actor--pc .panel--storage { .dotdungeon .actor--pc .panel--storage {
grid-area: storage; grid-area: storage;
} }
.dotdungeon .panel {
border: 2px solid black;
background: greenyellow;
}
.dotdungeon .panel__header {
background: black;
color: white;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 4px;
}
.dotdungeon .panel__header h2 {
all: initial;
color: inherit;
flex-grow: 1;
padding-left: 8px;
font-family: "Pixelify Sans", sans-serif;
font-size: 20px;
}
.dotdungeon .panel__header .icon {
height: 32px;
width: 32px;
aspect-ratio: 1/1;
}
@container (max-width: 620px) { @container (max-width: 620px) {
.dotdungeon .actor--pc { .dotdungeon .actor--pc {
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-rows: repeat(15, minmax(0, 1fr)); grid-template-rows: repeat(15, min-content);
grid-template-areas: "avatar sync" "avatar skills" "stats skills" "stats skills" "weapons aspect" "weapons aspect" "backpack aspect" "backpack roles" "backpack roles" "backpack roles" "backpack spells" "summons spells" "summons storage" "mounts storage" "mounts storage"; grid-template-areas: "avatar stats" "avatar skills" "sync skills" "weapons skills" "weapons skills" "backpack aspect" "backpack aspect" "backpack roles" "backpack roles" "backpack roles" "backpack spells" "summons spells" "summons storage" "mounts storage" "mounts storage";
} }
.dotdungeon .panel { .dotdungeon .actor--pc .panel {
background: yellowgreen; background: yellowgreen;
} }
.dotdungeon .panel--stats .panel__content { .dotdungeon .actor--pc .panel--stats .panel__content {
flex-wrap: wrap; flex-wrap: wrap;
} }
.dotdungeon .actor--pc .panel--skills .panel__content {
display: flex;
flex-direction: column;
}
} }
@container (max-width: 400px) { @container (max-width: 400px) {
.dotdungeon .actor--pc { .dotdungeon .actor--pc {
@ -100,13 +85,9 @@
grid-template-rows: repeat(12, min-content); grid-template-rows: repeat(12, min-content);
grid-template-areas: "avatar" "stats" "sync" "skills" "aspect" "roles" "backpack" "weapons" "spells" "mounts" "summons" "storage"; grid-template-areas: "avatar" "stats" "sync" "skills" "aspect" "roles" "backpack" "weapons" "spells" "mounts" "summons" "storage";
} }
.dotdungeon .panel { .dotdungeon .actor--pc .panel--skills .skill {
background: blueviolet; flex-direction: column;
}
.dotdungeon .panel__header .icon {
display: none;
visibility: hidden;
} }
} }
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../../../styles/sheets/actor/mvp.scss%22,%22../../../styles/_vars.scss%22,%22../../../styles/mixins/_breakpoints.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAIC;EACC;EACA,qBACC;EASD;EACA;EACA;EACA;;AAGC;EACC;;AAED;EACC;;AACA;EACC;EACA;EACA;EACA;EACA;;AAGF;EACC;;AAEA;EACC;EACA;EACA;;AAGF;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAKH;EACC;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA,aC5FS;ED6FT;;AAGD;EAEC,QADO;EAEP,OAFO;EAGP;;;AEnGH;EF4GC;IACC;IACA;IACA,qBACC;;EAiBF;IACC;;EAGC;IACC;;;AEhIJ;EFyIC;IACC;IACA;IACA,qBACC;;EAaF;IACC;;EAGC;IACC;IACA%22,%22file%22:%22mvp.css%22%7D */ /*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../../../styles/sheets/actor/mvp.scss%22,%22../../../styles/mixins/_breakpoints.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAGA;EACC;EACA,qBACC;EASD;EACA;EACA;EACA;;AAGC;EACC;;AAED;EACC;;AACA;EACC;EACA;EACA;EACA;EACA;;AAGF;EACC;;AAEA;EACC;EACA;EACA;;AAGF;EACC;;AAED;EACC;;AAED;EACC;;AACA;EACC;EACA;EACA;EACA;EACA;;AAGF;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;AAED;EACC;;;AC1EF;EDkFC;IACC;IACA;IACA,qBACC;;EAgBD;IACC;;EAGC;IACC;;EAKD;IACC;IACA;;;AC5GL;EDsHC;IACC;IACA;IACA,qBACC;;EAeC;IACC%22,%22file%22:%22mvp.css%22%7D */

View file

@ -2,15 +2,13 @@
padding: 4px; padding: 4px;
} }
.dotdungeon .item--aspect input[type=text] { .dotdungeon .item--aspect input[type=text] {
font-family: sans-serif;
font-size: 1.5em; font-size: 1.5em;
height: 1.5em; height: 1.5em;
width: 100%; width: 100%;
} }
.dotdungeon .item--aspect textarea { .dotdungeon .item--aspect textarea {
font-family: sans-serif;
width: 100%; width: 100%;
resize: vertical; resize: vertical;
} }
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../../../styles/sheets/items/aspect.scss%22,%22../../../styles/_vars.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAEA;EACC;;AAEA;EACC,aCLU;EDMV;EACA;EACA;;AAGD;EACC,aCZU;EDaV;EACA%22,%22file%22:%22aspect.css%22%7D */ /*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../../../styles/sheets/items/aspect.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAEA;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;EACA%22,%22file%22:%22aspect.css%22%7D */

View file

@ -0,0 +1,39 @@
.dotdungeon .panel {
display: grid;
grid-template-rows: min-content 1fr;
border: 2px solid black;
background: greenyellow;
}
.dotdungeon .panel__header {
background: black;
color: white;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 4px;
padding: 0 4px;
}
.dotdungeon .panel__header h2 {
all: initial;
display: block;
box-sizing: border-box;
color: inherit;
flex-grow: 1;
font-family: "Pixelify Sans", sans-serif;
font-size: 20px;
}
.dotdungeon .panel__header .icon {
height: 20px;
width: 20px;
aspect-ratio: 1/1;
}
@container (max-width: 400px) {
.dotdungeon .panel__header .icon {
display: none;
visibility: hidden;
}
}
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../../../styles/sheets/partials/panel.scss%22,%22../../../styles/mixins/_foundry.scss%22,%22../../../styles/_vars.scss%22,%22../../../styles/mixins/_breakpoints.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAIA;EACC;EACA;EAEA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;ECpBD;EACA;EACA;EDoBE;EACA;EACA,aEzBU;EF0BV;;AAGD;EAEC,QADO;EAEP,OAFO;EAGP;;;AG1BF;EHgCA;IACC;IACA%22,%22file%22:%22panel.css%22%7D */

View file

@ -4,6 +4,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
gap: 8px;
} }
.dotdungeon .skill-group { .dotdungeon .skill-group {
display: flex; display: flex;
@ -19,4 +20,4 @@
text-align: center; text-align: center;
} }
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../../../styles/sheets/partials/skill.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA%22,%22file%22:%22skill.css%22%7D */ /*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../../../styles/sheets/partials/skill.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA%22,%22file%22:%22skill.css%22%7D */

View file

@ -69,6 +69,8 @@
"dotdungeon.item.aspect.description": "Description", "dotdungeon.item.aspect.description": "Description",
"dotdungeon.item.aspect.send-to-chat": "Send Aspect to Chat", "dotdungeon.item.aspect.send-to-chat": "Send Aspect to Chat",
"dotdungeon.aria.skill-dropdown": "Your expertise level in the {skill} skill",
"dotdungeon.aria.skill.dropdown": "Your expertise level in the {skill} skill",
"dotdungeon.aria.skill.button.roll": "Roll a {skill} check",
"dotdungeon.aria.aspect-description": "The information on how the aspect works" "dotdungeon.aria.aspect-description": "The information on how the aspect works"
} }

View file

@ -2,7 +2,7 @@ export const partials = [
`actors/char-sheet-mvp/partials/dice_choice.hbs`, `actors/char-sheet-mvp/partials/dice_choice.hbs`,
`actors/char-sheet-mvp/partials/stat.hbs`, `actors/char-sheet-mvp/partials/stat.hbs`,
`actors/char-sheet-mvp/partials/skill.hbs`, `actors/char-sheet-mvp/partials/skill.hbs`,
`actors/char-sheet-mvp/partials/panel.hbs`, `partials/panel.hbs`,
`items/aspect.hbs`, `items/aspect.hbs`,
]; ];
@ -24,7 +24,7 @@ export async function preloadHandlebarsTemplates() {
console.debug(`Loading partial: ${partial}`); console.debug(`Loading partial: ${partial}`);
const path = `${pathPrefix}${partial}`; const path = `${pathPrefix}${partial}`;
paths[`dotdungeon.${partial.split(`/`).pop().replace(`.hbs`, ``)}`] = path; paths[`dotdungeon.${partial.split(`/`).pop().replace(`.hbs`, ``)}`] = path;
} };
console.debug(`Loaded ${partials.length} partials`); console.debug(`Loaded ${partials.length} partials`);
console.groupEnd(); console.groupEnd();
@ -37,8 +37,6 @@ function createArray(...args) {
}; };
function objectValue(obj, keypath) { function objectValue(obj, keypath) {
// console.log(obj, keypath.string)
return keypath
function helper(o, k) { function helper(o, k) {
let v = o[k[0]]; let v = o[k[0]];
if (typeof v === "object") { if (typeof v === "object") {
@ -46,7 +44,8 @@ function objectValue(obj, keypath) {
}; };
return v; return v;
}; };
return helper(obj, keypath.string.split(`.`)) let resp = helper(obj, keypath.string.split(`.`));
return resp;
}; };
@ -73,4 +72,4 @@ function toFriendlyDuration(duration) {
friendly += `${duration}s`; friendly += `${duration}s`;
}; };
return friendly; return friendly;
} };

View file

@ -62,9 +62,11 @@ export class PlayerData extends foundry.abstract.DataModel {
piloting: trainingLevelField(), piloting: trainingLevelField(),
}) })
}), }),
aspect: new fields.StringField({ aspect: new fields.SchemaField({
blank: true, name: new fields.StringField({ blank: true, trim: true }),
trim: true, description: new fields.StringField({ blank: true, trim: true }),
deactivateAfter: new fields.NumberField({ min: 0, integer: true}),
used: new fields.BooleanField(),
}), }),
roles: new fields.ArrayField(new fields.HTMLField()), roles: new fields.ArrayField(new fields.HTMLField()),
weapon: new fields.SchemaField({ weapon: new fields.SchemaField({

View file

@ -1,3 +1,4 @@
$title-font: 'Pixelify Sans', sans-serif; $title-font: 'Pixelify Sans', sans-serif;
$body-font: sans-serif; $body-font: sans-serif;
$input-font: $body-font;
$background: #f2f2f2; $background: #f2f2f2;

View file

@ -1,9 +1,12 @@
@use "../vars" as *;
@mixin input-generic { @mixin input-generic {
border-width: 2px; border-width: 2px;
border-radius: 4px; border-radius: 4px;
border-style: solid; border-style: solid;
border-color: rgba(0,0,0, 0.4); border-color: rgba(0,0,0, 0.4);
background-color: rgba(0,0,0, 0.1); background-color: rgba(0,0,0, 0.1);
font-family: $input-font;
&:focus, &:focus,
&:active { &:active {

View file

@ -22,7 +22,8 @@
} }
label { label {
display: block; display: inline-block;
cursor: pointer;
} }
button, button:hover { button, button:hover {
@ -56,6 +57,7 @@
@import "./sheets/partials/stat.scss"; @import "./sheets/partials/stat.scss";
@import "./sheets/partials/skill.scss"; @import "./sheets/partials/skill.scss";
@import "./sheets/partials/panel.scss";
@import "./sheets/actor/mvp.scss"; @import "./sheets/actor/mvp.scss";
@import "./sheets/items/aspect.scss"; @import "./sheets/items/aspect.scss";

View file

@ -1,8 +1,7 @@
@use "../../vars.scss" as *; @use "../../vars.scss" as *;
@use "../../mixins/breakpoints" as *; @use "../../mixins/breakpoints" as *;
.dotdungeon { .dotdungeon .actor--pc {
.actor--pc {
display: grid; display: grid;
grid-template-areas: grid-template-areas:
"avatar stats stats" "avatar stats stats"
@ -50,6 +49,13 @@
} }
&--aspect { &--aspect {
grid-area: aspect; grid-area: aspect;
.panel__content {
display: grid;
grid-template-rows: min-content min-content min-content 1fr;
height: 100%;
gap: 4px;
padding: 8px;
}
} }
&--weapons { &--weapons {
grid-area: weapons; grid-area: weapons;
@ -70,38 +76,6 @@
grid-area: storage; grid-area: storage;
} }
} }
}
.panel {
border: 2px solid black;
background: greenyellow;
&__header {
background: black;
color: white;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 4px;
h2 {
all: initial;
color: inherit;
flex-grow: 1;
padding-left: 8px;
font-family: $title-font;
font-size: 20px;
}
.icon {
$size: 32px;
height: $size;
width: $size;
aspect-ratio: 1/1;
}
}
}
} }
@ -109,14 +83,14 @@
.dotdungeon { .dotdungeon {
.actor--pc { .actor--pc {
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-rows: repeat(15, minmax(0, 1fr)); grid-template-rows: repeat(15, min-content);
grid-template-areas: grid-template-areas:
"avatar sync" "avatar stats"
"avatar skills" "avatar skills"
"stats skills" "sync skills"
"stats skills" "weapons skills"
"weapons aspect" "weapons skills"
"weapons aspect" "backpack aspect"
"backpack aspect" "backpack aspect"
"backpack roles" "backpack roles"
"backpack roles" "backpack roles"
@ -126,7 +100,6 @@
"summons storage" "summons storage"
"mounts storage" "mounts storage"
"mounts storage"; "mounts storage";
}
.panel { .panel {
background: yellowgreen; background: yellowgreen;
@ -136,6 +109,14 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
} }
&--skills {
.panel__content {
display: flex;
flex-direction: column;
}
}
}
} }
} }
} }
@ -158,14 +139,12 @@
"mounts" "mounts"
"summons" "summons"
"storage"; "storage";
}
.panel {
background: blueviolet;
&__header { .panel {
.icon { &--skills {
display: none; .skill {
visibility: hidden; flex-direction: column;
}
} }
} }
} }

View file

@ -4,14 +4,12 @@
padding: 4px; padding: 4px;
input[type=text] { input[type=text] {
font-family: $body-font;
font-size: 1.5em; font-size: 1.5em;
height: 1.5em; height: 1.5em;
width: 100%; width: 100%;
} }
textarea { textarea {
font-family: $body-font;
width: 100%; width: 100%;
resize: vertical; resize: vertical;
} }

View file

@ -0,0 +1,44 @@
@use "../../mixins/breakpoints" as *;
@use "../../mixins/foundry" as *;
@use "../../vars" as *;
.dotdungeon .panel {
display: grid;
grid-template-rows: min-content 1fr;
border: 2px solid black;
background: greenyellow;
&__header {
background: black;
color: white;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 4px;
padding: 0 4px;
h2 {
@include fvtt_reset;
color: inherit;
flex-grow: 1;
font-family: $title-font;
font-size: 20px;
}
.icon {
$size: 20px;
height: $size;
width: $size;
aspect-ratio: 1/1;
}
}
}
@include bp-s {
.dotdungeon .panel__header .icon {
display: none;
visibility: hidden;
}
}

View file

@ -4,6 +4,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
gap: 8px;
&-group { &-group {
display: flex; display: flex;

View file

@ -1,24 +1,37 @@
<div class="skill"> <div class="skill">
<button
{{disabled false}}
class="skill__label skill__button"
aria-label="{{localize "dotdungeon.aria.skill.button.roll" skill=name}}"
>
{{localize (concat "dotdungeon.actor.pc.skill." name)}}
{{#with (dotdungeon-objectValue system (concat "stats." stat)) as | die |}}
{{#if die}}
({{die}})
{{/if}}
{{/with}}
</button>
<select
name="{{concat "system.skills." stat "." name}}"
class="skill__select"
aria-label="{{localize "dotdungeon.aria.skill.dropdown" skill=name}}"
>
{{#select (dotdungeon-objectValue system (concat "skills." stat "." name))}}
<option value="">Novice (+0)</option>
<option value="+2">Trained (+2)</option>
<option value="+4">Expert (+4)</option>
<option value="locked">Locked</option>
{{/select}}
</select>
<!--
<button class="skill__button" data-stat="{{stat}}" data-skill="{{name}}"> <button class="skill__button" data-stat="{{stat}}" data-skill="{{name}}">
{{!-- {{!--
This would be nice to get working at some point, but it's seeming not This would be nice to get working at some point, but it's not something
super plausible at the moment due to context weirdness (probably because that is MVP
of my "with" helper)
<img src="icons/dice/{{dotdungeon-objectValue system (concat "system.skills." stat "." name)}}black.svg"> <img src="icons/dice/{{dotdungeon-objectValue system (concat "system.skills." stat "." name)}}black.svg">
--}} --}}
R Roll
</button> </button>
<label class="skill__label"> -->
{{localize (concat "dotdungeon.actor.pc.skill." name)}}
<select
class="skill__select"
aria-label="{{localize "dotdungeon.aria.skill-dropdown" skill=name}}"
>
<option value="">Novice (+0)</option>
<option value="locked">Locked</option>
<option value="+2">Trained (+2)</option>
<option value="+4">Expert (+4)</option>
</select>
</label>
</div> </div>

View file

@ -8,14 +8,12 @@
{{/each}} {{/each}}
{{/ dotdungeon.panel}} {{/ dotdungeon.panel}}
{{#> dotdungeon.panel class="skills" title="dotdungeon.actor.pc.panel.skills"}} {{#> dotdungeon.panel class="skills" title="dotdungeon.actor.pc.panel.skills"}}
{{#each system.skills}} {{#each system.skills as |skills|}}
<div class="skill-group"> <div class="skill-group">
<h3 class="skill-group__label">{{localize (concat "dotdungeon.actor.pc.skills." @key)}}</h3> <h3 class="skill-group__label">{{localize (concat "dotdungeon.actor.pc.skills." @key)}}</h3>
{{#with @key as | stat |}} {{#each skills as |skill|}}
{{#each ..}} {{> dotdungeon.skill system=../../system stat=@../key name=@key value=skill}}
{{> dotdungeon.skill stat=stat name=@key value=this}}
{{/each}} {{/each}}
{{/with}}
</div> </div>
{{/each}} {{/each}}
{{/ dotdungeon.panel}} {{/ dotdungeon.panel}}
@ -26,7 +24,39 @@
Sync Sync
{{/ dotdungeon.panel}} {{/ dotdungeon.panel}}
{{#> dotdungeon.panel class="aspect" title="dotdungeon.actor.pc.panel.aspect"}} {{#> dotdungeon.panel class="aspect" title="dotdungeon.actor.pc.panel.aspect"}}
Aspect <input
type="text"
class="aspect__name--input"
name="system.aspect.name"
value="{{system.aspect.name}}"
>
<label class="aspect__used--label">
Used
<input
type="checkbox"
class="aspect__used--input"
name="system.aspect.used"
{{checked system.aspect.used}}
>
</label>
<label class="aspect__duration--label">
Duration
{{#if system.aspect.deactivateAfter}}
<span class="friendly-duration aspect__duration--friendly">
({{dotdungeon-toFriendlyDuration system.aspect.deactivateAfter}})
</span>
{{/if}}
<input
type="number"
class="aspect__duration--input"
name="system.aspect.deactivateAfter"
value="{{system.aspect.deactivateAfter}}"
>
</label>
<textarea
class="aspect__description--input"
name="system.aspect.description"
>{{system.aspect.description}}</textarea>
{{/ dotdungeon.panel}} {{/ dotdungeon.panel}}
{{#> dotdungeon.panel class="weapons" title="dotdungeon.actor.pc.panel.weapons"}} {{#> dotdungeon.panel class="weapons" title="dotdungeon.actor.pc.panel.weapons"}}
Weapons Weapons