Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.7.1 - Fix TypeError issue #11

Merged
merged 1 commit into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dist/scripts/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/scripts/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "module-template",
"version": "1.7.0",
"name": "layer-hotkeys",
"version": "1.7.1",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
11 changes: 7 additions & 4 deletions src/scripts/layer-hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,24 @@ export default function() {
Hooks.on('renderSceneControls', (app, html, data) => {
let scene_control = html.children('li.scene-control');
let layerKeys = {};
for (let [key, value] of Object.entries(CONFIG["layer-hotkeys"].layer))
let config = CONFIG["layer-hotkeys"];
if (config === undefined) return;

for (let [key, value] of Object.entries(config.layer))
layerKeys[value] = key;
let toolKeys = {};
for (let [key, value] of Object.entries(CONFIG["layer-hotkeys"].tool))
for (let [key, value] of Object.entries(config.tool))
toolKeys[value] = key;

for (let i = 0; i < scene_control.length; i++) {
const li = scene_control[i];
let title = li.getAttribute("title");
let key = CONFIG["layer-hotkeys"].layer[li.getAttribute("data-control")];
let key = config.layer[li.getAttribute("data-control")];
if (key !== undefined)
li.title += " [" + key.toUpperCase() + "]";
let ctrls = li.getElementsByClassName('control-tool');
for (let j = 0; j < ctrls.length; j++) {
let title = ctrls[j].title + " [" + CONFIG["layer-hotkeys"].tool[j+1] + "]";
let title = ctrls[j].title + " [" + config.tool[j+1] + "]";
ctrls[j].title = title;
}
}
Expand Down