Dust particles are drawn in the same batch as the background sprites (-> far-away particles are rendered behind the sprites), limiting character name length in the crew info menu, the "submarine not found in your folder" -tooltip is updated after downloading a sub file

This commit is contained in:
Regalis
2016-10-29 15:38:29 +03:00
parent 72178d4b1f
commit 5cc605bc01
4 changed files with 10 additions and 16 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 KiB

After

Width:  |  Height:  |  Size: 2.8 MiB

+1 -1
View File
@@ -237,7 +237,7 @@ namespace Barotrauma
GUITextBlock textBlock = new GUITextBlock( GUITextBlock textBlock = new GUITextBlock(
new Rectangle(40, 0, 0, 25), new Rectangle(40, 0, 0, 25),
character.Info.Name + " (" + character.Info.Job.Name + ")", ToolBox.LimitString(character.Info.Name + " (" + character.Info.Job.Name + ")", GUI.Font, frame.Rect.Width-20),
Color.Transparent, Color.White, Color.Transparent, Color.White,
Alignment.Left, Alignment.Left, Alignment.Left, Alignment.Left,
null, frame); null, frame);
+4 -10
View File
@@ -124,21 +124,15 @@ namespace Barotrauma
if (backgroundCreatureManager!=null) backgroundCreatureManager.Draw(spriteBatch); if (backgroundCreatureManager!=null) backgroundCreatureManager.Draw(spriteBatch);
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.BackToFront, for (int i = 0; i < 4; i++)
BlendState.Additive,
SamplerState.LinearWrap, DepthStencilState.Default, null, null,
cam.Transform);
for (int i = 1; i < 4; i++)
{ {
float scale = 1.0f - i * 0.2f; float scale = 1.0f - i * 0.2f;
//alpha goes from 1.0 to 0.0 when scale is in the range of 0.2-0.1 //alpha goes from 1.0 to 0.0 when scale is in the range of 0.2-0.1
float alpha = (cam.Zoom * scale) < 0.2f ? (cam.Zoom * scale - 0.1f) * 10.0f : 1.0f; float alpha = (cam.Zoom * scale) < 0.2f ? (cam.Zoom * scale - 0.1f) * 10.0f : 1.0f;
if (alpha <= 0.0f) continue; if (alpha <= 0.0f) continue;
Vector2 offset = (new Vector2(cam.WorldViewCenter.X, cam.WorldViewCenter.Y) + dustOffset) * scale; Vector2 offset = (new Vector2(cam.WorldViewCenter.X, cam.WorldViewCenter.Y) + dustOffset) * scale;
Vector3 origin = new Vector3(cam.WorldView.Width, cam.WorldView.Height, 0.0f) * 0.5f; Vector3 origin = new Vector3(cam.WorldView.Width, cam.WorldView.Height, 0.0f) * 0.5f;
@@ -151,11 +145,11 @@ namespace Barotrauma
spriteBatch.Draw(dustParticles.Texture, spriteBatch.Draw(dustParticles.Texture,
new Vector2(cam.WorldViewCenter.X, -cam.WorldViewCenter.Y), new Vector2(cam.WorldViewCenter.X, -cam.WorldViewCenter.Y),
dustParticles.SourceRect, Color.White * alpha, 0.0f, dustParticles.SourceRect, Color.White * alpha, 0.0f,
new Vector2(cam.WorldView.Width, cam.WorldView.Height) * 0.5f / scale, scale, SpriteEffects.None, 0); new Vector2(cam.WorldView.Width, cam.WorldView.Height) * 0.5f / scale, scale, SpriteEffects.None, 1.0f - scale);
} }
spriteBatch.End(); spriteBatch.End();
RenderWalls(GameMain.CurrGraphicsDevice, cam); RenderWalls(GameMain.CurrGraphicsDevice, cam);
} }
+5 -5
View File
@@ -998,21 +998,21 @@ namespace Barotrauma.Networking
switch (receiver.FileType) switch (receiver.FileType)
{ {
case FileTransferMessageType.Submarine: case FileTransferMessageType.Submarine:
Submarine.SavedSubmarines.RemoveAll(s => s.Name + ".sub" == receiver.FileName); Submarine.SavedSubmarines.RemoveAll(s => s.Name + ".sub" == receiver.FileName);
for (int i = 0; i<2; i++) for (int i = 0; i<2; i++)
{ {
var textBlock = ((i == 0) ?
var textBlock = (i == 0) ?
GameMain.NetLobbyScreen.ShuttleList.ListBox.children.Find(c => (c.UserData as Submarine).Name+".sub" == receiver.FileName) : GameMain.NetLobbyScreen.ShuttleList.ListBox.children.Find(c => (c.UserData as Submarine).Name+".sub" == receiver.FileName) :
GameMain.NetLobbyScreen.SubList.children.Find(c => (c.UserData as Submarine).Name+".sub" == receiver.FileName); GameMain.NetLobbyScreen.SubList.children.Find(c => (c.UserData as Submarine).Name+".sub" == receiver.FileName)) as GUITextBlock;
if (textBlock == null) continue; if (textBlock == null) continue;
(textBlock as GUITextBlock).TextColor = Color.White; textBlock.TextColor = Color.White;
var newSub = new Submarine(receiver.FilePath); var newSub = new Submarine(receiver.FilePath);
Submarine.SavedSubmarines.Add(newSub); Submarine.SavedSubmarines.Add(newSub);
textBlock.UserData = newSub; textBlock.UserData = newSub;
textBlock.ToolTip = newSub.Description;
} }
break; break;