Skip to content

Commit

Permalink
Little update
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Sep 27, 2021
1 parent a43ee7e commit e121452
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/module/ArmsReachSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function recalculate(tokens) {
}

export function _socketRecalculate(tokenIds) {
// DO NOTHING JUST REGISTER THE TOKEN FOR STRANGE BUG WITH SOCKETLIB
//@ts-ignore
return getCanvas().controls?.ruler?.dragRulerRecalculate(tokenIds);
// return getCanvas().controls?.ruler?.dragRulerRecalculate(tokenIds);
}
18 changes: 9 additions & 9 deletions src/module/DoorsReach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const DoorsReach = {
ArmsReachVariables.door_interaction_lastTime = Date.now();
const character = getFirstPlayerToken();
if (!character) {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.noCharacterSelectedToCenterCamera'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.noCharacterSelectedToCenterCamera`));
return;
}

Expand Down Expand Up @@ -71,7 +71,7 @@ export const DoorsReach = {
const character = getFirstPlayerToken();

if (!character) {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.noCharacterSelected'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.noCharacterSelected`));
return;
}

Expand Down Expand Up @@ -215,18 +215,18 @@ export const DoorsReach = {
};

if (!character) {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.noCharacterSelected'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.noCharacterSelected`));
return false;
} else {
// PreHook (can abort the interaction with the door)
if (Hooks.call('ArmsReachPreInteraction', doorData) === false) {
const tokenName = getCharacterName(character);
if (tokenName) {
iteractionFailNotification(
i18nFormat(ARMS_REACH_MODULE_NAME + '.doorNotInReachFor', { tokenName: tokenName }),
i18nFormat(`${ARMS_REACH_MODULE_NAME}.doorNotInReachFor`, { tokenName: tokenName }),
);
} else {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.doorNotInReach'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.doorNotInReach`));
}
return false;
}
Expand Down Expand Up @@ -280,10 +280,10 @@ export const DoorsReach = {
const tokenName = getCharacterName(character);
if (tokenName) {
iteractionFailNotification(
i18nFormat(ARMS_REACH_MODULE_NAME + '.doorNotInReachFor', { tokenName: tokenName }),
i18nFormat(`${ARMS_REACH_MODULE_NAME}.doorNotInReachFor`, { tokenName: tokenName }),
);
} else {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.doorNotInReach'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.doorNotInReach`));
}
return false;
} else {
Expand Down Expand Up @@ -510,11 +510,11 @@ export const DoorsReach = {

if (tokenName) {
iteractionFailNotification(
i18nFormat(ARMS_REACH_MODULE_NAME + '.doorNotFoundInReachFor', { tokenName: tokenName }),
i18nFormat(`${ARMS_REACH_MODULE_NAME}.doorNotFoundInReachFor`, { tokenName: tokenName }),
);
//iteractionFailNotification(`Door distance: ${clampNum(shortestDistance)} <= ${reach}`);
} else {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.doorNotFoundInReach'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.doorNotFoundInReach`));
//iteractionFailNotification(`Door distance: ${clampNum(shortestDistance)} <= ${reach}`);
}
return;
Expand Down
6 changes: 3 additions & 3 deletions src/module/JournalsReach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const JournalsReach = {
<boolean>getGame().settings.get(ARMS_REACH_MODULE_NAME, 'globalInteractionDistanceForGM'))
) {
if (!character) {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.noCharacterSelectedForJournal'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.noCharacterSelectedForJournal`));
return false;
} else {
let isNotNearEnough = false;
Expand All @@ -62,10 +62,10 @@ export const JournalsReach = {
const tokenName = getCharacterName(character);
if (tokenName) {
iteractionFailNotification(
i18nFormat(ARMS_REACH_MODULE_NAME + '.journalsNotInReachFor', { tokenName: tokenName }),
i18nFormat(`${ARMS_REACH_MODULE_NAME}.journalsNotInReachFor`, { tokenName: tokenName }),
);
} else {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.journalsNotInReach'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.journalsNotInReach`));
}
return false;
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/module/StairwaysReach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const StairwaysReach = {
<boolean>getGame().settings.get(ARMS_REACH_MODULE_NAME, 'globalInteractionDistanceForGM'))
) {
if (!character) {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.noCharacterSelectedForStairway'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.noCharacterSelectedForStairway`));
return false;
} else {
let isNotNearEnough = false;
Expand All @@ -64,10 +64,10 @@ export const StairwaysReach = {
const tokenName = getCharacterName(character);
if (tokenName) {
iteractionFailNotification(
i18nFormat(ARMS_REACH_MODULE_NAME + '.stairwaysNotInReachFor', { tokenName: tokenName }),
i18nFormat(`${ARMS_REACH_MODULE_NAME}.stairwaysNotInReachFor`, { tokenName: tokenName }),
);
} else {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.stairwaysNotInReach'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.stairwaysNotInReach`));
}
return false;
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/module/TokensReach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const TokensReach = {
<boolean>getGame().settings.get(ARMS_REACH_MODULE_NAME, 'globalInteractionDistanceForGM'))
) {
if (!character) {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.noCharacterSelectedForJournal'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.noCharacterSelectedForJournal`));
return false;
} else {
let isNotNearEnough = false;
Expand All @@ -62,10 +62,10 @@ export const TokensReach = {
const tokenName = getCharacterName(character);
if (tokenName) {
iteractionFailNotification(
i18nFormat(ARMS_REACH_MODULE_NAME + '.tokensNotInReachFor', { tokenName: tokenName }),
i18nFormat(`${ARMS_REACH_MODULE_NAME}.tokensNotInReachFor`, { tokenName: tokenName }),
);
} else {
iteractionFailNotification(i18n(ARMS_REACH_MODULE_NAME + '.tokensNotInReach'));
iteractionFailNotification(i18n(`${ARMS_REACH_MODULE_NAME}.tokensNotInReach`));
}
return false;
} else {
Expand Down

0 comments on commit e121452

Please sign in to comment.