From 9e44f4d2fae724c2a64e1c54229721eb09414703 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:26:48 -0500 Subject: [PATCH] Action tips (cont'd) --- scripts/server/animation.js | 6 +++++- scripts/server/business.js | 14 +++++++++----- scripts/server/chat.js | 7 ++++++- scripts/server/help.js | 6 +++--- scripts/server/job.js | 12 ++++++++---- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/scripts/server/animation.js b/scripts/server/animation.js index d92d493d..9fd6d192 100644 --- a/scripts/server/animation.js +++ b/scripts/server/animation.js @@ -44,7 +44,9 @@ function playPlayerAnimationCommand(command, params, client) { return false; } - messagePlayerTip(client, getLocaleString(client, "AnimationStopCommandTip", "{ALTCOLOUR}/stopanim{MAINCOLOUR}")); + if (hasPlayerSeenActionTip(client, "AnimationStop")) { + messagePlayerTip(client, getIndexedLocaleString(client, "ActionTips", "AnimationStopTip", "{ALTCOLOUR}/stopanim{MAINCOLOUR}")); + } makePlayerPlayAnimation(client, animationSlot, animationPositionOffset); } @@ -66,6 +68,8 @@ function stopPlayerAnimationCommand(command, params, client) { getPlayerData(client).animationForced = false; //setPlayerMouseCameraState(client, false); + + markPlayerActionTipSeen(client, "AnimationStop"); } // =========================================================================== diff --git a/scripts/server/business.js b/scripts/server/business.js index ea801d8c..c7523922 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -2670,12 +2670,16 @@ function buyFromBusinessCommand(command, params, client) { //messagePlayerSuccess(client, `You bought ${amount} {ALTCOLOUR}${itemName} {MAINCOLOUR}for ${totalCost} ${priceEach}`); meActionToNearbyPlayers(client, `buys a ${itemName}`); - if (doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) { - let keyData = getPlayerKeyBindForCommand("inv"); - messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryKeyPressTip", `{ALTCOLOUR}${getKeyNameFromId(keyData.key)}{MAINCOLOUR}`)); - } else { - messagePlayerNewbieTip(client, getLocaleString(client, "ViewInventoryCommandTip", `{ALTCOLOUR}/inv{MAINCOLOUR}`)); + if (!hasPlayerSeenActionTip(client, "ViewInventory")) { + if (doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand("inv")) { + let keyData = getPlayerKeyBindForCommand("inv"); + messagePlayerActionTip(client, getIndexedLocaleString(client, "ActionTips", "ViewInventory", `{ALTCOLOUR}${getKeyNameFromId(keyData.key)}{MAINCOLOUR}`)); + } else { + messagePlayerActionTip(client, getIndexedLocaleString(client, "ActionTips", "ViewInventory", `{ALTCOLOUR}/inv{MAINCOLOUR}`)); + } } + + markPlayerActionTipSeen(client, "ViewInventory"); } // =========================================================================== diff --git a/scripts/server/chat.js b/scripts/server/chat.js index c2cc5673..19220075 100644 --- a/scripts/server/chat.js +++ b/scripts/server/chat.js @@ -217,7 +217,10 @@ function privateMessageCommand(command, params, client) { getPlayerData(targetClient).privateMessageReplyTo = client; messagePlayerPrivateMessage(targetClient, client, messageText); - messagePlayerTip(client, getLocaleString(client, "PrivateMessageReplyCommandTip", "{ALTCOLOUR}/reply{MAINCOLOUR}")) + + if (hasPlayerSeenActionTip(targetClient, "ReplyToDirectMessage")) { + messagePlayerTip(targetClient, getIndexedLocaleString(targetClient, "ActionTips", "ReplyToDirectMessage", "{ALTCOLOUR}/reply{MAINCOLOUR}")); + } } // =========================================================================== @@ -240,6 +243,8 @@ function replyToLastPrivateMessageCommand(command, params, client) { getPlayerData(targetClient).privateMessageReplyTo = client; messagePlayerPrivateMessage(targetClient, client, messageText); + + markPlayerActionTipSeen(client, "ReplyToDirectMessage"); } // =========================================================================== diff --git a/scripts/server/help.js b/scripts/server/help.js index f3aea44c..c7dda1ea 100644 --- a/scripts/server/help.js +++ b/scripts/server/help.js @@ -405,14 +405,14 @@ function hasPlayerSeenActionTip(client, seenActionTipFlagName) { if (hasBitFlag(getPlayerData(client).accountData.seenActionTips, seenActionTipFlagValue)) { return true; - } else { - return false; } + + return false; } // =========================================================================== -function playerHasSeenActionTip(client, seenActionTipFlagName) { +function markPlayerActionTipSeen(client, seenActionTipFlagName) { let seenActionTipFlagValue = getSeenActionTipsValue(seenActionTipFlagName); getPlayerData(client).accountData.seenActionTips = addBitFlag(getPlayerData(client).accountData.seenActionTips, seenActionTipFlagValue); diff --git a/scripts/server/job.js b/scripts/server/job.js index 3a5981cd..d9ab5d95 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -1394,11 +1394,15 @@ function jobEquipmentCommand(command, params, client) { givePlayerJobEquipment(client, equipmentId - 1); //messagePlayerSuccess(client, `You have been given the ${equipments[equipmentId-1].name} equipment`); meActionToNearbyPlayers(client, `grabs the ${jobEquipmentData.name} equipment from the locker`); - if (doesPlayerHaveKeyBindForCommand(client, "inv")) { - messagePlayerTip(client, getLocaleString(client, "JobEquipmentInventoryKeyBindTip", toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "inv").key)))); - } else { - messagePlayerTip(client, getLocaleString(client, "JobEquipmentInventoryCommandTip", "/inv")); + if (!hasPlayerSeenActionTip(client, "JobEquipmentInventory")) { + if (doesPlayerHaveKeyBindForCommand(client, "inv")) { + messagePlayerTip(client, getIndexedLocaleString(client, "ActionTips", "JobEquipmentInventory", toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "inv").key)))); + } else { + messagePlayerTip(client, getIndexedLocaleString(client, "ActionTips", "JobEquipmentInventory", "/inv")); + } + markPlayerActionTipSeen(client, "JobEquipmentInventory"); } + } // ===========================================================================