Some progress on flipping subs

Press crouch to flip every sub in the map, texture alignment breaks and physics items vanish, but other than that it's working.
This commit is contained in:
juanjp600
2016-09-29 22:20:15 -03:00
parent e22d8adde5
commit f6b82eb095
12 changed files with 207 additions and 56 deletions

View File

@@ -12,6 +12,8 @@ namespace Barotrauma
{
public List<Character> characters;
public List<CharacterInfo> characterInfos;
public int WinningTeam = 1;
private int money;

View File

@@ -66,43 +66,46 @@ namespace Barotrauma
int x = 0;
foreach (Character character in gameSession.CrewManager.characters)
{
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)
if (singleplayer || character.TeamID == GameMain.GameSession.CrewManager.WinningTeam)
{
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;
}
}
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;
new GUITextBlock(new Rectangle(0, 0, 0, 20), statusText,
GUI.Style, Alignment.BottomLeft, Alignment.TopCenter, characterFrame, true, GUI.SmallFont).Color = statusColor * 0.7f;
character.Info.CreateCharacterFrame(characterFrame,
character.Info.Job != null ? (character.Info.Name + '\n' + "(" + character.Info.Job.Name + ")") : character.Info.Name, null);
x += characterFrame.Rect.Width + 10;
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;