Navigation requires power, locationtypes and missions included in content packages

This commit is contained in:
Regalis
2016-02-18 22:04:47 +02:00
parent cd4e3a3d2a
commit 9e11134bd3
10 changed files with 50 additions and 29 deletions
+1 -1
View File
@@ -29,7 +29,7 @@
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="0,0,64,128"/>
<Steering minvoltage="0.5" canbeselected = "true">
<Steering minvoltage="0.5" canbeselected = "true" powerconsumption="10">
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.6"/>
</Steering>
@@ -36,6 +36,8 @@
<Character file="Content/Characters/Watcher/watcher.xml" />
<Structure file="Content/Map/StructurePrefabs.xml" />
<RandomEvents file="Content/randomevents.xml" />
<LocationTypes file="Content/Map/locationTypes.xml" />
<Missions file="Content/Missions.xml" />
<Jobs file="Content/Jobs.xml" />
<Executable file="Barotrauma.exe" />
</contentpackage>
+2 -2
View File
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.2.5")]
[assembly: AssemblyFileVersion("0.3.2.5")]
[assembly: AssemblyVersion("0.3.2.6")]
[assembly: AssemblyFileVersion("0.3.2.6")]
+1 -1
View File
@@ -10,7 +10,7 @@ namespace Barotrauma
{
public enum ContentType
{
None, Jobs, Item, Character, Structure, Executable, RandomEvents
None, Jobs, Item, Character, Structure, Executable, LocationTypes, RandomEvents, Missions
}
public class ContentPackage
+4 -3
View File
@@ -10,9 +10,7 @@ namespace Barotrauma
class Mission
{
private static List<Mission> list = new List<Mission>();
private static string configFile = "Content/Missions.xml";
private string name;
private string description;
@@ -96,6 +94,9 @@ namespace Barotrauma
public static Mission LoadRandom(Location[] locations, Random rand)
{
var files = GameMain.SelectedPackage.GetFilesOfType(ContentType.Missions);
string configFile = files[rand.Next(files.Count)];
XDocument doc = ToolBox.TryLoadXml(configFile);
if (doc == null) return null;
+1 -1
View File
@@ -253,7 +253,7 @@ namespace Barotrauma
ParticleManager = new ParticleManager("Content/Particles/ParticlePrefabs.xml", Cam);
yield return CoroutineStatus.Running;
LocationType.Init("Content/Map/locationTypes.xml");
LocationType.Init();
MainMenuScreen.Select();
TitleScreen.LoadState = 100.0f;
@@ -117,18 +117,10 @@ namespace Barotrauma.Items.Components
{
//base.Update(deltaTime, cam);
//if (voltage < minVoltage) return;
if (voltage < minVoltage) return;
if (autoPilot)
{
//if (steeringPath==null)
//{
// PathFinder pathFinder = new PathFinder(WayPoint.WayPointList, false);
// steeringPath = pathFinder.FindPath(
// ConvertUnits.ToSimUnits(Level.Loaded.StartPosition),
// ConvertUnits.ToSimUnits(Level.Loaded.EndPosition));
//}
UpdateAutoPilot(deltaTime);
}
else if (valueChanged)
@@ -149,6 +141,9 @@ namespace Barotrauma.Items.Components
targetLevel += (neutralBallastLevel - 0.5f) * 100.0f;
item.SendSignal(targetLevel.ToString(CultureInfo.InvariantCulture), "velocity_y_out");
voltage -= deltaTime;
}
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
@@ -162,13 +157,15 @@ namespace Barotrauma.Items.Components
GuiFrame.Update(1.0f / 60.0f);
GuiFrame.Draw(spriteBatch);
if (voltage < minVoltage) return;
Rectangle velRect = new Rectangle(x + 20, y + 20, width - 40, height - 40);
//GUI.DrawRectangle(spriteBatch, velRect, Color.White, false);
if (Submarine.Loaded != null && Level.Loaded != null)
{
Vector2 realWorldVelocity = ConvertUnits.ToDisplayUnits(Submarine.Loaded.Velocity * Physics.DisplayToRealWorldRatio) * 3.6f;
float realWorldDepth = (Submarine.Loaded.Position.Y - Level.Loaded.Size.Y) *Physics.DisplayToRealWorldRatio;
float realWorldDepth = Math.Abs(Submarine.Loaded.Position.Y - Level.Loaded.Size.Y) * Physics.DisplayToRealWorldRatio;
GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 65),
"Velocity: " + (int)realWorldVelocity.X + " km/h", Color.LightGreen, null, 0, GUI.SmallFont);
GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 50),
@@ -306,7 +303,11 @@ namespace Barotrauma.Items.Components
if (connection.Name == "velocity_in")
{
currVelocity = ToolBox.ParseToVector2(signal, false);
}
}
else
{
base.ReceiveSignal(signal, connection, sender, power);
}
}
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
+16 -10
View File
@@ -127,20 +127,26 @@ namespace Barotrauma
return null;
}
public static void Init(string file)
public static void Init()
{
XDocument doc = ToolBox.TryLoadXml(file);
if (doc==null)
var locationTypeFiles = GameMain.SelectedPackage.GetFilesOfType(ContentType.LocationTypes);
foreach (string file in locationTypeFiles)
{
return;
XDocument doc = ToolBox.TryLoadXml(file);
if (doc==null)
{
return;
}
foreach (XElement element in doc.Root.Elements())
{
LocationType locationType = new LocationType(element);
list.Add(locationType);
}
}
foreach (XElement element in doc.Root.Elements())
{
LocationType locationType = new LocationType(element);
list.Add(locationType);
}
}
}
}
+11
View File
@@ -1,3 +1,14 @@
---------------------------------------------------------------------------------------------------------
v0.3.2.6
---------------------------------------------------------------------------------------------------------
- fixed the broken password box
- location types and missions are included in content packages
- junction boxes and power sources can be connected with multiple parallel wires without multiplying
the power output
-
---------------------------------------------------------------------------------------------------------
v0.3.2.5
---------------------------------------------------------------------------------------------------------
Binary file not shown.