Skip to content

Commit

Permalink
11.01 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ironmonk88 committed Dec 31, 2023
1 parent 02a0a09 commit c87181d
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 93 deletions.
52 changes: 31 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# Version 10.1

Fixed issue with the initial opening of the bar when the reverse order setting is on.

Added a confirmation dialog when the clear entire row is clicked

Fixed tooltip issue in v10.

# Version 1.0.14

Rebuilt the hotbar so that it should integrate better with Foundry

Added the option to hit the up and down arrows

Added the option to have the hotbar open expanded

Added the option to collapse the hotbar expansion when a row is selected

Added the option to toggle the Hotbar with key presses


# Version 11.01

Added a little more padding between rows

Added keybindings to switch between rows quickly

Correctly implemented requiresReload in the settings

Updated the template to be compliant with v11

# Version 10.1

Fixed issue with the initial opening of the bar when the reverse order setting is on.

Added a confirmation dialog when the clear entire row is clicked

Fixed tooltip issue in v10.

# Version 1.0.14

Rebuilt the hotbar so that it should integrate better with Foundry

Added the option to hit the up and down arrows

Added the option to have the hotbar open expanded

Added the option to collapse the hotbar expansion when a row is selected

Added the option to toggle the Hotbar with key presses


7 changes: 6 additions & 1 deletion css/hotbar-expansion.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
bottom: 60px;
width: 100%;
left: 0px;
max-height: 260px;
max-height: 265px;
z-index: 10;
overflow:hidden;
}
Expand Down Expand Up @@ -62,6 +62,7 @@

.hotbar-page .hotbar-page-row {
flex-wrap: nowrap;
margin-top: 1px;
}

.hotbar-page .hotbar-page-row.selected .bar-controls .page-number {
Expand All @@ -81,3 +82,7 @@
.hotbar-page .page-number:hover {
text-shadow: 0 0 8px red;
}

#hotbar #hotbar-lock {
pointer-events: all;
}
27 changes: 26 additions & 1 deletion hotbar-expansion.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,32 @@ Hooks.on('init', () => {
game.keybindings.register('monks-hotbar-expansion', 'toggle-key', {
name: 'MonksHotbarExpansion.toggle-key.name',
hint: 'MonksHotbarExpansion.toggle-key.hint',
editable: [{ key: 'KeyH', modifiers: [KeyboardManager.MODIFIER_KEYS?.SHIFT] }],
editable: [{ key: '`', modifiers: [KeyboardManager.MODIFIER_KEYS?.SHIFT] }],
onDown: (data) => { ui.hotbar._onTogglePage(data.event); },
});
game.keybindings.register('monks-hotbar-expansion', 'switch-1', {
name: 'MonksHotbarExpansion.switch-row.name',
editable: [{ key: 'Key1', modifiers: [KeyboardManager.MODIFIER_KEYS?.SHIFT] }],
onDown: (data) => { ui.hotbar.changePage(1); },
});
game.keybindings.register('monks-hotbar-expansion', 'switch-2', {
name: 'MonksHotbarExpansion.switch-row.name',
editable: [{ key: 'Key2', modifiers: [KeyboardManager.MODIFIER_KEYS?.SHIFT] }],
onDown: (data) => { ui.hotbar.changePage(2); },
});
game.keybindings.register('monks-hotbar-expansion', 'switch-3', {
name: 'MonksHotbarExpansion.switch-row.name',
editable: [{ key: 'Key3', modifiers: [KeyboardManager.MODIFIER_KEYS?.SHIFT] }],
onDown: (data) => { ui.hotbar.changePage(3); },
});
game.keybindings.register('monks-hotbar-expansion', 'switch-4', {
name: 'MonksHotbarExpansion.switch-row.name',
editable: [{ key: 'Key4', modifiers: [KeyboardManager.MODIFIER_KEYS?.SHIFT] }],
onDown: (data) => { ui.hotbar.changePage(4); },
});
game.keybindings.register('monks-hotbar-expansion', 'switch-5', {
name: 'MonksHotbarExpansion.switch-row.name',
editable: [{ key: 'Key5', modifiers: [KeyboardManager.MODIFIER_KEYS?.SHIFT] }],
onDown: (data) => { ui.hotbar.changePage(5); },
});
});
36 changes: 19 additions & 17 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"MonksHotbarExpansion.number-rows.name": "Number of rows",
"MonksHotbarExpansion.number-rows.hint": "Number of rows to display when the hotbar number is clicked",
"MonksHotbarExpansion.reverse-row-order.name": "Reverse",
"MonksHotbarExpansion.reverse-row-order.hint": "Reverse the rows order, not duplicating the first row",
"MonksHotbarExpansion.hide-first-row.name": "Hide the first row",
"MonksHotbarExpansion.hide-first-row.hint": "If you like to have all rows open at once, hide the first row to save space",
"MonksHotbarExpansion.collapse-on-select.name": "Collapse on Select",
"MonksHotbarExpansion.collapse-on-select.hint": "Collapse the Expansion when a row is selected",
"MonksHotbarExpansion.toggle-key.name": "Toggle Hotbar",
"MonksHotbarExpansion.toggle-key.hint": "Toggle the hotbar expansion",
"MonksHotbarExpansion.collapse-on-open.name": "Start Collapsed",
"MonksHotbarExpansion.collapse-on-open.hint": "When Foundry first loads start with the Expansion collapsed",
"MonksHotbarExpansion.hide-page-arrows.name": "Hide Page Arrows",
"MonksHotbarExpansion.hide-page-arrows.hint": "In case you don't want the arrows visible",
"MonksHotbarExpansion.clear-row": "Clear Row"
}
{
"MonksHotbarExpansion.number-rows.name": "Number of rows",
"MonksHotbarExpansion.number-rows.hint": "Number of rows to display when the hotbar number is clicked",
"MonksHotbarExpansion.reverse-row-order.name": "Reverse",
"MonksHotbarExpansion.reverse-row-order.hint": "Reverse the rows order, not duplicating the first row",
"MonksHotbarExpansion.hide-first-row.name": "Hide the first row",
"MonksHotbarExpansion.hide-first-row.hint": "If you like to have all rows open at once, hide the first row to save space",
"MonksHotbarExpansion.collapse-on-select.name": "Collapse on Select",
"MonksHotbarExpansion.collapse-on-select.hint": "Collapse the Expansion when a row is selected",
"MonksHotbarExpansion.toggle-key.name": "Toggle Hotbar",
"MonksHotbarExpansion.toggle-key.hint": "Toggle the hotbar expansion",
"MonksHotbarExpansion.collapse-on-open.name": "Start Collapsed",
"MonksHotbarExpansion.collapse-on-open.hint": "When Foundry first loads start with the Expansion collapsed",
"MonksHotbarExpansion.hide-page-arrows.name": "Hide Page Arrows",
"MonksHotbarExpansion.hide-page-arrows.hint": "In case you don't want the arrows visible",
"MonksHotbarExpansion.switch-row.name": "Switch the Macro row",

"MonksHotbarExpansion.clear-row": "Clear Row"
}
91 changes: 47 additions & 44 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
{
"title": "Monk's Hotbar Expansion",
"description": "Click to show all rows of the Hotbar, so that you can select the row by sight rather than clicking through pages. Drag and Drop on any of the rows, and clear an entire row if needed.",
"version": "10.1",
"authors": [
{
"name": "IronMonk",
"discord": "ironmonk88#4075",
"patreon": "https://www.patreon.com/ironmonk",
"ko-fi": "https://ko-fi.com/ironmonk88"
}
],
"socket": true,
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "de",
"name": "Deutsch",
"path": "lang/de.json"
}
],
"esmodules": [
"hotbar-expansion.js"
],
"styles": [
"css/hotbar-expansion.css"
],
"url": "https://github.com/ironmonk88/hotbar-expansion",
"download": "https://github.com/ironmonk88/hotbar-expansion/archive/10.1.zip",
"manifest": "https://github.com/ironmonk88/hotbar-expansion/releases/latest/download/module.json",
"bugs": "https://github.com/ironmonk88/hotbar-expansion/issues",
"allowBugReporter": true,
"id": "monks-hotbar-expansion",
"compatibility": {
"minimum": "9",
"verified": "10"
},
"name": "monks-hotbar-expansion",
"minimumCoreVersion": "9",
"compatibleCoreVersion": "10"
{
"title": "Monk's Hotbar Expansion",
"description": "Click to show all rows of the Hotbar, so that you can select the row by sight rather than clicking through pages. Drag and Drop on any of the rows, and clear an entire row if needed.",
"version": "11.01",
"authors": [
{
"name": "IronMonk",
"discord": "ironmonk88#4075",
"flags": {
"github": "ironmonk88",
"patreon": "ironmonk",
"ko-fi": "ironmonk88"
}
}
],
"socket": true,
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "de",
"name": "Deutsch",
"path": "lang/de.json"
}
],
"esmodules": [
"hotbar-expansion.js"
],
"styles": [
"css/hotbar-expansion.css"
],
"url": "https://github.com/ironmonk88/hotbar-expansion",
"download": "https://github.com/ironmonk88/hotbar-expansion/archive/11.01.zip",
"manifest": "https://github.com/ironmonk88/hotbar-expansion/releases/latest/download/module.json",
"bugs": "https://github.com/ironmonk88/hotbar-expansion/issues",
"allowBugReporter": true,
"id": "monks-hotbar-expansion",
"compatibility": {
"minimum": "11",
"verified": "11"
},
"name": "monks-hotbar-expansion",
"minimumCoreVersion": "11",
"compatibleCoreVersion": "11"
}
6 changes: 2 additions & 4 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export const registerSettings = function () {

let modulename = "monks-hotbar-expansion";

const debouncedReload = foundry.utils.debounce(function () { window.location.reload(); }, 100);

const updateClass = () => {
$('#hotbar .hotbar-page')
.toggleClass('reverse', setting('reverse-row-order'))
Expand All @@ -24,7 +22,7 @@ export const registerSettings = function () {
max: 5,
step: 1
},
onChange: debouncedReload
requiresReload: true
});

game.settings.register(modulename, "reverse-row-order", {
Expand Down Expand Up @@ -72,6 +70,6 @@ export const registerSettings = function () {
config: true,
default: false,
type: Boolean,
onChange: debouncedReload
requiresReload: true
});
};
15 changes: 10 additions & 5 deletions templates/hotbar.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<div id="hotbar" class="flexrow" data-tooltip-direction="UP">
<div id="hotbar" class="flexrow {{#if locked}}locked{{/if}}" data-tooltip-direction="UP">
<div id="hotbar-directory-controls" class="bar-controls flexcol">
<a id="bar-toggle">
<a id="bar-toggle" data-tooltip="MACRO.CollapseHotbar">
<i class="fas fa-caret-down"></i>
</a>
<a id="macro-directory">
<a id="macro-directory" data-tooltip="MACRO.Directory">
<i class="fas fa-folder"></i>
</a>
</div>
<nav id="action-bar" class="action-bar flexrow {{barClass}}" aria-label="{{localize 'MACRO.NavLabel'}}">
<ol id="macro-list" class="flexrow macro-list" data-page="{{page}}">
{{#each macros}}
<li class="macro {{this.cssClass}}" data-slot="{{this.slot}}"
{{#if this.macro}} data-macro-id="{{this.macro.id}}" data-tooltip="{{this.tooltip}}"{{/if}}>
{{#if this.macro}} data-macro-id="{{this.macro.id}}" data-tooltip="{{this.tooltip}}" {{/if}}>
<span class="macro-key">{{this.key}}</span>
{{#if this.icon}}
<img class="macro-icon" src="{{this.icon}}" alt="{{this.tooltip}}" />
Expand All @@ -20,6 +20,11 @@
{{/each}}
</ol>
</nav>
<div id="hotbar-lock" class="bar-controls flexcol" data-tooltip-direction="UP">
<a class="page-control" data-action="lock" data-tooltip="MACRO.{{ifThen locked "Unlock" "Lock"}}Bar">
<i class="fas fa-lock{{#unless locked}}-open{{/unless}}"></i>
</a>
</div>
<div id="hotbar-page-controls" class="bar-controls flexcol" data-tooltip-direction="UP">
{{#if showArrows}}
<a class="page-control" data-action="page-up" data-tooltip="MACRO.PageUp" alt="{{localize 'MACRO.PageUp'}}">
Expand All @@ -43,7 +48,7 @@
<ol class="flexrow macro-list" data-page="{{page}}">
{{#each macros}}
<li class="macro {{this.cssClass}}" data-slot="{{this.slot}}"
{{#if this.macro}} data-macro-id="{{this.macro.id}}" data-tooltip="{{this.tooltip}}"{{/if}}>
{{#if this.macro}} data-macro-id="{{this.macro.id}}" data-tooltip="{{this.tooltip}}" {{/if}}>
<span class="macro-key">{{this.key}}</span>
{{#if this.icon}}
<img class="macro-icon" src="{{this.icon}}" alt="{{this.tooltip}}" />
Expand Down

0 comments on commit c87181d

Please sign in to comment.