Skip to content

Commit

Permalink
Introduce green icon for unlocked status
Browse files Browse the repository at this point in the history
  • Loading branch information
coffiarts committed Dec 16, 2023
1 parent f3bc989 commit 0aa9f5f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
Binary file added src/sheet-locker/artwork/lock-green-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/sheet-locker/artwork/lock-red-closed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/sheet-locker/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@
"name": "Sperrung auch für Spielleiter anwenden",
"hint": "Gleiche Regeln für alle! Sperrung gilt auch für den SL (als Schutz vor unbeabsichtigten Änderungen)."
},
"lockedStatusIcon": {
"overlayIconLocked": {
"name": "Status Icon bei Sperrung (optional)",
"hint": "Welches Icon soll auf Tokens und Akteuren angezeigt werden, wenn sie gesperrt sind (zum Deaktivieren leer lassen)?"
"hint": "Welches Icon soll auf Tokens und Akteuren angezeigt werden, wenn sie gesperrt sind (leer lassen, falls kein Icon angezeigt werden soll)?"
},
"overlayIconOpen": {
"name": "Status Icon bei Entsperrung (optional)",
"hint": "Welches Icon soll auf Tokens und Akteuren angezeigt werden, wenn sie freigeschaltet sind (leer lassen, falls kein Icon angezeigt werden soll)?"
}
},
"chatInfoContent": {
Expand Down
8 changes: 6 additions & 2 deletions src/sheet-locker/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@
"name": "Lock changes by GM",
"hint": "Same rules for all! Apply locking to me as the GM as well (protecting myself from doing unintended changes)."
},
"lockedStatusIcon": {
"overlayIconLocked": {
"name": "Status Icon when locked (optional)",
"hint": "Pick which icon to display on tokens and actors when locked (leave empty to disable)?"
"hint": "Pick which icon to display on tokens and actors when locked (leave empty to disable icon)?"
},
"overlayIconOpen": {
"name": "Status Icon when unlocked (optional)",
"hint": "Pick which icon to display on tokens and actors when unlocked (leave empty to disable icon)?"
}
},
"chatInfoContent": {
Expand Down
7 changes: 5 additions & 2 deletions src/sheet-locker/scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ export class Config {
alertGMOnReject: {
scope: 'world', config: true, type: Boolean, default: true
},
lockedStatusIcon: {
scope: 'world', config: true, type: String, filePicker: "image", default: `${Config.data.modPath}/artwork/red-lock.png`
overlayIconLocked: {
scope: 'world', config: true, type: String, filePicker: "image", default: `${Config.data.modPath}/artwork/lock-red-closed.png`
},
overlayIconOpen: {
scope: 'world', config: true, type: String, filePicker: "image", default: `${Config.data.modPath}/artwork/lock-green-open.png`
}
};
Config.registerSettings(data);
Expand Down
2 changes: 1 addition & 1 deletion src/sheet-locker/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function onItemDeletedFromSheet(item, options, userid) {
* inspired by // https://github.com/LeafWulf/deathmark/blob/master/scripts/deathmark.js
*/
async function renderTokenOverlays() {
let img = (SheetLocker.isActive) ? Config.setting('lockedStatusIcon') : "";
let img = (SheetLocker.isActive) ? Config.setting('overlayIconLocked') : Config.setting('overlayIconOpen');
for (const aToken of game.scenes.current.tokens) {
if (aToken.actorLink) {
const ownedActor = game.actors.find((actor)=>{return (actor.id === game.users.current.character?.id)});
Expand Down

0 comments on commit 0aa9f5f

Please sign in to comment.