stairs fix, wraptext fix, moved drawing sprites from GUIFrame to GUIComponent, server name and "welcome text" in netlobby

This commit is contained in:
Regalis
2015-07-21 18:43:57 +03:00
parent 326b46cf18
commit 9a7eae8ace
15 changed files with 158 additions and 59 deletions

View File

@@ -44,7 +44,7 @@ namespace Subsurface
private string RandomName(LocationType type)
{
string name = ToolBox.GetRandomLine("Content/Map/locationNames.txt");
int nameFormatIndex = Rand.Int(type.NameFormats.Count);
int nameFormatIndex = Rand.Int(type.NameFormats.Count, false);
return type.NameFormats[nameFormatIndex].Replace("[name]", name);
}
}

View File

@@ -47,7 +47,7 @@ namespace Subsurface
{
Debug.Assert(list.Count > 0, "LocationType.list.Count == 0, you probably need to initialize LocationTypes");
int randInt = Rand.Int(totalWeight);
int randInt = Rand.Int(totalWeight, false);
foreach (LocationType type in list)
{

View File

@@ -64,8 +64,7 @@ namespace Subsurface
iceTexture = Game1.TextureLoader.FromFile("Content/Map/iceSurface.png");
iceCraters = Game1.TextureLoader.FromFile("Content/Map/iceCraters.png");
iceCrack = Game1.TextureLoader.FromFile("Content/Map/iceCrack.png");
Rand.SetSyncedSeed(this.seed);
GenerateLocations();

View File

@@ -208,7 +208,7 @@ namespace Subsurface
bodies = new List<Body>();
Body newBody = BodyFactory.CreateRectangle(Game1.World,
ConvertUnits.ToSimUnits(rect.Width * Math.Sqrt(2.0) - Submarine.GridSize.X),
ConvertUnits.ToSimUnits(rect.Width * Math.Sqrt(2.0) + Submarine.GridSize.X*3.0f),
ConvertUnits.ToSimUnits(10),
1.5f);
@@ -218,7 +218,6 @@ namespace Subsurface
(StairDirection == Direction.Right) ? -Submarine.GridSize.X*1.5f : Submarine.GridSize.X*1.5f,
- Submarine.GridSize.Y*2.0f);
newBody.Position = ConvertUnits.ToSimUnits(stairPos);
newBody.Rotation = (StairDirection == Direction.Right) ? MathHelper.PiOver4 : -MathHelper.PiOver4;
newBody.Friction = 0.8f;
@@ -228,6 +227,25 @@ namespace Subsurface
newBody.UserData = this;
bodies.Add(newBody);
//newBody = BodyFactory.CreateRectangle(Game1.World,
// ConvertUnits.ToSimUnits(Submarine.GridSize.X*2),
// ConvertUnits.ToSimUnits(10.0f),
// 1.5f);
//newBody.BodyType = BodyType.Static;
////newBody.IsSensor = true;
//newBody.Position = ConvertUnits.ToSimUnits(
// new Vector2(Position.X + (rect.Width/2 + Submarine.GridSize.X) * ((StairDirection == Direction.Right) ? -1.0f : 1.0f), rect.Y + 5.0f));
////newBody.Rotation = (StairDirection == Direction.Right) ? MathHelper.PiOver4 : -MathHelper.PiOver4;
////newBody.Friction = 0.8f;
//newBody.CollisionCategories = Physics.CollisionStairs;
//newBody.UserData = this;
//bodies.Add(newBody);
}
}