Make scoreboard key re-bindable
This commit is contained in:
@@ -152,6 +152,7 @@ function addAllNetworkHandlers() {
|
||||
addNetworkEventHandler("v.rp.minuteDuration", setMinuteDuration);
|
||||
addNetworkEventHandler("v.rp.snow", setSnowState);
|
||||
addNetworkEventHandler("v.rp.enterPropertyKey", setEnterPropertyKey);
|
||||
addNetworkEventHandler("v.rp.scoreBoardKey", setScoreBoardKey);
|
||||
addNetworkEventHandler("v.rp.skinSelect", toggleSkinSelect);
|
||||
addNetworkEventHandler("v.rp.hotbar", updatePlayerHotBar);
|
||||
addNetworkEventHandler("v.rp.logLevel", setLogLevel);
|
||||
@@ -288,7 +289,6 @@ function setEnterPropertyKey(key) {
|
||||
} else {
|
||||
enterPropertyKey = key;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -12,7 +12,7 @@ let scoreBoardListFont = null;
|
||||
|
||||
let pausedColour = COLOUR_RED;
|
||||
|
||||
let scoreboardKey = SDLK_TAB;
|
||||
let scoreBoardKey = null;
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -43,7 +43,7 @@ function processScoreBoardRendering() {
|
||||
}
|
||||
|
||||
if (renderScoreBoard) {
|
||||
if (isKeyDown(SDLK_TAB)) {
|
||||
if (isKeyDown(scoreBoardKey)) {
|
||||
if (scoreBoardListFont != null && scoreBoardTitleFont != null) {
|
||||
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);
|
||||
@@ -101,4 +101,16 @@ function processScoreBoardRendering() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setScoreBoardKey(key) {
|
||||
if (key == -1) {
|
||||
scoreBoardKey = null;
|
||||
} else {
|
||||
scoreBoardKey = key;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user