mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Fix some css & resources select (#277)
This commit is contained in:
parent
608920c193
commit
51b7cdeefb
4 changed files with 46 additions and 40 deletions
|
|
@ -132,7 +132,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
disableOption(index, options, choices) {
|
disableOption(index, options, choices) {
|
||||||
const filtered = foundry.utils.deepClone(options);
|
const filtered = foundry.utils.deepClone(options);
|
||||||
Object.keys(filtered).forEach(o => {
|
Object.keys(filtered).forEach(o => {
|
||||||
if (choices.find((c, idx) => c.type === o && index !== idx)) delete filtered[o];
|
if (choices.find((c, idx) => c.type === o && index !== idx)) filtered[o].disabled = true;
|
||||||
});
|
});
|
||||||
return filtered;
|
return filtered;
|
||||||
}
|
}
|
||||||
|
|
@ -181,11 +181,11 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||||
}
|
}
|
||||||
|
|
||||||
static removeElement(event) {
|
static removeElement(event, button) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
const data = this.action.toObject(),
|
const data = this.action.toObject(),
|
||||||
key = event.target.closest('[data-key]').dataset.key,
|
key = event.target.closest('[data-key]').dataset.key,
|
||||||
index = event.target.dataset.index;
|
index = button.dataset.index;
|
||||||
data[key].splice(index, 1);
|
data[key].splice(index, 1);
|
||||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||||
}
|
}
|
||||||
|
|
@ -197,10 +197,10 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||||
}
|
}
|
||||||
|
|
||||||
static removeDamage(event) {
|
static removeDamage(event, button) {
|
||||||
if (!this.action.damage.parts) return;
|
if (!this.action.damage.parts) return;
|
||||||
const data = this.action.toObject(),
|
const data = this.action.toObject(),
|
||||||
index = event.target.dataset.index;
|
index = button.dataset.index;
|
||||||
data.damage.parts.splice(index, 1);
|
data.damage.parts.splice(index, 1);
|
||||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||||
}
|
}
|
||||||
|
|
@ -229,9 +229,9 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static removeEffect(event) {
|
static removeEffect(event, button) {
|
||||||
if (!this.action.effects) return;
|
if (!this.action.effects) return;
|
||||||
const index = event.target.dataset.index,
|
const index = button.dataset.index,
|
||||||
effectId = this.action.effects[index]._id;
|
effectId = this.action.effects[index]._id;
|
||||||
this.constructor.removeElement.bind(this)(event);
|
this.constructor.removeElement.bind(this)(event);
|
||||||
this.action.item.deleteEmbeddedDocuments('ActiveEffect', [effectId]);
|
this.action.item.deleteEmbeddedDocuments('ActiveEffect', [effectId]);
|
||||||
|
|
|
||||||
|
|
@ -5667,11 +5667,17 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
outline: 2px solid light-dark(#222, #efe6d8);
|
outline: 2px solid light-dark(#222, #efe6d8);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
.application.dh-style select option {
|
.application.dh-style select option,
|
||||||
|
.application.dh-style select optgroup {
|
||||||
color: #efe6d8;
|
color: #efe6d8;
|
||||||
background-color: #18162e;
|
background-color: #18162e;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
.application.dh-style select:disabled {
|
||||||
|
opacity: 0.6;
|
||||||
|
outline: 2px solid transparent;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
.application.dh-style p {
|
.application.dh-style p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
@ -5728,15 +5734,6 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
}
|
}
|
||||||
.application.dh-style fieldset .checkbox {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
align-self: end;
|
|
||||||
}
|
|
||||||
.application.dh-style fieldset .fas.fa-trash {
|
|
||||||
align-self: end;
|
|
||||||
}
|
|
||||||
.application.dh-style fieldset.one-column {
|
.application.dh-style fieldset.one-column {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -5748,10 +5745,6 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
.application.dh-style fieldset.one-column > .one-column {
|
.application.dh-style fieldset.one-column > .one-column {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.application.dh-style fieldset.one-column .nest-inputs fieldset {
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.application.dh-style fieldset.two-columns {
|
.application.dh-style fieldset.two-columns {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 2fr;
|
grid-template-columns: 1fr 2fr;
|
||||||
|
|
@ -5792,6 +5785,19 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
}
|
}
|
||||||
|
.application.dh-style fieldset .nest-inputs .btn {
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
|
.application.dh-style fieldset .nest-inputs .image {
|
||||||
|
height: 40px;
|
||||||
|
width: 40px;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: 6px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.application.dh-style fieldset .nest-inputs > .checkbox {
|
||||||
|
align-self: end;
|
||||||
|
}
|
||||||
.application.dh-style fieldset .form-group {
|
.application.dh-style fieldset .form-group {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
@ -5800,22 +5806,18 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
}
|
}
|
||||||
|
.application.dh-style fieldset .form-group.checkbox {
|
||||||
|
width: fit-content;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.application.dh-style fieldset .form-group.checkbox .form-fields {
|
||||||
|
height: 32px;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
.application.dh-style fieldset:has(.list-w-img) {
|
.application.dh-style fieldset:has(.list-w-img) {
|
||||||
gap: 0;
|
gap: 0;
|
||||||
}
|
}
|
||||||
.application.dh-style fieldset:has(+ .fas.fa-trash) {
|
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
}
|
|
||||||
.application.dh-style fieldset .fas.fa-trash {
|
|
||||||
color: darkred;
|
|
||||||
border-radius: 0 6px 6px 0;
|
|
||||||
border-color: light-dark(#18162e, #f3c267);
|
|
||||||
border-width: 2px;
|
|
||||||
border-style: groove;
|
|
||||||
border-left-width: 0;
|
|
||||||
padding: 5px;
|
|
||||||
margin-left: -7px;
|
|
||||||
}
|
|
||||||
.application.dh-style .two-columns {
|
.application.dh-style .two-columns {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 2fr;
|
grid-template-columns: 1fr 2fr;
|
||||||
|
|
@ -6048,8 +6050,6 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
.sheet.daggerheart.dh-style .tab-form-footer {
|
.sheet.daggerheart.dh-style .tab-form-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
position: relative;
|
|
||||||
bottom: -32px;
|
|
||||||
}
|
}
|
||||||
.sheet.daggerheart.dh-style .tab-form-footer button {
|
.sheet.daggerheart.dh-style .tab-form-footer button {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
@ -6455,6 +6455,7 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.application.daggerheart.dh-style .card-list {
|
.application.daggerheart.dh-style .card-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,10 @@
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .checkbox {
|
||||||
|
align-self: end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-group {
|
.form-group {
|
||||||
|
|
@ -248,7 +252,8 @@
|
||||||
|
|
||||||
&.checkbox {
|
&.checkbox {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
.form-fields {
|
.form-fields {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
|
|
||||||
|
|
@ -32,17 +32,17 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base) dmg.resultBased)}}
|
{{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base) dmg.resultBased)}}
|
||||||
<div class="nest-inputs">
|
<div class="nest-inputs">
|
||||||
<fieldset>
|
<fieldset class="one-column">
|
||||||
<legend>With Hope</legend>
|
<legend>With Hope</legend>
|
||||||
{{> formula fields=../../fields.value.fields type=../../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}}
|
{{> formula fields=../../fields.value.fields type=../../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset class="one-column">
|
||||||
<legend>With Fear</legend>
|
<legend>With Fear</legend>
|
||||||
{{> formula fields=../../fields.valueAlt.fields type=../../fields.type dmg=dmg source=dmg.valueAlt target="valueAlt" realIndex=realIndex}}
|
{{> formula fields=../../fields.valueAlt.fields type=../../fields.type dmg=dmg source=dmg.valueAlt target="valueAlt" realIndex=realIndex}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<fieldset{{#if dmg.base}} disabled{{/if}}>
|
<fieldset{{#if dmg.base}} disabled{{/if}} class="one-column">
|
||||||
{{> formula fields=../../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}}
|
{{> formula fields=../../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue