Compare commits

...

2 Commits

Author SHA1 Message Date
Maulerant 5c5bdb0041 Created item template and JSON files 2024-06-28 02:42:16 -07:00
Maulerant 5907a3f62b Created item template and JSON files 2024-06-28 02:37:25 -07:00
4 changed files with 111 additions and 1 deletions

15
scripts/itemDisplay.js Normal file
View File

@ -0,0 +1,15 @@
document.addEventListener("DOMContentLoaded", function () {
fetch('./scripts/items.json')
.then(Response => Response.json())
.then(data => {
const itemDisplay = document.getElementById("iType");
//creates HTML elements to display JSON data
const typeElement = document.createElement("option");
typeElement.textContent = items.itemTypes;
//append the elements to the options
itemDisplay.appendChile(itemDisplay);
})
.catch(error => console.error("Error fetching JSON Data:", error));
});

11
scripts/items.json Normal file
View File

@ -0,0 +1,11 @@
{
"itemtypes":[
"Item",
"weapons"
],
"weaponTypes":[
"Martial",
"Throwing",
"Taser"
]
}

View File

@ -37,6 +37,8 @@
<div class="tab attributes" data-group="primary" data-tab="attributes">
{{!-- As you add new fields, add them in here! --}}
<div class="resource">
<!-- ORIGINAL
<label class="resource-label">Roll Formula:</label>
<span>{{system.formula}}</span>
<div class="grid grid-4col">
@ -50,7 +52,15 @@
</div>
<div class="grid-span-2">
<label class="resource-label">Roll Modifier</label>
<input type="text" name="system.roll.diceBonus" value="{{system.roll.diceBonus}}" data-dtype="String" />
<input type="text" name="system.roll.diceBonus" value="{{system.roll.diceBonus}}" data-dtype="String" /> -->
<span>Choose Item Type</span>
<span><select name="Item Type" id="iType">
<script src="shadowrun-6e-ultimate/module/scripts/itemDisplay.js"></script>
</select></span>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,74 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
<div class="grid grid-2col">
<div class="resource">
<label class="resource-label">Quantity</label>
<input type="text" name="system.quantity" value="{{system.quantity}}" data-dtype="Number" />
</div>
<div class="resource">
<label class="resource-label">Weight</label>
<input type="text" name="system.weight" value="{{system.weight}}" data-dtype="Number" />
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="attributes">Attributes</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Description Tab --}}
<div class="tab" data-group="primary" data-tab="description">
{{!-- To render inline rolls in a TinyMCE editor, you need to pass the parent actor's (if any) roll data to the
rollData prop. --}}
{{editor system.description target="system.description" rollData=rollData button=true owner=owner
editable=editable}}
</div>
{{!-- Attributes Tab --}}
<div class="tab attributes" data-group="primary" data-tab="attributes">
{{!-- As you add new fields, add them in here! --}}
<div class="resource">
<!-- ORIGINAL
<label class="resource-label">Roll Formula:</label>
<span>{{system.formula}}</span>
<div class="grid grid-4col">
<div class="grid-span-1">
<label class="resource-label">Number of Dice</label>
<input type="text" name="system.roll.diceNum" value="{{system.roll.diceNum}}" data-dtype="Number" />
</div>
<div class="grid-span-1">
<label class="resource-label">Die Size</label>
<input type="text" name="system.roll.diceSize" value="{{system.roll.diceSize}}" data-dtype="String" />
</div>
<div class="grid-span-2">
<label class="resource-label">Roll Modifier</label>
<input type="text" name="system.roll.diceBonus" value="{{system.roll.diceBonus}}" data-dtype="String" /> -->
<span>Choose a Weapon type</span>
<span><select name="Weapon Type" id="wTypes">
<option value="martial">Martial</option>
<option value="Throwing">Throwing</option>
<option value="tasers">Tasers</option>
<option value="holdouts">Hold-Outs</option>
</select></span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</form>
{{log system}}