WIP CrashReporter, misc refactoring
This commit is contained in:
@@ -79,7 +79,7 @@ namespace Subsurface
|
||||
endTime = startTime + duration;
|
||||
this.duration = duration;
|
||||
|
||||
timerBar = new GUIProgressBar(new Rectangle(Game1.GraphicsWidth - 120, 20, 100, 25), Color.Gold, 0.0f, null);
|
||||
timerBar = new GUIProgressBar(new Rectangle(GameMain.GraphicsWidth - 120, 20, 100, 25), Color.Gold, 0.0f, null);
|
||||
}
|
||||
|
||||
endMessage = "The round has ended!";
|
||||
@@ -108,7 +108,7 @@ namespace Subsurface
|
||||
|
||||
if (endMessage != "" || this.endMessage == null) this.endMessage = endMessage;
|
||||
|
||||
Game1.GameSession.EndShift(endMessage);
|
||||
GameMain.GameSession.EndShift(endMessage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Subsurface
|
||||
{
|
||||
Location[] locations = new Location[2];
|
||||
|
||||
Random rand = new Random(ToolBox.StringToInt(Game1.NetLobbyScreen.LevelSeed));
|
||||
Random rand = new Random(ToolBox.StringToInt(GameMain.NetLobbyScreen.LevelSeed));
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Subsurface
|
||||
|
||||
CargoManager = new CargoManager();
|
||||
|
||||
endShiftButton = new GUIButton(new Rectangle(Game1.GraphicsWidth - 220, 20, 200, 25), "End shift", Alignment.TopLeft, GUI.Style);
|
||||
endShiftButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End shift", Alignment.TopLeft, GUI.Style);
|
||||
endShiftButton.OnClicked = EndShift;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
@@ -101,7 +101,7 @@ namespace Subsurface
|
||||
|
||||
if (!savedOnStart)
|
||||
{
|
||||
SaveUtil.SaveGame(Game1.GameSession.SaveFile);
|
||||
SaveUtil.SaveGame(GameMain.GameSession.SaveFile);
|
||||
savedOnStart = true;
|
||||
}
|
||||
|
||||
@@ -192,9 +192,9 @@ namespace Subsurface
|
||||
sb.Append("Your entire crew has died!");
|
||||
|
||||
var msgBox = new GUIMessageBox("", sb.ToString(), new string[] { "Load game", "Quit" });
|
||||
msgBox.Buttons[0].OnClicked += Game1.GameSession.LoadPrevious;
|
||||
msgBox.Buttons[0].OnClicked += GameMain.GameSession.LoadPrevious;
|
||||
msgBox.Buttons[0].OnClicked += msgBox.Close;
|
||||
msgBox.Buttons[1].OnClicked = Game1.LobbyScreen.QuitToMainMenu;
|
||||
msgBox.Buttons[1].OnClicked = GameMain.LobbyScreen.QuitToMainMenu;
|
||||
msgBox.Buttons[1].OnClicked += msgBox.Close;
|
||||
}
|
||||
else
|
||||
@@ -217,7 +217,7 @@ namespace Subsurface
|
||||
Map.MoveToNextLocation();
|
||||
}
|
||||
|
||||
SaveUtil.SaveGame(Game1.GameSession.SaveFile);
|
||||
SaveUtil.SaveGame(GameMain.GameSession.SaveFile);
|
||||
}
|
||||
|
||||
CrewManager.EndShift();
|
||||
@@ -226,7 +226,7 @@ namespace Subsurface
|
||||
Character.CharacterList[i].Remove();
|
||||
}
|
||||
|
||||
Game1.GameSession.EndShift("");
|
||||
GameMain.GameSession.EndShift("");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Subsurface
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
if (Game1.Server == null) return;
|
||||
if (GameMain.Server == null) return;
|
||||
|
||||
base.Update(deltaTime);
|
||||
|
||||
@@ -34,21 +34,21 @@ namespace Subsurface
|
||||
|
||||
if (traitor==null || target ==null)
|
||||
{
|
||||
int clientCount = Game1.Server.connectedClients.Count();
|
||||
int clientCount = GameMain.Server.connectedClients.Count();
|
||||
if (clientCount < 2) return;
|
||||
|
||||
int traitorIndex = Rand.Int(clientCount, false);
|
||||
traitor = Game1.Server.connectedClients[traitorIndex];
|
||||
traitor = GameMain.Server.connectedClients[traitorIndex];
|
||||
|
||||
int targetIndex = 0;
|
||||
while (targetIndex == traitorIndex)
|
||||
{
|
||||
targetIndex = Rand.Int(clientCount, false);
|
||||
}
|
||||
target = Game1.Server.connectedClients[targetIndex];
|
||||
target = GameMain.Server.connectedClients[targetIndex];
|
||||
|
||||
|
||||
Game1.Server.NewTraitor(traitor, target);
|
||||
GameMain.Server.NewTraitor(traitor, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace Subsurface
|
||||
{
|
||||
Submarine.Load("Content/Map/TutorialSub.gz");
|
||||
|
||||
Game1.GameSession = new GameSession(Submarine.Loaded, "", GameModePreset.list.Find(gm => gm.Name.ToLower()=="tutorial"));
|
||||
GameMain.GameSession = new GameSession(Submarine.Loaded, "", GameModePreset.list.Find(gm => gm.Name.ToLower()=="tutorial"));
|
||||
|
||||
Game1.GameSession.StartShift(TimeSpan.Zero, "tutorial");
|
||||
GameMain.GameSession.StartShift(TimeSpan.Zero, "tutorial");
|
||||
|
||||
Game1.GameSession.taskManager.Tasks.Clear();
|
||||
GameMain.GameSession.taskManager.Tasks.Clear();
|
||||
|
||||
Game1.GameScreen.Select();
|
||||
GameMain.GameScreen.Select();
|
||||
}
|
||||
|
||||
public TutorialMode(GameModePreset preset)
|
||||
@@ -313,7 +313,7 @@ namespace Subsurface
|
||||
Vector2 steeringDir = windows[0].Position - moloch.Position;
|
||||
if (steeringDir != Vector2.Zero) steeringDir = Vector2.Normalize(steeringDir);
|
||||
|
||||
foreach (Limb limb in moloch.AnimController.limbs)
|
||||
foreach (Limb limb in moloch.AnimController.Limbs)
|
||||
{
|
||||
limb.body.LinearVelocity = new Vector2(limb.LinearVelocity.X, limb.LinearVelocity.Y + steeringDir.Y*10.0f);
|
||||
}
|
||||
@@ -511,7 +511,7 @@ namespace Subsurface
|
||||
float secondsLeft = endPreviewLength;
|
||||
|
||||
Character.Controlled = null;
|
||||
Game1.GameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
GameMain.GameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -522,14 +522,14 @@ namespace Subsurface
|
||||
(float)Math.Cos(camAngle) * (Submarine.Borders.Width / 2.0f),
|
||||
(float)Math.Sin(camAngle) * (Submarine.Borders.Height / 2.0f)));
|
||||
|
||||
Game1.GameScreen.Cam.TargetPos = offset * 0.8f;
|
||||
GameMain.GameScreen.Cam.TargetPos = offset * 0.8f;
|
||||
//Game1.GameScreen.Cam.MoveCamera((float)deltaTime);
|
||||
|
||||
yield return CoroutineStatus.Running;
|
||||
} while (secondsLeft > 0.0f);
|
||||
|
||||
Submarine.Unload();
|
||||
Game1.MainMenuScreen.Select();
|
||||
GameMain.MainMenuScreen.Select();
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
@@ -544,7 +544,7 @@ namespace Subsurface
|
||||
messageBox.Buttons[0].OnClicked += messageBox.Close;
|
||||
|
||||
//messageBox.Buttons[1].UserData = MainMenuScreen.Tabs.Main;
|
||||
messageBox.Buttons[1].OnClicked = Game1.MainMenuScreen.SelectTab;
|
||||
messageBox.Buttons[1].OnClicked = GameMain.MainMenuScreen.SelectTab;
|
||||
messageBox.Buttons[1].OnClicked += messageBox.Close;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user