Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Antho committed Oct 6, 2022
2 parents a09c3ab + f09b44d commit c32c4fe
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 52 deletions.
6 changes: 5 additions & 1 deletion module/sheets/WitcherActorSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,11 @@ export default class WitcherActorSheet extends ActorSheet {
this.actor.update({ "system.deathSaves": this.actor.system.deathSaves + 1 });
}

async _onDrop(event, data) {
async _onDropItem(event, data) {
if ( !this.actor.isOwner ) return false;
const item = await Item.implementation.fromDropData(data);
const itemData = item.toObject();
if ( this.actor.uuid === item.parent?.uuid ) return this._onSortItem(event, itemData);
let dragData = JSON.parse(event.dataTransfer.getData("text/plain"));
if (dragData.type === "itemDrop") {
let previousActor = game.actors.get(dragData.actor._id)
Expand Down
2 changes: 1 addition & 1 deletion system.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"minimum" : "10",
"verified" : "10.284"
},
"version": 0.93,
"version": 0.94,
"authors": {
"name": "TechAntho"
},
Expand Down
4 changes: 2 additions & 2 deletions templates/partials/monster-inventory-tab.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h2>{{localize "WITCHER.Loot.Weapons"}} <a class="add-item" data-itemType="weapon"><i class="fas fa-plus"></i></a></h2>
<table class="item-table">
<table class="item-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -53,7 +53,7 @@ <h2 class="flex1">{{localize "WITCHER.Loot.Name"}} <a class="add-item" data-item
class="fas fa-plus"></i></a></h2>
<a class="button-roll export-loot">{{localize "WITCHER.Monster.exportLoot"}}</a>
</div>
<table>
<table class="item-list">
{{#each loots as |valuable id|}}
<tr class="item" data-item-id="{{valuable._id}}">
<td><img src="{{valuable.img}}" class="item-img dragable" draggable="true" data-id="{{valuable._id}}"/></td>
Expand Down
16 changes: 7 additions & 9 deletions templates/partials/monster-spell-tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3>{{localize "WITCHER.Spell.Spells"}} - {{localize "WITCHER.Spell.Novice"}}
<a class="spell-display"><i class="fas fa-chevron-right"></i></a>
{{/if}}
</h3>
<table {{#if system.pannels.noviceSpellIsOpen}} class="skill-list" {{else}} class="skill-list invisible" {{/if}}>
<table {{#if system.pannels.noviceSpellIsOpen}} class="skill-list item-list" {{else}} class="skill-list invisible" {{/if}}>
<tr>
<td></td>
<td></td>
Expand All @@ -46,8 +46,7 @@ <h3>{{localize "WITCHER.Spell.Spells"}} - {{localize "WITCHER.Spell.Novice"}}
<td><a class="item-edit"><i class="fas fa-edit"></i></a></td>
<td><img src="{{spell.img}}" class="item-img dragable" draggable="true" data-id="{{spell._id}}"/></td>
<td><a class="spell-roll">{{spell.name}}</a></td>
<td><input class="inline-edit spell-sta" data-field="system.stamina" type="text"
value="{{spell.system.stamina}}" placeholder="1" data-dtype="Number"/></td>
<td><input class="inline-edit spell-sta" data-field="system.stamina" type="text" value="{{spell.system.stamina}}" placeholder="1" data-dtype="Number"/></td>
<td><a class="item-delete"><i class="fas fa-trash-alt"></i></a>
</tr>
</tbody>
Expand All @@ -62,8 +61,7 @@ <h3>{{localize "WITCHER.Spell.Spells"}} - {{localize "WITCHER.Spell.Journeyman"}
<a class="spell-display"><i class="fas fa-chevron-right"></i></a>
{{/if}}
</h3>
<table {{#if system.pannels.journeymanSpellIsOpen}}
class="skill-list" {{else}} class="skill-list invisible" {{/if}}>
<table {{#if system.pannels.journeymanSpellIsOpen}} class="skill-list item-list" {{else}} class="skill-list invisible" {{/if}}>
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -93,7 +91,7 @@ <h3>{{localize "WITCHER.Spell.Spells"}} - {{localize "WITCHER.Spell.Master"}}
<a class="spell-display"><i class="fas fa-chevron-right"></i></a>
{{/if}}
</h3>
<table {{#if system.pannels.masterSpellIsOpen}} class="skill-list" {{else}} class="skill-list invisible" {{/if}}>
<table {{#if system.pannels.masterSpellIsOpen}} class="skill-list item-list" {{else}} class="skill-list invisible" {{/if}}>
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -123,7 +121,7 @@ <h3>{{localize "WITCHER.Spell.Rituals"}}
<a class="spell-display"><i class="fas fa-chevron-right"></i></a>
{{/if}}
</h3>
<table {{#if system.pannels.ritualIsOpen}} class="skill-list" {{else}} class="skill-list invisible" {{/if}}>
<table {{#if system.pannels.ritualIsOpen}} class="skill-list item-list" {{else}} class="skill-list invisible" {{/if}}>
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -153,7 +151,7 @@ <h3>{{localize "WITCHER.Spell.Hexes"}}
<a class="spell-display"><i class="fas fa-chevron-right"></i></a>
{{/if}}
</h3>
<table {{#if system.pannels.hexIsOpen}} class="skill-list" {{else}} class="skill-list invisible" {{/if}}>
<table {{#if system.pannels.hexIsOpen}} class="skill-list item-list" {{else}} class="skill-list invisible" {{/if}}>
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -187,7 +185,7 @@ <h3>{{localize "WITCHER.Spell.MagicalGift"}}
<table class="skill-list invisible">
{{/unless}}
{{#if system.pannels.magicalgiftIsOpen}}
<table class="skill-list">
<table class="skill-list item-list">
{{/if}}
<tr>
<td></td>
Expand Down
18 changes: 9 additions & 9 deletions templates/partials/substances.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</tr>
</table>
{{#if system.pannels.vitriolIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Vitriol"}}</label>
<a class="add-item" data-itemType="component" data-subtype="vitriol"><i class="fas fa-plus"></i></a>
Expand All @@ -138,7 +138,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.rebisIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Rebis"}}</label>
<a class="add-item" data-itemType="component" data-subtype="rebis"><i class="fas fa-plus"></i></a>
Expand All @@ -159,7 +159,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.aetherIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Aether"}}</label>
<a class="add-item" data-itemType="component" data-subtype="aether"><i class="fas fa-plus"></i></a>
Expand All @@ -180,7 +180,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.quebrithIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Quebrith"}}</label>
<a class="add-item" data-itemType="component" data-subtype="quebrith"><i class="fas fa-plus"></i></a>
Expand All @@ -201,7 +201,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.hydragenumIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Hydragenum"}}</label>
<a class="add-item" data-itemType="component" data-subtype="hydragenum"><i class="fas fa-plus"></i></a>
Expand All @@ -222,7 +222,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.vermilionIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Vermilion"}}</label>
<a class="add-item" data-itemType="component" data-subtype="vermilion"><i class="fas fa-plus"></i></a>
Expand All @@ -243,7 +243,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.solIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Sol"}}</label>
<a class="add-item" data-itemType="component" data-subtype="sol"><i class="fas fa-plus"></i></a>
Expand All @@ -264,7 +264,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.caelumIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Caelum"}}</label>
<a class="add-item" data-itemType="component" data-subtype="caelum"><i class="fas fa-plus"></i></a>
Expand All @@ -285,7 +285,7 @@ <h2 title="Click picture to expand list">{{localize "WITCHER.Inventory.Substance
</table>
{{/if}}
{{#if system.pannels.fulgurIsOpen}}
<table>
<table class="item-list">
<tr class="substance-type-subheader">
<label>{{localize "WITCHER.Inventory.Fulgur"}}</label>
<a class="add-item" data-itemType="component" data-subtype="fulgur"><i class="fas fa-plus"></i></a>
Expand Down
39 changes: 20 additions & 19 deletions templates/partials/tab-inventory.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

<h2>{{localize "WITCHER.Inventory.Weapons"}} <a class="add-item" data-itemType="weapon"><i
class="fas fa-plus"></i></a></h2>
<table class="item-table">
<table class="item-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -197,7 +197,7 @@ <h2>{{localize "WITCHER.Inventory.Weapons"}} <a class="add-item" data-itemType=
<h2>{{localize "WITCHER.Inventory.Armor"}} <a class="add-item" data-itemType="armor"><i
class="fas fa-plus"></i></a></h2>

<table class="armor-table">
<table class="armor-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -334,8 +334,7 @@ <h2>{{localize "WITCHER.Inventory.Armor"}} <a class="add-item" data-itemType="a

</td>
{{/unless}}
<td><input type="checkbox" name="system.bludgeoning" {{checked armor.system.bludgeoning}} disabled/>
</td>
<td><input type="checkbox" name="system.bludgeoning" {{checked armor.system.bludgeoning}} disabled/></td>
<td><input type="checkbox" name="system.slashing" {{checked armor.system.slashing}} disabled/></td>
<td><input type="checkbox" name="system.Piercing" {{checked armor.system.piercing}} disabled/></td>

Expand Down Expand Up @@ -421,7 +420,6 @@ <h2>{{localize "WITCHER.Inventory.Armor"}} <a class="add-item" data-itemType="a
{{/if}}
</table>
</td>

</tr>
</tbody>
{{/each}}
Expand All @@ -432,29 +430,32 @@ <h2>{{localize "WITCHER.Inventory.Armor"}} <a class="add-item" data-itemType="a
<div class="valuable-section">
<h2>{{localize "WITCHER.Inventory.Valuables"}} <a class="add-item" data-itemType="valuable"><i
class="fas fa-plus"></i></a></h2>
<table class="valuable-table">
<tr>
<td></td>
<table class="valuable-table item-list">
<th>
<td></td>
<td><b>{{localize "WITCHER.table.Quantity"}}</b></td>
<td><b>{{localize "WITCHER.table.Name"}}</b></td>
<td><b>{{localize "WITCHER.Item.Weight"}}</b></td>
<td></td>
</tr>
</th>
{{#each valuables as |valuable id|}}
<tbody class="item" data-item-id="{{valuable._id}}">
<tr>
<td>
<a class="item-armor-display"><i class="fas fa-info"></i></a>
</td>
<td><img src="{{valuable.img}}" class="item-img dragable" draggable="true"
data-id="{{valuable._id}}"/></td>
<td><input class="inline-edit item-quantity" data-field="system.quantity" type="text"
value="{{valuable.system.quantity}}" data-dtype="Number"/></td>
<td><input class="inline-edit" data-field="name" type="text" value="{{valuable.name}}"
placeholder="name"/></td>
<td><input class="inline-edit weight-data" data-field="system.weight" type="text"
value="{{valuable.system.weight}}" data-dtype="Number"/></td>
<td>
<img src="{{valuable.img}}" class="item-img dragable" draggable="true" data-id="{{valuable._id}}"/>
</td>
<td>
<input class="inline-edit item-quantity" data-field="system.quantity" type="text" value="{{valuable.system.quantity}}" data-dtype="Number"/>
</td>
<td>
<input class="inline-edit" data-field="name" type="text" value="{{valuable.name}}" placeholder="name"/>
</td>
<td>
<input class="inline-edit weight-data" data-field="system.weight" type="text" value="{{valuable.system.weight}}" data-dtype="Number"/>
</td>
</tr>
<tr class="item-info invisible">
{{#if (eq type "valuable")}}
Expand Down Expand Up @@ -514,7 +515,7 @@ <h2>{{localize "WITCHER.Inventory.Valuables"}} <a class="add-item" data-itemTyp
</table>
<h2>{{localize "WITCHER.Inventory.Diagrams"}} <a class="add-item" data-itemType="diagrams"><i
class="fas fa-plus"></i></a></h2>
<table class="diagram-table">
<table class="diagram-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -686,7 +687,7 @@ <h2>{{localize "WITCHER.Inventory.Diagrams"}} <a class="add-item" data-itemType
<div class="components">
<h2>{{localize "WITCHER.Inventory.Components"}} <a class="add-item" data-itemType="component"><i
class="fas fa-plus"></i></a></h2>
<table class="component-table">
<table class="component-table item-list">
<tr>
<td></td>
<td><b>{{localize "WITCHER.table.Quantity"}}</b></td>
Expand Down
12 changes: 6 additions & 6 deletions templates/partials/tab-magic.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h2> {{localize "WITCHER.Spell.Novice"}} - {{localize "WITCHER.Spell.Spells"}},
<i class="fas fa-plus"></i>
</a>
</h2>
<table class="novice-spell-table">
<table class="novice-spell-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -65,7 +65,7 @@ <h2> {{localize "WITCHER.Spell.Journeyman"}} - {{localize "WITCHER.Spell.Spells"
<i class="fas fa-plus"></i>
</a>
</h2>
<table class="journeyman-spell-table">
<table class="journeyman-spell-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -125,7 +125,7 @@ <h2> {{localize "WITCHER.Spell.Master"}} - {{localize "WITCHER.Spell.Spells"}},
<i class="fas fa-plus"></i>
</a>
</h2>
<table class="master-spell-table">
<table class="master-spell-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -212,7 +212,7 @@ <h2> {{localize "WITCHER.Spell.Master"}} - {{localize "WITCHER.Spell.Spells"}},
</div>
<h2> {{localize "WITCHER.Spell.Rituals"}} <a class="add-item" data-itemType="spell" data-spellType="rituals"><i
class="fas fa-plus"></i></a></h2>
<table class="hexes-table">
<table class="hexes-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -262,7 +262,7 @@ <h2> {{localize "WITCHER.Spell.Rituals"}} <a class="add-item" data-itemType="spe
</table>
<h2> {{localize "WITCHER.Spell.Hexes"}} <a class="add-item" data-itemType="spell" data-spellType="hexes"><i
class="fas fa-plus"></i></a></h2>
<table class="hexes-table">
<table class="hexes-table item-list">
<tr>
<td></td>
<td></td>
Expand Down Expand Up @@ -302,7 +302,7 @@ <h2> {{localize "WITCHER.Spell.Hexes"}} <a class="add-item" data-itemType="spell
{{/each}}
</table>
<h2> {{localize "WITCHER.Spell.MagicalGift"}} <a class="add-item" data-itemType="spell" data-spellType="magicalgift"><i class="fas fa-plus"></i></a> </h2>
<table class="magicalgift-table">
<table class="magicalgift-table item-list">
<tr>
<td></td>
<td></td>
Expand Down
10 changes: 5 additions & 5 deletions templates/sheets/actor/loot-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></
</div>
<h2>{{localize "WITCHER.Loot.Weapons"}} <a class="add-item" data-itemType="weapon"><i
class="fas fa-plus"></i></a></h2>
<table class="item-table">
<table class="item-table item-list">
<tr>
<td class="table-empty-space"></td>
<td></td>
Expand All @@ -118,28 +118,28 @@ <h2>{{localize "WITCHER.Loot.Weapons"}} <a class="add-item" data-itemType="weapo
</table>
<h2>{{localize "WITCHER.Loot.Armors"}} <a class="add-item" data-itemType="armor"><i class="fas fa-plus"></i></a>
</h2>
<table class="item-table">
<table class="item-table item-list">
{{#each armors as |item id|}}
{{> "systems/TheWitcherTRPG/templates/partials/loot-item-display.html" item=item isGM=../isGM}}
{{/each}}
</table>
<h2>{{localize "WITCHER.Loot.Valuables"}} <a class="add-item" data-itemType="valuable"><i
class="fas fa-plus"></i></a></h2>
<table class="item-table">
<table class="item-table item-list">
{{#each valuables as |item id|}}
{{> "systems/TheWitcherTRPG/templates/partials/loot-item-display.html" item=item isGM=../isGM}}
{{/each}}
</table>
<h2>{{localize "WITCHER.Loot.Diagrams"}} <a class="add-item" data-itemType="diagrams"><i
class="fas fa-plus"></i></a></h2>
<table class="item-table">
<table class="item-table item-list">
{{#each diagrams as |item id|}}
{{> "systems/TheWitcherTRPG/templates/partials/loot-item-display.html" item=item isGM=../isGM}}
{{/each}}
</table>
<h2>{{localize "WITCHER.Loot.Components"}} <a class="add-item" data-itemType="component"><i
class="fas fa-plus"></i></a></h2>
<table class="item-table">
<table class="item-table item-list">
{{#each allComponents as |item id|}}
{{> "systems/TheWitcherTRPG/templates/partials/loot-item-display.html" item=item isGM=../isGM}}
{{/each}}
Expand Down

0 comments on commit c32c4fe

Please sign in to comment.