Action tips (cont'd)

This commit is contained in:
Vortrex
2022-08-22 14:26:48 -05:00
parent c4f8afecc0
commit 9e44f4d2fa
5 changed files with 31 additions and 14 deletions

View File

@@ -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");
}
// ===========================================================================

View File

@@ -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");
}
// ===========================================================================

View File

@@ -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");
}
// ===========================================================================

View File

@@ -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);

View File

@@ -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");
}
}
// ===========================================================================