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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user