This commit is contained in:
Regalis
2015-11-22 00:40:37 +02:00
parent 91fa25ecd2
commit 1eaf22d3d0
14 changed files with 100 additions and 22 deletions
+2 -2
View File
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.5.0")] [assembly: AssemblyVersion("0.2.6.0")]
[assembly: AssemblyFileVersion("0.2.5.0")] [assembly: AssemblyFileVersion("0.2.6.0")]
@@ -283,7 +283,6 @@ namespace Barotrauma
case AttackType.PinchCCW: case AttackType.PinchCCW:
float dir = (limb.attack.Type == AttackType.PinchCW) ? 1.0f : -1.0f; float dir = (limb.attack.Type == AttackType.PinchCW) ? 1.0f : -1.0f;
float dist = Vector2.Distance(limb.SimPosition, attackPosition);
if (wallAttackPos != Vector2.Zero && targetEntity != null) if (wallAttackPos != Vector2.Zero && targetEntity != null)
{ {
@@ -302,6 +301,7 @@ namespace Barotrauma
break; break;
} }
float dist = Vector2.Distance(limb.SimPosition, damageTarget.SimPosition);
if (dist < limb.attack.Range * 0.5f) if (dist < limb.attack.Range * 0.5f)
{ {
attackTimer += deltaTime; attackTimer += deltaTime;
+15 -4
View File
@@ -143,10 +143,21 @@ namespace Barotrauma
var md5 = MD5.Create(); var md5 = MD5.Create();
foreach (ContentFile file in files) foreach (ContentFile file in files)
{ {
using (var stream = File.OpenRead(file.path)) if (file.type == ContentType.Executable) continue;
try
{ {
hashes.Add(md5.ComputeHash(stream)); using (var stream = File.OpenRead(file.path))
} {
hashes.Add(md5.ComputeHash(stream));
}
}
catch (Exception e)
{
DebugConsole.ThrowError("Error while calculating content package hash: ", e);
}
} }
//string str = sb.ToString(); //string str = sb.ToString();
@@ -157,7 +168,7 @@ namespace Barotrauma
} }
//System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); //System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
md5Hash = new Md5Hash(bytes); md5Hash = new Md5Hash(bytes);
} }
public List<string> GetFilesOfType(ContentType type) public List<string> GetFilesOfType(ContentType type)
+5 -3
View File
@@ -80,6 +80,10 @@ namespace Barotrauma
if (isOpen) if (isOpen)
{ {
frame.Update(deltaTime);
Character.DisableControls = true; Character.DisableControls = true;
if (PlayerInput.KeyHit(Keys.Up)) if (PlayerInput.KeyHit(Keys.Up))
@@ -91,7 +95,7 @@ namespace Barotrauma
SelectMessage(1); SelectMessage(1);
} }
textBox.Update(deltaTime); //textBox.Update(deltaTime);
if (PlayerInput.GetKeyboardState.IsKeyDown(Keys.Enter) && textBox.Text != "") if (PlayerInput.GetKeyboardState.IsKeyDown(Keys.Enter) && textBox.Text != "")
{ {
@@ -122,8 +126,6 @@ namespace Barotrauma
{ {
if (!isOpen) return; if (!isOpen) return;
frame.Update(1.0f / 60.0f);
int margin = 5; int margin = 5;
//GUI.DrawRectangle(spriteBatch, //GUI.DrawRectangle(spriteBatch,
+1 -1
View File
@@ -205,7 +205,7 @@ namespace Barotrauma
private Vector2 MeasureText(string text) private Vector2 MeasureText(string text)
{ {
if (string.IsNullOrEmpty(text) || Font==null) return Vector2.Zero; if (Font==null) return Vector2.Zero;
Vector2 size = Vector2.Zero; Vector2 size = Vector2.Zero;
while (size == Vector2.Zero) while (size == Vector2.Zero)
+8 -2
View File
@@ -196,9 +196,15 @@ namespace Barotrauma
{ {
string input = Text; string input = Text;
Text = ""; Text = "";
OnEnterPressed(this, input); OnEnterPressed(this, input);
} }
#if LINUX
else if (PlayerInput.KeyHit(Keys.Back) && Text.Length>0)
{
Text = Text.Substring(0, Text.Length-1);
}
#endif
} }
textBlock.Update(deltaTime); textBlock.Update(deltaTime);
@@ -21,7 +21,7 @@ namespace Barotrauma.Items.Components
private SteeringPath steeringPath; private SteeringPath steeringPath;
private static PathFinder pathFinder; private PathFinder pathFinder;
private float networkUpdateTimer; private float networkUpdateTimer;
private bool valueChanged; private bool valueChanged;
@@ -199,6 +199,11 @@ namespace Barotrauma.Lights
spriteBatch.Draw(lightMap, Vector2.Zero, Color.White); spriteBatch.Draw(lightMap, Vector2.Zero, Color.White);
spriteBatch.End(); spriteBatch.End();
} }
public void ClearLights()
{
lights.Clear();
}
} }
+3
View File
@@ -12,6 +12,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Xml.Linq; using System.Xml.Linq;
using Barotrauma.Lights;
namespace Barotrauma namespace Barotrauma
{ {
@@ -666,6 +667,8 @@ namespace Barotrauma
if (loaded == null) return; if (loaded == null) return;
Sound.OnGameEnd(); Sound.OnGameEnd();
if (GameMain.LightManager != null) GameMain.LightManager.ClearLights();
loaded.Remove(); loaded.Remove();
+17 -3
View File
@@ -248,10 +248,17 @@ namespace Barotrauma
spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), new Color(0.75f, 0.8f, 0.9f, 1.0f)); spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), new Color(0.75f, 0.8f, 0.9f, 1.0f));
spriteBatch.End(); spriteBatch.End();
#if LINUX
spriteBatch.Begin(SpriteSortMode.Deferred, spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend, BlendState.NonPremultiplied,
null, DepthStencilState.Default, null, null, null, DepthStencilState.DepthRead, null, null,
cam.Transform); cam.Transform);
#else
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
#endif
GameMain.ParticleManager.Draw(spriteBatch, true, Particles.ParticleBlendState.AlphaBlend); GameMain.ParticleManager.Draw(spriteBatch, true, Particles.ParticleBlendState.AlphaBlend);
spriteBatch.End(); spriteBatch.End();
@@ -270,11 +277,18 @@ namespace Barotrauma
BlendState.Opaque); BlendState.Opaque);
spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White); spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
spriteBatch.End(); spriteBatch.End();
#if LINUX
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.NonPremultiplied,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
#else
spriteBatch.Begin(SpriteSortMode.Deferred, spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend, BlendState.AlphaBlend,
null, DepthStencilState.DepthRead, null, null, null, DepthStencilState.DepthRead, null, null,
cam.Transform); cam.Transform);
#endif
GameMain.ParticleManager.Draw(spriteBatch, false, Particles.ParticleBlendState.AlphaBlend); GameMain.ParticleManager.Draw(spriteBatch, false, Particles.ParticleBlendState.AlphaBlend);
spriteBatch.End(); spriteBatch.End();
+10 -2
View File
@@ -297,8 +297,16 @@ namespace Barotrauma
GameMain.NetLobbyScreen = new NetLobbyScreen(); GameMain.NetLobbyScreen = new NetLobbyScreen();
GameMain.NetworkMember = new GameServer(name, port, isPublicBox.Selected, passwordBox.Text, useUpnpBox.Selected, int.Parse(maxPlayersBox.Text)); try
{
GameMain.NetworkMember = new GameServer(name, port, isPublicBox.Selected, passwordBox.Text, useUpnpBox.Selected, int.Parse(maxPlayersBox.Text));
}
catch (Exception e)
{
DebugConsole.ThrowError("Failed to start server", e);
}
GameMain.NetLobbyScreen.IsServer = true; GameMain.NetLobbyScreen.IsServer = true;
//Game1.NetLobbyScreen.Select(); //Game1.NetLobbyScreen.Select();
return true; return true;
+26 -3
View File
@@ -254,7 +254,21 @@ namespace Barotrauma
if (response.StatusCode!= System.Net.HttpStatusCode.OK) if (response.StatusCode!= System.Net.HttpStatusCode.OK)
{ {
serverList.ClearChildren(); serverList.ClearChildren();
DebugConsole.ThrowError("Error while connecting to master server (" +response.StatusCode+": "+response.StatusDescription+")");
switch (response.StatusCode)
{
case System.Net.HttpStatusCode.NotFound:
DebugConsole.ThrowError("Error while connecting to master server (404 - ''" + NetConfig.MasterServerUrl + "'' not found)");
break;
case System.Net.HttpStatusCode.ServiceUnavailable:
DebugConsole.ThrowError("Error while connecting to master server (505 - Service Unavailable)");
DebugConsole.ThrowError("The master server may be down for maintenance or temporarily overloaded. Please try again after in a few moments.");
break;
default:
DebugConsole.ThrowError("Error while connecting to master server (" +response.StatusCode+": "+response.StatusDescription+")");
break;
}
return; return;
} }
@@ -304,8 +318,17 @@ namespace Barotrauma
selectedPassword = passwordBox.Text; selectedPassword = passwordBox.Text;
} }
GameMain.NetworkMember = new GameClient(clientNameBox.Text); try
GameMain.Client.ConnectToServer(ip, selectedPassword); {
GameMain.NetworkMember = new GameClient(clientNameBox.Text);
GameMain.Client.ConnectToServer(ip, selectedPassword);
}
catch (Exception e)
{
DebugConsole.ThrowError("Failed to start the client", e);
}
yield return CoroutineStatus.Success; yield return CoroutineStatus.Success;
} }
+6
View File
@@ -1,3 +1,9 @@
---------------------------------------------------------------------------------------------------------
v0.2.6.1
---------------------------------------------------------------------------------------------------------
- fixed a bug that caused characters to take bleeding damage for no apparent reason
- fixed autopilot not working when changing the map seed
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------
v0.2.6 v0.2.6
Binary file not shown.