mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Use only the Diplomacy Color of non-defeated players
Patch By: LangBart Differential Revision: D4288 This was SVN commit r25951.
This commit is contained in:
@@ -16,6 +16,7 @@ class DiplomacyColors
|
||||
this.diplomacyColorsChangeHandlers = [];
|
||||
|
||||
registerPlayersInitHandler(this.onPlayersInit.bind(this));
|
||||
registerPlayersFinishedHandler(this.onPlayersFinished.bind(this));
|
||||
registerConfigChangeHandler(this.onConfigChange.bind(this));
|
||||
registerCeasefireEndedHandler(this.onCeasefireEnded.bind(this));
|
||||
}
|
||||
@@ -30,6 +31,12 @@ class DiplomacyColors
|
||||
this.computeTeamColors();
|
||||
}
|
||||
|
||||
onPlayersFinished()
|
||||
{
|
||||
if (this.enabled)
|
||||
this.updateDisplayedPlayerColors();
|
||||
}
|
||||
|
||||
onDiplomacyChange()
|
||||
{
|
||||
if (this.enabled)
|
||||
@@ -99,7 +106,7 @@ class DiplomacyColors
|
||||
if (g_ViewedPlayer <= 0)
|
||||
{
|
||||
// Observers and gaia see team colors
|
||||
let team = g_Players[i].team;
|
||||
const team = g_Players[i].state == "active" ? g_Players[i].team : -1;
|
||||
this.displayedPlayerColors[i] = g_Players[teamRepresentatives[team] || i].color;
|
||||
if (team != -1 && !teamRepresentatives[team])
|
||||
teamRepresentatives[team] = i;
|
||||
|
||||
Reference in New Issue
Block a user