- wiring tool bugfixes

- new oxygen and welding fuel tank sprites
- more reliable method of checking that the sub can pass through the level
- moved the name of the highlighted item to the bottom of the screen
This commit is contained in:
Regalis
2016-03-11 19:12:07 +02:00
parent ad17b1a9bf
commit ae4e4d8f34
16 changed files with 40 additions and 55 deletions

View File

@@ -734,12 +734,7 @@
</Content>
<Content Include="Content\Items\idcard.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Tools\fueltank.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Tools\plasmacutter.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Items\Weapons\weapons.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -771,9 +766,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Items\Diving\oxygentank.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Electricity\poweritems.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
@@ -803,12 +795,6 @@
<Content Include="Content\Items\Weapons\rope.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Tools\screwdriver.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Tools\wrench.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\OxygenGenerator\vent.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -816,9 +802,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Items\Tools\weldingtool.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Weapons\stungrenade.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

View File

@@ -10,10 +10,10 @@
<Deconstruct time="10">
<Item name="Steel Bar"/>
</Deconstruct>
<Sprite texture ="oxygentank.png" depth="0.5"/>
<Body radius="6" height="22" density="5"/>
<Sprite texture ="Content/Items/Tools/tools.png" sourcerect="39,31,12,33" depth="0.5"/>
<Body width="12" height="33" density="5"/>
<Pickable holdpos="30,-15" handle1="0,1" slots="RightHand,LeftHand,Any">
<StatusEffect type="OnFire" target="This" Condition="-100.0" sound="Content/Items/Reactor/explosion.ogg" disabledeltatime="true">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -110,9 +110,9 @@
<Item name="Steel Bar"/>
</Deconstruct>
<Sprite texture ="fueltank.png" depth="0.5"/>
<Sprite texture ="tools.png" sourcerect="52,31,12,33" depth="0.5"/>
<Body radius="6" height="22" density="5"/>
<Body width="12" height="33" density="5"/>
<Holdable slots="RightHand,Any" holdpos="30,-15" handle1="0,5" handle2="0,-5">
<StatusEffect type="OnFire" target="This" Condition="-100.0" sound="Content/Items/Reactor/explosion.ogg" disabledeltatime="true">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

View File

@@ -377,6 +377,8 @@ namespace Barotrauma
public static Character Create(string file, Vector2 position, CharacterInfo characterInfo = null, bool isNetworkPlayer = false, bool hasAi=true)
{
if (!System.IO.File.Exists(file)) return null;
if (file != humanConfigFile)
{
var enemyCharacter = new AICharacter(file, position, characterInfo, isNetworkPlayer);

View File

@@ -9,7 +9,6 @@ namespace Barotrauma
{
class CharacterHUD
{
private static Sprite statusIcons;
private static Sprite noiseOverlay, damageOverlay;
@@ -22,7 +21,7 @@ namespace Barotrauma
{
healthBar.Flash();
damageOverlayTimer = MathHelper.Clamp(amount*0.1f, 0.2f, 5.0f);
damageOverlayTimer = MathHelper.Clamp(amount * 0.1f, 0.2f, 5.0f);
}
public static void Update(float deltaTime, Character character)
@@ -39,17 +38,17 @@ namespace Barotrauma
public static void Draw(SpriteBatch spriteBatch, Character character, Camera cam)
{
if (statusIcons==null)
if (statusIcons == null)
{
statusIcons = new Sprite("Content/UI/statusIcons.png", Vector2.Zero);
}
if (noiseOverlay==null)
if (noiseOverlay == null)
{
noiseOverlay = new Sprite("Content/UI/noise.png", Vector2.Zero);
noiseOverlay = new Sprite("Content/UI/noise.png", Vector2.Zero);
}
if (damageOverlay==null)
if (damageOverlay == null)
{
damageOverlay = new Sprite("Content/UI/damageOverlay.png", Vector2.Zero);
}
@@ -71,26 +70,26 @@ namespace Barotrauma
Vector2 textPos = startPos;
textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestCharacter.Info.Name).X / 2, 20);
GUI.DrawString(spriteBatch, textPos, character.ClosestCharacter.Info.Name, Color.Orange, Color.Black, 2);
GUI.DrawString(spriteBatch, textPos, character.ClosestCharacter.Info.Name, Color.White, Color.Black, 2);
}
else if (character.SelectedCharacter == null && character.ClosestItem != null && character.SelectedConstruction == null)
{
var hudTexts = character.ClosestItem.GetHUDTexts(character);
Vector2 startPos = character.DrawPosition + (character.ClosestItem.DrawPosition - character.DrawPosition) * 0.7f;
startPos = cam.WorldToScreen(startPos);
Vector2 startPos = new Vector2((int)(GameMain.GraphicsWidth / 2.0f), (int)(GameMain.GraphicsHeight));
startPos.Y -= 50 + hudTexts.Count * 25;
Vector2 textPos = startPos;
textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestItem.Name).X / 2, 20);
textPos -= new Vector2((int)GUI.Font.MeasureString(character.ClosestItem.Name).X / 2, 20);
GUI.DrawString(spriteBatch, textPos, character.ClosestItem.Name, Color.Orange, Color.Black * 0.7f, 2);
textPos.Y += 50.0f;
foreach (ColoredText coloredText in character.ClosestItem.GetHUDTexts(character))
GUI.DrawString(spriteBatch, textPos, character.ClosestItem.Name, Color.White, Color.Black * 0.7f, 2);
textPos.Y += 30.0f;
foreach (ColoredText coloredText in hudTexts)
{
textPos.X = startPos.X - GUI.Font.MeasureString(coloredText.Text).X / 2;
textPos.X = (int)(startPos.X - GUI.SmallFont.MeasureString(coloredText.Text).X / 2);
GUI.DrawString(spriteBatch, textPos, coloredText.Text, coloredText.Color, Color.Black*0.7f, 2);
GUI.DrawString(spriteBatch, textPos, coloredText.Text, coloredText.Color, Color.Black*0.7f, 2, GUI.SmallFont);
textPos.Y += 25;
}

View File

@@ -219,10 +219,6 @@ namespace Barotrauma
if (spawnedCharacter != null && GameMain.Server != null) GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter);
break;
//case "startserver":
// if (Game1.Server==null)
// Game1.NetworkMember = new GameServer();
// break;
case "kick":
if (GameMain.Server == null) break;
GameMain.Server.KickPlayer(commands[1]);

View File

@@ -164,6 +164,9 @@ namespace Barotrauma.Items.Components
case "set_state":
IsActive = (signal != "0");
break;
case "set_color":
LightColor = signal;
break;
}
}
}

View File

@@ -162,7 +162,7 @@ namespace Barotrauma
backgroundColor = new Color(backgroundColor, 1.0f);
float minWidth = Submarine.Loaded == null ? 0.0f : Math.Max(Submarine.Borders.Width, Submarine.Borders.Height);
minWidth = Math.Max(minWidth, 3500.0f);
minWidth = Math.Max(minWidth, 6500.0f);
startPosition = new Vector2((int)minWidth * 2, Rand.Range((int)minWidth * 2, borders.Height - (int)minWidth * 2, false));
endPosition = new Vector2(borders.Width - (int)minWidth * 2, Rand.Range((int)minWidth * 2, borders.Height - (int)minWidth * 2, false));
@@ -628,12 +628,11 @@ namespace Barotrauma
if (tooClose && !tooCloseCells.Contains(cell)) tooCloseCells.Add(cell);
}
for (int x = -1; x <= 1; x++)
for (float x = -minDistance; x <= minDistance; x+=siteInterval)
{
for (int y = -1; y <= 1; y++)
for (float y = -minDistance; y <= minDistance; y += siteInterval)
{
if (x == 0 && y == 0) continue;
Vector2 cornerPos = position + new Vector2(x * minDistance, y * minDistance);
Vector2 cornerPos = position + new Vector2(x,y);
int cellIndex = FindCellIndex(cornerPos);
if (cellIndex == -1) continue;

View File

@@ -516,8 +516,9 @@ namespace Barotrauma
{
if (dummyCharacter == null) return false;
//if the same type of wire has already been selected, deselect it and return
Item existingWire = dummyCharacter.SelectedItems.FirstOrDefault(i => i != null && i.Prefab == userData as ItemPrefab);
if (existingWire!=null)
if (existingWire != null)
{
existingWire.Drop();
existingWire.Remove();
@@ -526,12 +527,14 @@ namespace Barotrauma
var wire = new Item(userData as ItemPrefab, Vector2.Zero, null);
int slotIndex = dummyCharacter.Inventory.FindLimbSlot(LimbSlot.LeftHand);
if (dummyCharacter.Inventory.Items[slotIndex] != null && dummyCharacter.Inventory.Items[slotIndex].Prefab != userData as ItemPrefab)
//if there's some other type of wire in the inventory, remove it
existingWire = dummyCharacter.Inventory.Items[slotIndex];
if (existingWire != null && existingWire.Prefab != userData as ItemPrefab)
{
dummyCharacter.Inventory.Items[slotIndex].Drop();
dummyCharacter.Inventory.Items[slotIndex].Remove();
existingWire.Drop();
existingWire.Remove();
}
dummyCharacter.Inventory.TryPutItem(wire, slotIndex, false, false);
@@ -663,7 +666,7 @@ namespace Barotrauma
if (wiringMode)
{
if (!dummyCharacter.SelectedItems.Any(it => it.HasTag("Wire")))
if (!dummyCharacter.SelectedItems.Any(it => it != null && it.HasTag("Wire")))
{
wiringToolPanel.GetChild<GUIListBox>().Deselect();
}