Added commands to change sub, shuttle, gamemode & mission
Also fixed the exe icons
This commit is contained in:
@@ -57,8 +57,7 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>
|
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
|
||||||
</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
|||||||
@@ -122,8 +122,7 @@ namespace Barotrauma
|
|||||||
get { return (int)missionTypeBlock.UserData; }
|
get { return (int)missionTypeBlock.UserData; }
|
||||||
set { missionTypeBlock.UserData = value; }
|
set { missionTypeBlock.UserData = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<JobPrefab> JobPreferences
|
public List<JobPrefab> JobPreferences
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -48,6 +48,9 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="MonoGame.Framework, Version=3.5.1.1679, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MonoGame.Framework, Version=3.5.1.1679, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
|||||||
@@ -46,15 +46,70 @@ namespace Barotrauma
|
|||||||
break;
|
break;
|
||||||
case "say":
|
case "say":
|
||||||
case "msg":
|
case "msg":
|
||||||
string text = "";
|
string text = string.Join(" ", commands.Skip(1));
|
||||||
for (int i=1;i<commands.Count();i++)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(text)) text += " ";
|
|
||||||
text += commands[i];
|
|
||||||
}
|
|
||||||
if (commands[0].ToLower() == "say") text = "HOST: " + text;
|
if (commands[0].ToLower() == "say") text = "HOST: " + text;
|
||||||
GameMain.Server.SendChatMessage(text, ChatMessageType.Server);
|
GameMain.Server.SendChatMessage(text, ChatMessageType.Server);
|
||||||
break;
|
break;
|
||||||
|
case "servername":
|
||||||
|
GameMain.Server.Name = string.Join(" ", commands.Skip(1));
|
||||||
|
GameMain.NetLobbyScreen.ChangeServerName(string.Join(" ", commands.Skip(1)));
|
||||||
|
break;
|
||||||
|
case "servermsg":
|
||||||
|
GameMain.NetLobbyScreen.ChangeServerMessage(string.Join(" ", commands.Skip(1)));
|
||||||
|
break;
|
||||||
|
case "gamemode":
|
||||||
|
{
|
||||||
|
int index = -1;
|
||||||
|
if (int.TryParse(string.Join(" ", commands.Skip(1)), out index))
|
||||||
|
{
|
||||||
|
GameMain.NetLobbyScreen.SelectedModeIndex = index;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameMain.NetLobbyScreen.SelectedModeName = string.Join(" ", commands.Skip(1));
|
||||||
|
}
|
||||||
|
DebugConsole.NewMessage("Set gamemode to " + GameMain.NetLobbyScreen.SelectedModeName, Color.Cyan);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "mission":
|
||||||
|
{
|
||||||
|
int index = -1;
|
||||||
|
if (int.TryParse(string.Join(" ", commands.Skip(1)), out index))
|
||||||
|
{
|
||||||
|
GameMain.NetLobbyScreen.MissionTypeIndex = index;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameMain.NetLobbyScreen.MissionTypeName = string.Join(" ", commands.Skip(1));
|
||||||
|
}
|
||||||
|
DebugConsole.NewMessage("Set mission to " + GameMain.NetLobbyScreen.MissionTypeName, Color.Cyan);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "sub":
|
||||||
|
case "submarine":
|
||||||
|
{
|
||||||
|
Submarine sub = GameMain.NetLobbyScreen.GetSubList().Find(s => s.Name.ToLower() == string.Join(" ", commands.Skip(1)).ToLower());
|
||||||
|
|
||||||
|
if (sub != null)
|
||||||
|
{
|
||||||
|
GameMain.NetLobbyScreen.SelectedSub = sub;
|
||||||
|
}
|
||||||
|
sub = GameMain.NetLobbyScreen.SelectedSub;
|
||||||
|
DebugConsole.NewMessage("Selected sub: " + sub.Name + (sub.HasTag(SubmarineTag.Shuttle) ? " (shuttle)" : ""), Color.Cyan);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "shuttle":
|
||||||
|
{
|
||||||
|
Submarine shuttle = GameMain.NetLobbyScreen.GetSubList().Find(s => s.Name.ToLower() == string.Join(" ", commands.Skip(1)).ToLower());
|
||||||
|
|
||||||
|
if (shuttle != null)
|
||||||
|
{
|
||||||
|
GameMain.NetLobbyScreen.SelectedShuttle = shuttle;
|
||||||
|
}
|
||||||
|
shuttle = GameMain.NetLobbyScreen.SelectedShuttle;
|
||||||
|
DebugConsole.NewMessage("Selected shuttle: " + shuttle.Name + (shuttle.HasTag(SubmarineTag.Shuttle) ? "" : " (not shuttle)"), Color.Cyan);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "startgame":
|
case "startgame":
|
||||||
case "startround":
|
case "startround":
|
||||||
case "start":
|
case "start":
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ namespace Barotrauma
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
private static int restartAttempts;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The main entry point for the application.
|
/// The main entry point for the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -66,10 +64,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
sb.AppendLine("Server (" + (GameMain.Server.GameStarted ? "Round had started)" : "Round hadn't been started)"));
|
sb.AppendLine("Server (" + (GameMain.Server.GameStarted ? "Round had started)" : "Round hadn't been started)"));
|
||||||
}
|
}
|
||||||
else if (GameMain.Client != null)
|
|
||||||
{
|
|
||||||
sb.AppendLine("Client (" + (GameMain.Client.GameStarted ? "Round had started)" : "Round hadn't been started)"));
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.AppendLine("\n");
|
sb.AppendLine("\n");
|
||||||
sb.AppendLine("System info:");
|
sb.AppendLine("System info:");
|
||||||
|
|||||||
@@ -11,11 +11,48 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
partial class NetLobbyScreen : Screen
|
partial class NetLobbyScreen : Screen
|
||||||
{
|
{
|
||||||
public Submarine SelectedSub;
|
private Submarine selectedSub;
|
||||||
public Submarine SelectedShuttle;
|
private Submarine selectedShuttle;
|
||||||
|
|
||||||
|
public Submarine SelectedSub
|
||||||
|
{
|
||||||
|
get { return selectedSub; }
|
||||||
|
set { selectedSub = value; lastUpdateID++; }
|
||||||
|
}
|
||||||
|
public Submarine SelectedShuttle
|
||||||
|
{
|
||||||
|
get { return selectedShuttle; }
|
||||||
|
set { selectedShuttle = value; lastUpdateID++; }
|
||||||
|
}
|
||||||
|
|
||||||
private GameModePreset[] GameModes;
|
private GameModePreset[] GameModes;
|
||||||
public int SelectedModeIndex;
|
|
||||||
|
private int selectedModeIndex;
|
||||||
|
public int SelectedModeIndex
|
||||||
|
{
|
||||||
|
get { return selectedModeIndex; }
|
||||||
|
set {
|
||||||
|
lastUpdateID++;
|
||||||
|
selectedModeIndex = Math.Max(0, Math.Min(GameModes.Count()-1, value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string SelectedModeName
|
||||||
|
{
|
||||||
|
get { return GameModes[SelectedModeIndex].Name; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
for (int i = 0; i < GameModes.Count(); i++)
|
||||||
|
{
|
||||||
|
if (GameModes[i].Name.ToLower() == value.ToLower())
|
||||||
|
{
|
||||||
|
SelectedModeIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public GameModePreset SelectedMode
|
public GameModePreset SelectedMode
|
||||||
{
|
{
|
||||||
get { return GameModes[SelectedModeIndex]; }
|
get { return GameModes[SelectedModeIndex]; }
|
||||||
@@ -23,7 +60,41 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public string ServerMessageText;
|
public string ServerMessageText;
|
||||||
|
|
||||||
public int MissionTypeIndex;
|
private int missionTypeIndex;
|
||||||
|
public int MissionTypeIndex
|
||||||
|
{
|
||||||
|
get { return missionTypeIndex; }
|
||||||
|
set {
|
||||||
|
lastUpdateID++;
|
||||||
|
missionTypeIndex = Math.Max(0, Math.Min(Mission.MissionTypes.Count()-1, value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string MissionTypeName
|
||||||
|
{
|
||||||
|
get { return Mission.MissionTypes[MissionTypeIndex]; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Mission.MissionTypes.Count(); i++)
|
||||||
|
{
|
||||||
|
if (Mission.MissionTypes[i].ToLower() == value.ToLower())
|
||||||
|
{
|
||||||
|
MissionTypeIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ChangeServerName(string n)
|
||||||
|
{
|
||||||
|
ServerName = n; lastUpdateID++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ChangeServerMessage(string m)
|
||||||
|
{
|
||||||
|
ServerMessageText = m; lastUpdateID++;
|
||||||
|
}
|
||||||
|
|
||||||
public List<JobPrefab> JobPreferences
|
public List<JobPrefab> JobPreferences
|
||||||
{
|
{
|
||||||
@@ -39,8 +110,13 @@ namespace Barotrauma
|
|||||||
|
|
||||||
subs = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus)).ToList();
|
subs = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus)).ToList();
|
||||||
|
|
||||||
SelectedSub = subs[0];
|
if (subs == null || subs.Count()==0)
|
||||||
SelectedShuttle = subs[0]; //TODO: don't use the same sub as a shuttle by default
|
{
|
||||||
|
throw new Exception("No submarines are available.");
|
||||||
|
}
|
||||||
|
|
||||||
|
selectedSub = subs.First(s => !s.HasTag(SubmarineTag.Shuttle));
|
||||||
|
selectedShuttle = subs.First(s => s.HasTag(SubmarineTag.Shuttle));
|
||||||
|
|
||||||
DebugConsole.NewMessage("Selected sub: " + SelectedSub.Name, Color.White);
|
DebugConsole.NewMessage("Selected sub: " + SelectedSub.Name, Color.White);
|
||||||
DebugConsole.NewMessage("Selected shuttle: " + SelectedShuttle.Name, Color.White);
|
DebugConsole.NewMessage("Selected shuttle: " + SelectedShuttle.Name, Color.White);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
return commands.ToArray();
|
return commands.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ExecuteCommand(string command, GameMain game)
|
public static void ExecuteCommand(string command, GameMain game)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(command)) return;
|
if (string.IsNullOrWhiteSpace(command)) return;
|
||||||
|
|||||||
@@ -293,11 +293,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
/*#if CLIENT
|
#if CLIENT
|
||||||
return (GameMain.DebugDraw) ? Name + "(ID: " + ID + ")" : Name;
|
return (GameMain.DebugDraw) ? Name + "(ID: " + ID + ")" : Name;
|
||||||
#elif SERVER*/
|
#elif SERVER
|
||||||
return Name + "(ID: " + ID + ")";
|
return Name + "(ID: " + ID + ")";
|
||||||
//#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IPropertyObject> AllPropertyObjects
|
public List<IPropertyObject> AllPropertyObjects
|
||||||
@@ -1304,7 +1304,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void ServerWrite(NetBuffer msg, Client c, object[] extraData = null)
|
public void ServerWrite(NetBuffer msg, Client c, object[] extraData = null)
|
||||||
{
|
{
|
||||||
DebugConsole.NewMessage(ToString(), Color.Magenta);
|
|
||||||
if (extraData == null || extraData.Length == 0 || !(extraData[0] is NetEntityEvent.Type))
|
if (extraData == null || extraData.Length == 0 || !(extraData[0] is NetEntityEvent.Type))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user