mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
style countdown interface, application and ownership dialog
This commit is contained in:
parent
36c952faff
commit
f7f70f54bb
8 changed files with 71 additions and 35 deletions
|
|
@ -11,7 +11,10 @@ export default class OwnershipSelection extends HandlebarsApplicationMixin(Appli
|
|||
|
||||
static DEFAULT_OPTIONS = {
|
||||
tag: 'form',
|
||||
classes: ['daggerheart', 'views', 'ownership-selection'],
|
||||
classes: ['daggerheart', 'views', 'dialog', 'dh-style', 'ownership-selection'],
|
||||
window: {
|
||||
icon: 'fa-solid fa-users'
|
||||
},
|
||||
position: {
|
||||
width: 600,
|
||||
height: 'auto'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export default class CountdownEdit extends HandlebarsApplicationMixin(Applicatio
|
|||
}
|
||||
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ['daggerheart', 'dh-style', 'countdown-edit'],
|
||||
classes: ['daggerheart', 'dialog', 'dh-style', 'countdown-edit'],
|
||||
tag: 'form',
|
||||
position: { width: 600 },
|
||||
window: { icon: 'fa-solid fa-clock-rotate-left' },
|
||||
|
|
@ -142,18 +142,20 @@ export default class CountdownEdit extends HandlebarsApplicationMixin(Applicatio
|
|||
this.updateSetting({ [`countdowns.${button.dataset.countdownId}`]: data });
|
||||
}
|
||||
|
||||
static async #removeCountdown(_, button) {
|
||||
static async #removeCountdown(event, button) {
|
||||
const { countdownId } = button.dataset;
|
||||
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: {
|
||||
title: game.i18n.localize('DAGGERHEART.APPLICATIONS.CountdownEdit.removeCountdownTitle')
|
||||
},
|
||||
content: game.i18n.format('DAGGERHEART.APPLICATIONS.CountdownEdit.removeCountdownText', {
|
||||
name: this.data.countdowns[countdownId].name
|
||||
})
|
||||
});
|
||||
if (!confirmed) return;
|
||||
if (!event.shiftKey) {
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: {
|
||||
title: game.i18n.localize('DAGGERHEART.APPLICATIONS.CountdownEdit.removeCountdownTitle')
|
||||
},
|
||||
content: game.i18n.format('DAGGERHEART.APPLICATIONS.CountdownEdit.removeCountdownText', {
|
||||
name: this.data.countdowns[countdownId].name
|
||||
})
|
||||
});
|
||||
if (!confirmed) return;
|
||||
}
|
||||
|
||||
if (this.editingCountdowns.has(countdownId)) this.editingCountdowns.delete(countdownId);
|
||||
this.updateSetting({ [`countdowns.-=${countdownId}`]: null });
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
static DEFAULT_OPTIONS = {
|
||||
id: 'countdowns',
|
||||
tag: 'div',
|
||||
classes: ['daggerheart', 'dh-style', 'countdowns'],
|
||||
classes: ['daggerheart', 'dh-style', 'countdowns', 'faded-ui'],
|
||||
window: {
|
||||
icon: 'fa-solid fa-clock-rotate-left',
|
||||
frame: true,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
@import '../../utils/colors.less';
|
||||
@import '../../utils/fonts.less';
|
||||
|
||||
.theme-light .daggerheart.application.dh-style.countdown-edit {
|
||||
background-image: url('../assets/parchments/dh-parchment-light.png');
|
||||
}
|
||||
|
|
@ -22,6 +25,7 @@
|
|||
gap: 8px;
|
||||
|
||||
.header-main-button {
|
||||
height: 32px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
|
@ -48,13 +52,10 @@
|
|||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
&.viewing {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.countdown-edit-text {
|
||||
|
|
@ -65,13 +66,16 @@
|
|||
|
||||
.countdown-edit-subtext {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
gap: 10px;
|
||||
|
||||
.countdown-edit-sub-tag {
|
||||
border: 1px solid;
|
||||
border-radius: 4px;
|
||||
padding: 2px 4px;
|
||||
background: light-dark(@beige, @dark-blue);
|
||||
padding: 3px 5px;
|
||||
font-size: var(--font-size-12);
|
||||
font: @font-body;
|
||||
|
||||
background: light-dark(@dark-15, @beige-15);
|
||||
border: 1px solid light-dark(@dark, @beige);
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -110,6 +114,7 @@
|
|||
input,
|
||||
select {
|
||||
background: light-dark(@beige, @dark-blue);
|
||||
color: light-dark(@dark, @beige);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
@import '../../utils/colors.less';
|
||||
@import '../../utils/fonts.less';
|
||||
|
||||
.theme-dark {
|
||||
.daggerheart.dh-style.countdowns {
|
||||
background-image: url(../assets/parchments/dh-parchment-dark.png);
|
||||
|
|
@ -16,7 +19,14 @@
|
|||
width: 300px;
|
||||
top: 16px;
|
||||
right: 64px;
|
||||
transition: right ease 250ms;
|
||||
transition:
|
||||
right ease 250ms,
|
||||
all var(--ui-fade-duration) ease,
|
||||
opacity var(--ui-fade-duration);
|
||||
|
||||
.window-title {
|
||||
font-family: @font-body;
|
||||
}
|
||||
|
||||
&.expanded {
|
||||
right: 364px;
|
||||
|
|
@ -60,6 +70,7 @@
|
|||
img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.countdown-content {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,15 @@
|
|||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.ownership-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.ownership-container {
|
||||
display: flex;
|
||||
border: 2px solid light-dark(@dark-blue, @golden);
|
||||
border-radius: 6px;
|
||||
padding: 0 4px 0 0;
|
||||
align-items: center;
|
||||
|
|
@ -17,10 +23,15 @@
|
|||
img {
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 6px 0 0 6px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
span {
|
||||
flex: 3;
|
||||
}
|
||||
|
||||
select {
|
||||
flex: 1;
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,15 +7,17 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{#each ownership as |player id|}}
|
||||
<div class="ownership-container">
|
||||
<img src="{{player.img}}" />
|
||||
<div>{{player.name}}</div>
|
||||
<select name="{{concat "ownership." id}}" data-dtype="Number">
|
||||
{{selectOptions @root.ownershipOptions selected=player.ownership labelAttr="label" valueAttr="value" localize=true }}
|
||||
</select>
|
||||
</div>
|
||||
{{/each}}
|
||||
<ul class="ownership-list">
|
||||
{{#each ownership as |player id|}}
|
||||
<li class="ownership-container">
|
||||
<img src="{{player.img}}" />
|
||||
<span>{{player.name}}</span>
|
||||
<select name="{{concat "ownership." id}}" data-dtype="Number">
|
||||
{{selectOptions @root.ownershipOptions selected=player.ownership labelAttr="label" valueAttr="value" localize=true }}
|
||||
</select>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
<footer class="flexrow">
|
||||
<button type="submit">{{localize "Save"}}</button>
|
||||
</footer>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<div>
|
||||
<div class="edit-container">
|
||||
<h2>{{localize "DAGGERHEART.APPLICATIONS.CountdownEdit.editTitle"}}</h2>
|
||||
<header class="dialog-header">
|
||||
<h1>{{localize "DAGGERHEART.APPLICATIONS.CountdownEdit.editTitle"}}</h1>
|
||||
</header>
|
||||
|
||||
<div class="header-tools">
|
||||
<button class="header-main-button" data-action="addCountdown">{{localize "DAGGERHEART.APPLICATIONS.CountdownEdit.newCountdown"}}</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue