autoupdater fixes, cursor fix, consistent directory separators + use of Path.Combine(), wire bugfixes, more loading screens

This commit is contained in:
Regalis
2015-10-02 21:33:33 +03:00
parent 24f7a1baa5
commit a285b00eb9
51 changed files with 451 additions and 1304 deletions
@@ -118,10 +118,7 @@ namespace Subsurface
}
Physics.Alpha = Physics.accumulator / Physics.step;
}
}
}
/// <summary>
+2 -1
View File
@@ -225,8 +225,9 @@ namespace Subsurface
}
}
dummyCharacter.ControlLocalPlayer((float)deltaTime, cam);
dummyCharacter.ControlLocalPlayer((float)deltaTime, cam, false);
dummyCharacter.Control((float)deltaTime, cam);
cam.TargetPos = Vector2.Zero;
}
else
{
-44
View File
@@ -58,15 +58,8 @@ namespace Subsurface
//http://gafferongames.com/game-physics/fix-your-timestep/
Physics.accumulator += deltaTime;
Stopwatch sw = new Stopwatch();
sw.Start();
AmbientSoundManager.Update();
sw.Stop();
Debug.WriteLine("************** abupdate: "+sw.ElapsedTicks);
sw.Restart();
//if (Game1.GameSession != null && Game1.GameSession.Level != null)
//{
// Vector2 targetMovement = Vector2.Zero;
@@ -81,38 +74,17 @@ namespace Subsurface
if (GameMain.GameSession!=null) GameMain.GameSession.Update((float)deltaTime);
//EventManager.Update(gameTime);
sw.Stop();
Debug.WriteLine("gamesession update: " + sw.ElapsedTicks);
sw.Restart();
Character.UpdateAll(cam, (float)deltaTime);
sw.Stop();
Debug.WriteLine("characterupdate: " + sw.ElapsedTicks);
sw.Restart();
BackgroundSpriteManager.Update(cam, (float)deltaTime);
sw.Stop();
Debug.WriteLine("bgsprite: " + sw.ElapsedTicks);
sw.Restart();
GameMain.ParticleManager.Update((float)deltaTime);
sw.Stop();
Debug.WriteLine("particlemanager: " + sw.ElapsedTicks);
sw.Restart();
StatusEffect.UpdateAll((float)deltaTime);
sw.Stop();
Debug.WriteLine("statuseff: " + sw.ElapsedTicks);
Physics.accumulator = Math.Min(Physics.accumulator, Physics.step * 4);
while (Physics.accumulator >= Physics.step)
{
sw.Restart();
cam.MoveCamera((float)Physics.step);
foreach (PhysicsBody pb in PhysicsBody.list)
@@ -122,16 +94,8 @@ namespace Subsurface
MapEntity.UpdateAll(cam, (float)Physics.step);
sw.Stop();
Debug.WriteLine(" mapentity: " + sw.ElapsedTicks);
sw.Restart();
Character.UpdateAnimAll((float)Physics.step);
sw.Stop();
Debug.WriteLine(" char: " + sw.ElapsedTicks);
sw.Restart();
Ragdoll.UpdateAll(cam, (float)Physics.step);
if (GameMain.GameSession != null && GameMain.GameSession.Level != null)
@@ -139,16 +103,8 @@ namespace Subsurface
GameMain.GameSession.Submarine.Update((float)Physics.step);
}
sw.Stop();
Debug.WriteLine(" sub: " + sw.ElapsedTicks);
sw.Restart();
GameMain.World.Step((float)Physics.step);
sw.Stop();
Debug.WriteLine(" worldstep: " + sw.ElapsedTicks);
sw.Restart();
Level.AfterWorldStep();
Physics.accumulator -= Physics.step;
+12 -3
View File
@@ -4,6 +4,7 @@ using FarseerPhysics.Factories;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
namespace Subsurface
{
@@ -444,13 +445,21 @@ namespace Subsurface
}
private bool StartShift(GUIButton button, object selection)
{
GameMain.GameSession.StartShift(TimeSpan.Zero, selectedLevel, false);
GameMain.GameScreen.Select();
{
GameMain.ShowLoading(ShiftLoading());
return true;
}
private IEnumerable<object> ShiftLoading()
{
GameMain.GameSession.StartShift(TimeSpan.Zero, selectedLevel, false);
GameMain.GameScreen.Select();
yield return CoroutineStatus.Success;
}
public bool QuitToMainMenu(GUIButton button, object selection)
{
GameMain.MainMenuScreen.Select();
+14 -8
View File
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics;
using Subsurface.Networking;
using System.IO;
using System.Xml.Linq;
using System.Collections.Generic;
namespace Subsurface
{
@@ -231,6 +232,7 @@ namespace Subsurface
return true;
}
private bool QuitClicked(GUIButton button, object obj)
{
game.Exit();
@@ -261,7 +263,6 @@ namespace Subsurface
var button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.Right | Alignment.Bottom, GUI.Style, menuTabs[(int)Tabs.LoadGame]);
button.OnClicked = LoadGame;
}
private bool SelectSaveFile(GUIComponent component, object obj)
@@ -278,6 +279,8 @@ namespace Subsurface
RemoveSaveFrame();
string subName = ToolBox.GetAttributeString(doc.Root, "submarine", "");
string saveTime = ToolBox.GetAttributeString(doc.Root, "savetime", "unknown");
XElement modeElement = null;
@@ -291,17 +294,20 @@ namespace Subsurface
string mapseed = ToolBox.GetAttributeString(modeElement, "mapseed", "unknown");
GUIFrame saveFileFrame = new GUIFrame(new Rectangle((int)(saveList.Rect.Width + 20), 0, 200, 200), Color.Black*0.4f, GUI.Style, menuTabs[(int)Tabs.LoadGame]);
GUIFrame saveFileFrame = new GUIFrame(new Rectangle((int)(saveList.Rect.Width + 20), 0, 200, 230), Color.Black*0.4f, GUI.Style, menuTabs[(int)Tabs.LoadGame]);
saveFileFrame.UserData = "savefileframe";
saveFileFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
new GUITextBlock(new Rectangle(0,0,0,20), fileName, GUI.Style, saveFileFrame);
new GUITextBlock(new Rectangle(0, 30, 0, 20), "Last saved: ", GUI.Style, saveFileFrame).Font = GUI.SmallFont;
new GUITextBlock(new Rectangle(15, 45, 0, 20), saveTime, GUI.Style, saveFileFrame).Font = GUI.SmallFont;
new GUITextBlock(new Rectangle(0, 30, 0, 20), subName, GUI.Style, saveFileFrame);
new GUITextBlock(new Rectangle(0, 65, 0, 20), "Map seed: ", GUI.Style, saveFileFrame).Font = GUI.SmallFont;
new GUITextBlock(new Rectangle(15, 80, 0, 20), mapseed, GUI.Style, saveFileFrame).Font = GUI.SmallFont;
new GUITextBlock(new Rectangle(0, 50, 0, 20), "Last saved: ", GUI.Style, saveFileFrame).Font = GUI.SmallFont;
new GUITextBlock(new Rectangle(15, 65, 0, 20), saveTime, GUI.Style, saveFileFrame).Font = GUI.SmallFont;
new GUITextBlock(new Rectangle(0, 85, 0, 20), "Map seed: ", GUI.Style, saveFileFrame).Font = GUI.SmallFont;
new GUITextBlock(new Rectangle(15, 100, 0, 20), mapseed, GUI.Style, saveFileFrame).Font = GUI.SmallFont;
var deleteSaveButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Delete", Alignment.BottomCenter, GUI.Style, saveFileFrame);
deleteSaveButton.UserData = fileName;
@@ -353,7 +359,8 @@ namespace Subsurface
{
graphics.Clear(Color.CornflowerBlue);
GameMain.TitleScreen.Draw(spriteBatch, graphics, -1.0f, (float)deltaTime);
GameMain.TitleScreen.DrawLoadingText = false;
GameMain.TitleScreen.Draw(spriteBatch, graphics, (float)deltaTime);
//Game1.GameScreen.DrawMap(graphics, spriteBatch);
@@ -406,7 +413,6 @@ namespace Subsurface
private bool LoadGame(GUIButton button, object obj)
{
string saveFile = saveList.SelectedData as string;
if (string.IsNullOrWhiteSpace(saveFile)) return false;
+2 -9
View File
@@ -273,7 +273,7 @@ namespace Subsurface
if (IsServer && GameMain.Server != null)
{
GUIButton startButton = new GUIButton(new Rectangle(0, 0, 200, 30), "Start", Alignment.BottomRight, GUI.Style, infoFrame);
startButton.OnClicked = GameMain.Server.StartGame;
startButton.OnClicked = GameMain.Server.StartGameClicked;
startButton.UserData = "startButton";
//mapList.OnSelected = new GUIListBox.OnSelectedHandler(Game1.server.UpdateNetLobby);
@@ -523,14 +523,7 @@ namespace Subsurface
if ((prevSize == 1.0f && chatBox.BarScroll == 0.0f) || (prevSize < 1.0f && chatBox.BarScroll == 1.0f)) chatBox.BarScroll = 1.0f;
}
public bool StartGame(object obj)
{
GameMain.Server.StartGame(null, obj);
return true;
}
public bool EnterChatMessage(GUITextBox textBox, string message)
{
if (String.IsNullOrEmpty(message)) return false;