Get most of the Untyped item implemented and functioning
This commit is contained in:
parent
a383225b8c
commit
6a355e63c0
7 changed files with 180 additions and 37 deletions
|
|
@ -48,12 +48,32 @@
|
||||||
"actor": {
|
"actor": {
|
||||||
"v2": {
|
"v2": {
|
||||||
"stat-not-chosen": "Select a dice to see the {name} skills",
|
"stat-not-chosen": "Select a dice to see the {name} skills",
|
||||||
"skill-roll-locked": "@dotdungeon.trainingLevel.locked"
|
"skill-roll-locked": "@dotdungeon.trainingLevel.locked",
|
||||||
|
"toggle-item-information": "Toggle the item's extra information visibility"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"item": {
|
||||||
|
"untyped": {
|
||||||
|
"quantity": "Quantity",
|
||||||
|
"usage": "Usage Cost",
|
||||||
|
"rarity": "Tier",
|
||||||
|
"no-description": "This item hasn't been described yet..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rarity": {
|
||||||
|
"simple": "Simple",
|
||||||
|
"greater": "Greater",
|
||||||
|
"rare": "Rare",
|
||||||
|
"legendary": "Legendary"
|
||||||
|
},
|
||||||
"default": {
|
"default": {
|
||||||
"name": "(Unnamed @TYPES.{document}.{type})"
|
"name": "(Unnamed @TYPES.{document}.{type})"
|
||||||
|
},
|
||||||
|
"common": {
|
||||||
|
"send-to-chat": "Send to Chat",
|
||||||
|
"edit": "Edit",
|
||||||
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TYPES": {
|
"TYPES": {
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,9 @@ export class GenericActorSheet extends ActorSheet {
|
||||||
};
|
};
|
||||||
|
|
||||||
async openEmbeddedSheet($event) {
|
async openEmbeddedSheet($event) {
|
||||||
const data = $event.target.dataset;
|
const data = $event.currentTarget.dataset;
|
||||||
let item = await fromUuid(data.embeddedEdit);
|
let item = await fromUuid(data.embeddedEdit);
|
||||||
|
console.log(data)
|
||||||
item?.sheet.render(true);
|
item?.sheet.render(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import { localizerConfig } from "../config.mjs";
|
import { localizerConfig } from "../config.mjs";
|
||||||
|
|
||||||
export function localizer(key, args = {}, depth = 0) {
|
export function localizer(key, args = {}, depth = 0) {
|
||||||
|
if (key instanceof Handlebars.SafeString) key = key.toString();
|
||||||
|
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
let localized = game.i18n.format(key, args);
|
let localized = game.i18n.format(key, args);
|
||||||
const subkeys = localized.matchAll(localizerConfig.subKeyPattern);
|
const subkeys = localized.matchAll(localizerConfig.subKeyPattern);
|
||||||
|
|
|
||||||
|
|
@ -94,18 +94,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-list {
|
.material-list {
|
||||||
.material-list {
|
display: grid;
|
||||||
display: grid;
|
grid-template-columns: 1fr 1fr;
|
||||||
grid-template-columns: 1fr 1fr;
|
gap: 8px;
|
||||||
gap: 8px;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.untyped-list {
|
.untyped-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.material {
|
.material {
|
||||||
|
|
@ -140,6 +138,10 @@
|
||||||
@include material.elevate(4);
|
@include material.elevate(4);
|
||||||
color: var(--inventory-material-hover-color);
|
color: var(--inventory-material-hover-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:focus-visible {
|
||||||
|
box-shadow: 0 0 10px var(--color-shadow-highlight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__input {
|
&__input {
|
||||||
|
|
@ -173,8 +175,15 @@
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
color: var(--inventory-material-color);
|
color: var(--inventory-material-color);
|
||||||
|
&:focus-visible {
|
||||||
|
box-shadow: 0 0 10px var(--color-shadow-highlight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&__name {
|
&__name {
|
||||||
|
|
@ -185,45 +194,86 @@
|
||||||
|
|
||||||
&__content {
|
&__content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr)) min-content;
|
grid-template-columns: repeat(3, minmax(0, 1fr)) 2.25rem;
|
||||||
grid-template-rows: repeat(3, min-content) auto;
|
grid-template-rows: repeat(3, 2.25rem) auto;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 4px;
|
}
|
||||||
|
|
||||||
|
&__button {
|
||||||
|
@include material.elevate(2);
|
||||||
|
padding: 0px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
@include material.elevate(4);
|
||||||
|
}
|
||||||
|
&:focus-visible {
|
||||||
|
box-shadow: 0 0 10px var(--color-shadow-highlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
&--send-to-chat {
|
||||||
|
@extend .untyped__button;
|
||||||
|
color: var(--inventory-untyped-send-to-chat-color);
|
||||||
|
}
|
||||||
|
&--edit {
|
||||||
|
@extend .untyped__button;
|
||||||
|
color: var(--inventory-untyped-edit-color);
|
||||||
|
}
|
||||||
|
&--delete {
|
||||||
|
@extend .untyped__button;
|
||||||
|
color: var(--inventory-untyped-delete-color);
|
||||||
|
background: var(--inventory-untyped-delete-bg);
|
||||||
|
&:hover {
|
||||||
|
background: var(--inventory-untyped-delete-bg-hover);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__usage, &__tier {
|
&__usage, &__tier {
|
||||||
@include material.elevate(1);
|
@include material.elevate(1);
|
||||||
|
color: var(--inventory-untyped-card-color);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center
|
align-items: center;
|
||||||
}
|
justify-content: space-between;
|
||||||
|
border-radius: 4px;
|
||||||
button {
|
|
||||||
@include material.elevate(2);
|
|
||||||
&:hover {
|
|
||||||
@include material.elevate(4);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__quantity--edit {
|
&__quantity--edit {
|
||||||
@include material.elevate(1);
|
@include material.elevate(1);
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: minmax(0, 1fr) 40px;
|
flex-direction: row;
|
||||||
max-width: 100%;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 8px;
|
justify-content: space-between;
|
||||||
|
padding: 0px 8px;
|
||||||
|
gap: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
> :first-child {
|
> :first-child {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
@include material.elevate(2);
|
||||||
|
font-family: var(--input-font);
|
||||||
|
font-size: var(--inventory-untyped-quantity-font-size);
|
||||||
|
width: 50px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 5px 7px;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__description {
|
&__description {
|
||||||
@include material.elevate(1);
|
@include material.elevate(1);
|
||||||
|
color: var(--inventory-untyped-description-color);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
grid-row: span 3;
|
grid-row: span 3;
|
||||||
grid-column: span 3;
|
grid-column: span 3;
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,10 +4,12 @@ $background: #0a0a0a;
|
||||||
$surface: #121212;
|
$surface: #121212;
|
||||||
$primary: #005300;
|
$primary: #005300;
|
||||||
$secondary: #6c056c;
|
$secondary: #6c056c;
|
||||||
|
$danger: red;
|
||||||
$on-background: $t;
|
$on-background: $t;
|
||||||
$on-surface: white;
|
$on-surface: white;
|
||||||
$on-primary: $t;
|
$on-primary: $t;
|
||||||
$on-secondary: $t;
|
$on-secondary: $t;
|
||||||
|
$on-danger: black;
|
||||||
|
|
||||||
$title-font: 'Pixelify Sans', sans-serif;
|
$title-font: 'Pixelify Sans', sans-serif;
|
||||||
$body-font: sans-serif;
|
$body-font: sans-serif;
|
||||||
|
|
@ -56,5 +58,14 @@ $body-font: sans-serif;
|
||||||
--inventory-material-focus-color: white;
|
--inventory-material-focus-color: white;
|
||||||
|
|
||||||
/* Untyped (custom) inventory item details */
|
/* Untyped (custom) inventory item details */
|
||||||
--inventory-untyped-color: white;
|
--inventory-untyped-description-color: white;
|
||||||
|
--inventory-untyped-card-color: white;
|
||||||
|
--inventory-untyped-send-to-chat-color: white;
|
||||||
|
--inventory-untyped-edit-color: white;
|
||||||
|
--inventory-untyped-delete-color: white;
|
||||||
|
--inventory-untyped-delete-bg: color-mix(in lab, #{$danger} 30%, #{$surface});
|
||||||
|
--inventory-untyped-delete-bg-hover: color-mix(in lab, #{$danger} 37%, #{$surface});;
|
||||||
|
--inventory-untyped-quantity-font-size: 14px;
|
||||||
|
--inventory-untyped-quantity-color: white;
|
||||||
|
--inventory-untyped-quantity-input-color: white;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.placeholder {
|
||||||
|
opacity: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
padding-bottom: 69px;
|
padding-bottom: 69px;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@
|
||||||
type="button"
|
type="button"
|
||||||
class="equal-padding reduced-padding"
|
class="equal-padding reduced-padding"
|
||||||
data-collapse-id="{{item.uuid}}"
|
data-collapse-id="{{item.uuid}}"
|
||||||
aria-label="Toggle the extra information's visibility"
|
tabindex="0"
|
||||||
|
aria-label="{{dd-i18n 'dotdungeon.sheet.actor.v2.toggle-item-information' item}}"
|
||||||
>
|
>
|
||||||
<div aria-hidden="true" class="icon icon--12">
|
<div aria-hidden="true" class="icon icon--12">
|
||||||
{{#if (dd-set-has meta.expanded item.uuid)}}
|
{{#if (dd-set-has meta.expanded item.uuid)}}
|
||||||
|
|
@ -28,20 +29,74 @@
|
||||||
<hr>
|
<hr>
|
||||||
<div class="untyped__content">
|
<div class="untyped__content">
|
||||||
<div class="untyped__quantity--edit">
|
<div class="untyped__quantity--edit">
|
||||||
<label for="">
|
<label for="{{meta.idp}}-{{item.uuid}}-quantity">
|
||||||
Quantity
|
Quantity
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
|
min="0"
|
||||||
|
id="{{meta.idp}}-{{item.uuid}}-quantity"
|
||||||
value="{{item.system.quantity}}"
|
value="{{item.system.quantity}}"
|
||||||
|
data-embedded-id="{{item.uuid}}"
|
||||||
|
data-embedded-update="system.quantity"
|
||||||
|
data-embedded-update-on="blur"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="untyped__usage">Usage Cost</div>
|
<div class="untyped__usage">
|
||||||
<div class="untyped__tier">Tier</div>
|
<span>Usage Cost:</span>
|
||||||
<button type="button">C</button>
|
<span>
|
||||||
<p class="untyped__description">Description</p>
|
{{dd-empty-state item.system.usage}}
|
||||||
<button type="button">E</button>
|
</span>
|
||||||
<button type="button">D</button>
|
</div>
|
||||||
|
<div class="untyped__tier">
|
||||||
|
<span>Tier:</span>
|
||||||
|
<span>{{dd-i18n (concat "dotdungeon.rarity." item.system.tier)}}</span>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-label="{{dd-i18n 'dotdungeon.common.send-to-chat'}}"
|
||||||
|
data-tooltip="{{dd-i18n 'dotdungeon.common.send-to-chat'}}"
|
||||||
|
data-tooltip-direction="RIGHT"
|
||||||
|
class="untyped__button--send-to-chat"
|
||||||
|
>
|
||||||
|
<div aria-hidden="true" class="icon icon--20">
|
||||||
|
{{{ icons.chat-bubble }}}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<p class="untyped__description">
|
||||||
|
{{#if item.system.description}}
|
||||||
|
{{item.system.description}}
|
||||||
|
{{else}}
|
||||||
|
<span class="placeholder">
|
||||||
|
This item hasn't been described yet...
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-label="{{dd-i18n 'dotdungeon.common.edit'}}"
|
||||||
|
data-tooltip="{{dd-i18n 'dotdungeon.common.edit'}}"
|
||||||
|
data-tooltip-direction="RIGHT"
|
||||||
|
class="untyped__button--edit"
|
||||||
|
data-embedded-edit="{{item.uuid}}"
|
||||||
|
>
|
||||||
|
<div aria-hidden="true" class="icon icon--20">
|
||||||
|
{{{ icons.edit }}}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-label="{{dd-i18n 'dotdungeon.common.delete'}}"
|
||||||
|
data-tooltip="{{dd-i18n 'dotdungeon.common.delete'}}"
|
||||||
|
data-tooltip-direction="RIGHT"
|
||||||
|
class="untyped__button--delete"
|
||||||
|
data-embedded-delete
|
||||||
|
data-embedded-id="{{item.uuid}}"
|
||||||
|
>
|
||||||
|
<div aria-hidden="true" class="icon icon--20">
|
||||||
|
{{{ icons.garbage-bin }}}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue