GUIStyle improvements & some simple UI graphics, networking bugfixes, separate Random class, some StyleCop cleanup

This commit is contained in:
Regalis
2015-07-02 22:24:50 +03:00
parent b493ed2b39
commit d836a99515
119 changed files with 8842 additions and 1277 deletions
+3 -3
View File
@@ -25,15 +25,15 @@ namespace Subsurface
{
WayPoint randomWayPoint = WayPoint.GetRandom(WayPoint.SpawnType.Enemy);
int amount = Game1.random.Next(minAmount, maxAmount);
int amount = Rand.Range(minAmount, maxAmount, false);
monsters = new Character[amount];
for (int i = 0; i < amount; i++)
{
Vector2 position = (randomWayPoint == null) ? Vector2.Zero : randomWayPoint.SimPosition;
position.X += MathUtils.RandomFloatLocal(-0.5f,0.5f);
position.Y += MathUtils.RandomFloatLocal(-0.5f,0.5f);
position.X += Rand.Range(-0.5f, 0.5f);
position.Y += Rand.Range(-0.5f, 0.5f);
monsters[i] = new Character(characterFile, position);
}
}
+2 -2
View File
@@ -125,7 +125,7 @@ namespace Subsurface
i++;
}
float randomNumber = (float)Game1.random.NextDouble() * probabilitySum;
float randomNumber = Rand.Range(0.0f,probabilitySum);
i = 0;
foreach (XElement element in doc.Root.Elements())
@@ -169,7 +169,7 @@ namespace Subsurface
{
isStarted = false;
isFinished = false;
startTimer = Game1.random.Next(startTimeMin, startTimeMax);
startTimer = Rand.Range(startTimeMin, startTimeMax, false);
}
protected virtual void Start()
+4 -4
View File
@@ -35,7 +35,7 @@ namespace Subsurface
taskListBox = new GUIListBox(new Rectangle(Game1.GraphicsWidth - 250, 50, 250, 500), Color.Transparent);
//taskListBox.ScrollBarEnabled = false;
taskListBox.Padding = GUI.style.smallPadding;
//taskListBox.Padding = GUI.style.smallPadding;
}
public void AddTask(Task newTask)
@@ -83,12 +83,12 @@ namespace Subsurface
color = Color.Orange;
}
GUIFrame frame = new GUIFrame(new Rectangle(0,0,width,40), Color.Transparent, Alignment.Right, taskListBox);
GUIFrame frame = new GUIFrame(new Rectangle(0,0,width,40), Color.Transparent, Alignment.Right, null, taskListBox);
frame.UserData = task;
frame.Padding = new Vector4(0.0f, 5.0f, 5.0f, 5.0f);
GUIFrame colorFrame = new GUIFrame(new Rectangle(0, 0, 0, 0), color * 0.5f, Alignment.Right, frame);
GUITextBlock textBlock = new GUITextBlock(new Rectangle(5, 5, 0, 20), task.Name, Color.Transparent, Color.Black, Alignment.Right, colorFrame);
GUIFrame colorFrame = new GUIFrame(new Rectangle(0, 0, 0, 0), color * 0.5f, Alignment.Right, null, frame);
GUITextBlock textBlock = new GUITextBlock(new Rectangle(5, 5, 0, 20), task.Name, Color.Transparent, Color.Black, Alignment.Right, null, colorFrame);
//textBlock.Padding = new Vector4(10.0f, 10.0f, 0.0f, 0.0f);
//colorFrame.AddChild(textBlock);