- emergency siren and alarm buzzer items
- wires and alarm buzzers can be fabricated - fixed items selecting constructions outside the hulls - ItemLabel.TextColor works now - removed a random dot at the corner of head5.png - inventory is visible in wiring mode - fixed null reference exceptions in AIObjectiveGoto and Holdable
This commit is contained in:
@@ -1036,6 +1036,12 @@
|
|||||||
<None Include="Content\Items\Tools\weldingTool.ogg">
|
<None Include="Content\Items\Tools\weldingTool.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="Content\Items\warningBeep.ogg">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="Content\Items\warningSiren.ogg">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="Content\Items\Weapons\harpoon1.ogg">
|
<None Include="Content\Items\Weapons\harpoon1.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 12 KiB |
@@ -222,6 +222,11 @@
|
|||||||
|
|
||||||
<RelayComponent canbeselected = "true"/>
|
<RelayComponent canbeselected = "true"/>
|
||||||
|
|
||||||
|
<fixrequirement name="Reset fuse">
|
||||||
|
<skill name="Electrical Engineering" level="30"/>
|
||||||
|
<item name="Screwdriver"/>
|
||||||
|
</fixrequirement>
|
||||||
|
|
||||||
<Body width="16" height="16" density="30"/>
|
<Body width="16" height="16" density="30"/>
|
||||||
|
|
||||||
<Holdable selectkey="Action" slots="Any,RightHand,LeftHand" msg="Detach [Wrench]" PickingTime="5.0"
|
<Holdable selectkey="Action" slots="Any,RightHand,LeftHand" msg="Detach [Wrench]" PickingTime="5.0"
|
||||||
@@ -470,5 +475,71 @@
|
|||||||
</ConnectionPanel>
|
</ConnectionPanel>
|
||||||
</Item>
|
</Item>
|
||||||
|
|
||||||
|
<Item
|
||||||
|
name="Emergency Siren"
|
||||||
|
category="Electrical"
|
||||||
|
Tags="smallitem"
|
||||||
|
pickdistance="150"
|
||||||
|
linkable="true"
|
||||||
|
price="10">
|
||||||
|
|
||||||
|
<Deconstruct time="10">
|
||||||
|
<Item name="Steel Bar"/>
|
||||||
|
<Item name="FPGA Circuit"/>
|
||||||
|
</Deconstruct>
|
||||||
|
|
||||||
|
<Sprite texture="signalcomp.png" depth="0.8" sourcerect="32,32,32,32"/>
|
||||||
|
|
||||||
|
<Body width="32" height="30" density="30"/>
|
||||||
|
|
||||||
|
<Holdable selectkey="Action" slots="Any,RightHand,LeftHand" msg="Detach [Wrench]" PickingTime="5.0"
|
||||||
|
aimpos="35,-10" handle1="0,0" attachable="true" aimable="true">
|
||||||
|
<requireditem name="Wrench" type="Equipped"/>
|
||||||
|
</Holdable>
|
||||||
|
|
||||||
|
<ItemComponent>
|
||||||
|
<sound file="Content/Items/warningSiren.ogg" type="OnActive" range="2000.0" loop="true"/>
|
||||||
|
</ItemComponent>
|
||||||
|
|
||||||
|
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||||
|
<requireditem name="Screwdriver,Wire" type="Equipped"/>
|
||||||
|
<input name="toggle"/>
|
||||||
|
<input name="set_state"/>
|
||||||
|
</ConnectionPanel>
|
||||||
|
</Item>
|
||||||
|
|
||||||
|
<Item
|
||||||
|
name="Alarm Buzzer"
|
||||||
|
category="Electrical"
|
||||||
|
Tags="smallitem"
|
||||||
|
pickdistance="150"
|
||||||
|
linkable="true"
|
||||||
|
price="10">
|
||||||
|
|
||||||
|
<Deconstruct time="10">
|
||||||
|
<Item name="Steel Bar"/>
|
||||||
|
<Item name="FPGA Circuit"/>
|
||||||
|
</Deconstruct>
|
||||||
|
|
||||||
|
<Sprite texture="signalcomp.png" depth="0.8" sourcerect="64,32,23,16"/>
|
||||||
|
|
||||||
|
<Body width="20" height="16" density="20"/>
|
||||||
|
|
||||||
|
<Holdable selectkey="Action" slots="Any,RightHand,LeftHand" msg="Detach [Wrench]" PickingTime="5.0"
|
||||||
|
aimpos="35,-10" handle1="0,0" attachable="true" aimable="true">
|
||||||
|
<requireditem name="Wrench" type="Equipped"/>
|
||||||
|
</Holdable>
|
||||||
|
|
||||||
|
<ItemComponent>
|
||||||
|
<sound file="Content/Items/warningBeep.ogg" type="OnActive" range="1000.0" loop="true"/>
|
||||||
|
</ItemComponent>
|
||||||
|
|
||||||
|
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||||
|
<requireditem name="Screwdriver,Wire" type="Equipped"/>
|
||||||
|
<input name="toggle"/>
|
||||||
|
<input name="set_state"/>
|
||||||
|
</ConnectionPanel>
|
||||||
|
</Item>
|
||||||
|
|
||||||
</Items>
|
</Items>
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
<fabricableitem name="Railgun Shell" requireditems="Steel Bar, Steel Bar, Polycarbonate Bar" requiredtime="20"/>
|
<fabricableitem name="Railgun Shell" requireditems="Steel Bar, Steel Bar, Polycarbonate Bar" requiredtime="20"/>
|
||||||
<fabricableitem name="Nuclear Shell" requireditems="Steel Bar, Steel Bar, Uranium Bar, Polycarbonate Bar" requiredtime="30"/>
|
<fabricableitem name="Nuclear Shell" requireditems="Steel Bar, Steel Bar, Uranium Bar, Polycarbonate Bar" requiredtime="30"/>
|
||||||
|
|
||||||
|
<fabricableitem name="Wire" requireditems="Copper" requiredtime="5"/>
|
||||||
|
|
||||||
<fabricableitem name="Button" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
<fabricableitem name="Button" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
||||||
<fabricableitem name="And Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
<fabricableitem name="And Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
||||||
<fabricableitem name="Or Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
<fabricableitem name="Or Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
||||||
@@ -35,6 +37,8 @@
|
|||||||
<fabricableitem name="RegEx Find Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
<fabricableitem name="RegEx Find Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
||||||
<fabricableitem name="Wifi Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
<fabricableitem name="Wifi Component" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
||||||
|
|
||||||
|
<fabricableitem name="Alarm Buzzer" requireditems="Steel Bar, FPGA Circuit" requiredtime="10"/>
|
||||||
|
|
||||||
<fabricableitem name="Underwater Scooter" requireditems="Steel Bar, Polycarbonate Bar, Polycarbonate Bar, FPGA Circuit" requiredtime="30"/>
|
<fabricableitem name="Underwater Scooter" requireditems="Steel Bar, Polycarbonate Bar, Polycarbonate Bar, FPGA Circuit" requiredtime="30"/>
|
||||||
|
|
||||||
<fabricableitem name="Fulgurium Battery Cell" requireditems="Steel Bar, Fulgurium Bar, FPGA Circuit" requiredtime="10"/>
|
<fabricableitem name="Fulgurium Battery Cell" requireditems="Steel Bar, Fulgurium Bar, FPGA Circuit" requiredtime="10"/>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -104,7 +104,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
var indoorsSteering = character.AIController.SteeringManager as IndoorsSteeringManager;
|
var indoorsSteering = character.AIController.SteeringManager as IndoorsSteeringManager;
|
||||||
|
|
||||||
if (indoorsSteering.CurrentPath.Unreachable)
|
if (indoorsSteering.CurrentPath==null || indoorsSteering.CurrentPath.Unreachable)
|
||||||
{
|
{
|
||||||
indoorsSteering.SteeringWander();
|
indoorsSteering.SteeringWander();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -756,7 +756,7 @@ namespace Barotrauma
|
|||||||
if (torso == null) return null;
|
if (torso == null) return null;
|
||||||
|
|
||||||
Vector2 pos = (torso.body.TargetPosition != Vector2.Zero) ? torso.body.TargetPosition : torso.SimPosition;
|
Vector2 pos = (torso.body.TargetPosition != Vector2.Zero) ? torso.body.TargetPosition : torso.SimPosition;
|
||||||
Vector2 pickPos = selectedConstruction == null ? mouseSimPos : selectedConstruction.SimPosition;
|
Vector2 pickPos = selectedConstruction == null ? mouseSimPos : ConvertUnits.ToSimUnits(selectedConstruction.WorldPosition);
|
||||||
|
|
||||||
if (Submarine != null)
|
if (Submarine != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public override void Update(float deltaTime, Camera cam)
|
public override void Update(float deltaTime, Camera cam)
|
||||||
{
|
{
|
||||||
if (!item.body.Enabled) return;
|
if (item.body==null || !item.body.Enabled) return;
|
||||||
if (!picker.HasSelectedItem(item)) IsActive = false;
|
if (!picker.HasSelectedItem(item)) IsActive = false;
|
||||||
|
|
||||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, picker);
|
ApplyStatusEffects(ActionType.OnActive, deltaTime, picker);
|
||||||
|
|||||||
@@ -265,7 +265,15 @@ namespace Barotrauma.Items.Components
|
|||||||
break;
|
break;
|
||||||
case "sound":
|
case "sound":
|
||||||
string filePath = ToolBox.GetAttributeString(subElement, "file", "");
|
string filePath = ToolBox.GetAttributeString(subElement, "file", "");
|
||||||
if (filePath=="") continue;
|
|
||||||
|
if (filePath == "") filePath = ToolBox.GetAttributeString(subElement, "sound", "");
|
||||||
|
|
||||||
|
if (filePath == "")
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError("Error when instantiating item ''"+item.Name+"'' - sound with no file path set");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!filePath.Contains("/") && !filePath.Contains("\\") && !filePath.Contains(Path.DirectorySeparatorChar))
|
if (!filePath.Contains("/") && !filePath.Contains("\\") && !filePath.Contains(Path.DirectorySeparatorChar))
|
||||||
{
|
{
|
||||||
filePath = Path.Combine(Path.GetDirectoryName(item.Prefab.ConfigFile), filePath);
|
filePath = Path.Combine(Path.GetDirectoryName(item.Prefab.ConfigFile), filePath);
|
||||||
@@ -448,11 +456,6 @@ namespace Barotrauma.Items.Components
|
|||||||
//called then the item is dropped or dragged out of a "limbslot"
|
//called then the item is dropped or dragged out of a "limbslot"
|
||||||
public virtual void Unequip(Character character) { }
|
public virtual void Unequip(Character character) { }
|
||||||
|
|
||||||
public virtual bool UseOtherItem(Item item)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void ReceiveSignal(string signal, Connection connection, Item sender, float power = 0.0f)
|
public virtual void ReceiveSignal(string signal, Connection connection, Item sender, float power = 0.0f)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -462,6 +465,13 @@ namespace Barotrauma.Items.Components
|
|||||||
case "use":
|
case "use":
|
||||||
item.Use(1.0f);
|
item.Use(1.0f);
|
||||||
break;
|
break;
|
||||||
|
case "toggle":
|
||||||
|
IsActive = !isActive;
|
||||||
|
break;
|
||||||
|
case "set_active":
|
||||||
|
case "set_state":
|
||||||
|
IsActive = signal != "0";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace Barotrauma.Items.Components
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
textColor = new Color(ToolBox.ParseToVector4(value));
|
textColor = new Color(ToolBox.ParseToVector4(value));
|
||||||
|
if (textBlock != null) textBlock.TextColor = textColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,10 +34,10 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (textBlock==null)
|
if (textBlock == null)
|
||||||
{
|
{
|
||||||
textBlock = new GUITextBlock(new Rectangle(item.Rect.X,-item.Rect.Y,item.Rect.Width, item.Rect.Height), "",
|
textBlock = new GUITextBlock(new Rectangle(item.Rect.X,-item.Rect.Y,item.Rect.Width, item.Rect.Height), "",
|
||||||
Color.Transparent, Color.Black,
|
Color.Transparent, textColor,
|
||||||
Alignment.TopLeft, Alignment.Center,
|
Alignment.TopLeft, Alignment.Center,
|
||||||
null, null, true);
|
null, null, true);
|
||||||
textBlock.Font = GUI.SmallFont;
|
textBlock.Font = GUI.SmallFont;
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
for (int i = 0; i<dummyCharacter.Inventory.SlotPositions.Length; i++)
|
for (int i = 0; i<dummyCharacter.Inventory.SlotPositions.Length; i++)
|
||||||
{
|
{
|
||||||
dummyCharacter.Inventory.SlotPositions[i].X += leftPanel.Rect.Width+10;
|
dummyCharacter.Inventory.SlotPositions[i].X += false ? -1000 : leftPanel.Rect.Width+10;
|
||||||
}
|
}
|
||||||
|
|
||||||
Character.Controlled = dummyCharacter;
|
Character.Controlled = dummyCharacter;
|
||||||
@@ -436,23 +436,16 @@ namespace Barotrauma
|
|||||||
characterMode = !characterMode;
|
characterMode = !characterMode;
|
||||||
//button.Color = (characterMode) ? Color.Gold : Color.White;
|
//button.Color = (characterMode) ? Color.Gold : Color.White;
|
||||||
|
|
||||||
|
wiringMode = false;
|
||||||
|
|
||||||
if (characterMode)
|
if (characterMode)
|
||||||
{
|
{
|
||||||
if (wiringMode) ToggleWiringMode();
|
|
||||||
|
|
||||||
CreateDummyCharacter();
|
CreateDummyCharacter();
|
||||||
}
|
}
|
||||||
else if (dummyCharacter != null)
|
else if (dummyCharacter != null)
|
||||||
{
|
{
|
||||||
foreach (Item item in dummyCharacter.Inventory.Items)
|
RemoveDummyCharacter();
|
||||||
{
|
|
||||||
if (item == null) continue;
|
|
||||||
|
|
||||||
item.Remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
dummyCharacter.Remove();
|
|
||||||
dummyCharacter = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (MapEntity me in MapEntity.mapEntityList)
|
foreach (MapEntity me in MapEntity.mapEntityList)
|
||||||
@@ -473,22 +466,45 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
wiringMode = !wiringMode;
|
wiringMode = !wiringMode;
|
||||||
|
|
||||||
if (characterMode != wiringMode) ToggleCharacterMode();
|
characterMode = false;
|
||||||
|
|
||||||
|
|
||||||
if (wiringMode)
|
if (wiringMode)
|
||||||
{
|
{
|
||||||
|
CreateDummyCharacter();
|
||||||
|
|
||||||
var screwdriverPrefab = ItemPrefab.list.Find(ip => ip.Name == "Screwdriver") as ItemPrefab;
|
var screwdriverPrefab = ItemPrefab.list.Find(ip => ip.Name == "Screwdriver") as ItemPrefab;
|
||||||
|
|
||||||
var item = new Item(screwdriverPrefab, Vector2.Zero, null);
|
var item = new Item(screwdriverPrefab, Vector2.Zero, null);
|
||||||
|
|
||||||
dummyCharacter.Inventory.TryPutItem(item, new List<LimbSlot>() { LimbSlot.RightHand }, false);
|
dummyCharacter.Inventory.TryPutItem(item, new List<LimbSlot>() {LimbSlot.RightHand}, false);
|
||||||
|
|
||||||
wiringToolPanel = CreateWiringPanel();
|
wiringToolPanel = CreateWiringPanel();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RemoveDummyCharacter();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RemoveDummyCharacter()
|
||||||
|
{
|
||||||
|
if (dummyCharacter == null) return;
|
||||||
|
|
||||||
|
foreach (Item item in dummyCharacter.Inventory.Items)
|
||||||
|
{
|
||||||
|
if (item == null) continue;
|
||||||
|
|
||||||
|
item.Remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
dummyCharacter.Remove();
|
||||||
|
dummyCharacter = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private GUIFrame CreateWiringPanel()
|
private GUIFrame CreateWiringPanel()
|
||||||
{
|
{
|
||||||
GUIFrame frame = new GUIFrame(new Rectangle(0,0,50,300), null, Alignment.Right | Alignment.CenterY, GUI.Style);
|
GUIFrame frame = new GUIFrame(new Rectangle(0,0,50,300), null, Alignment.Right | Alignment.CenterY, GUI.Style);
|
||||||
@@ -627,7 +643,7 @@ namespace Barotrauma
|
|||||||
//cam.Zoom = MathHelper.Clamp(cam.Zoom + (PlayerInput.ScrollWheelSpeed / 1000.0f)*cam.Zoom, 0.1f, 2.0f);
|
//cam.Zoom = MathHelper.Clamp(cam.Zoom + (PlayerInput.ScrollWheelSpeed / 1000.0f)*cam.Zoom, 0.1f, 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (characterMode)
|
if (characterMode || wiringMode)
|
||||||
{
|
{
|
||||||
if (dummyCharacter == null || Entity.FindEntityByID(dummyCharacter.ID) != dummyCharacter)
|
if (dummyCharacter == null || Entity.FindEntityByID(dummyCharacter.ID) != dummyCharacter)
|
||||||
{
|
{
|
||||||
@@ -709,7 +725,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
Submarine.Draw(spriteBatch, true);
|
Submarine.Draw(spriteBatch, true);
|
||||||
|
|
||||||
if (!characterMode)
|
if (!characterMode && !wiringMode)
|
||||||
{
|
{
|
||||||
if (MapEntityPrefab.Selected != null) MapEntityPrefab.Selected.UpdatePlacing(spriteBatch, cam);
|
if (MapEntityPrefab.Selected != null) MapEntityPrefab.Selected.UpdatePlacing(spriteBatch, cam);
|
||||||
|
|
||||||
@@ -728,7 +744,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
//EntityPrefab.DrawList(spriteBatch, new Vector2(20,50));
|
//EntityPrefab.DrawList(spriteBatch, new Vector2(20,50));
|
||||||
|
|
||||||
if (characterMode && dummyCharacter != null)
|
if ((characterMode || wiringMode) && dummyCharacter != null)
|
||||||
{
|
{
|
||||||
dummyCharacter.AnimController.FindHull(dummyCharacter.CursorWorldPosition, false);
|
dummyCharacter.AnimController.FindHull(dummyCharacter.CursorWorldPosition, false);
|
||||||
|
|
||||||
@@ -747,14 +763,9 @@ namespace Barotrauma
|
|||||||
if (PlayerInput.KeyHit(InputType.Select) && dummyCharacter.ClosestItem != dummyCharacter.SelectedConstruction) dummyCharacter.SelectedConstruction = null;
|
if (PlayerInput.KeyHit(InputType.Select) && dummyCharacter.ClosestItem != dummyCharacter.SelectedConstruction) dummyCharacter.SelectedConstruction = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wiringMode)
|
dummyCharacter.DrawHUD(spriteBatch, cam);
|
||||||
{
|
|
||||||
dummyCharacter.DrawHUD(spriteBatch, cam);
|
if (wiringMode) wiringToolPanel.Draw(spriteBatch);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wiringToolPanel.Draw(spriteBatch);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user