f8b0295...0671290

This commit is contained in:
Joonas Rikkonen
2019-03-18 22:59:45 +02:00
parent 23687fbf2f
commit 63eb4d64e5
103 changed files with 1378 additions and 4692 deletions
@@ -117,7 +117,6 @@ namespace Barotrauma
GameMain.Instance.OnResolutionChanged += OnResolutionChanged;
instance = this;
}
#endregion
public override void Deselect()
{
@@ -196,6 +195,7 @@ namespace Barotrauma
{
ParamsEditor.Instance.EditorBox.AddToGUIUpdateList();
}
}
public override void Update(double deltaTime)
{
@@ -351,91 +351,6 @@ namespace Barotrauma
{
CopyLimb(selectedLimb);
}
idToCodeName.TryGetValue(id, out string notes);
LimbXElements.Add(id.ToString(), new XElement("limb",
new XAttribute("id", id),
new XAttribute("name", limbName),
new XAttribute("type", limbType.ToString()),
colliderAttributes,
new XElement("sprite",
new XAttribute("texture", TexturePath),
new XAttribute("sourcerect", $"{rectInputs[0].IntValue}, {rectInputs[1].IntValue}, {width}, {height}")),
new XAttribute("notes", null ?? string.Empty)
));
}
}
UpdateJointCreation();
if (PlayerInput.KeyHit(Keys.Left))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.X--;
UpdateSourceRect(limb, newRect);
}
}
if (PlayerInput.KeyHit(Keys.Right))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.X++;
UpdateSourceRect(limb, newRect);
}
}
if (PlayerInput.KeyHit(Keys.Down))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.Y++;
UpdateSourceRect(limb, newRect);
}
}
if (PlayerInput.KeyHit(Keys.Up))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.Y--;
UpdateSourceRect(limb, newRect);
}
}
UpdateJointCreation();
if (PlayerInput.KeyHit(Keys.Left))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.X--;
UpdateSourceRect(limb, newRect);
}
}
if (PlayerInput.KeyHit(Keys.Right))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.X++;
UpdateSourceRect(limb, newRect);
}
}
if (PlayerInput.KeyHit(Keys.Down))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.Y++;
UpdateSourceRect(limb, newRect);
}
}
if (PlayerInput.KeyHit(Keys.Up))
{
foreach (var limb in selectedLimbs)
{
var newRect = limb.ActiveSprite.SourceRect;
newRect.Y--;
UpdateSourceRect(limb, newRect);
}
}
UpdateJointCreation();
@@ -51,10 +51,6 @@ namespace Barotrauma
damageEffect.Parameters["xStencil"].SetValue(damageStencil);
damageEffect.Parameters["aMultiplier"].SetValue(50.0f);
damageEffect.Parameters["cMultiplier"].SetValue(200.0f);
distortTexture = TextureLoader.FromFile("Content/Effects/distortnormals.png");
postProcessEffect.Parameters["xDistortTexture"].SetValue(distortTexture);
}
distortTexture = TextureLoader.FromFile("Content/Effects/distortnormals.png");
postProcessEffect.Parameters["xDistortTexture"].SetValue(distortTexture);
@@ -1,15 +1,15 @@
using Barotrauma.Networking;
using Barotrauma.Extensions;
using Barotrauma.Networking;
using Barotrauma.Tutorials;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using Barotrauma.Extensions;
using System.Diagnostics;
using Lidgren.Network;
using System.IO;
using System.Linq;
using System.Threading;
namespace Barotrauma
@@ -34,10 +34,13 @@ namespace Barotrauma
private Tab selectedTab;
private Sprite backgroundSprite;
private Sprite backgroundVignette;
#region Creation
public MainMenuScreen(GameMain game)
{
backgroundVignette = new Sprite("Content/UI/MainMenuVignette.png", Vector2.Zero);
new GUIImage(new RectTransform(new Vector2(0.35f, 0.2f), Frame.RectTransform, Anchor.BottomRight)
{ RelativeOffset = new Vector2(0.05f, 0.05f), AbsoluteOffset = new Point(-5, -5) },
style: "TitleText")
@@ -688,6 +691,11 @@ namespace Barotrauma
blurAmount: 0.0f,
aberrationStrength: 0.0f);
}
spriteBatch.Begin(blendState: BlendState.AlphaBlend);
backgroundVignette.Draw(spriteBatch, Vector2.Zero, Color.White, Vector2.Zero, 0.0f,
new Vector2(GameMain.GraphicsWidth / backgroundVignette.size.X, GameMain.GraphicsHeight / backgroundVignette.size.Y));
spriteBatch.End();
}
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
@@ -431,7 +431,6 @@ namespace Barotrauma
return true;
}
};
shuttleList = new GUIDropDown(new RectTransform(new Vector2(1.0f, 0.05f), midInfoColumn.RectTransform), elementCount: 10);
//gamemode ------------------------------------------------------------------
@@ -1050,10 +1049,9 @@ namespace Barotrauma
}
}
public void SetPlayYourself(bool playYourself)
public bool TogglePlayYourself(GUITickBox tickBox)
{
this.playYourself.Selected = playYourself;
if (playYourself)
if (tickBox.Selected)
{
UpdatePlayerFrame(campaignCharacterInfo, allowEditing: campaignCharacterInfo == null);
}
@@ -1068,6 +1066,7 @@ namespace Barotrauma
TextManager.Get("PlayingAsSpectator"),
textAlignment: Alignment.Center);
}
return false;
}
public void SetPlayYourself(bool playYourself)
@@ -1097,7 +1096,6 @@ namespace Barotrauma
{
return;
}
}
//show the player config menu if spectating is not allowed
if (!playYourself.Selected && !allowSpectating)
@@ -716,7 +716,7 @@ namespace Barotrauma
catch (PingException ex)
{
string errorMsg = "Failed to ping a server (" + serverInfo.ServerName + ", " + serverInfo.IP + ") - " + (ex?.InnerException?.Message ?? ex.Message);
GameAnalyticsManager.AddErrorEventOnce("ServerListScreen.PingServer:PingException" + serverInfo.IP, GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
GameAnalyticsManager.AddErrorEventOnce("ServerListScreen.PingServer:PingException" + serverInfo.IP, GameAnalyticsSDK.Net.EGAErrorSeverity.Warning, errorMsg);
#if DEBUG
DebugConsole.NewMessage(errorMsg, Color.Red);
#endif
@@ -1913,8 +1913,6 @@ namespace Barotrauma
CreateUI();
}
if (tutorial != null) tutorial.Update((float)deltaTime);
hullVolumeFrame.Visible = MapEntity.SelectedList.Any(s => s is Hull);
saveAssemblyFrame.Visible = MapEntity.SelectedList.Count > 0;