Picking items from outside the sub, replcaed fabricator.png with separate sprites for each machine, descriptions moved from itemprefab to the mapentityprefab base class, editortutorial progress
This commit is contained in:
@@ -103,6 +103,7 @@
|
||||
<Compile Include="Source\GameSession\GameModes\GameModePreset.cs" />
|
||||
<Compile Include="Source\GameSession\GameModes\QuestMode.cs" />
|
||||
<Compile Include="Source\GameSession\GameModes\Tutorials\BasicTutorial.cs" />
|
||||
<Compile Include="Source\GameSession\GameModes\Tutorials\EditorTutorial.cs" />
|
||||
<Compile Include="Source\GameSession\GameModes\Tutorials\TutorialType.cs" />
|
||||
<Compile Include="Source\GameSession\GameModes\Tutorials\TutorialMode.cs" />
|
||||
<Compile Include="Source\GameSession\InfoTextManager.cs" />
|
||||
@@ -457,6 +458,9 @@
|
||||
<Content Include="Content\Items\itemlabel.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\machines.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\Medical\medical.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -464,9 +468,6 @@
|
||||
<Content Include="Content\Items\Medical\med.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\MiniMap\fabricator.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\OxygenGenerator\oxygengenerator.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -537,18 +538,12 @@
|
||||
<Content Include="Content\Items\Engine\engine.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\Engine\fabricator.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\Engine\pingCircle.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\Engine\radarOverlay.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\Fabricators\fabricator.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Items\Fabricators\fabricators.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -11,16 +11,16 @@
|
||||
thightorque="-5.0">
|
||||
|
||||
<!-- head -->
|
||||
<limb id = "0" radius="13" mass = "6" type="Head" attackpriority="2" impacttolerance="4.0">
|
||||
<limb id = "0" radius="13" mass = "6" type="Head" attackpriority="2" impacttolerance="5.0">
|
||||
<sprite texture="Content/Characters/Human/[GENDER]head[HEADID].png" sourcerect="1,1,37,38" depth="0.04" origin="0.5,0.5"/>
|
||||
<damagedsprite texture="Content/Characters/Human/damagedhead.png" sourcerect="1,1,37,38" origin="0.5,0.5"/>
|
||||
</limb>
|
||||
<!-- body -->
|
||||
<limb id = "1" radius="14" height="21" mass = "20" type="Torso" attackpriority="3" impacttolerance="6.0">
|
||||
<limb id = "1" radius="14" height="21" mass = "20" type="Torso" attackpriority="3" impacttolerance="10.0">
|
||||
<sprite texture="Content/Characters/Human/[GENDER]torso.png" sourcerect="0,0,29,58" depth="0.05" origin="0.5,0.6"/>
|
||||
<damagedsprite texture="Content/Characters/Human/damagedtorso.png" sourcerect="0,0,29,58" origin="0.5,0.6"/>
|
||||
</limb>
|
||||
<limb id = "12" radius="13" mass = "20" type="Waist" impacttolerance="6.0">
|
||||
<limb id = "12" radius="13" mass = "20" type="Waist" impacttolerance="10.0">
|
||||
<sprite texture="Content/Characters/Human/[GENDER]legs.png" sourcerect="0,0,32,29" depth="0.045" origin="0.5,0.5"/>
|
||||
<damagedsprite texture="Content/Characters/Human/damagedlegs.png" sourcerect="0,0,32,29" origin="0.5,0.5"/>
|
||||
</limb>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
<input name="set_state"/>
|
||||
<output name="state_out"/>
|
||||
</ConnectionPanel>
|
||||
|
||||
</Item>
|
||||
|
||||
<Item
|
||||
@@ -54,6 +53,5 @@
|
||||
<input name="set_state"/>
|
||||
<output name="state_out"/>
|
||||
</ConnectionPanel>
|
||||
|
||||
</Item>
|
||||
</Items>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 8.1 KiB |
@@ -100,7 +100,7 @@
|
||||
|
||||
<Body width="16" height="16"/>
|
||||
|
||||
<Holdable selectkey="Action" slots="Any,RightHand,LeftHand"/>
|
||||
<Holdable slots="Any,RightHand,LeftHand"/>
|
||||
</Item>
|
||||
|
||||
<Item
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
category="Machine"
|
||||
pickdistance="150">
|
||||
|
||||
<Sprite texture ="fabricator.png" depth="0.8"/>
|
||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="0,0,64,128"/>
|
||||
|
||||
<Steering minvoltage="0.5" canbeselected = "true">
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
@@ -54,8 +54,8 @@
|
||||
linkable="true"
|
||||
category="Machine"
|
||||
pickdistance="150">
|
||||
|
||||
<Sprite texture ="fabricator.png" depth="0.8"/>
|
||||
|
||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/>
|
||||
|
||||
<Radar canbeselected = "true" powerconsumption="100">
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB |
@@ -6,8 +6,8 @@
|
||||
pickdistance="150"
|
||||
category="Machine"
|
||||
description="A machine capable of manufacturing a wide range of items out of basic raw materials.">
|
||||
|
||||
<Sprite texture ="fabricator.png" depth="0.8"/>
|
||||
|
||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="0,128,64,128"/>
|
||||
|
||||
<Fabricator canbeselected = "true">
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
pickdistance="150"
|
||||
category="Machine"
|
||||
description="Disassembles and breaks down items to reusable components and material bars.">
|
||||
|
||||
<Sprite texture ="fabricator.png" depth="0.8"/>
|
||||
|
||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,128,64,128"/>
|
||||
|
||||
<Deconstructor canbeselected = "true">
|
||||
<sound file="deconstructor.ogg" type="OnActive" range="1000.0" loop="true"/>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
@@ -2,8 +2,8 @@
|
||||
name="MiniMap"
|
||||
category="Machine"
|
||||
linkable="true">
|
||||
|
||||
<Sprite texture ="fabricator.png" depth="0.8"/>
|
||||
|
||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/>
|
||||
|
||||
<trigger/>
|
||||
|
||||
|
||||
BIN
Subsurface/Content/Items/machines.png
Normal file
BIN
Subsurface/Content/Items/machines.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -1,18 +1,24 @@
|
||||
<prefabs>
|
||||
<largehorizontalback sprite="Content/Map/testroom.png" sourcerect="0,0,896,64" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "128" height ="64" resizehorizontal="true"/>
|
||||
|
||||
<smallhorizontalback sprite="Content/Map/testroom.png" sourcerect="0,64,896,32" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "128" height ="32" resizehorizontal="true"/>
|
||||
|
||||
<largeverticalback sprite="Content/Map/testroom.png" sourcerect="0,96,64,448" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "64" height ="128" resizevertical="true"/>
|
||||
<largeverticalback2 sprite="Content/Map/testroom.png" sourcerect="64,96,64,448" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "64" height ="128" resizevertical="true"/>
|
||||
|
||||
<smallverticalback sprite="Content/Map/testroom.png" sourcerect="128,96,32,352" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "32" height ="128" resizevertical="true"/>
|
||||
<smallverticalback2 sprite="Content/Map/testroom.png" sourcerect="160,96,32,352" depth ="0.9"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "32" height ="128" resizevertical="true"/>
|
||||
|
||||
<engineeringLabel sprite="Content/Map/testroom.png" sourcerect="464,336,153,16" depth ="0.99"
|
||||
@@ -40,12 +46,15 @@
|
||||
width = "16" height ="16"/>
|
||||
|
||||
<leftwall sprite="Content/Map/testroom.png" sourcerect="688,368,32,496" depth ="0.05" castshadow="true"
|
||||
description="A vertical wall with collision detection"
|
||||
width = "32" height ="64" resizevertical="true" fliphorizontal="true" body="true" health="500"/>
|
||||
|
||||
<rightwall sprite="Content/Map/testroom.png" sourcerect="688,368,32,496" depth ="0.05" castshadow="true"
|
||||
description="A vertical wall with collision detection"
|
||||
width = "32" height ="64" resizevertical="true" body="true" health="500"/>
|
||||
|
||||
<topwall sprite="Content/Map/testroom.png" sourcerect="144,464,496,32" depth ="0.06" castshadow="true"
|
||||
description="A horizontal wall with collision detection"
|
||||
width = "64" height ="32" resizehorizontal="true" body="true" health="500"/>
|
||||
|
||||
<topwindow sprite="Content/Map/testroom.png" sourcerect="208,352,128,80" depth ="0.05"
|
||||
@@ -61,9 +70,10 @@
|
||||
width = "64" height ="128" body="true" health="100" resizevertical="true"/>
|
||||
|
||||
<smallhorizontalback sprite="Content/Map/testroom.png" sourcerect="0,65,896,32" depth ="0.4"
|
||||
description="A decorative structure with no collision detection"
|
||||
width = "128" height ="32" resizehorizontal="true"/>
|
||||
|
||||
<largeplatform sprite="Content/Map/testroom.png" sourcerect="896,0,128,64" depth ="0.9"
|
||||
<largeplatform sprite="Content/Map/testroom.png" sourcerect="896,0,128,64" depth="0.9"
|
||||
width = "64" height ="64" resizehorizontal="true" body="true" platform="true"/>
|
||||
|
||||
<platform sprite="Content/Map/testroom.png" sourcerect="896,64,128,32" depth ="0.9"
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace Barotrauma
|
||||
|
||||
foreach (Controller controller in buttons)
|
||||
{
|
||||
if (Vector2.Distance(controller.Item.SimPosition, character.SimPosition) > controller.Item.PickDistance * 2.0f) continue;
|
||||
if (Vector2.Distance(controller.Item.Position, character.Position) > controller.Item.PickDistance * 2.0f) continue;
|
||||
|
||||
controller.Item.Pick(character, false, true);
|
||||
break;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Vector2.Distance(character.SimPosition, container.Item.SimPosition) > container.Item.PickDistance
|
||||
if (Vector2.Distance(character.Position, container.Item.Position) > container.Item.PickDistance
|
||||
&& !container.Item.IsInsideTrigger(character.Position))
|
||||
{
|
||||
AddSubObjective(new AIObjectiveGoTo(container.Item, character));
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (targetItem != null)
|
||||
{
|
||||
if (Vector2.Distance(character.SimPosition, targetItem.SimPosition) < targetItem.PickDistance)
|
||||
if (Vector2.Distance(character.Position, targetItem.Position) < targetItem.PickDistance)
|
||||
{
|
||||
int targetSlot = -1;
|
||||
if (equip)
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace Barotrauma
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
allowedDistance = Math.Max(item.PickDistance, allowedDistance);
|
||||
allowedDistance = Math.Max(ConvertUnits.ToSimUnits(item.PickDistance), allowedDistance);
|
||||
if (item.IsInsideTrigger(character.WorldPosition)) completed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (component.CanBeSelected)
|
||||
{
|
||||
if (Vector2.Distance(character.SimPosition, component.Item.SimPosition) < component.Item.PickDistance
|
||||
if (Vector2.Distance(character.Position, component.Item.Position) < component.Item.PickDistance
|
||||
|| component.Item.IsInsideTrigger(character.WorldPosition))
|
||||
{
|
||||
if (character.SelectedConstruction != component.Item && component.CanBeSelected)
|
||||
|
||||
@@ -383,7 +383,7 @@ namespace Barotrauma
|
||||
|
||||
avgVelocity = avgVelocity / Limbs.Count();
|
||||
|
||||
float impact = Vector2.Dot((f1.Body.LinearVelocity + avgVelocity) / 2.0f, -normal);
|
||||
float impact = Vector2.Dot(avgVelocity, -normal);
|
||||
|
||||
if (GameMain.Server != null) impact = impact / 2.0f;
|
||||
|
||||
|
||||
@@ -676,8 +676,15 @@ namespace Barotrauma
|
||||
if (torso == null) return null;
|
||||
|
||||
Vector2 pos = (torso.body.TargetPosition != Vector2.Zero) ? torso.body.TargetPosition : torso.SimPosition;
|
||||
Vector2 pickPos = selectedConstruction == null ? mouseSimPos : selectedConstruction.SimPosition;
|
||||
|
||||
return Item.FindPickable(pos, selectedConstruction == null ? mouseSimPos : selectedConstruction.SimPosition, AnimController.CurrentHull, selectedItems);
|
||||
if (Submarine != null)
|
||||
{
|
||||
pos += Submarine.SimPosition;
|
||||
pickPos += Submarine.SimPosition;
|
||||
}
|
||||
|
||||
return Item.FindPickable(pos, pickPos, AnimController.CurrentHull, selectedItems);
|
||||
}
|
||||
|
||||
private Character FindClosestCharacter(Vector2 mouseSimPos, float maxDist = 150.0f)
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace Barotrauma
|
||||
body.CollidesWith = Physics.CollisionAll & ~Physics.CollisionCharacter & ~Physics.CollisionMisc;
|
||||
}
|
||||
|
||||
impactTolerance = ToolBox.GetAttributeFloat(element, "impacttolerance", character.IsHumanoid ? 15.0f : 50.0f);
|
||||
impactTolerance = ToolBox.GetAttributeFloat(element, "impacttolerance", character.IsHumanoid ? 10.0f : 50.0f);
|
||||
|
||||
body.UserData = this;
|
||||
|
||||
|
||||
@@ -340,6 +340,12 @@ namespace Barotrauma
|
||||
break;
|
||||
case "tutorial":
|
||||
TutorialMode.StartTutorial(Tutorials.TutorialType.TutorialTypes[0]);
|
||||
|
||||
|
||||
break;
|
||||
case "editortutorial":
|
||||
GameMain.EditMapScreen.Select();
|
||||
GameMain.EditMapScreen.StartTutorial();
|
||||
break;
|
||||
case "lobbyscreen":
|
||||
case "lobby":
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
}
|
||||
|
||||
protected override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<object> UpdateState()
|
||||
{
|
||||
Submarine.Loaded.SetPosition(new Vector2(Submarine.Loaded.Position.X, 38500.0f));
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Barotrauma.Tutorials
|
||||
{
|
||||
class EditorTutorial : TutorialType
|
||||
{
|
||||
public EditorTutorial(string name)
|
||||
: base (name)
|
||||
{
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
{
|
||||
infoBox = CreateInfoFrame("Use the mouse wheel to zoom in and out, and WASD to move the camera around.", true);
|
||||
|
||||
while (infoBox!=null)
|
||||
{
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
infoBox = CreateInfoFrame("Press ''Structure'' at the left side of the screen to start placing some walls.");
|
||||
|
||||
while (GameMain.EditMapScreen.SelectedTab != (int)MapEntityCategory.Structure)
|
||||
{
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
infoBox = CreateInfoFrame("Select ''topwall'' from the list.", true);
|
||||
|
||||
while (MapEntityPrefab.Selected == null || MapEntityPrefab.Selected.Name != "topwall")
|
||||
{
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
infoBox = CreateInfoFrame("You can now create a horizontal wall by clicking and dragging. When you're done, right click to stop creating walls.");
|
||||
|
||||
|
||||
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
protected GUIComponent infoBox;
|
||||
|
||||
Character character;
|
||||
|
||||
|
||||
public string Name
|
||||
{
|
||||
@@ -26,6 +28,7 @@ namespace Barotrauma.Tutorials
|
||||
TutorialTypes = new List<TutorialType>();
|
||||
|
||||
TutorialTypes.Add(new BasicTutorial("Basic tutorial"));
|
||||
|
||||
}
|
||||
|
||||
public TutorialType(string name)
|
||||
@@ -58,7 +61,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
CharacterInfo charInfo = new CharacterInfo(Character.HumanConfigFile, "", Gender.None, JobPrefab.List.Find(jp => jp.Name == "Engineer"));
|
||||
|
||||
Character character = Character.Create(charInfo, wayPoint.WorldPosition);
|
||||
character = Character.Create(charInfo, wayPoint.WorldPosition);
|
||||
Character.Controlled = character;
|
||||
character.GiveJobItems(null);
|
||||
|
||||
@@ -72,27 +75,30 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
public virtual void Update(float deltaTime)
|
||||
{
|
||||
|
||||
if (Character.Controlled==null)
|
||||
if (character!=null)
|
||||
{
|
||||
CoroutineManager.StopCoroutine("TutorialMode.UpdateState");
|
||||
infoBox = null;
|
||||
}
|
||||
else if (Character.Controlled.IsDead)
|
||||
{
|
||||
Character.Controlled = null;
|
||||
if (Character.Controlled==null)
|
||||
{
|
||||
CoroutineManager.StopCoroutine("TutorialMode.UpdateState");
|
||||
infoBox = null;
|
||||
}
|
||||
else if (Character.Controlled.IsDead)
|
||||
{
|
||||
Character.Controlled = null;
|
||||
|
||||
CoroutineManager.StopCoroutine("TutorialMode.UpdateState");
|
||||
infoBox = null;
|
||||
CoroutineManager.StartCoroutine(Dead());
|
||||
CoroutineManager.StopCoroutine("TutorialMode.UpdateState");
|
||||
infoBox = null;
|
||||
CoroutineManager.StartCoroutine(Dead());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//CrewManager.Update(deltaTime);
|
||||
|
||||
if (infoBox != null) infoBox.Update(deltaTime);
|
||||
}
|
||||
|
||||
protected virtual IEnumerable<object> UpdateState()
|
||||
public virtual IEnumerable<object> UpdateState()
|
||||
{
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,18 @@ namespace Barotrauma.Items.Components
|
||||
ConvexHull convexHull;
|
||||
ConvexHull convexHull2;
|
||||
|
||||
private bool isOpen;
|
||||
|
||||
private float openState;
|
||||
|
||||
private PhysicsBody body;
|
||||
|
||||
private Sprite doorSprite, weldedSprite;
|
||||
|
||||
private bool isHorizontal;
|
||||
|
||||
private bool isStuck;
|
||||
|
||||
private float stuck;
|
||||
public float Stuck
|
||||
{
|
||||
@@ -33,8 +45,6 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
private bool isStuck;
|
||||
|
||||
Gap LinkedGap
|
||||
{
|
||||
get
|
||||
@@ -53,10 +63,6 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
bool isOpen;
|
||||
|
||||
float openState;
|
||||
|
||||
[HasDefaultValue("0.0,0.0,0.0,0.0", false)]
|
||||
public string Window
|
||||
{
|
||||
@@ -97,10 +103,6 @@ namespace Barotrauma.Items.Components
|
||||
UpdateConvexHulls();
|
||||
}
|
||||
}
|
||||
|
||||
PhysicsBody body;
|
||||
|
||||
Sprite doorSprite, weldedSprite;
|
||||
|
||||
public Door(Item item, XElement element)
|
||||
: base(item, element)
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Barotrauma.Items.Components
|
||||
if (character == null || reloadTimer>0.0f) return false;
|
||||
if (!character.IsKeyDown(InputType.Aim) || hitting) return false;
|
||||
|
||||
user = character;
|
||||
SetUser(character);
|
||||
|
||||
if (hitPos < MathHelper.Pi * 0.69f) return false;
|
||||
|
||||
@@ -154,9 +154,36 @@ namespace Barotrauma.Items.Components
|
||||
hitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void SetUser(Character character)
|
||||
{
|
||||
if (user == character) return;
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
foreach (Limb limb in user.AnimController.Limbs)
|
||||
{
|
||||
try
|
||||
{
|
||||
item.body.FarseerBody.RestoreCollisionWith(limb.body.FarseerBody);
|
||||
}
|
||||
|
||||
catch
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Limb limb in character.AnimController.Limbs)
|
||||
{
|
||||
item.body.FarseerBody.IgnoreCollisionWith(limb.body.FarseerBody);
|
||||
}
|
||||
|
||||
user = character;
|
||||
}
|
||||
|
||||
private void RestoreCollision()
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (character == null
|
||||
|| character.SelectedConstruction != item
|
||||
|| Vector2.Distance(character.SimPosition, item.SimPosition) > item.PickDistance * 1.5f)
|
||||
|| Vector2.Distance(character.Position, item.Position) > item.PickDistance * 1.5f)
|
||||
{
|
||||
if (character != null)
|
||||
{
|
||||
|
||||
@@ -895,7 +895,7 @@ namespace Barotrauma
|
||||
|
||||
foreach (Rectangle trigger in item.prefab.Triggers)
|
||||
{
|
||||
Rectangle transformedTrigger = item.TransformTrigger(trigger);
|
||||
Rectangle transformedTrigger = item.TransformTrigger(trigger, true);
|
||||
|
||||
if (!Submarine.RectContains(transformedTrigger, displayPos)) continue;
|
||||
|
||||
@@ -917,16 +917,16 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (item.prefab.PickDistance == 0.0f) continue;
|
||||
if (Vector2.Distance(position, item.SimPosition) > item.prefab.PickDistance) continue;
|
||||
if (item.prefab.PickDistance == 0.0f) continue;
|
||||
if (Vector2.Distance(displayPos, item.WorldPosition) > item.prefab.PickDistance) continue;
|
||||
|
||||
if (!item.prefab.PickThroughWalls)
|
||||
{
|
||||
Body body = Submarine.CheckVisibility(position, item.SimPosition);
|
||||
Body body = Submarine.CheckVisibility(item.Submarine == null ? position : position - item.Submarine.SimPosition, item.SimPosition);
|
||||
if (body != null && body.UserData as Item != item) continue;
|
||||
}
|
||||
|
||||
dist = Vector2.Distance(pickPosition, item.SimPosition);
|
||||
dist = Vector2.Distance(displayPickPos, item.WorldPosition);
|
||||
if (dist < item.prefab.PickDistance && (closest == null || dist < closestDist))
|
||||
{
|
||||
closest = item;
|
||||
|
||||
@@ -38,12 +38,6 @@ namespace Barotrauma
|
||||
get { return configFile; }
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public List<string> DeconstructItems
|
||||
{
|
||||
get;
|
||||
@@ -189,7 +183,7 @@ namespace Barotrauma
|
||||
Description = ToolBox.GetAttributeString(element, "description", "");
|
||||
|
||||
pickThroughWalls = ToolBox.GetAttributeBool(element, "pickthroughwalls", false);
|
||||
pickDistance = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "pickdistance", 0.0f));
|
||||
pickDistance = ToolBox.GetAttributeFloat(element, "pickdistance", 0.0f);
|
||||
|
||||
isLinkable = ToolBox.GetAttributeBool(element, "linkable", false);
|
||||
|
||||
@@ -221,7 +215,13 @@ namespace Barotrauma
|
||||
switch (subElement.Name.ToString().ToLower())
|
||||
{
|
||||
case "sprite":
|
||||
sprite = new Sprite(subElement, Path.GetDirectoryName(filePath));
|
||||
string spriteFolder = "";
|
||||
if (!ToolBox.GetAttributeString(subElement, "texture", "").Contains("/"))
|
||||
{
|
||||
spriteFolder = Path.GetDirectoryName(filePath);
|
||||
}
|
||||
|
||||
sprite = new Sprite(subElement, spriteFolder);
|
||||
size = sprite.size;
|
||||
break;
|
||||
case "deconstruct":
|
||||
|
||||
@@ -47,6 +47,13 @@ namespace Barotrauma
|
||||
set { selected = value; }
|
||||
}
|
||||
|
||||
|
||||
public string Description
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
public virtual bool IsLinkable
|
||||
{
|
||||
get { return isLinkable; }
|
||||
@@ -83,6 +90,7 @@ namespace Barotrauma
|
||||
{
|
||||
MapEntityPrefab ep = new MapEntityPrefab();
|
||||
ep.name = "hull";
|
||||
ep.Description = "Hulls determine which parts are considered to be ''inside the sub''. Generally every room should be enclosed by a hull.";
|
||||
ep.constructor = typeof(Hull).GetConstructor(new Type[] { typeof(Rectangle) });
|
||||
ep.resizeHorizontal = true;
|
||||
ep.resizeVertical = true;
|
||||
@@ -90,6 +98,7 @@ namespace Barotrauma
|
||||
|
||||
ep = new MapEntityPrefab();
|
||||
ep.name = "gap";
|
||||
ep.Description = "Gaps allow water and air to flow between two hulls. ";
|
||||
ep.constructor = typeof(Gap).GetConstructor(new Type[] { typeof(Rectangle) });
|
||||
ep.resizeHorizontal = true;
|
||||
ep.resizeVertical = true;
|
||||
|
||||
@@ -89,6 +89,8 @@ namespace Barotrauma
|
||||
if (ToolBox.GetAttributeBool(element, "flipvertical", false)) sp.sprite.effects = SpriteEffects.FlipVertically;
|
||||
}
|
||||
|
||||
sp.Description = ToolBox.GetAttributeString(element, "description", "");
|
||||
|
||||
sp.size = Vector2.Zero;
|
||||
sp.size.X = ToolBox.GetAttributeFloat(element, "width", 0.0f);
|
||||
sp.size.Y = ToolBox.GetAttributeFloat(element, "height", 0.0f);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Barotrauma
|
||||
{
|
||||
private Camera cam;
|
||||
|
||||
private GUIComponent GUIpanel;
|
||||
public GUIComponent GUIpanel;
|
||||
|
||||
private GUIComponent[] GUItabs;
|
||||
private int selectedTab;
|
||||
@@ -21,11 +21,18 @@ namespace Barotrauma
|
||||
|
||||
private bool characterMode;
|
||||
|
||||
private Tutorials.EditorTutorial tutorial;
|
||||
|
||||
public Camera Cam
|
||||
{
|
||||
get { return cam; }
|
||||
}
|
||||
|
||||
public int SelectedTab
|
||||
{
|
||||
get { return selectedTab; }
|
||||
}
|
||||
|
||||
//public string GetSubName()
|
||||
//{
|
||||
// return ((Submarine.Loaded == null) ? "" : Submarine.Loaded.Name);
|
||||
@@ -125,10 +132,9 @@ namespace Barotrauma
|
||||
null, frame);
|
||||
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
|
||||
|
||||
ItemPrefab ip = ep as ItemPrefab;
|
||||
if (ip != null && !string.IsNullOrWhiteSpace(ip.Description))
|
||||
if (!string.IsNullOrWhiteSpace(ep.Description))
|
||||
{
|
||||
textBlock.ToolTip = ip.Description;
|
||||
textBlock.ToolTip = ep.Description;
|
||||
}
|
||||
|
||||
if (ep.sprite != null)
|
||||
@@ -163,6 +169,13 @@ namespace Barotrauma
|
||||
|
||||
}
|
||||
|
||||
public void StartTutorial()
|
||||
{
|
||||
tutorial = new Tutorials.EditorTutorial("EditorTutorial");
|
||||
|
||||
CoroutineManager.StartCoroutine(tutorial.UpdateState());
|
||||
}
|
||||
|
||||
public override void Select()
|
||||
{
|
||||
base.Select();
|
||||
@@ -302,6 +315,7 @@ namespace Barotrauma
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
public override void Update(double deltaTime)
|
||||
{
|
||||
if (tutorial!=null) tutorial.Update((float)deltaTime);
|
||||
|
||||
if (GUIComponent.MouseOn == null)
|
||||
{
|
||||
@@ -420,6 +434,8 @@ namespace Barotrauma
|
||||
MapEntity.Edit(spriteBatch, cam);
|
||||
}
|
||||
|
||||
if (tutorial != null) tutorial.Draw(spriteBatch);
|
||||
|
||||
GUI.Draw((float)deltaTime, spriteBatch, cam);
|
||||
|
||||
if (!PlayerInput.LeftButtonDown()) Inventory.draggingItem = null;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user