Level wall generation bugfixes, moved level background drawing to LevelRenderer, more coordinate system bugfixes, better looking progress bars,

This commit is contained in:
Regalis
2015-12-14 18:59:59 +02:00
parent c74caadc42
commit 859be53d28
28 changed files with 318 additions and 232 deletions
+24 -15
View File
@@ -733,7 +733,7 @@ namespace Barotrauma
{
Limb head = AnimController.GetLimb(LimbType.Head);
Lights.LightManager.ViewPos = DrawPosition;
//Lights.LightManager.ViewPos = WorldPosition;
if (!DisableControls)
{
@@ -1327,10 +1327,14 @@ namespace Barotrauma
message.Write(AnimController.Dir > 0.0f);
}
if ((AnimController.RefLimb.SimPosition - Submarine.Loaded.SimPosition).Length() > NetConfig.CharacterIgnoreDistance) return true;
message.Write(AnimController.RefLimb.SimPosition.X);
message.Write(AnimController.RefLimb.SimPosition.Y);
message.Write(Submarine != null);
//Vector2 position = Submarine == null ? SimPosition : SimPosition - Submarine.SimPosition;
//if ((AnimController.RefLimb.SimPosition - Submarine.Loaded.SimPosition).Length() > NetConfig.CharacterIgnoreDistance) return true;
message.Write(SimPosition.X);
message.Write(SimPosition.Y);
return true;
default:
@@ -1495,17 +1499,21 @@ namespace Barotrauma
#endif
return;
}
try
{
pos.X = message.ReadFloat();
pos.Y = message.ReadFloat();
}
catch
bool inSub = message.ReadBoolean();
pos.X = message.ReadFloat();
pos.Y = message.ReadFloat();
if (inSub)
{
//failed to read position, Character may be further than NetConfig.CharacterIgnoreDistance
pos = SimPosition;
}
Hull newHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(pos), AnimController.CurrentHull, false);
if (newHull != null)
{
AnimController.CurrentHull = newHull;
Submarine = newHull.Submarine;
}
}
if (secondaryKeyState)
{
@@ -1517,7 +1525,8 @@ namespace Barotrauma
cursorPosition = Position + new Vector2(1000.0f, 0.0f) * dir;
}
AnimController.RefLimb.body.TargetPosition = AnimController.EstimateCurrPosition(pos, (float)(NetTime.Now + message.SenderConnection.RemoteTimeOffset) - sendingTime);
AnimController.RefLimb.body.TargetPosition =
AnimController.EstimateCurrPosition(pos, (float)(NetTime.Now + message.SenderConnection.RemoteTimeOffset) - sendingTime);
LastNetworkUpdate = sendingTime;
+4 -4
View File
@@ -54,7 +54,7 @@ namespace Barotrauma
if (character.ClosestCharacter != null && (character.ClosestCharacter.IsDead || character.ClosestCharacter.Stun > 0.0f))
{
Vector2 startPos = character.Position + (character.ClosestCharacter.WorldPosition - character.WorldPosition) * 0.7f;
Vector2 startPos = character.DrawPosition + (character.ClosestCharacter.DrawPosition - character.DrawPosition) * 0.7f;
startPos = cam.WorldToScreen(startPos);
Vector2 textPos = startPos;
@@ -67,7 +67,7 @@ namespace Barotrauma
else if (character.SelectedCharacter == null && character.ClosestItem != null && character.SelectedConstruction == null)
{
Vector2 startPos = character.WorldPosition + (character.ClosestItem.WorldPosition - character.WorldPosition) * 0.7f;
Vector2 startPos = character.DrawPosition + (character.ClosestItem.DrawPosition - character.DrawPosition) * 0.7f;
startPos = cam.WorldToScreen(startPos);
Vector2 textPos = startPos;
@@ -96,10 +96,10 @@ namespace Barotrauma
{
int width = 100, height = 20;
drowningBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 200, width, height), Color.Blue, 1.0f);
drowningBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 200, width, height), Color.Blue, GUI.Style, 1.0f, Alignment.TopLeft);
new GUIImage(new Rectangle(-27, -7, 20, 20), new Rectangle(17, 0, 20, 24), statusIcons, Alignment.TopLeft, drowningBar);
healthBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 230, width, height), Color.Red, 1.0f);
healthBar = new GUIProgressBar(new Rectangle(30, GameMain.GraphicsHeight - 230, width, height), Color.Red, GUI.Style, 1.0f, Alignment.TopLeft);
new GUIImage(new Rectangle(-26, -7, 20, 20), new Rectangle(0, 0, 13, 24), statusIcons, Alignment.TopLeft, healthBar);
}