Some cleanup using ReSharper (mostly removing redundancies)

This commit is contained in:
Regalis
2016-03-12 15:32:34 +02:00
parent ae4e4d8f34
commit d1580328ed
99 changed files with 197 additions and 483 deletions
+2 -7
View File
@@ -206,12 +206,7 @@ namespace Barotrauma
{
var frame = c.CreateCharacterFrame(hireList, c.Name + " (" + c.Job.Name + ")", c);
//GUITextBlock textBlock = new GUITextBlock(
// new Rectangle(0, 0, 0, 25),
// c.Name + " (" + c.Job.Name + ")", GUI.Style, hireList);
//textBlock.UserData = c;
var textBlock = new GUITextBlock(
new GUITextBlock(
new Rectangle(0, 0, 0, 25),
c.Salary.ToString(),
null, null,
@@ -475,7 +470,7 @@ namespace Barotrauma
GUIComponent prevInfoFrame = null;
foreach (GUIComponent child in bottomPanel[selectedRightPanel].children)
{
if (child.UserData as CharacterInfo == null) continue;
if (!(child.UserData is CharacterInfo)) continue;
prevInfoFrame = child;
}
+1 -4
View File
@@ -208,16 +208,13 @@ namespace Barotrauma
otherButton.Selected = false;
}
if (Screen.Selected != this) Select();
if (Selected != this) Select();
return true;
}
public void SelectTab(Tab tab)
{
int oldTab = selectedTab;
if (GameMain.Config.UnsavedSettings)
{
var applyBox = new GUIMessageBox("Apply changes?", "Do you want to apply the settings or discard the changes?",
+2 -2
View File
@@ -246,7 +246,7 @@ namespace Barotrauma
//traitor probability ------------------------------------------------------------------
var traitorText = new GUITextBlock(new Rectangle(columnX, 180, 20, 20), "Traitors:", GUI.Style, infoFrame);
new GUITextBlock(new Rectangle(columnX, 180, 20, 20), "Traitors:", GUI.Style, infoFrame);
traitorProbabilityButtons = new GUIButton[2];
@@ -1000,7 +1000,7 @@ namespace Barotrauma
//msg.Write(durationBar.BarScroll);
msg.Write(LevelSeed);
msg.Write(GameMain.Server == null ? false : GameMain.Server.AutoRestart);
msg.Write(GameMain.Server != null && GameMain.Server.AutoRestart);
msg.Write(GameMain.Server == null ? 0.0f : GameMain.Server.AutoRestartTimer);
msg.Write((byte)(playerList.CountChildren));
+1 -2
View File
@@ -45,11 +45,10 @@ namespace Barotrauma
private IEnumerable<object> UpdateColorFade(Color from, Color to, float duration)
{
while (Screen.Selected != this)
while (Selected != this)
{
yield return CoroutineStatus.Running;
}
float timer = 0.0f;
@@ -1,12 +1,7 @@
using System;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Barotrauma.Networking;
using FarseerPhysics;
using FarseerPhysics.Factories;
using FarseerPhysics.Dynamics;
using System.IO;
using System.Collections.Generic;
using RestSharp;