NPC: restyling

pull/12/head
Matheus Clemente 2024-03-30 20:58:44 -03:00
parent 6416a4462b
commit c4c8f5a68b
4 changed files with 28 additions and 42 deletions

View File

@ -38,7 +38,7 @@ export class CompendiumBrowserVueApplication extends Application {
template: "modules/compendium-browser/templates/vue-compendium-browser.html",
id: "compendium-browser",
title: game.i18n.localize("CMPBrowser.compendiumBrowser"),
width: 800,
width: 600,
height: 730,
resizable: true,
};

View File

@ -1570,20 +1570,12 @@ class CompendiumBrowser extends Application {
Hooks.once("init", () => {
game.compendiumBrowser = new CompendiumBrowser();
});
// @todo hooks are never async.
Hooks.once("init", async () => {
await preloadTemplates();
preloadTemplates();
});
Hooks.once("setup", () => {
registerSettings();
});
// @todo hooks are never async.
Hooks.once("setup", async () => {
await game.compendiumBrowser.setup();
game.compendiumBrowser.setup();
});
/* ---------------------------------------------- */

View File

@ -16,7 +16,7 @@
overflow-y: hidden !important;
max-width: 1100px;
max-height: 90vh;
min-width: 630px;
min-width: 600px;
min-height: 500px;
.window-content {
overflow-y: hidden !important;
@ -61,12 +61,7 @@
}
.control-area {
position: sticky;
display: block;
min-width: 250px;
max-width: 45%;
width: 350px;
height: 100%;
padding-right: 5px;
overflow: auto;
button {
background: rgba(0, 0, 0, 0.05);
@ -132,12 +127,8 @@
}
.list-area {
position: sticky;
display: flex;
min-width: 250px;
max-width: 55%;
width: 400px;
height: 100%;
padding-right: 5px;
flex: 2;
.loading {
flex: 0;
text-align: center;
@ -322,21 +313,19 @@
.npc-line {
line-height: 25px;
padding: 9px 0 5px 5px;
}
.npc-name {
font-weight: bold;
font-size: 16px;
}
.cr {
display: inline-block;
width: 55px;
.npc-tags {
.bold {
font-weight: bold;
}
.details {
flex: 2;
}
.size {
display: inline-block;
width: 75px;
}
.type {
display: inline-block;
}
}
}

View File

@ -90,13 +90,18 @@
<div class="npc-line">
<!-- First row is the title. -->
<div class="npc-name">
<a>{{ entry.name }}</a>
<a>[{{ game.dnd5e.utils.formatCR(entry.system.details.cr) }}] {{ entry.name }}</a>
</div>
<!-- Second row is supplemental info. -->
<div class="npc-tags">
<span class="cr" :data-tooltip="game.i18n.localize('Challenge rating')">{{ game.dnd5e.utils.formatCR(entry.system.details.cr) }}</span>
<span class="size">{{ CONFIG.DND5E.actorSizes?.[entry.system.traits.size].label ?? entry.system.traits.size }}</span>
<span class="type">{{ CONFIG.DND5E.creatureTypes?.[entry.system.details.type.value]?.label ?? entry.system.details.type.value }}</span>
<div class="npc-tags flexrow">
<div class="numbers flexrow">
<!-- <span class="cr" :data-tooltip="game.i18n.localize('Challenge rating')">CR {{ game.dnd5e.utils.formatCR(entry.system.details.cr) }}</span> -->
<span class="hp"><span class="bold">HP:</span> {{ entry.system.attributes.hp.max }}</span>
<span class="ac"><span class="bold">AC:</span> {{ entry.system.attributes.ac.flat }}</span>
</div>
<div class="details flexrow">
<span>{{ CONFIG.DND5E.actorSizes?.[entry.system.traits.size].label ?? entry.system.traits.size }} {{ CONFIG.DND5E.creatureTypes?.[entry.system.details.type.value]?.label ?? entry.system.details.type.value }}</span>
</div>
</div>
</div>
</li>