Skip to content

Commit

Permalink
10.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ironmonk88 committed Sep 23, 2022
1 parent 820e2af commit c55bd54
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 18 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 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
Expand Down
4 changes: 2 additions & 2 deletions css/hotbar-expansion.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
z-index: 10;
overflow:hidden;
}
.hotbar-page.custom-hotbar{
bottom:110px;
.hotbar-page.custom-hotbar {
bottom: 110px;
}
/*
.hotbar-page.rpg-ui {
Expand Down
15 changes: 11 additions & 4 deletions hotbar-expansion.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const WithMonksHotbarExpansion = (Hotbar) => {
return new Promise(resolve => {
page.slideDown(200, () => {
page.removeClass("collapsed");
page.css({"display":""});
this._pagecollapsed = false;
resolve(true);
});
Expand Down Expand Up @@ -135,10 +136,16 @@ const WithMonksHotbarExpansion = (Hotbar) => {
}

async clearMacroRow(event) {
let page = $(event.currentTarget).closest('.hotbar-page-row').data('page');
for (let i = 1; i <= 10; i++) {
await game.user.assignHotbarMacro(null, ((page - 1) * 10) + i);
}
return Dialog.confirm({
title: `Clearing Macro Row`,
content: `<h4>${game.i18n.localize("AreYouSure")}</h4><p>You are about to remove all macros from this row</p>`,
yes: async () => {
let page = $(event.currentTarget).closest('.hotbar-page-row').data('page');
for (let i = 1; i <= 10; i++) {
await game.user.assignHotbarMacro(null, ((page - 1) * 10) + i);
}
}
});
}
}

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": "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": "1.0.14",
"version": "10.1",
"authors": [
{
"name": "IronMonk",
Expand All @@ -25,7 +25,7 @@
"css/hotbar-expansion.css"
],
"url": "https://github.com/ironmonk88/hotbar-expansion",
"download": "https://github.com/ironmonk88/hotbar-expansion/archive/1.0.14.zip",
"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,
Expand Down
28 changes: 18 additions & 10 deletions templates/hotbar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="hotbar" class="flexrow">
<div id="hotbar" class="flexrow" data-tooltip-direction="UP">
<div id="hotbar-directory-controls" class="bar-controls flexcol">
<a id="bar-toggle">
<i class="fas fa-caret-down"></i>
Expand All @@ -7,38 +7,46 @@
<i class="fas fa-folder"></i>
</a>
</div>
<nav id="action-bar" class="action-bar flexrow {{barClass}}">
<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}}" {{/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}}" />
<img class="macro-icon" src="{{this.icon}}" alt="{{this.tooltip}}" />
{{/if}}
</li>
{{/each}}
</ol>
</nav>
<div id="hotbar-page-controls" class="bar-controls flexcol">
{{#if showArrows}}<a class="page-control" data-action="page-up"><i class="fas fa-angle-up"></i></a>{{/if}}
<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'}}">
<i class="fas fa-angle-up"></i>
</a>
{{/if}}
<span class="page-number">{{page}}</span>
{{#if showArrows}}<a class="page-control" data-action="page-down"><i class="fas fa-angle-down"></i></a>{{/if}}
{{#if showArrows}}
<a class="page-control" data-action="page-down" data-tooltip="MACRO.PageDown" alt="{{localize 'MACRO.PageDown'}}">
<i class="fas fa-angle-down"></i>
</a>
{{/if}}
</div>
<div id="hotbar-page" class="hotbar-page flexcol {{pageClass}}">
{{#each macrolist}}
<div class="hotbar-page-row flexrow{{#if this.selected}} selected{{/if}}" data-page="{{page}}">
<div title="{{ localize MonksHotbarExpansion.clear-row}}" class="bar-controls clear-row flexcol">
<div data-tooltip="MonksHotbarExpansion.clear-row" class="bar-controls clear-row flexcol">
<i class="fas fa-trash"></i>
</div>
<nav class="action-bar flexrow">
<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}}" {{/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}}" />
<img class="macro-icon" src="{{this.icon}}" alt="{{this.tooltip}}" />
{{/if}}
</li>
{{/each}}
Expand Down

0 comments on commit c55bd54

Please sign in to comment.