Make scoreboard key re-bindable
This commit is contained in:
@@ -104,6 +104,11 @@
|
|||||||
"keyName": "9",
|
"keyName": "9",
|
||||||
"commandString": "item 9",
|
"commandString": "item 9",
|
||||||
"keyState": 1
|
"keyState": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyName": "f5",
|
||||||
|
"commandString": "scoreboard",
|
||||||
|
"keyState": 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -152,6 +152,7 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("v.rp.minuteDuration", setMinuteDuration);
|
addNetworkEventHandler("v.rp.minuteDuration", setMinuteDuration);
|
||||||
addNetworkEventHandler("v.rp.snow", setSnowState);
|
addNetworkEventHandler("v.rp.snow", setSnowState);
|
||||||
addNetworkEventHandler("v.rp.enterPropertyKey", setEnterPropertyKey);
|
addNetworkEventHandler("v.rp.enterPropertyKey", setEnterPropertyKey);
|
||||||
|
addNetworkEventHandler("v.rp.scoreBoardKey", setScoreBoardKey);
|
||||||
addNetworkEventHandler("v.rp.skinSelect", toggleSkinSelect);
|
addNetworkEventHandler("v.rp.skinSelect", toggleSkinSelect);
|
||||||
addNetworkEventHandler("v.rp.hotbar", updatePlayerHotBar);
|
addNetworkEventHandler("v.rp.hotbar", updatePlayerHotBar);
|
||||||
addNetworkEventHandler("v.rp.logLevel", setLogLevel);
|
addNetworkEventHandler("v.rp.logLevel", setLogLevel);
|
||||||
@@ -288,7 +289,6 @@ function setEnterPropertyKey(key) {
|
|||||||
} else {
|
} else {
|
||||||
enterPropertyKey = key;
|
enterPropertyKey = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ let scoreBoardListFont = null;
|
|||||||
|
|
||||||
let pausedColour = COLOUR_RED;
|
let pausedColour = COLOUR_RED;
|
||||||
|
|
||||||
let scoreboardKey = SDLK_TAB;
|
let scoreBoardKey = null;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ function processScoreBoardRendering() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (renderScoreBoard) {
|
if (renderScoreBoard) {
|
||||||
if (isKeyDown(SDLK_TAB)) {
|
if (isKeyDown(scoreBoardKey)) {
|
||||||
if (scoreBoardListFont != null && scoreBoardTitleFont != null) {
|
if (scoreBoardListFont != null && scoreBoardTitleFont != null) {
|
||||||
let scoreboardStart = (game.height / 2) - (Math.floor(getClients().length / 2) * 20);
|
let scoreboardStart = (game.height / 2) - (Math.floor(getClients().length / 2) * 20);
|
||||||
let titleSize = scoreBoardTitleFont.measure("PLAYERS", game.width, 0.0, 1.0, 10, false, false);
|
let titleSize = scoreBoardTitleFont.measure("PLAYERS", game.width, 0.0, 1.0, 10, false, false);
|
||||||
@@ -102,3 +102,15 @@ function processScoreBoardRendering() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setScoreBoardKey(key) {
|
||||||
|
if (key == -1) {
|
||||||
|
scoreBoardKey = null;
|
||||||
|
} else {
|
||||||
|
scoreBoardKey = key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -562,9 +562,9 @@ function onPlayerSpawn(client) {
|
|||||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "scoreboard")) {
|
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "scoreboard")) {
|
||||||
let keyId = getPlayerKeyBindForCommand(client, "scoreboard");
|
let keyId = getPlayerKeyBindForCommand(client, "scoreboard");
|
||||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending scoreboard key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending scoreboard key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||||
sendPlayerScoreboardKey(client, keyId.key);
|
sendPlayerScoreBoardKey(client, keyId.key);
|
||||||
} else {
|
} else {
|
||||||
sendPlayerScoreboardKey(client, -1);
|
sendPlayerScoreBoardKey(client, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPlayerChatBoxTimeStampsState(client, isPlayerAccountSettingEnabled(client, "ChatBoxTimestamps"));
|
sendPlayerChatBoxTimeStampsState(client, isPlayerAccountSettingEnabled(client, "ChatBoxTimestamps"));
|
||||||
|
|||||||
@@ -1013,3 +1013,10 @@ function getPlayerInPropertyData(client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function scoreBoardCommand(command, params, client) {
|
||||||
|
// Handled client side
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -1010,6 +1010,12 @@ function sendPlayerEnterPropertyKey(client, key) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function sendPlayerScoreBoardKey(client, key) {
|
||||||
|
sendNetworkEventToPlayer("v.rp.scoreBoardKey", client, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function makePedPlayAnimation(ped, animationSlot, positionOffset) {
|
function makePedPlayAnimation(ped, animationSlot, positionOffset) {
|
||||||
if (getAnimationData(animationSlot).loop == true) {
|
if (getAnimationData(animationSlot).loop == true) {
|
||||||
setEntityData(ped, "v.rp.anim", animationSlot, true);
|
setEntityData(ped, "v.rp.anim", animationSlot, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user