Skip to content

Commit

Permalink
Dnd 3.0.x Compatibility (#30)
Browse files Browse the repository at this point in the history
* edited sheet to make items rollable in 5e 3.0

* change release action to work with new foundry admin system

* Make hit point and hit dice config buttons clickable again
  • Loading branch information
eastcw authored Mar 18, 2024
1 parent ed10ad1 commit 725461b
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:

# Publish this new version to the Foundry VTT Module Listing
- name: FoundryVTT AutoPublish
uses: Varriount/fvtt-autopublish@v1.1.1
uses: Varriount/fvtt-autopublish@v2.0.2
with:
username: ${{ secrets.FOUNDRY_ADMIN_USER }}
password: ${{ secrets.FOUNDRY_ADMIN_PW }}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": false,
Expand Down
12 changes: 6 additions & 6 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"manifest": "https://github.com/eastcw/foundryvtt-compactBeyond5eSheet/releases/latest/download/module.json",
"readme": "https://github.com/eastcw/foundryvtt-compactBeyond5eSheet/blob/master/README.md",
"url": "https://github.com/eastcw/foundryvtt-compactBeyond5eSheet/",
"version": "2.4.1",
"version": "3.0.0",
"compatibility": {
"minimum": "10",
"verified": "11.314"
"minimum": "11",
"verified": "11.315"
},
"scripts": [],
"esmodules": ["module/foundryvtt-compactBeyond5eSheet.js"],
Expand All @@ -44,8 +44,8 @@
"id": "dnd5e",
"type": "system",
"compatibility": {
"minimum": "2.2.0",
"verified": "2.3.1"
"minimum": "3.0.0",
"verified": "3.0.4"
}
}
],
Expand All @@ -54,7 +54,7 @@
"id": "character-actions-list-5e",
"type": "module",
"compatibility": {
"verified": "6.1.1"
"verified": "7.0.0"
}
}
],
Expand Down
1 change: 1 addition & 0 deletions src/styles/ability-scores.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
border-radius: $border-radius;
flex: 1; // arbitrary
border: $groove-border;
min-width: 0%;
}
}

Expand Down
46 changes: 28 additions & 18 deletions src/templates/character-sheet-ltd.hbs
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
<form class="{{cssClass}} flexcol limited" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<img class="profile" src="{{actor.img}}" title="{{actor.name}}" data-edit="img" />
<form class='{{cssClass}} flexcol limited' autocomplete='off'>
{{! Sheet Header }}
<header class='sheet-header'>
<img class='profile' src='{{actor.img}}' data-tooltip='{{actor.name}}' data-edit='img' />

<section class="header-details">
<section class='header-details'>
<h1>
{{actor.name}}
</h1>
</section>
</header>

{{!-- Sheet Body --}}
<section class="sheet-body">
{{! Sheet Body }}
<section class='sheet-body'>

{{!-- Biography Tab --}}
<div class="tab biography flexrow">
<div class="note-entries">
{{! Biography Tab }}
<div class='tab biography flexrow'>
<div class='note-entries'>
<article>
<h4 class="section-titles biopage">{{ localize "DND5E.Appearance" }}</h4>
{{editor content=system.details.appearance target="system.details.appearance" button=true owner=owner
editable=editable}}
<h4 class='section-titles biopage'>{{localize 'DND5E.Appearance'}}</h4>
{{editor
content=system.details.appearance
target='system.details.appearance'
button=true
owner=owner
editable=editable
}}
</article>
<article class="biography-notes big-bio">
<h4 class="section-titles">{{ localize "DND5E.Background" }}</h4>
{{editor content=system.details.biography.value target="system.details.biography.value" button=true
owner=owner editable=editable}}
<article class='biography-notes big-bio'>
<h4 class='section-titles'>{{localize 'DND5E.Background'}}</h4>
{{editor
content=system.details.biography.value
target='system.details.biography.value'
button=true
owner=owner
editable=editable
}}
</article>
</div>
</div>

</section>
</form>
</form>
6 changes: 3 additions & 3 deletions src/templates/character-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
class="ability-score{{#if ../options.locked}} locked{{/if}}"
placeholder="10" data-dtype="Number" >
<div class="ability-modifiers flexrow">
<span class="ability-mod" title="{{ localize 'DND5E.Modifier' }}">{{numberFormat ability.mod decimals=0
<span class="ability-mod" data-tooltip="{{ localize 'DND5E.Modifier' }}">{{numberFormat ability.mod decimals=0
sign=true}}</span>
{{#unless ../options.locked}}
<input type="hidden" name="system.abilities.{{id}}.proficient" value="{{ability.baseProf}}"
data-dtype="Number"/>
{{/unless}}
<a class="proficiency-toggle ability-proficiency" title="{{ localize 'DND5E.Proficiency' }}">{{{ability.icon}}}</a>
<span class="ability-save" title="{{ localize 'DND5E.SavingThrow' }}">{{numberFormat ability.save decimals=0
<a class="proficiency-toggle ability-proficiency" data-tooltip="{{ localize 'DND5E.Proficiency' }}">{{{ability.icon}}}</a>
<span class="ability-save" data-tooltip="{{ localize 'DND5E.SavingThrow' }}">{{numberFormat ability.save decimals=0
sign=true}}</span>
</div>
<a class="config-button" data-action="ability" data-tooltip="{{localize 'DND5E.AbilityConfigure'}}">
Expand Down
24 changes: 13 additions & 11 deletions src/templates/parts/actor-features.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<{{elements.inventory}}>
{{#unless isVehicle}}
<div class="inventory-filters flexrow">
<ul class="filter-list flexrow" data-filter="features">
Expand Down Expand Up @@ -29,7 +30,7 @@

{{#if ../owner}}
<div class="item-controls">
<a class="item-control item-create" title="{{localize 'DND5E.FeatureAdd'}}" {{#each section.dataset as |v
<a class="item-control item-action" data-action="create" data-tooltip="{{localize 'DND5E.FeatureAdd'}}" {{#each section.dataset as |v
k|}}data-{{k}}="{{v}}" {{/each}}>
<i class="fas fa-plus"></i> {{localize "DND5E.Add"}}
</a>
Expand All @@ -42,20 +43,20 @@
{{#with (lookup @root.itemContext item.id) as |ctx|}}
<li class="item flexrow {{#if ctx.isDepleted}}depleted{{/if}}" data-item-id="{{item.id}}">
<div class="item-name flexrow rollable">
<div class="item-image" tabindex="0" role="button" aria-label="{{item.name}}"
<div class="item-image item-action" data-action="use" tabindex="0" role="button" aria-label="{{item.name}}"
style="background-image: url('{{item.img}}')"></div>
<h4>
<h4 class="item-action" data-action="expand">
{{#if (eq item.type "subclass")}}&rdsh;{{/if}}
{{item.name}}
{{#if item.system.isOriginalClass}} <i class="original-class fas fa-sun"
title="{{localize 'DND5E.ClassOriginal'}}"></i>{{/if}}
data-tooltip="{{localize 'DND5E.ClassOriginal'}}"></i>{{/if}}
</h4>
</div>

{{#if section.hasActions}}
<div class="item-detail item-uses">
{{#if ctx.isOnCooldown}}
<a class="item-recharge rollable">{{item.labels.recharge}}</a>
<a class="item-action rollable" data-action="recharge">{{item.labels.recharge}}</a>
{{else if item.system.recharge.value}}
{{localize "DND5E.Charged"}}
{{else if ctx.hasUses}}
Expand All @@ -70,11 +71,11 @@

<div class="item-detail item-target spell-target">
{{#if (eq item.system.target.type 'self')}}
<span title="{{item.labels.target}}">{{item.labels.target}}</span>
<span data-tooltip="{{item.labels.target}}">{{item.labels.target}}</span>
{{else}}
<span title="{{localize 'DND5E.Range'}}: {{item.labels.range}}">{{item.labels.range}}</span>
<span data-tooltip="{{localize 'DND5E.Range'}}: {{item.labels.range}}">{{item.labels.range}}</span>
{{#if item.labels.target}}
<small title="{{item.labels.target}}">
<small data-tooltip="{{item.labels.target}}">
{{item.labels.target}}
</small>
{{/if}}
Expand Down Expand Up @@ -112,12 +113,12 @@
{{#if @root.owner}}
<div class="item-controls">
{{#if section.crewable}}
<a class="item-control item-toggle {{ctx.toggleClass}}" title="{{ctx.toggleTitle}}">
<a class="item-control item-action {{ctx.toggleClass}}" data-action="crew" data-tooltip="{{ctx.toggleTitle}}">
<i class="fas fa-sun"></i>
</a>
{{/if}}
<a class="item-control item-edit" title="{{localize 'DND5E.ItemEdit'}}"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="{{localize 'DND5E.ItemDelete'}}"><i class="fas fa-trash"></i></a>
<a class="item-control item-action" data-action="edit" data-tooltip="{{localize 'DND5E.ItemEdit'}}"><i class="fas fa-edit"></i></a>
<a class="item-control item-action" data-action="delete" data-tooltip="{{localize 'DND5E.ItemDelete'}}"><i class="fas fa-trash"></i></a>
</div>
{{/if}}
</li>
Expand All @@ -126,3 +127,4 @@
</ol>
{{/each}}
</ol>
</{{elements.inventory}}>
22 changes: 12 additions & 10 deletions src/templates/parts/actor-inventory.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<{{elements.inventory}}>
<div class="inventory-tab-header">

{{#unless isNPC}}
Expand All @@ -19,7 +20,7 @@
<div class="currency">
<h3>
<strong>{{localize "DND5E.Currency"}}</strong>
<a class="currency-convert rollable" data-action="convertCurrency" title="Convert All Currency"><i
<a class="item-action rollable" data-action="currency" data-tooltip="DND5e.CurrencyManager.Title"><i
class="fas fa-coins"></i></a>
</h3>
<div class="currency-inputs">
Expand Down Expand Up @@ -70,7 +71,7 @@

{{#if ../owner}}
<div class="item-controls">
<a class="item-control item-create" data-action="itemCreate" data-tooltip="DND5E.ItemCreate" {{#each
<a class="item-control item-action" data-action="create" data-tooltip="DND5E.ItemCreate" {{#each
section.dataset as |v k|}}data-{{k}}="{{v}}" {{/each}}>
<i class="fas fa-plus"></i> {{localize "DND5E.Add"}}
</a>
Expand All @@ -81,21 +82,21 @@
<ol class="item-list">
{{#each section.items as |item iid|}}
{{#with (lookup @root.itemContext item.id) as |ctx|}}
<li class="item flexrow {{section.css}}" data-item-id="{{item.id}}" {{#if
section.editableName}}data-item-index="{{iid}}" {{/if}}>
<li class="item flexrow {{section.css}}" data-item-id="{{item.id}}"
{{#if section.editableName}}data-item-index="{{iid}}" {{/if}}>
<div class="item-name flexrow {{@root.rollableClass}}">
{{#if section.editableName}}
<input type="text" value="{{item.name}}">
{{else}}
<div class="item-image" tabindex="0" role="button" aria-label="{{item.name}}"
<div class="item-image item-action" data-action="use" tabindex="0" role="button" aria-label="{{item.name}}"
style="background-image: url('{{item.img}}')"></div>
<h4>
<h4 class="item-action" data-action="expand">
{{item.name~}}
{{~#if ctx.isStack}} ({{item.system.quantity}}){{/if}}
</h4>
{{#if ctx.attunement}}
<div class="item-detail attunement">
<i class="fas {{ctx.attunement.icon}} {{ctx.attunement.cls}}" title="{{localize ctx.attunement.title}}"></i>
<i class="fas {{ctx.attunement.icon}} {{ctx.attunement.cls}}" data-tooltip="{{localize ctx.attunement.title}}"></i>
</div>
{{/if}}
{{/if}}
Expand Down Expand Up @@ -140,17 +141,17 @@
{{#if @root.owner}}
<div class="item-controls">
{{#if ctx.canToggle}}
<a class="item-control item-toggle {{ctx.toggleClass}}" data-action="itemToggle"
<a class="item-control item-action {{ctx.toggleClass}}" data-action="equip"
data-tooltip='{{ctx.toggleTitle}}'>
<i class="fas fa-shield-alt"></i>
</a>
{{/if}}
{{#unless section.editableName}}
<a class="item-control item-edit" data-action="itemEdit" data-tooltip="DND5E.ItemEdit">
<a class="item-control item-action" data-action="edit" data-tooltip="DND5E.ItemEdit">
<i class="fas fa-edit"></i>
</a>
{{/unless}}
<a class="item-control item-delete" data-action="itemDelete" data-tooltip="DND5E.ItemDelete">
<a class="item-control item-action" data-action="delete" data-tooltip="DND5E.ItemDelete">
<i class="fas fa-trash"></i>
</a>
</div>
Expand All @@ -161,3 +162,4 @@
</ol>
{{/each}}
</ol>
</{{elements.inventory}}>
37 changes: 22 additions & 15 deletions src/templates/parts/actor-spellbook.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<{{elements.inventory}}>
<div class="spellcasting-ability">
<div class="spell-dc">
<label>{{localize "DND5E.SpellDC"}} </label>
Expand Down Expand Up @@ -40,7 +41,7 @@

<ol class="items-list inventory-list">
{{#each spellbook as |section|}}
<li class="items-header spellbook-header flexrow">
<li class="items-header spellbook-header flexrow" {{ dnd5e-dataset section.dataset }}>
<div class="item-name flexrow spell-level-slots">
<h3>{{section.label}}</h3>
<div class="spell-slots">
Expand All @@ -51,7 +52,7 @@
<span class="spell-max" data-level="{{section.prop}}" data-slots="{{section.slots}}">
{{{section.slots}}}
{{#if ../editable}}
<a class="slot-max-override" title="{{localize 'DND5E.SpellProgOverride'}}">
<a class="slot-max-override" data-tooltip="{{localize 'DND5E.SpellProgOverride'}}">
<i class="fas fa-edit"></i>
</a>
{{/if}}
Expand All @@ -68,7 +69,7 @@

<div class="item-controls">
{{#if section.canCreate}}
<a class="item-control item-create" title="{{localize 'DND5E.SpellCreate'}}" {{#each section.dataset as |v
<a class="item-control item-action" data-action="create" data-tooltip="{{localize 'DND5E.SpellCreate'}}" {{#each section.dataset as |v
k|}}data-{{k}}="{{v}}" {{/each}}>
<i class="fas fa-plus"></i> {{localize "DND5E.Add"}}
</a>
Expand All @@ -78,14 +79,14 @@

<ol class="item-list">
{{#each section.spells as |item i|}}
{{#with (lookup @root.itemContext item.id) as |ctx|}}
{{#dnd5e-itemContext item as |ctx|}}
<li
class="item flexrow {{~#if item.system.preparation.prepared}} prepared{{/if}}{{#if (eq item.system.preparation.mode 'always')}} alwaysPrepared{{/if}}"
class="item flexrow {{#if ctx.isExpanded}}expanded{{/if}}"
data-item-id="{{item.id}}">
<div class="item-name flexrow rollable">
<div class="item-image" tabindex="0" role="button" aria-label="{{item.name}}"
<div class="item-image item-action" data-action="use" tabindex="0" role="button" aria-label="{{item.name}}"
style="background-image: url('{{item.img}}')"></div>
<h4>{{item.name}}</h4>
<h4 class="item-action" data-action="expand">{{item.name}}</h4>
{{#if item.system.uses.per }}
<div class="item-detail spell-uses">Uses {{item.system.uses.value}} / {{item.system.uses.max}}</div>
{{/if}}
Expand All @@ -102,11 +103,11 @@

<div class="item-detail item-target spell-target">
{{#if (eq item.system.target.type 'self')}}
<span title="{{item.labels.target}}">{{item.labels.target}}</span>
<span data-tooltip="{{item.labels.target}}">{{item.labels.target}}</span>
{{else}}
<span title="{{localize 'DND5E.Range'}}: {{item.labels.range}}">{{item.labels.range}}</span>
<span data-tooltip="{{localize 'DND5E.Range'}}: {{item.labels.range}}">{{item.labels.range}}</span>
{{#if item.labels.target}}
<small title="{{item.labels.target}}">
<small data-tooltip="{{item.labels.target}}">
{{item.labels.target}}
</small>
{{/if}}
Expand All @@ -117,15 +118,20 @@
{{#if @root.owner}}
<div class="item-controls">
{{#if section.canPrepare}}
<a class="item-control item-toggle {{ctx.toggleClass}}" title="{{ctx.toggleTitle}}"><i
<a class="item-control item-action {{ctx.toggleClass}}" data-action="prepare" data-tooltip="{{ctx.toggleTitle}}"><i
class="fas fa-sun"></i></a>
{{/if}}
<a class="item-control item-edit" title="{{localize 'DND5E.ItemEdit'}}"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="{{localize 'DND5E.ItemDelete'}}"><i class="fas fa-trash"></i></a>
<a class="item-control item-edit" data-tooltip="{{localize 'DND5E.ItemEdit'}}"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" data-tooltip="{{localize 'DND5E.ItemDelete'}}"><i class="fas fa-trash"></i></a>
</div>
{{/if}}

{{#if ctx.isExpanded}}
{{> "dnd5e.item-summary" (lookup @root.expandedData item.id)}}
{{/if}}

</li>
{{/with}}
{{/dnd5e-itemContext}}
{{/each}}
</ol>
{{else}}
Expand All @@ -137,7 +143,7 @@
{{else}}
<li class="item flexrow inventory-header spellbook-header spellbook-empty">
<div class="item-controls">
<a class="item-control item-create" title="{{localize 'DND5E.SpellCreate'}}" data-type="spell"
<a class="item-control item-create" data-tooltip="{{localize 'DND5E.SpellCreate'}}" data-type="spell"
data-level="{{lvl}}"><i class="fas fa-plus"></i> {{localize "DND5E.SpellAdd"}}</a>
</div>
</li>
Expand All @@ -148,3 +154,4 @@
{{/if}}
{{/each}}
</ol>
</{{elements.inventory}}>
Loading

0 comments on commit 725461b

Please sign in to comment.