forked from 0ad/0ad
Some "varfare" again plus a call to initMusic because that will be needed for the Spidermonkey upgrade.
This was SVN commit r14188.
This commit is contained in:
parent
54fcb3b4ca
commit
3ab983f8a1
@ -836,7 +836,7 @@ function launchGame()
|
||||
const romanNumbers = [undefined, "I", "II", "III", "IV", "V", "VI", "VII", "VIII"];
|
||||
for (var i = 0; i < numPlayers; ++i)
|
||||
{
|
||||
civs = allcivs[Math.floor(Math.random()*allcivs.length)];
|
||||
var civs = allcivs[Math.floor(Math.random()*allcivs.length)];
|
||||
|
||||
if (!g_GameAttributes.settings.PlayerData[i].Civ || g_GameAttributes.settings.PlayerData[i].Civ == "random")
|
||||
g_GameAttributes.settings.PlayerData[i].Civ = civs[Math.floor(Math.random()*civs.length)];
|
||||
@ -1549,7 +1549,7 @@ function sendRegisterGameStanza()
|
||||
var nbp = numberOfPlayers ? numberOfPlayers : 1;
|
||||
var tnbp = g_GameAttributes.settings.PlayerData.length;
|
||||
|
||||
gameData = {
|
||||
var gameData = {
|
||||
"name":g_ServerName,
|
||||
"mapName":g_GameAttributes.map,
|
||||
"niceMapName":getMapDisplayName(g_GameAttributes.map),
|
||||
|
@ -20,8 +20,8 @@ function init(data)
|
||||
if (tipText)
|
||||
{
|
||||
var index = tipText.indexOf("\n");
|
||||
tipTextTitle = tipText.substring(0, index);
|
||||
tipTextMessage = tipText.substring(index);
|
||||
var tipTextTitle = tipText.substring(0, index);
|
||||
var tipTextMessage = tipText.substring(index);
|
||||
getGUIObjectByName("tipTitle").caption = tipTextTitle? tipTextTitle : "";
|
||||
getGUIObjectByName("tipText").caption = tipTextMessage? tipTextMessage : "";
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ var g_mapSizes = {};
|
||||
function init(attribs)
|
||||
{
|
||||
// Play menu music
|
||||
initMusic();
|
||||
global.music.setState(global.music.states.MENU);
|
||||
|
||||
g_Name = Engine.LobbyGetNick();
|
||||
@ -38,8 +39,8 @@ function init(attribs)
|
||||
updatePlayerList();
|
||||
|
||||
resetFilters();
|
||||
var spamMonitorTimer = setTimeout(clearSpamMonitor, 5000);
|
||||
var spammerTimer = setTimeout(clearSpammers, 30000);
|
||||
setTimeout(clearSpamMonitor, 5000);
|
||||
setTimeout(clearSpammers, 30000);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -609,18 +610,18 @@ function ircFormat(text, from, color, key)
|
||||
|
||||
// Generate and apply color to uncolored names,
|
||||
if (!color && from)
|
||||
coloredFrom = colorPlayerName(from);
|
||||
var coloredFrom = colorPlayerName(from);
|
||||
else if (from)
|
||||
coloredFrom = "[color='" + color + "']" + from + "[/color]";
|
||||
var coloredFrom = "[color='" + color + "']" + from + "[/color]";
|
||||
|
||||
// Time for optional time header
|
||||
var time = new Date(Date.now());
|
||||
|
||||
// Build time header if enabled
|
||||
if (g_timestamp)
|
||||
formatted = '[font="serif-bold-13"]\x5B' + twoDigits(time.getHours() % 12) + ":" + twoDigits(time.getMinutes()) + '\x5D[/font] '
|
||||
var formatted = '[font="serif-bold-13"]\x5B' + twoDigits(time.getHours() % 12) + ":" + twoDigits(time.getMinutes()) + '\x5D[/font] '
|
||||
else
|
||||
formatted = "";
|
||||
var formatted = "";
|
||||
|
||||
// Handle commands
|
||||
if (text[0] == '/')
|
||||
@ -671,13 +672,13 @@ function updateSpamandDetect(text, from)
|
||||
function clearSpamMonitor()
|
||||
{
|
||||
g_spamMonitor = {};
|
||||
spamTimer = setTimeout(clearSpamMonitor, 5000);
|
||||
setTimeout(clearSpamMonitor, 5000);
|
||||
}
|
||||
|
||||
function clearSpammers()
|
||||
{
|
||||
g_spammers = {};
|
||||
spammerTimer = setTimeout(clearSpammers, 30000);
|
||||
setTimeout(clearSpammers, 30000);
|
||||
}
|
||||
|
||||
/* Utilities */
|
||||
|
@ -4,6 +4,7 @@
|
||||
<script file="gui/common/functions_global_object.js"/>
|
||||
<script file="gui/common/functions_utility.js"/>
|
||||
<script file="gui/common/timer.js"/>
|
||||
<script file="gui/common/music.js"/>
|
||||
|
||||
<script file="gui/lobby/lobby.js"/>
|
||||
|
||||
|
@ -195,7 +195,7 @@ function init(data)
|
||||
militaryScore.size = left + " 2 " + (left + width) + " 100%"; left += width;
|
||||
explorationScore.size = left + " 2 " + (left + width) + " 100%"; left += width;
|
||||
totalScore.size = left + " 2 " + (left + width) + " 100%"; left += width;
|
||||
size = getGUIObjectByName("playerBox0["+i+"]").size;
|
||||
var size = getGUIObjectByName("playerBox0["+i+"]").size;
|
||||
size.right = left + 10;
|
||||
getGUIObjectByName("playerBox0["+i+"]").size = size;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user