mirror of
https://github.com/fzumpe/foundry-usernotes.git
synced 2026-06-06 21:00:03 +02:00
Cleanup console logs and Update to Version 1.0.2
This commit is contained in:
parent
00cbcecbfd
commit
6a37be1ce8
@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "user-notes",
|
||||
"title": "User Notes",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Florian Zumpe"
|
||||
@ -21,5 +21,5 @@
|
||||
"languages": [],
|
||||
"url": "https://github.com/fzumpe/foundry-usernotes",
|
||||
"manifest": "https://raw.githubusercontent.com/fzumpe/foundry-usernotes/main/module.json",
|
||||
"download": "https://codeload.github.com/fzumpe/foundry-usernotes/zip/refs/tags/V1.0.1"
|
||||
"download": "https://codeload.github.com/fzumpe/foundry-usernotes/zip/refs/tags/V1.0.2"
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import {
|
||||
USER_NOTES_MODULE_ID,
|
||||
USER_NOTES_TOOL_ID
|
||||
} from "./user-notes-constants.js";
|
||||
|
||||
@ -8,17 +7,15 @@ import {
|
||||
} from "./user-notes-window.js";
|
||||
|
||||
export function userNotesRegisterTokenControl(controls) {
|
||||
console.log("User Notes | registering token control", controls);
|
||||
|
||||
const tokenControl = controls?.tokens;
|
||||
|
||||
if (!tokenControl) {
|
||||
console.warn("User Notes | controls.tokens fehlt", controls);
|
||||
console.warn("User Notes | controls.tokens is not available; token control was not registered");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tokenControl.tools) {
|
||||
console.warn("User Notes | controls.tokens.tools fehlt", tokenControl);
|
||||
console.warn("User Notes | controls.tokens.tools is not available; token control was not registered");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -30,19 +27,14 @@ export function userNotesRegisterTokenControl(controls) {
|
||||
button: true,
|
||||
visible: true,
|
||||
|
||||
onChange: (event, active) => {
|
||||
console.log("User Notes | onChange", { event, active });
|
||||
onChange: () => {
|
||||
userNotesOpenNotes();
|
||||
},
|
||||
|
||||
onClick: event => {
|
||||
console.log("User Notes | onClick", { event });
|
||||
onClick: () => {
|
||||
userNotesOpenNotes();
|
||||
}
|
||||
};
|
||||
|
||||
console.log(
|
||||
"User Notes | token control registered",
|
||||
tokenControl.tools[USER_NOTES_TOOL_ID]
|
||||
);
|
||||
console.log("User Notes | token control button registered");
|
||||
}
|
||||
|
||||
@ -8,37 +8,38 @@ import {
|
||||
|
||||
import {
|
||||
userNotesOpenNotes,
|
||||
userNotesResetPositionAndSize,
|
||||
userNotesRefreshOpenWindow
|
||||
userNotesResetPositionAndSize
|
||||
} from "./user-notes-window.js";
|
||||
|
||||
console.log("User Notes | ES module loaded");
|
||||
|
||||
globalThis.UserNotes = {
|
||||
open: userNotesOpenNotes,
|
||||
resetPosition: userNotesResetPositionAndSize,
|
||||
refresh: userNotesRefreshOpenWindow
|
||||
resetPosition: userNotesResetPositionAndSize
|
||||
};
|
||||
|
||||
Hooks.once("init", () => {
|
||||
console.log("User Notes | init hook fired");
|
||||
|
||||
try {
|
||||
console.log("User Notes | application registered");
|
||||
|
||||
userNotesRegisterSettings(userNotesResetPositionAndSize);
|
||||
|
||||
console.log("User Notes | settings registered");
|
||||
} catch (err) {
|
||||
console.error("User Notes | error during init", err);
|
||||
ui.notifications?.error("User Notes: Fehler beim Initialisieren. Details stehen in der Browser-Konsole.");
|
||||
|
||||
ui.notifications?.error(
|
||||
"User Notes: Fehler beim Initialisieren. Details stehen in der Browser-Konsole."
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Hooks.on("getSceneControlButtons", controls => {
|
||||
console.log("User Notes | getSceneControlButtons fired");
|
||||
|
||||
try {
|
||||
userNotesRegisterTokenControl(controls);
|
||||
} catch (err) {
|
||||
console.error("User Notes | error while registering token control", err);
|
||||
ui.notifications?.error("User Notes: Fehler beim Registrieren des Token-Controls.");
|
||||
|
||||
ui.notifications?.error(
|
||||
"User Notes: Fehler beim Registrieren des Token-Controls."
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user