Skip to content

Commit deaa180

Browse files
committed
Update to version 0.1.2.
1 parent 5fbfad1 commit deaa180

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ A frontend web application for creating creature statblocks that are similar in
2424

2525
## Future Improvements
2626

27-
- Support for additional browsers (Firefox, Safari, etc.)
27+
- Import monster stats from the [Open5e][open5e] API
2828
- Generate Spellcasting (currently disabled under Special Traits)
29-
- Get suggested proficiency bonus from Challenge Rating
3029
- Buttons to toggle bold/italic text and add expressions to Special Trait/Action/Reaction/Legendary Action descriptions
3130
- Autofill common Special Traits and Actions
32-
- Import monster stats from the [Open5e][open5e] API
3331
- Export to [Improved Initiative][improved-initiative] (JSON format)
32+
- Support for additional browsers (Firefox, Safari, etc.)
3433
- Export as Image
3534
- Offline/Local Storage
3635
- Additional printing options, including printing 2 one-column statblocks side-by-side

dist/app.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "statblock5e-creator",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "A frontend web application for creating D&D 5th Edition Creature Statblocks",
55
"main": "index.js",
66
"dependencies": {

src/js/elements/autonomous/containers/stat-block-editor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@ export default class StatBlockEditor extends CustomAutonomousElement {
178178

179179
exportToJson() {
180180
const layoutSettings = CurrentContext.layoutSettings;
181+
const version = CurrentContext.version;
181182
const json = this.statBlock.exportToJson();
182183

183184
json.meta = {
184-
version: '0.1.1',
185+
version: version,
185186
description: 'Created using statblock5e-creator',
186187
url: 'https://frumple.github.io/statblock5e-creator'
187188
};

src/js/init.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as HtmlExportDocumentFactory from './helpers/html-export-document-factory.js';
2+
import { fetchFromFile } from './helpers/file-helpers.js';
3+
import CurrentContext from './models/current-context.js';
24

35
import BlockTextArea from './elements/builtin/block-textarea.js';
46
import EnableDisableElementsCheckbox from './elements/builtin/enable-disable-elements-checkbox.js';
@@ -61,6 +63,7 @@ import BasicStats from './elements/autonomous/containers/basic-stats.js';
6163
import AdvancedStats from './elements/autonomous/containers/advanced-stats.js';
6264

6365
async function init() {
66+
CurrentContext.version = await getVersion();
6467
await HtmlExportDocumentFactory.init();
6568
await defineElements();
6669
await onBodyLoaded(() => {
@@ -69,6 +72,13 @@ async function init() {
6972
});
7073
}
7174

75+
async function getVersion() {
76+
const packageJsonText = await fetchFromFile('package.json');
77+
const packageJson = JSON.parse(packageJsonText);
78+
79+
return packageJson.version;
80+
}
81+
7282
async function defineElements() {
7383
const elementClasses = [];
7484

src/js/models/current-context.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import LayoutSettings from './layout-settings.js';
33

44
class CurrentContext {
55
constructor() {
6+
this.version = '0.0.0';
7+
68
this.creature = new Creature();
79
this.layoutSettings = new LayoutSettings();
810
}

0 commit comments

Comments
 (0)