From 9e11134bd305223282a9871ebb9605e80a7b5224 Mon Sep 17 00:00:00 2001 From: Regalis Date: Thu, 18 Feb 2016 22:04:47 +0200 Subject: [PATCH] Navigation requires power, locationtypes and missions included in content packages --- Subsurface/Content/Items/Engine/engine.xml | 2 +- .../Data/ContentPackages/Vanilla 0.3.xml | 2 ++ Subsurface/Properties/AssemblyInfo.cs | 4 +-- Subsurface/Source/ContentPackage.cs | 2 +- Subsurface/Source/Events/Quests/Quest.cs | 7 +++-- Subsurface/Source/GameMain.cs | 2 +- .../Items/Components/Machines/Steering.cs | 23 ++++++++-------- Subsurface/Source/Map/Map/LocationType.cs | 26 +++++++++++------- Subsurface/changelog.txt | 11 ++++++++ Subsurface_Solution.v12.suo | Bin 930304 -> 930304 bytes 10 files changed, 50 insertions(+), 29 deletions(-) diff --git a/Subsurface/Content/Items/Engine/engine.xml b/Subsurface/Content/Items/Engine/engine.xml index 56ce5cb6d..741dc979e 100644 --- a/Subsurface/Content/Items/Engine/engine.xml +++ b/Subsurface/Content/Items/Engine/engine.xml @@ -29,7 +29,7 @@ - + diff --git a/Subsurface/Data/ContentPackages/Vanilla 0.3.xml b/Subsurface/Data/ContentPackages/Vanilla 0.3.xml index 9348a625f..7c02ddc28 100644 --- a/Subsurface/Data/ContentPackages/Vanilla 0.3.xml +++ b/Subsurface/Data/ContentPackages/Vanilla 0.3.xml @@ -36,6 +36,8 @@ + + diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index 63dd17eb2..17cfa604d 100644 --- a/Subsurface/Properties/AssemblyInfo.cs +++ b/Subsurface/Properties/AssemblyInfo.cs @@ -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")] diff --git a/Subsurface/Source/ContentPackage.cs b/Subsurface/Source/ContentPackage.cs index 803fbef5b..caa18b81c 100644 --- a/Subsurface/Source/ContentPackage.cs +++ b/Subsurface/Source/ContentPackage.cs @@ -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 diff --git a/Subsurface/Source/Events/Quests/Quest.cs b/Subsurface/Source/Events/Quests/Quest.cs index 87e3ef798..64b1ec523 100644 --- a/Subsurface/Source/Events/Quests/Quest.cs +++ b/Subsurface/Source/Events/Quests/Quest.cs @@ -10,9 +10,7 @@ namespace Barotrauma class Mission { private static List list = new List(); - - 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; diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index 70bc95b17..dd83c7cb0 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -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; diff --git a/Subsurface/Source/Items/Components/Machines/Steering.cs b/Subsurface/Source/Items/Components/Machines/Steering.cs index 9bc6e3bc1..3a8b59066 100644 --- a/Subsurface/Source/Items/Components/Machines/Steering.cs +++ b/Subsurface/Source/Items/Components/Machines/Steering.cs @@ -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) diff --git a/Subsurface/Source/Map/Map/LocationType.cs b/Subsurface/Source/Map/Map/LocationType.cs index cbf510651..1d0e8bc3d 100644 --- a/Subsurface/Source/Map/Map/LocationType.cs +++ b/Subsurface/Source/Map/Map/LocationType.cs @@ -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); - } } } } diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 2f7e64523..f5643c177 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -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 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 1da1054f47164f3dd4eb702039aa9a977b0a4634..569f66c8b0587f9037731e9c7f86691a3f19d1bf 100644 GIT binary patch delta 2537 zcmb_d3viUx72b32-DUsX&1T7x2q7fD%kmD>4Uw8!+hj>JB!;I64Vn@#DKC|R#t6v3 z5<{s_>F(ZiPh}bg4D<7lwvifu<@ifKS-Yl=?dP=Tc9Coqi;cG?+t z=9}}l=bn51`<;6>)RhzJ$_WR6MY2XFbBo1dC)fyKuvnagHzJEhYKxe~@)t6`Cx;5J z@)TH?LXbHS68$G*+v+@zUoqeZ@$bpOEV|47oc zx%44_qL|Y%*_**KL4MskQG8@>s`ggH$MW~y(KmwQm%aDu1KS3bA_kQ*uvn5<@t#ESXAG0W*WV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