diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index 539ce7732..a0285d8a9 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -103,6 +103,7 @@ + @@ -457,6 +458,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest Designer @@ -464,9 +468,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest @@ -537,18 +538,12 @@ PreserveNewest - - PreserveNewest - PreserveNewest PreserveNewest - - PreserveNewest - PreserveNewest Designer diff --git a/Subsurface/Content/Characters/Human/human.xml b/Subsurface/Content/Characters/Human/human.xml index 0f826b5ac..c4d03a9ca 100644 --- a/Subsurface/Content/Characters/Human/human.xml +++ b/Subsurface/Content/Characters/Human/human.xml @@ -11,16 +11,16 @@ thightorque="-5.0"> - + - + - + diff --git a/Subsurface/Content/Items/Door/doors.xml b/Subsurface/Content/Items/Door/doors.xml index 8c0819d0e..bf3a18d10 100644 --- a/Subsurface/Content/Items/Door/doors.xml +++ b/Subsurface/Content/Items/Door/doors.xml @@ -25,7 +25,6 @@ - - \ No newline at end of file diff --git a/Subsurface/Content/Items/Electricity/signalcomp.png b/Subsurface/Content/Items/Electricity/signalcomp.png index 82ca40a94..726b7921e 100644 Binary files a/Subsurface/Content/Items/Electricity/signalcomp.png and b/Subsurface/Content/Items/Electricity/signalcomp.png differ diff --git a/Subsurface/Content/Items/Electricity/signalitems.xml b/Subsurface/Content/Items/Electricity/signalitems.xml index 4cf60b7d2..6a828cdfe 100644 --- a/Subsurface/Content/Items/Electricity/signalitems.xml +++ b/Subsurface/Content/Items/Electricity/signalitems.xml @@ -100,7 +100,7 @@ - + - + @@ -54,8 +54,8 @@ linkable="true" category="Machine" pickdistance="150"> - - + + diff --git a/Subsurface/Content/Items/Engine/fabricator.png b/Subsurface/Content/Items/Engine/fabricator.png deleted file mode 100644 index 29579d52d..000000000 Binary files a/Subsurface/Content/Items/Engine/fabricator.png and /dev/null differ diff --git a/Subsurface/Content/Items/Fabricators/fabricator.png b/Subsurface/Content/Items/Fabricators/fabricator.png deleted file mode 100644 index 24af1ee9c..000000000 Binary files a/Subsurface/Content/Items/Fabricators/fabricator.png and /dev/null differ diff --git a/Subsurface/Content/Items/Fabricators/fabricators.xml b/Subsurface/Content/Items/Fabricators/fabricators.xml index 1cc85e0c8..ef0f0a55e 100644 --- a/Subsurface/Content/Items/Fabricators/fabricators.xml +++ b/Subsurface/Content/Items/Fabricators/fabricators.xml @@ -6,8 +6,8 @@ pickdistance="150" category="Machine" description="A machine capable of manufacturing a wide range of items out of basic raw materials."> - - + + @@ -55,8 +55,8 @@ pickdistance="150" category="Machine" description="Disassembles and breaks down items to reusable components and material bars."> - - + + diff --git a/Subsurface/Content/Items/MiniMap/fabricator.png b/Subsurface/Content/Items/MiniMap/fabricator.png deleted file mode 100644 index 29579d52d..000000000 Binary files a/Subsurface/Content/Items/MiniMap/fabricator.png and /dev/null differ diff --git a/Subsurface/Content/Items/MiniMap/item.xml b/Subsurface/Content/Items/MiniMap/item.xml index 14f414d58..7511ae36b 100644 --- a/Subsurface/Content/Items/MiniMap/item.xml +++ b/Subsurface/Content/Items/MiniMap/item.xml @@ -2,8 +2,8 @@ name="MiniMap" category="Machine" linkable="true"> - - + + diff --git a/Subsurface/Content/Items/machines.png b/Subsurface/Content/Items/machines.png new file mode 100644 index 000000000..0088db9cd Binary files /dev/null and b/Subsurface/Content/Items/machines.png differ diff --git a/Subsurface/Content/Map/StructurePrefabs.xml b/Subsurface/Content/Map/StructurePrefabs.xml index 5b7b2af85..0c6384379 100644 --- a/Subsurface/Content/Map/StructurePrefabs.xml +++ b/Subsurface/Content/Map/StructurePrefabs.xml @@ -1,18 +1,24 @@ - 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; diff --git a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveContainItem.cs b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveContainItem.cs index 83a4b573a..607e6a612 100644 --- a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveContainItem.cs +++ b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveContainItem.cs @@ -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)); diff --git a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGetItem.cs b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGetItem.cs index aa7f8210c..27f3f894c 100644 --- a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGetItem.cs +++ b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGetItem.cs @@ -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) diff --git a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGoTo.cs b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGoTo.cs index e2cc46235..09f668857 100644 --- a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGoTo.cs +++ b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveGoTo.cs @@ -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; } diff --git a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveOperateItem.cs b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveOperateItem.cs index b23df973b..01937ede8 100644 --- a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveOperateItem.cs +++ b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveOperateItem.cs @@ -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) diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs index 3a5e7699a..da1716e5d 100644 --- a/Subsurface/Source/Characters/Animation/Ragdoll.cs +++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs @@ -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; diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index db40f3d36..116581fc8 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -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) diff --git a/Subsurface/Source/Characters/Limb.cs b/Subsurface/Source/Characters/Limb.cs index 24c7ef5dd..fd0a25df7 100644 --- a/Subsurface/Source/Characters/Limb.cs +++ b/Subsurface/Source/Characters/Limb.cs @@ -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; diff --git a/Subsurface/Source/DebugConsole.cs b/Subsurface/Source/DebugConsole.cs index 0906250a0..631dd8c3b 100644 --- a/Subsurface/Source/DebugConsole.cs +++ b/Subsurface/Source/DebugConsole.cs @@ -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": diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs index b1f1fb1a1..c852f1416 100644 --- a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs +++ b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs @@ -15,7 +15,7 @@ namespace Barotrauma.Tutorials } - protected override IEnumerable UpdateState() + public override IEnumerable UpdateState() { Submarine.Loaded.SetPosition(new Vector2(Submarine.Loaded.Position.X, 38500.0f)); diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/EditorTutorial.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/EditorTutorial.cs new file mode 100644 index 000000000..04b8154a6 --- /dev/null +++ b/Subsurface/Source/GameSession/GameModes/Tutorials/EditorTutorial.cs @@ -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 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; + } + } +} diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/TutorialType.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/TutorialType.cs index 39670e33f..4914ddb00 100644 --- a/Subsurface/Source/GameSession/GameModes/Tutorials/TutorialType.cs +++ b/Subsurface/Source/GameSession/GameModes/Tutorials/TutorialType.cs @@ -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(); 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 UpdateState() + public virtual IEnumerable UpdateState() { yield return CoroutineStatus.Success; } diff --git a/Subsurface/Source/Items/Components/Door.cs b/Subsurface/Source/Items/Components/Door.cs index 0afce8bc3..6e5d41421 100644 --- a/Subsurface/Source/Items/Components/Door.cs +++ b/Subsurface/Source/Items/Components/Door.cs @@ -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) diff --git a/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs b/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs index b06348507..5d1bef900 100644 --- a/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs +++ b/Subsurface/Source/Items/Components/Holdable/MeleeWeapon.cs @@ -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() { diff --git a/Subsurface/Source/Items/Components/Machines/Controller.cs b/Subsurface/Source/Items/Components/Machines/Controller.cs index 14120a924..6f6fbe473 100644 --- a/Subsurface/Source/Items/Components/Machines/Controller.cs +++ b/Subsurface/Source/Items/Components/Machines/Controller.cs @@ -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) { diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 9e1bccab4..08623c56e 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -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; diff --git a/Subsurface/Source/Items/ItemPrefab.cs b/Subsurface/Source/Items/ItemPrefab.cs index 1f98ed3b2..222f7d7f7 100644 --- a/Subsurface/Source/Items/ItemPrefab.cs +++ b/Subsurface/Source/Items/ItemPrefab.cs @@ -38,12 +38,6 @@ namespace Barotrauma get { return configFile; } } - public string Description - { - get; - private set; - } - public List 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": diff --git a/Subsurface/Source/Map/MapEntityPrefab.cs b/Subsurface/Source/Map/MapEntityPrefab.cs index 9c463dca0..eb7aa06ea 100644 --- a/Subsurface/Source/Map/MapEntityPrefab.cs +++ b/Subsurface/Source/Map/MapEntityPrefab.cs @@ -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; diff --git a/Subsurface/Source/Map/StructurePrefab.cs b/Subsurface/Source/Map/StructurePrefab.cs index 21dbeadfd..2b2df7539 100644 --- a/Subsurface/Source/Map/StructurePrefab.cs +++ b/Subsurface/Source/Map/StructurePrefab.cs @@ -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); diff --git a/Subsurface/Source/Screens/EditMapScreen.cs b/Subsurface/Source/Screens/EditMapScreen.cs index a83713ed8..30f1c442a 100644 --- a/Subsurface/Source/Screens/EditMapScreen.cs +++ b/Subsurface/Source/Screens/EditMapScreen.cs @@ -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 /// Provides a snapshot of timing values. 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; diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 935b9c7d4..281c36942 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ