Skip to content

Commit e096aba

Browse files
committed
v5.0.15
1 parent 5396f13 commit e096aba

File tree

6 files changed

+40
-7
lines changed

6 files changed

+40
-7
lines changed

lang/de.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,14 @@
940940
"settings" : {
941941
"target" : {
942942
"name" : "Ziel"
943+
},
944+
"ConfirmDialogBehaviour" : {
945+
"name" : "Bestätigungs Dialog Verhalten",
946+
"options" : {
947+
"world" : "Welt Einstellung",
948+
"force" : "Dialog erzwingen",
949+
"skip" : "Dialog überspringen"
950+
}
943951
}
944952
}
945953
},

lang/en.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,14 @@
940940
"settings" : {
941941
"target" : {
942942
"name" : "Target"
943+
},
944+
"ConfirmDialogBehaviour" : {
945+
"name" : "Confirm dialog behaviour",
946+
"options" : {
947+
"world" : "World setting",
948+
"force" : "Force dialog",
949+
"skip" : "Skip dialog"
950+
}
943951
}
944952
}
945953
},

module.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"name": "saibot"
88
}
99
],
10-
"version": "5.0.14",
10+
"version": "5.0.15",
1111
"compatibility": {
1212
"minimum": "11",
1313
"verified": "13"
@@ -88,7 +88,7 @@
8888
}
8989
],
9090
"url": "https://github.com/Saibot393/perceptive",
91-
"download": "https://github.com/Saibot393/perceptive/archive/refs/tags/v5.0.14.zip",
91+
"download": "https://github.com/Saibot393/perceptive/archive/refs/tags/v5.0.15.zip",
9292
"manifest": "https://github.com/Saibot393/perceptive/releases/latest/download/module.json",
9393
"readme": "https://github.com/Saibot393/perceptive/blob/main/README.md",
9494
"changelog": "https://github.com/Saibot393/perceptive/blob/main/CHANGELOG.md"

scripts/SpottingScript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ class SpottingManager {
782782
Tiles : PerceptiveUtils.IDsfromWalls(pObjects.filter(vObject => vObject.documentName == "Tile"))};
783783

784784
if (game.user.isGM) {
785-
if (["always"].includes(game.settings.get(cModuleName, "GMSpotconfirmDialogbehaviour")) || pInfos.forceConfirmDialog) {
785+
if ((["always"].includes(game.settings.get(cModuleName, "GMSpotconfirmDialogbehaviour")) && !pInfos.skipConfirmDialog) || pInfos.forceConfirmDialog) {
786786
SpottingManager.openSpottingDialoge(vObjectIDs, PerceptiveUtils.IDsfromTokens(pSpotters), canvas.scene.id, pInfos);
787787
}
788788
else {
@@ -801,7 +801,7 @@ class SpottingManager {
801801

802802
static async SpotObjectsRequest(pObjectIDs, pSpotterIDs, pSceneID, pInfos) {
803803
if (game.user.isGM) {
804-
if (["playersonly", "always"].includes(game.settings.get(cModuleName, "GMSpotconfirmDialogbehaviour")) || pInfos.forceConfirmDialog) {
804+
if ((["playersonly", "always"].includes(game.settings.get(cModuleName, "GMSpotconfirmDialogbehaviour")) && !pInfos.skipConfirmDialog) || pInfos.forceConfirmDialog) {
805805
SpottingManager.openSpottingDialoge(pObjectIDs, pSpotterIDs, pSceneID, pInfos);
806806
}
807807
else {

scripts/compatibility/PerceptiveCompatibility.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,22 @@ Hooks.once("setupTileActions", (pMATT) => {
398398
options: { show: ['token', 'tile', 'within', 'players', 'previous', 'tagger'] },
399399
required: true,
400400
restrict: (entity) => { return ((entity instanceof Token) || (entity instanceof Wall) || (entity instanceof Tile)); }
401+
},
402+
{
403+
id: "ConfirmDialogBehaviour",
404+
name: Translate(cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".name"),
405+
list: "ConfirmDialogBehaviour",
406+
type: "list",
407+
defvalue: "world"
401408
}
402409
],
410+
values: {
411+
"ConfirmDialogBehaviour": {
412+
"world": Translate(cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".options." + "world"),
413+
"force": Translate(cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".options." + "force"),
414+
"skip": Translate(cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".options." + "skip")
415+
}
416+
},
403417
group: cModuleName,
404418
fn: async (args = {}) => {
405419
const { action } = args;
@@ -408,15 +422,18 @@ Hooks.once("setupTileActions", (pMATT) => {
408422

409423
let vSpotted = await pMATT.getEntities(args, "tokens", action.data?.targets);
410424

425+
let vConfirmDialogBehaviour = action.data?.ConfirmDialogBehaviour;
426+
411427
let vTokenSpotted = {};
412428

413429
for (let i = 0; i < vSpotted.length; i++) {
414430
vTokenSpotted[vSpotted[i].id] = true; //technically only tokens and tiles are required, but oh well
415431
}
416-
417432
let vInfos = {TokenSpotted : vTokenSpotted,
418433
sendingPlayer : args.userid,
419-
forceConfirmDialog : true};
434+
forceConfirmDialog : vConfirmDialogBehaviour == "force",
435+
skipConfirmDialog : vConfirmDialogBehaviour == "skip",
436+
sendingPlayer : game.user.id};
420437

421438
SpottingManager.RequestSpotObjects(vSpotted, vSpotters, vInfos);
422439
},

scripts/settings/PerceptiveSettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Hooks.once("init", () => { // game.settings.get(cModuleName, "")
291291
"playersonly" : Translate("Settings.GMSpotconfirmDialogbehaviour.options.playersonly"),
292292
"always" : Translate("Settings.GMSpotconfirmDialogbehaviour.options.always")
293293
},
294-
default: false
294+
default: "off"
295295
});
296296

297297
game.settings.register(cModuleName, "ShowfailuresinGMconfirm", {

0 commit comments

Comments
 (0)