Skip to content

Commit

Permalink
update for dnd5e 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
akrigline committed Oct 10, 2021
1 parent 9b89255 commit c0d0ec3
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 89 deletions.
14 changes: 14 additions & 0 deletions src/foundryvtt-5eOGLCharacterSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ export class OGL5eCharacterSheet extends ActorSheet5eCharacter {

sheetData.settingsShowEquipInventory = game.settings.get(MODULE_ID, MySettings.showEquipOnInventoryList);

// system features
const systemVersion = game.system.data.version;
//@ts-ignore
sheetData.systemFeatures = {
//@ts-ignore
skillConfig: !foundry.utils.isNewerVersion('1.5.0', systemVersion),
//@ts-ignore
attributeConfig: !foundry.utils.isNewerVersion('1.5.0', systemVersion),
//@ts-ignore
profLabel: !foundry.utils.isNewerVersion('1.5.0', systemVersion),
//@ts-ignore
currencyLabel: !foundry.utils.isNewerVersion('1.5.0', systemVersion),
};

return sheetData;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"OGL5E.showEquipOnInventoryList": "Add Equip Check to Inventory Rows",
"OGL5E.showEquipOnInventoryListHint": "Add a checkbox to equip/unequip items directly on the inventory list. By default these are in the expanded item details.",
"OGL5E.expandedLimited": "Use Expanded Sheet as Limited",
"OGL5E.expandedLimitedHint": "Show the full character sheet for users who have the Limited permission for a given Actor."
"OGL5E.expandedLimitedHint": "Show the full character sheet for users who have the Limited permission for a given Actor.",
"OGL5E.experience": "Experience"
}
142 changes: 72 additions & 70 deletions src/module.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
{
"name": "5e-ogl-character-sheet",
"title": "D&D 5e OGL Character Sheet",
"description": "A character sheet resembling a classic Pencil and Paper or Roll20 sheet.",
"systems": ["dnd5e"],
"version": "0.12.1",
"author": "Andrew Krigline (akrigline)",
"authors": [
{
"name": "Andrew Krigline",
"discord": "Calego#0914",
"url": "https://github.com/ElfFriend-DnD",
"patreon": "https://www.patreon.com/ElfFriend_DnD"
}
],
"dependencies": [
{
"name": "character-actions-list-5e",
"type": "module",
"versionMin": "1.0.0",
"manifest": "https://github.com/ElfFriend-DnD/foundryvtt-dnd5eCharacterActions/releases/latest/download/module.json"
}
],
"esmodules": [
"foundryvtt-5eOGLCharacterSheet.js"
],
"styles": [
"foundryvtt-5eOGLCharacterSheet.css"
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
}
],
"media": [
{
"type": "cover",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/cover-image.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/main-top.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/main-bottom.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/spellbook.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/biography.png"
}
],
"minimumCoreVersion": "0.8.5",
"compatibleCoreVersion": "0.8.8",
"minimumSystemVersion": "1.4.0",
"bugs": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/issues",
"changelog": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/releases",
"download": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/releases/download/v0.12.1/module.zip",
"manifest": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/releases/latest/download/module.json",
"readme": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/README.md",
"url": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet",
"flags": {
"allowBugReporter": true
},
"manifestPlusVersion": "1.0.0"
"name": "5e-ogl-character-sheet",
"title": "D&D 5e OGL Character Sheet",
"description": "A character sheet resembling a classic Pencil and Paper or Roll20 sheet.",
"system": [
"dnd5e"
],
"version": "0.12.1",
"author": "Andrew Krigline (akrigline)",
"authors": [
{
"name": "Andrew Krigline",
"discord": "Calego#0914",
"url": "https://github.com/ElfFriend-DnD",
"patreon": "https://www.patreon.com/ElfFriend_DnD"
}
],
"dependencies": [
{
"name": "character-actions-list-5e",
"type": "module",
"versionMin": "1.0.0",
"manifest": "https://github.com/ElfFriend-DnD/foundryvtt-dnd5eCharacterActions/releases/latest/download/module.json"
}
],
"esmodules": [
"foundryvtt-5eOGLCharacterSheet.js"
],
"styles": [
"foundryvtt-5eOGLCharacterSheet.css"
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
}
],
"media": [
{
"type": "cover",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/cover-image.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/main-top.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/main-bottom.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/spellbook.png"
},
{
"type": "screenshot",
"link": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/readme-img/biography.png"
}
],
"minimumCoreVersion": "0.8.9",
"compatibleCoreVersion": "0.8.9",
"minimumSystemVersion": "1.4.0",
"bugs": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/issues",
"changelog": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/releases",
"download": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/releases/download/v0.12.1/module.zip",
"manifest": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/releases/latest/download/module.json",
"readme": "https://raw.githubusercontent.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet/master/README.md",
"url": "https://github.com/ElfFriend-DnD/foundryvtt-5eOGLCharacterSheet",
"flags": {
"allowBugReporter": true
},
"manifestPlusVersion": "1.0.0"
}
8 changes: 4 additions & 4 deletions src/styles/health-armor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@
overflow: hidden;

&:hover {
.configure-movement {
.config-button {
visibility: visible;
}
}

.configure-movement {
.config-button {
visibility: hidden;
position: absolute;
top: $space / 2;
top: 3px;
right: 2px;
font-size: 12px; // arbitrary
font-size: 10px; // arbitrary
}

.movement-primary {
Expand Down
2 changes: 2 additions & 0 deletions src/templates/character-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<div class="ability-modifiers flexrow">
<span class="ability-mod" title="Modifier">{{numberFormat ability.mod decimals=0 sign=true}}</span>
</div>
{{#if @root/systemFeatures.attributeConfig}}<a class="config-button" data-action="ability"
title="{{localize 'DND5E.AbilityConfigure'}}"><i class="fas fa-cog"></i></a>{{/if}}
</li>
{{/each}}
</ul>
Expand Down
3 changes: 2 additions & 1 deletion src/templates/parts/actor-features.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<li class="item flexrow {{#if isDepleted}}depleted{{/if}}" data-item-id="{{item._id}}">
<div class="item-name flexrow rollable">
{{#if (or section.hasActions ../../settingsShowInventoryIcons)}}
<div class="item-image" style="background-image: url({{item.img}})"></div>
<div class="item-image" tabindex="0" role="button" aria-label="{{item.name}}"
style="background-image: url({{item.img}})"></div>
{{/if}}
<h4 title="{{item.name}}">{{item.name}}</h4>

Expand Down
2 changes: 1 addition & 1 deletion src/templates/parts/actor-health-armor.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<footer class="attribute-footer">
<span class="movement-special" title="{{movement.special}}">{{movement.special}}</span>
</footer>
<a class="config-button configure-movement" data-action="movement" title="{{localize 'DND5E.MovementConfig'}}"><i
<a class="config-button" data-action="movement" title="{{localize 'DND5E.MovementConfig'}}"><i
class="fas fa-cog"></i></a>
</li>
</ul>
Expand Down
5 changes: 3 additions & 2 deletions src/templates/parts/actor-inventory.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="currency-input">
<input type="text" name="data.currency.{{k}}" value="{{v}}" data-dtype="Number" />
<label class="denomination {{k}}">
{{k}}
{{#if @root/systemFeatures.currencyLabels}}{{ lookup @root/labels.currencies k }}{{else}}{{k}}{{/if}}
</label>
</div>
{{/each}}
Expand Down Expand Up @@ -77,7 +77,8 @@
{{/if}}

{{#if @root/settingsShowInventoryIcons}}
<div class="item-image item-image-show rollable" style="background-image: url({{item.img}})"></div>
<div class="item-image item-image-show rollable" tabindex="0" role="button" aria-label="{{item.name}}"
style="background-image: url({{item.img}})"></div>
{{/if}}
<div class="item-detail item-quantity">
<input type="text" value="{{item.data.quantity}}" data-dtype="Number" />
Expand Down
21 changes: 15 additions & 6 deletions src/templates/parts/actor-skills.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

<div class="fancy-value">
<h4>{{ localize "DND5E.Proficiency" }}</h4>
<div>{{numberFormat data.attributes.prof decimals=0 sign=true}}</div>
<div>{{#if systemFeatures.profLabel}}{{labels.proficiency}}{{else}}{{numberFormat data.attributes.prof decimals=0
sign=true}}{{/if}}</div>
</div>

{{!-- Saving Throws --}}
Expand All @@ -23,7 +24,11 @@
<a class="proficiency-toggle ability-proficiency"
title="{{ localize 'DND5E.Proficiency' }}">{{{ability.icon}}}</a>
<span class="skill-mod" title="Saving Throw">{{numberFormat ability.save decimals=0 sign=true}}</span>
<h4 class="saving-throw-name rollable">{{ability.label}}</h4>
<div class="skill-name-controls">
<h4 class="saving-throw-name rollable">{{ability.label}}</h4>
{{#if @root/systemFeatures.attributeConfig}}<a class="config-button" data-action="ability"
title="{{localize 'DND5E.AbilityConfigure'}}"><i class="fas fa-cog"></i></a>{{/if}}
</div>
</li>
{{/each}}
</ul>
Expand All @@ -38,10 +43,14 @@
<input type="hidden" name="data.skills.{{s}}.value" value="{{skill.baseValue}}" data-dtype="Number" />
<a class="proficiency-toggle skill-proficiency" title="{{skill.hover}}">{{{skill.icon}}}</a>
<span class="skill-mod">{{numberFormat skill.total decimals=0 sign=true}}</span>
<h4 class="skill-name rollable">
{{skill.label}}
<span class="skill-ability">{{skill.ability}}</span>
</h4>
<div class="skill-name-controls">
<h4 class="skill-name rollable">
{{skill.label}}
<span class="skill-ability">{{skill.ability}}</span>
</h4>
{{#if @root/systemFeatures.skillConfig}}<a class="config-button" data-action="skill"
title="{{localize 'DND5E.SkillConfigure'}}"><i class="fas fa-cog"></i></a>{{/if}}
</div>
</li>
{{/each}}
</ul>
Expand Down
7 changes: 4 additions & 3 deletions src/templates/parts/actor-spellbook.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@

<div class="item-controls">
{{#if section.canCreate}}
<a class="item-control item-create" title="{{localize 'DND5E.SpellCreate'}}"
{{#each section.dataset as |v k|}}data-{{k}}="{{v}}" {{/each}}>
<a class="item-control item-create" title="{{localize 'DND5E.SpellCreate'}}" {{#each section.dataset as |v
k|}}data-{{k}}="{{v}}" {{/each}}>
<i class="fas fa-plus"></i> {{localize "DND5E.Add"}}
</a>
{{/if}}
Expand All @@ -103,7 +103,8 @@
{{#each section.spells as |item i|}}
<li class="item flexrow" data-item-id="{{item._id}}">
<div class="item-name flexrow rollable">
<div class="item-image" style="background-image: url({{item.img}})"></div>
<div class="item-image" tabindex="0" role="button" aria-label="{{item.name}}"
style="background-image: url({{item.img}})"></div>
<h4>{{item.name}}</h4>
{{#if item.data.uses.per }}
<div class="item-detail spell-uses">Uses {{item.data.uses.value}} / {{item.data.uses.max}}</div>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/parts/sheet-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<li class="experience-input">
<input name="data.details.xp.value" type="text" value="{{data.details.xp.value}}" data-dtype="Number"
placeholder="0" />
<small><label>{{ localize 'DND5E.Experience' }}</label></small>
<small><label>{{ localize 'OGL5E.experience' }}</label></small>
</li>
{{/unless}}
</ul>
Expand Down

0 comments on commit c0d0ec3

Please sign in to comment.