- separate listboxes for both teams in the crew menu

- fixed host getting team ID 0
- fixed clients not spawning if their ID is 0 (= if playing a non-combat mission before IDs have been assigned)
- fixed host's character taking part in the job assignment of both teams
This commit is contained in:
Regalis
2016-10-05 20:15:39 +03:00
parent 41c38575b9
commit fb28fc8cda
4 changed files with 93 additions and 76 deletions

View File

@@ -66,46 +66,48 @@ namespace Barotrauma
int x = 0;
foreach (Character character in gameSession.CrewManager.characters)
{
if (singleplayer || character.TeamID == GameMain.GameSession.CrewManager.WinningTeam)
if (GameMain.GameSession.Mission is CombatMission &&
character.TeamID != GameMain.GameSession.CrewManager.WinningTeam)
{
var characterFrame = new GUIFrame(new Rectangle(x, y, 170, 70), Color.Transparent, GUI.Style, listBox);
characterFrame.OutlineColor = Color.Transparent;
characterFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
characterFrame.CanBeFocused = false;
character.Info.CreateCharacterFrame(characterFrame,
character.Info.Job != null ? (character.Info.Name + '\n' + "(" + character.Info.Job.Name + ")") : character.Info.Name, null);
string statusText = "OK";
Color statusColor = Color.DarkGreen;
if (character.IsDead)
{
statusText = InfoTextManager.GetInfoText("CauseOfDeath." + character.CauseOfDeath.ToString());
statusColor = Color.DarkRed;
}
else
{
if (character.IsUnconscious)
{
statusText = "Unconscious";
statusColor = Color.DarkOrange;
}
else if (character.Health / character.MaxHealth < 0.8f)
{
statusText = "Injured";
statusColor = Color.DarkOrange;
}
}
new GUITextBlock(new Rectangle(0, 0, 0, 20), statusText,
GUI.Style, Alignment.BottomLeft, Alignment.TopCenter, characterFrame, true, GUI.SmallFont).Color = statusColor * 0.7f;
x += characterFrame.Rect.Width + 10;
continue;
}
var characterFrame = new GUIFrame(new Rectangle(x, y, 170, 70), Color.Transparent, GUI.Style, listBox);
characterFrame.OutlineColor = Color.Transparent;
characterFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
characterFrame.CanBeFocused = false;
character.Info.CreateCharacterFrame(characterFrame,
character.Info.Job != null ? (character.Info.Name + '\n' + "(" + character.Info.Job.Name + ")") : character.Info.Name, null);
string statusText = "OK";
Color statusColor = Color.DarkGreen;
if (character.IsDead)
{
statusText = InfoTextManager.GetInfoText("CauseOfDeath." + character.CauseOfDeath.ToString());
statusColor = Color.DarkRed;
}
else
{
if (character.IsUnconscious)
{
statusText = "Unconscious";
statusColor = Color.DarkOrange;
}
else if (character.Health / character.MaxHealth < 0.8f)
{
statusText = "Injured";
statusColor = Color.DarkOrange;
}
}
new GUITextBlock(new Rectangle(0, 0, 0, 20), statusText,
GUI.Style, Alignment.BottomLeft, Alignment.TopCenter, characterFrame, true, GUI.SmallFont).Color = statusColor * 0.7f;
x += characterFrame.Rect.Width + 10;
}
y += 120;