Some cleanup

This commit is contained in:
juanjp600
2017-06-23 17:48:49 -03:00
parent d6d8a5b868
commit b7a0bff294
37 changed files with 43 additions and 212 deletions

View File

@@ -81,7 +81,7 @@ namespace Barotrauma
}
}
private void UpdateControlled(float deltaTime)
partial void UpdateControlled(float deltaTime)
{
if (controlled == this)
{
@@ -239,7 +239,7 @@ namespace Barotrauma
selectedSound.Sound.Play(1.0f, selectedSound.Range, AnimController.WorldPosition);
}
private void ImplodeFX()
partial void ImplodeFX()
{
Vector2 centerOfMass = AnimController.GetCenterOfMass();

View File

@@ -110,7 +110,7 @@ namespace Barotrauma
}
}
private void InitProjSpecific(XDocument doc)
partial void InitProjSpecific(XDocument doc)
{
if (doc == null)
{

View File

@@ -18,7 +18,7 @@ namespace Barotrauma
private GUIButton[] useOnSelfButton;
void InitProjSpecific()
partial void InitProjSpecific()
{
useOnSelfButton = new GUIButton[2];

View File

@@ -19,7 +19,7 @@ namespace Barotrauma.Items.Components
private GUIProgressBar progressBar;
private GUIButton activateButton;
private void InitProjSpecific()
partial void InitProjSpecific()
{
GuiFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);

View File

@@ -12,7 +12,7 @@ namespace Barotrauma.Items.Components
{
private GUITickBox isActiveTickBox;
private void InitProjSpecific()
partial void InitProjSpecific()
{
isActiveTickBox = new GUITickBox(new Rectangle(0, 0, 20, 20), "Running", Alignment.TopLeft, GuiFrame);
isActiveTickBox.OnSelected = (GUITickBox box) =>

View File

@@ -12,7 +12,7 @@ namespace Barotrauma.Items.Components
{
private GUITickBox autoTempTickBox;
private void InitProjSpecific()
partial void InitProjSpecific()
{
var button = new GUIButton(new Rectangle(410, 70, 40, 40), "-", "", GuiFrame);
button.OnPressed = () =>

View File

@@ -35,7 +35,7 @@ namespace Barotrauma.Items.Components
set { maintainPosTickBox.Selected = value; }
}
private void InitProjSpecific()
partial void InitProjSpecific()
{
autopilotTickBox = new GUITickBox(new Rectangle(0, 25, 20, 20), "Autopilot", Alignment.TopLeft, GuiFrame);
autopilotTickBox.OnSelected = (GUITickBox box) =>

View File

@@ -9,7 +9,7 @@ namespace Barotrauma.Items.Components
{
partial class PowerContainer : Powered, IDrawableComponent, IServerSerializable, IClientSerializable
{
private void InitProjSpecific()
partial void InitProjSpecific()
{
if (canBeSelected)
{

View File

@@ -10,7 +10,7 @@ namespace Barotrauma
{
partial class Explosion
{
private void ExplodeProjSpecific(Vector2 worldPosition,Hull hull)
partial void ExplodeProjSpecific(Vector2 worldPosition,Hull hull)
{
if (shockwave)

View File

@@ -14,7 +14,7 @@ namespace Barotrauma
private LightSource lightSource;
private void UpdateProjSpecific(float growModifier)
partial void UpdateProjSpecific(float growModifier)
{
if (hull.FireSources.Any(fs => fs != this && fs.size.X > size.X))
{

View File

@@ -95,7 +95,7 @@ namespace Barotrauma
1.0f, SpriteEffects.None, 0.0f);
}
private void DisposeProjSpecific()
partial void DisposeProjSpecific()
{
if (bodyShapeTexture != null)
{

View File

@@ -35,7 +35,7 @@ namespace Barotrauma
list.Add(this);
}
private void LoadTexture(ref Vector4 sourceVector,ref bool shouldReturn)
partial void LoadTexture(ref Vector4 sourceVector,ref bool shouldReturn)
{
texture = LoadTexture(this.file);
@@ -49,7 +49,7 @@ namespace Barotrauma
if (sourceVector.W == 0.0f) sourceVector.W = texture.Height;
}
private void CalculateSourceRect()
partial void CalculateSourceRect()
{
sourceRect = new Rectangle(0, 0, texture.Width, texture.Height);
}
@@ -261,7 +261,7 @@ namespace Barotrauma
}
}
private void DisposeTexture()
partial void DisposeTexture()
{
//check if another sprite is using the same texture
foreach (Sprite s in list)

View File

@@ -67,27 +67,18 @@
<Compile Include="Source\GameMain.cs" />
<Compile Include="Source\GameSession\GameSession.cs" />
<Compile Include="Source\GameSettings.cs" />
<Compile Include="Source\Items\CharacterInventory.cs" />
<Compile Include="Source\Items\Components\ItemComponent.cs" />
<Compile Include="Source\Items\Components\ItemLabel.cs" />
<Compile Include="Source\Items\Components\Machines\Pump.cs" />
<Compile Include="Source\Items\Components\Machines\Reactor.cs" />
<Compile Include="Source\Items\Components\Machines\Fabricator.cs" />
<Compile Include="Source\Items\Components\Machines\Steering.cs" />
<Compile Include="Source\Items\Components\Power\PowerContainer.cs" />
<Compile Include="Source\Map\Explosion.cs" />
<Compile Include="Source\Map\FireSource.cs" />
<Compile Include="Source\Map\Hull.cs" />
<Compile Include="Source\Networking\GameClient.cs" />
<Compile Include="Source\Networking\GameServer.cs" />
<Compile Include="Source\Networking\NetworkMember.cs" />
<Compile Include="Source\Networking\Voting.cs" />
<Compile Include="Source\Physics\PhysicsBody.cs" />
<Compile Include="Source\PlayerInput.cs" />
<Compile Include="Source\Program.cs" />
<Compile Include="Source\Screens\NetLobbyScreen.cs" />
<Compile Include="Source\Screens\UnimplementedScreen.cs" />
<Compile Include="Source\Sprite\Sprite.cs" />
<Compile Include="Source\Utils\MonogameTypes\Color.cs" />
<Compile Include="Source\Utils\MonogameTypes\Graphics\SpriteEffects.cs" />
<Compile Include="Source\Utils\MonogameTypes\Input\KeyboardState.cs" />

View File

@@ -28,15 +28,5 @@ namespace Barotrauma
{
keys = null;
}
private void UpdateControlled(float deltaTime)
{
//do nothing
}
private void ImplodeFX()
{
//do nothing
}
}
}

View File

@@ -14,10 +14,6 @@ namespace Barotrauma
public partial class GameSettings
{
private void InitProjSpecific(XDocument doc)
{
//do nothing
}
public void Save(string filePath)
{
XDocument doc = new XDocument();

View File

@@ -1,19 +0,0 @@
using System;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Barotrauma.Networking;
using Lidgren.Network;
using System.Collections.Generic;
using Barotrauma.Items.Components;
namespace Barotrauma
{
partial class CharacterInventory : Inventory
{
void InitProjSpecific()
{
//do nothing
}
}
}

View File

@@ -1,20 +0,0 @@
using Barotrauma.Networking;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
partial class Fabricator : Powered, IServerSerializable, IClientSerializable
{
private void InitProjSpecific()
{
//do nothing
}
}
}

View File

@@ -1,18 +0,0 @@
using Barotrauma.Networking;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Specialized;
using System.Globalization;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
partial class Pump : Powered, IServerSerializable, IClientSerializable
{
private void InitProjSpecific()
{
//do nothing
}
}
}

View File

@@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Barotrauma.Networking;
namespace Barotrauma.Items.Components
{
partial class Reactor : Powered, IDrawableComponent, IServerSerializable, IClientSerializable
{
private void InitProjSpecific()
{
//do nothing
}
}
}

View File

@@ -17,10 +17,5 @@ namespace Barotrauma.Items.Components
public bool MaintainPos;
public bool LevelStartSelected;
public bool LevelEndSelected;
private void InitProjSpecific()
{
//do nothing
}
}
}

View File

@@ -1,17 +0,0 @@
using System;
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Barotrauma.Networking;
using Lidgren.Network;
namespace Barotrauma.Items.Components
{
partial class PowerContainer : Powered, IDrawableComponent, IServerSerializable, IClientSerializable
{
private void InitProjSpecific()
{
//do nothing
}
}
}

View File

@@ -1,17 +0,0 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Barotrauma.Networking;
using FarseerPhysics;
namespace Barotrauma
{
partial class Explosion
{
private void ExplodeProjSpecific(Vector2 worldPosition,Hull hull)
{
//do nothing
}
}
}

View File

@@ -1,17 +0,0 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Barotrauma.Networking;
namespace Barotrauma
{
partial class FireSource
{
private void UpdateProjSpecific(float growModifier)
{
//do nothing
}
}
}

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Barotrauma
{
partial class PhysicsBody
{
private void DisposeProjSpecific()
{
//do nothing
}
}
}

View File

@@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
namespace Barotrauma
{
public partial class Sprite
{
private void LoadTexture(ref Vector4 sourceVector, ref bool shouldReturn)
{
//do nothing
}
private void CalculateSourceRect()
{
//do nothing
}
private void DisposeTexture()
{
//do nothing
}
}
}

View File

@@ -1442,6 +1442,8 @@ namespace Barotrauma
if (!IsDead) LockHands = false;
}
partial void UpdateControlled(float deltaTime);
private void UpdateOxygen(float deltaTime)
{
float prevOxygen = oxygen;
@@ -1617,6 +1619,8 @@ namespace Barotrauma
joint.LimitEnabled = false;
}
}
partial void ImplodeFX();
public void Kill(CauseOfDeath causeOfDeath, bool isNetworkMessage = false)
{

View File

@@ -66,5 +66,6 @@ namespace Barotrauma
}
}
partial void InitProjSpecific(XDocument doc);
}
}

View File

@@ -32,6 +32,8 @@ namespace Barotrauma
InitProjSpecific();
}
partial void InitProjSpecific();
private bool UseItemOnSelf(int slotIndex)
{
if (Items[slotIndex] == null) return false;

View File

@@ -106,6 +106,8 @@ namespace Barotrauma.Items.Components
InitProjSpecific();
}
partial void InitProjSpecific();
public override bool Select(Character character)
{
CheckFabricableItems(character);

View File

@@ -70,6 +70,8 @@ namespace Barotrauma.Items.Components
InitProjSpecific();
}
partial void InitProjSpecific();
public override void Move(Vector2 amount)
{
base.Move(amount);

View File

@@ -166,6 +166,8 @@ namespace Barotrauma.Items.Components
InitProjSpecific();
}
partial void InitProjSpecific();
public override void Update(float deltaTime, Camera cam)
{
if (GameMain.Server != null && nextServerLogWriteTime != null)

View File

@@ -104,7 +104,9 @@ namespace Barotrauma.Items.Components
InitProjSpecific();
}
partial void InitProjSpecific();
public override void Update(float deltaTime, Camera cam)
{
if (unsentChanges)

View File

@@ -95,6 +95,8 @@ namespace Barotrauma.Items.Components
InitProjSpecific();
}
partial void InitProjSpecific();
public override bool Pick(Character picker)
{
if (picker == null) return false;

View File

@@ -80,6 +80,8 @@ namespace Barotrauma
}
partial void ExplodeProjSpecific(Vector2 worldPosition, Hull hull);
private Vector2 ClampParticlePos(Vector2 particlePos, Hull hull)
{
if (hull == null) return particlePos;

View File

@@ -169,6 +169,8 @@ namespace Barotrauma
if (size.X < 1.0f) Remove();
}
partial void UpdateProjSpecific(float growModifier);
private void OnChangeHull(Vector2 pos, Hull particleHull)
{
if (particleHull == hull || particleHull==null) return;

View File

@@ -535,5 +535,6 @@ namespace Barotrauma
DisposeProjSpecific();
}
partial void DisposeProjSpecific();
}
}

View File

@@ -60,6 +60,9 @@ namespace Barotrauma
return FilePath + ": " + sourceRect;
}
partial void LoadTexture(ref Vector4 sourceVector, ref bool shouldReturn);
partial void CalculateSourceRect();
public Sprite(XElement element, string path = "", string file = "")
{
if (file == "")
@@ -157,6 +160,8 @@ namespace Barotrauma
DisposeTexture();
}
partial void DisposeTexture();
}
}