Human AI improvements, minor UI tweaking

This commit is contained in:
Regalis
2015-11-25 16:04:51 +02:00
parent c456fa3c90
commit 4b5126675c
42 changed files with 687 additions and 321 deletions

View File

@@ -98,7 +98,8 @@ namespace Barotrauma
name,
Color.Transparent, Color.White,
Alignment.Left, Alignment.Left,
null, frame);
null, frame, false);
textBlock.Font = GUI.SmallFont;
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
new GUIImage(new Rectangle(-10, -10, 0, 0), character.AnimController.Limbs[0].sprite, Alignment.Left, frame);

View File

@@ -52,6 +52,7 @@ namespace Barotrauma
CargoManager = new CargoManager();
endShiftButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End shift", Alignment.TopLeft, GUI.Style);
endShiftButton.Font = GUI.SmallFont;
endShiftButton.OnClicked = EndShift;
for (int i = 0; i < 3; i++)
@@ -142,14 +143,12 @@ namespace Barotrauma
if (Level.Loaded.AtEndPosition)
{
endShiftButton.Text = "Enter " + Map.SelectedLocation.Name;
endShiftButton.Font = GUI.SmallFont;
endShiftButton.Text = "Enter " + Map.SelectedLocation.Name;
endShiftButton.Draw(spriteBatch);
}
else if (Level.Loaded.AtStartPosition)
{
endShiftButton.Text = "Enter " + Map.CurrentLocation.Name;
endShiftButton.Font = GUI.SmallFont;
endShiftButton.Draw(spriteBatch);
}

View File

@@ -50,16 +50,10 @@ namespace Barotrauma
Character character = Character.Create(charInfo, wayPoint.SimPosition);
Character.Controlled = character;
character.GiveJobItems(null);
foreach (Item item in character.Inventory.items)
{
if (item == null || item.Name != "ID Card") continue;
item.AddTag("com");
item.AddTag("eng");
break;
}
var idCard = character.Inventory.FindItem("ID Card");
idCard.AddTag("com");
idCard.AddTag("eng");
CrewManager.AddCharacter(character);
@@ -495,7 +489,7 @@ namespace Barotrauma
do
{
var weldingTool = Character.Controlled.Inventory.items.FirstOrDefault(i => i != null && i.Name == "Welding Tool");
var weldingTool = Character.Controlled.Inventory.Items.FirstOrDefault(i => i != null && i.Name == "Welding Tool");
if (weldingTool != null &&
weldingTool.ContainedItems.FirstOrDefault(contained => contained != null && contained.Name == "Welding Fuel Tank") != null) break;
@@ -604,7 +598,7 @@ namespace Barotrauma
private bool HasItem(string itemName)
{
if (Character.Controlled == null) return false;
return Character.Controlled.Inventory.items.FirstOrDefault(i => i != null && i.Name == itemName)!=null;
return Character.Controlled.Inventory.Items.FirstOrDefault(i => i != null && i.Name == itemName)!=null;
}
/// <summary>