This commit is contained in:
Regalis
2017-01-01 23:21:29 +02:00
parent e358ea9917
commit 9c07038fef
4 changed files with 7 additions and 56 deletions
+3 -8
View File
@@ -62,21 +62,16 @@ namespace Barotrauma
switch (state) switch (state)
{ {
case 0: case 0:
state = 1;
break;
case 1:
//item.body.LinearVelocity = Vector2.Zero;
if (item.ParentInventory!=null) item.body.FarseerBody.IsKinematic = false; if (item.ParentInventory!=null) item.body.FarseerBody.IsKinematic = false;
if (item.CurrentHull == null) return; if (item.CurrentHull == null) return;
state = 2; state = 1;
break; break;
case 2: case 1:
if (!Submarine.MainSub.AtEndPosition && !Submarine.MainSub.AtStartPosition) return; if (!Submarine.MainSub.AtEndPosition && !Submarine.MainSub.AtStartPosition) return;
Finished(); Finished();
state = 3; state = 2;
break; break;
} }
} }
@@ -151,7 +151,6 @@ namespace Barotrauma
isFinished = false; isFinished = false;
} }
public virtual void Update(float deltaTime) public virtual void Update(float deltaTime)
{ {
} }
@@ -159,9 +158,6 @@ namespace Barotrauma
public virtual void Finished() public virtual void Finished()
{ {
isFinished = true; isFinished = true;
//EventManager.EventFinished(this);
} }
} }
} }
-1
View File
@@ -58,7 +58,6 @@ namespace Barotrauma
protected virtual void Finished() protected virtual void Finished()
{ {
taskManager.TaskFinished(this);
isFinished = true; isFinished = true;
} }
} }
+2 -41
View File
@@ -10,8 +10,6 @@ namespace Barotrauma
private List<Task> tasks; private List<Task> tasks;
//private GUIListBox taskListBox;
public List<Task> Tasks public List<Task> Tasks
{ {
get { return tasks; } get { return tasks; }
@@ -28,10 +26,6 @@ namespace Barotrauma
public TaskManager(GameSession session) public TaskManager(GameSession session)
{ {
tasks = new List<Task>(); tasks = new List<Task>();
//taskListBox = new GUIListBox(new Rectangle(Game1.GraphicsWidth - 250, 50, 250, 500), Color.Transparent);
//taskListBox.ScrollBarEnabled = false;
//taskListBox.Padding = GUI.style.smallPadding;
} }
public void AddTask(Task newTask) public void AddTask(Task newTask)
@@ -44,14 +38,11 @@ namespace Barotrauma
public void StartShift(Level level) public void StartShift(Level level)
{ {
CreateScriptedEvents(level); CreateScriptedEvents(level);
//taskListBox.ClearChildren();
} }
public void EndShift() public void EndShift()
{ {
//taskListBox.ClearChildren();
tasks.Clear(); tasks.Clear();
} }
@@ -79,47 +70,17 @@ namespace Barotrauma
} }
public void TaskFinished(Task task)
{
}
public void Update(float deltaTime) public void Update(float deltaTime)
{ {
Task removeTask = null;
foreach (Task task in tasks) foreach (Task task in tasks)
{ {
if (task.IsFinished) if (!task.IsFinished)
{
//foreach (GUIComponent comp in taskListBox.children)
//{
// if (comp.UserData as Task != task) continue;
// comp.Rect = new Rectangle(comp.Rect.X, comp.Rect.Y, comp.Rect.Width, comp.Rect.Height - 1);
// comp.children[0].ClearChildren();
// if (comp.Rect.Height < 1)
// {
// removeComponent = comp;
removeTask = task;
// }
// break;
//}
}
else
{ {
task.Update(deltaTime); task.Update(deltaTime);
} }
} }
if (removeTask!= null) tasks.RemoveAll(t => t.IsFinished);
{
//taskListBox.RemoveChild(removeComponent);
tasks.Remove(removeTask);
}
//endShiftButton.Enabled = finished || Game1.server!=null;
} }
} }