Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
casualsoty committed Sep 29, 2023
1 parent 8995a01 commit ca3c04b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
5 changes: 5 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"Name": "Chat Bubbles Duration"
},

"AlternativeButtonIcon": {
"Hint": "Configure whether or not to display an alternative button icon in the chat control buttons.",
"Name": "Alternative Button Icon"
},

"DisplayDefaultEmotes": {
"Hint": "Configure whether or not default emotes will be displayed in the dialog window.",
"Name": "Display Default Emotes"
Expand Down
25 changes: 14 additions & 11 deletions module.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,10 @@ Hooks.on('changeSidebarTab', _ => {
'<style>.close-maemotes-button { display: none; }</style>' +
'<a ' +
'class="chat-control-icon" ' +
'data-tooltip="' + game.i18n.localize('MAEMOTES.OpenMaemotesButtonTitle') + '"' +
'id="open-maemotes-button" ' +
'title="' + game.i18n.localize('MAEMOTES.OpenMaemotesButtonTitle') + '">' +
'<svg ' +
'class="bi bi-emoji-smile-fill" ' +
'fill="currentColor" ' +
'height="21" ' +
'style="position: relative; top: 3px;" ' +
'viewBox="0 0 16 16" ' +
'width="21" ' +
'xmlns="http://www.w3.org/2000/svg">' +
'<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zM4.285 9.567a.5.5 0 0 1 .683.183A3.498 3.498 0 0 0 8 11.5a3.498 3.498 0 0 0 3.032-1.75.5.5 0 1 1 .866.5A4.498 4.498 0 0 1 8 12.5a4.498 4.498 0 0 1-3.898-2.25.5.5 0 0 1 .183-.683zM10 8c-.552 0-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5S10.552 8 10 8z"/>'
'</svg>' +
'style="align-items: center; display: flex; font-size: 20px;">' +
'<i class="' + (game.settings.get('maemotes', 'alternativeButtonIcon') ? 'fa-frog' : 'fa-face-smile') + ' fa"></i>'
'</a>';

document.getElementById('open-maemotes-button').addEventListener('click', _ => {
Expand Down Expand Up @@ -72,6 +64,8 @@ Hooks.on('changeSidebarTab', _ => {

setTimeout(_ => dialog.render(true), isDialogOpen * 250);
});
} else {
$('#open-maemotes-button i').removeClass(['fa-face-smile', 'fa-frog']).addClass(game.settings.get('maemotes', 'alternativeButtonIcon') ? 'fa-frog' : 'fa-face-smile');
}
});

Expand Down Expand Up @@ -108,6 +102,15 @@ Hooks.once('init', _ => {
type: Number
});

game.settings.register('maemotes', 'alternativeButtonIcon', {
config: true,
default: false,
hint: game.i18n.localize('MAEMOTES.Settings.AlternativeButtonIcon.Hint'),
name: game.i18n.localize('MAEMOTES.Settings.AlternativeButtonIcon.Name'),
scope: 'client',
type: Boolean
});

game.settings.register('maemotes', 'displayDefaultEmotes', {
config: true,
default: true,
Expand Down
4 changes: 2 additions & 2 deletions scripts/get-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const getButton = file => {
'};" ' +
'style="height: 66px; margin: 0 4px 8px 4px; padding: 0; width: 66px">' +
'<img ' +
'data-tooltip="' + TITLE + '" ' +
'src="' + file + '" ' +
'style="border: 0; max-height: 64px; max-width: 64px;" ' +
'title="' + TITLE + '">' +
'style="border: 0; max-height: 64px; max-width: 64px;">' +
'</button>';
}

0 comments on commit ca3c04b

Please sign in to comment.