Campaign mode can't be voted for. The host has to manually create/select the campaign save, so switching to the campaign mode when the host isn't present would cause problems.
This commit is contained in:
@@ -8,13 +8,9 @@ namespace Barotrauma
|
||||
public static List<GameModePreset> PresetList = new List<GameModePreset>();
|
||||
|
||||
protected DateTime startTime;
|
||||
|
||||
//public readonly bool IsSinglePlayer;
|
||||
|
||||
|
||||
protected bool isRunning;
|
||||
|
||||
//protected string name;
|
||||
|
||||
|
||||
protected GameModePreset preset;
|
||||
|
||||
private string endMessage;
|
||||
@@ -57,13 +53,6 @@ namespace Barotrauma
|
||||
public virtual void Start()
|
||||
{
|
||||
startTime = DateTime.Now;
|
||||
//if (duration!=TimeSpan.Zero)
|
||||
//{
|
||||
// endTime = startTime + duration;
|
||||
// this.duration = duration;
|
||||
|
||||
// timerBar = new GUIProgressBar(new Rectangle(GameMain.GraphicsWidth - 120, 20, 100, 25), Color.Gold, 0.0f, null);
|
||||
//}
|
||||
|
||||
endMessage = "The round has ended!";
|
||||
|
||||
@@ -74,20 +63,7 @@ namespace Barotrauma
|
||||
|
||||
public virtual void AddToGUIUpdateList() { }
|
||||
|
||||
public virtual void Update(float deltaTime)
|
||||
{
|
||||
//if (!isRunning) return;
|
||||
|
||||
//if (duration != TimeSpan.Zero)
|
||||
//{
|
||||
// double elapsedTime = (DateTime.Now - startTime).TotalSeconds;
|
||||
// timerBar.BarSize = (float)(elapsedTime / duration.TotalSeconds);
|
||||
//}
|
||||
//if (DateTime.Now >= endTime)
|
||||
//{
|
||||
// End(endMessage);
|
||||
//}
|
||||
}
|
||||
public virtual void Update(float deltaTime) { }
|
||||
|
||||
public virtual void End(string endMessage = "")
|
||||
{
|
||||
|
||||
@@ -10,17 +10,34 @@ namespace Barotrauma
|
||||
|
||||
public ConstructorInfo Constructor;
|
||||
public string Name;
|
||||
public bool IsSinglePlayer;
|
||||
|
||||
public string Description;
|
||||
public bool IsSinglePlayer
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public GameModePreset(string name, Type type, bool isSinglePlayer = false)
|
||||
//are clients allowed to vote for this gamemode
|
||||
public bool Votable
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public GameModePreset(string name, Type type, bool isSinglePlayer = false, bool votable = true)
|
||||
{
|
||||
this.Name = name;
|
||||
|
||||
Constructor = type.GetConstructor(new Type[] { typeof(GameModePreset), typeof(object) });
|
||||
|
||||
IsSinglePlayer = isSinglePlayer;
|
||||
Votable = votable;
|
||||
|
||||
list.Add(this);
|
||||
}
|
||||
@@ -46,7 +63,7 @@ namespace Barotrauma
|
||||
+ "an alien artifact or killing a creature that's terrorizing nearby outposts. The game ends "
|
||||
+ "when the task is completed or everyone in the crew has died.";
|
||||
|
||||
new GameModePreset("Campaign", typeof(MultiplayerCampaign), false);
|
||||
new GameModePreset("Campaign", typeof(MultiplayerCampaign), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user