ENH: Monster treasure link
parent
c022f07bcb
commit
82a6a2508a
|
@ -41,10 +41,32 @@ export class OseActorSheetMonster extends OseActorSheet {
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
data.config.morale = game.settings.get("ose", "morale");
|
data.config.morale = game.settings.get("ose", "morale");
|
||||||
|
console.log(data);
|
||||||
|
data.data.details.treasure.link = TextEditor.enrichHTML(data.data.details.treasure.table);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async _onDrop(event) {
|
||||||
|
super._onDrop(event);
|
||||||
|
let data;
|
||||||
|
try {
|
||||||
|
data = JSON.parse(event.dataTransfer.getData('text/plain'));
|
||||||
|
if (data.type !== "RollTable") return;
|
||||||
|
} catch (err) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let link = "";
|
||||||
|
if (data.pack) {
|
||||||
|
let tableData = game.packs.get(data.pack).index.filter(el => el._id = "laDZWR1TIe0MVNZe");
|
||||||
|
link = `@Compendium[${data.pack}.${data.id}]{${tableData[0].name}}`;
|
||||||
|
} else {
|
||||||
|
link = `@RollTable[${data.id}]`;
|
||||||
|
}
|
||||||
|
this.actor.update({"data.details.treasure.table": link});
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
async _chooseItemType(choices = ["weapon", "armor", "shield", "gear"]) {
|
async _chooseItemType(choices = ["weapon", "armor", "shield", "gear"]) {
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
min-width: 460px;
|
min-width: 460px;
|
||||||
.header-details {
|
.header-details {
|
||||||
.summary {
|
.summary {
|
||||||
|
.treasure-table {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.check-field {
|
.check-field {
|
||||||
&:hover {
|
&:hover {
|
||||||
.check {
|
.check {
|
||||||
|
|
|
@ -33,17 +33,13 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="summary flexrow">
|
<ul class="summary flexrow">
|
||||||
<li class="flex3">
|
<li>
|
||||||
<input type="text" name="data.details.xp" value="{{data.details.xp}}" />
|
<input type="text" name="data.details.xp" value="{{data.details.xp}}" />
|
||||||
<label>{{localize 'OSE.details.experience.award'}}</label>
|
<label>{{localize 'OSE.details.experience.award'}}</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="flex3">
|
<li class="treasure-table" title="{{localize 'OSE.details.treasureTableHint'}}">
|
||||||
<input type="text" name="data.details.treasure.type" value="{{data.details.treasure.type}}" />
|
<div>{{{data.details.treasure.link}}}</div>
|
||||||
<label>{{localize 'OSE.details.treasure'}}</label>
|
<label>{{localize 'OSE.details.treasure'}}</label>
|
||||||
</li>
|
</li>
|
||||||
<!-- <li title="{{localize 'OSE.details.treasureTableHint'}}">
|
|
||||||
<div>{{data.details.treasure.table}}</div>
|
|
||||||
<label>{{localize 'OSE.details.treasureTable'}}</label>
|
|
||||||
</li> -->
|
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
Loading…
Reference in New Issue