Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level Up #441

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ node_modules/

# Foundry Lockfile
dcc.lock

# Mac files
.DS_store
1 change: 1 addition & 0 deletions module/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ DCC.items = {
weapon: 'DCC.Weapon',
ammunition: 'DCC.Ammunition',
armor: 'DCC.Armor',
level: 'DCC.Level',
equipment: 'DCC.Equipment',
mount: 'DCC.Mount',
spell: 'DCC.Spell',
Expand Down
1 change: 1 addition & 0 deletions module/dcc.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Hooks.once('init', async function () {
'systems/dcc/templates/item-sheet-partial-description.html',
'systems/dcc/templates/item-sheet-partial-values.html',
'systems/dcc/templates/item-sheet-armor.html',
'systems/dcc/templates/item-sheet-level.html',
'systems/dcc/templates/item-sheet-treasure.html',
'systems/dcc/templates/item-sheet-weapon.html',
'systems/dcc/templates/item-sheet-weapon-npc.html',
Expand Down
12 changes: 8 additions & 4 deletions module/item-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class DCCItemSheet extends ItemSheet {
return 'systems/dcc/templates/item-sheet-weapon.html'
case 'armor':
return 'systems/dcc/templates/item-sheet-armor.html'
case 'level':
return 'systems/dcc/templates/item-sheet-level.html'
case 'spell':
return 'systems/dcc/templates/item-sheet-spell.html'
case 'skill':
Expand Down Expand Up @@ -90,10 +92,12 @@ class DCCItemSheet extends ItemSheet {
}

// Format Description HTML
data.descriptionHTML = await TextEditor.enrichHTML(this.item.system.description.value, {
relativeTo: this.item,
secrets: this.item.isOwner
})
if (this.item.system.description) {
data.descriptionHTML = await TextEditor.enrichHTML(this.item.system.description.value, {
relativeTo: this.item,
secrets: this.item.isOwner
})
}

data.config = CONFIG.DCC

Expand Down
Binary file removed packs/dcc-macros/000256.ldb
Binary file not shown.
6 changes: 3 additions & 3 deletions packs/dcc-macros/LOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/11/02-09:40:42.319 5d38 Recovering log #270
2024/11/02-09:40:42.321 5d38 Delete type=0 #270
2024/11/02-09:40:42.321 5d38 Delete type=3 #269
2024/11/17-16:29:57.334207 30fc94000 Recovering log #286
2024/11/17-16:29:57.334592 30fc94000 Delete type=0 #286
2024/11/17-16:29:57.334624 30fc94000 Delete type=3 #285
6 changes: 3 additions & 3 deletions packs/dcc-macros/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/10/26-08:59:02.858 1794 Recovering log #268
2024/10/26-08:59:02.860 1794 Delete type=0 #268
2024/10/26-08:59:02.860 1794 Delete type=3 #267
2024/11/17-16:22:08.459813 30c2f2000 Recovering log #284
2024/11/17-16:22:08.460177 30c2f2000 Delete type=0 #284
2024/11/17-16:22:08.460205 30c2f2000 Delete type=3 #283
Binary file removed packs/dcc-userguide/000287.ldb
Binary file not shown.
7 changes: 7 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@
"ammunition",
"armor",
"equipment",
"level",
"mount",
"spell",
"treasure",
Expand Down Expand Up @@ -482,6 +483,12 @@
"currency"
]
},
"level": {
"alignment": "",
"class": "",
"level": "",
"levelData": ""
},
"mount": {
"templates": [
"itemDescription",
Expand Down
31 changes: 31 additions & 0 deletions templates/item-sheet-level.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<form class="{{cssClass}}" autocomplete="off">
<!-- Nav -->
<nav class="sheet-tabs tabs" data-group="item">
<a data-tab="main">{{localize "DCC.Level"}}</a>
</nav>

<section class="sheet-body">
<div class="tab" data-group="item" data-tab="main">
<div class="tab-body">
<div class="grid-col-span-12 grid-tpl-max-auto" style="margin-bottom: 5px;">
<label for="name">{{localize "DCC.Name"}}</label>
<input id="name" name="name" value="{{item.name}}" placeholder="Name" autocomplete="off" size="25">
<label for="system.class">{{localize "DCC.Class"}}</label>
<input id="system.class" name="system.class" value="{{item.system.class}}"
placeholder="" autocomplete="off" size="25">
<label for="system.details.alignment">{{localize "DCC.Alignment"}}</label>
<input id="system.details.alignment" name="system.details.alignment" value="{{system.details.alignment}}"
placeholder="" autocomplete="off" size="25">
<label for="system.level">{{localize "DCC.Level"}}</label>
<input id="system.level" name="system.level" value="{{item.system.level}}"
placeholder="" autocomplete="off" size="25">
</div>

<div class="dark-border grid-col-span-12">
<div class="dark-title">{{localize "DCC.LevelData"}}</div>
<textarea id="system.levelData" name="system.levelData">{{system.levelData}}</textarea>
</div>
</div>
</div>
</section>
</form>