Skip to content

Commit

Permalink
10.5 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ironmonk88 committed Jan 21, 2023
1 parent 4480e65 commit ddeb031
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 10.5

Fixed issues with input field auto focussing.

# Version 10.4

Added Polish translation, thank you Lioheart
Expand Down
7 changes: 3 additions & 4 deletions alwayshp.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export class AlwaysHP extends Application {
.append($('<div>').addClass('token-stats flexrow').attr('title', this.tokentooltip).html((this.tokentemp ? `<div class="stat temp">${this.tokentemp}</div>` : '') + (this.tokenstat ? `<div class="stat" style="background-color:${this.color}">${this.tokenstat}</div>` : '')));
delete ui.windows[that.appId];
this.refreshSelected();
$('#alwayshp-hp').focus();
});
}

Expand Down Expand Up @@ -478,17 +477,14 @@ export class AlwaysHP extends Application {

Hooks.on('init', () => {
registerSettings();
});

Hooks.on('ready', () => {
game.AlwaysHP = {
app: null,
toggleApp: (show = 'toggle') => {
if (show == 'toggle') show = !game.AlwaysHP.app;

if (show && !game.AlwaysHP.app) {
game.AlwaysHP.app = new AlwaysHP().render(true);
window.setTimeout(() => { $('#alwayshp-hp').focus(); }, 100);
} else if (!show && game.AlwaysHP.app)
game.AlwaysHP.app.close({ properClose: true });
},
Expand All @@ -497,6 +493,9 @@ Hooks.on('ready', () => {
game.AlwaysHP.app.refreshSelected();
}
};
});

Hooks.on('ready', () => {
if ((setting("show-option") == 'on' || (setting("show-option") == 'toggle' && setting("show-dialog"))) && (setting("load-option") == 'everyone' || (setting("load-option") == 'gm' == game.user.isGM)))
game.AlwaysHP.toggleApp(true);

Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Always HP",
"description": "We're always updating HP, add a window to make it easier to adjust that",
"version": "10.4",
"version": "10.5",
"authors": [
{
"name": "IronMonk",
Expand Down Expand Up @@ -35,7 +35,7 @@
"css/alwayshp.css"
],
"url": "https://github.com/ironmonk88/always-hp",
"download": "https://github.com/ironmonk88/always-hp/archive/10.4.zip",
"download": "https://github.com/ironmonk88/always-hp/archive/10.5.zip",
"manifest": "https://github.com/ironmonk88/always-hp/releases/latest/download/module.json",
"bugs": "https://github.com/ironmonk88/always-hp/issues",
"allowBugReporter": true,
Expand Down

0 comments on commit ddeb031

Please sign in to comment.