Merged branch temp-netcode into new-netcode

This commit is contained in:
juanjp600
2016-10-11 21:39:14 -03:00
153 changed files with 3392 additions and 67475 deletions
Binary file not shown.
-15
View File
@@ -1,15 +0,0 @@
#----------------------------- Global Properties ----------------------------#
/outputDir:bin/Windows
/intermediateDir:obj/Windows
/platform:Windows
/config:
/profile:Reach
/compress:False
#-------------------------------- References --------------------------------#
#---------------------------------- Content ---------------------------------#
-73
View File
@@ -1,73 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6BE950CD-9A34-49C9-939A-786AC89C287E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CrashReporter</RootNamespace>
<AssemblyName>CrashReporter</AssemblyName>
<FileAlignment>512</FileAlignment>
<MonoGamePlatform>Windows</MonoGamePlatform>
<MonoGameContentBuilderExe>
</MonoGameContentBuilderExe>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Windows\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Windows\Release\</OutputPath>
<DefineConstants>TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Compile Include="ReporterMain.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="MonoGame.Framework">
<HintPath>$(MSBuildProgramFiles32)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Content Include="Icon.ico" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Subsurface\Barotrauma.csproj">
<Project>{008c0f83-e914-4966-9135-ea885059edd8}</Project>
<Name>Barotrauma</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

-26
View File
@@ -1,26 +0,0 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace CrashReporter
{
#if WINDOWS || LINUX
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using (var game = new ReporterMain())
game.Run();
}
}
#endif
}
-36
View File
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CrashReporter")]
[assembly: AssemblyProduct("CrashReporter")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5087c690-b7c4-4087-979a-a064ada558b4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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("3.3.0.2069")]
[assembly: AssemblyFileVersion("3.3.0.2069")]
-147
View File
@@ -1,147 +0,0 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Barotrauma;
using System.IO;
namespace CrashReporter
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class ReporterMain : Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
int graphicsWidth, graphicsHeight;
Texture2D backgroundTexture, titleTexture;
GUIFrame guiRoot;
string crashReport;
public ReporterMain()
: base()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 640;
graphics.PreferredBackBufferHeight = 360;
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
graphicsWidth = GraphicsDevice.Viewport.Width;
graphicsHeight = GraphicsDevice.Viewport.Height;
TextureLoader.Init(GraphicsDevice);
GUI.Init(Content);
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
GUI.LoadContent(GraphicsDevice);
backgroundTexture = TextureLoader.FromFile("Content/UI/titleBackground.png");
titleTexture = TextureLoader.FromFile("Content/UI/titleText.png");
guiRoot = new GUIFrame(new Rectangle(0, 0, graphicsWidth, graphicsHeight), Color.Transparent);
guiRoot.Padding = new Vector4(40.0f, 40.0f, 40.0f, 40.0f);
GUIListBox infoBox = new GUIListBox(new Rectangle(0, 0, 330, 150), GUI.Style, guiRoot);
infoBox.Visible = false;
crashReport = System.IO.File.ReadAllText("CrashReport.txt");
string wrappedText = ToolBox.WrapText(crashReport, infoBox.Rect.Width, GUI.SmallFont);
int lineHeight = (int)GUI.SmallFont.MeasureString(" ").Y;
string[] lines = wrappedText.Split('\n');
foreach (string line in lines)
{
if (string.IsNullOrWhiteSpace(line)) continue;
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(0, 0, 0, lineHeight),
line, GUI.Style,
Alignment.TopLeft, Alignment.TopLeft,
infoBox, false, GUI.SmallFont);
textBlock.CanBeFocused = false;
}
GUIButton sendButton = new GUIButton(new Rectangle(0, 0, 100, 30), "SEND", Alignment.BottomRight, GUI.Style, guiRoot);
//se.OnClicked = LaunchClick;
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
// TODO: Add your update logic here
base.Update(gameTime);
guiRoot.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
guiRoot.Draw(spriteBatch);
spriteBatch.End();
}
private void SendReport()
{
}
}
}
-416
View File
@@ -1,416 +0,0 @@
<stylecopresultscache>
<version>12</version>
<project key="-635107402">
<configuration>DEBUG;TRACE;WINDOWS</configuration>
</project>
<sourcecode name="Game1.cs" parser="StyleCop.CSharp.CsParser">
<timestamps>
<styleCop>2014.04.01 10:18:24.000</styleCop>
<settingsFile>2012.09.27 21:03:32.000</settingsFile>
<sourceFile>2015.09.17 23:21:18.138</sourceFile>
<parser>2014.04.01 10:18:24.000</parser>
<StyleCop.CSharp.DocumentationRules>2014.04.01 10:18:24.000</StyleCop.CSharp.DocumentationRules>
<StyleCop.CSharp.DocumentationRules.FilesHashCode>-1945363787</StyleCop.CSharp.DocumentationRules.FilesHashCode>
<StyleCop.CSharp.LayoutRules>2014.04.01 10:18:24.000</StyleCop.CSharp.LayoutRules>
<StyleCop.CSharp.LayoutRules.FilesHashCode>0</StyleCop.CSharp.LayoutRules.FilesHashCode>
<StyleCop.CSharp.MaintainabilityRules>2014.04.01 10:18:24.000</StyleCop.CSharp.MaintainabilityRules>
<StyleCop.CSharp.MaintainabilityRules.FilesHashCode>0</StyleCop.CSharp.MaintainabilityRules.FilesHashCode>
<StyleCop.CSharp.NamingRules>2014.04.01 10:18:24.000</StyleCop.CSharp.NamingRules>
<StyleCop.CSharp.NamingRules.FilesHashCode>0</StyleCop.CSharp.NamingRules.FilesHashCode>
<StyleCop.CSharp.OrderingRules>2014.04.01 10:18:24.000</StyleCop.CSharp.OrderingRules>
<StyleCop.CSharp.OrderingRules.FilesHashCode>0</StyleCop.CSharp.OrderingRules.FilesHashCode>
<StyleCop.CSharp.ReadabilityRules>2014.04.01 10:18:24.000</StyleCop.CSharp.ReadabilityRules>
<StyleCop.CSharp.ReadabilityRules.FilesHashCode>0</StyleCop.CSharp.ReadabilityRules.FilesHashCode>
<StyleCop.CSharp.SpacingRules>2014.04.01 10:18:24.000</StyleCop.CSharp.SpacingRules>
<StyleCop.CSharp.SpacingRules.FilesHashCode>0</StyleCop.CSharp.SpacingRules.FilesHashCode>
</timestamps>
<violations>
<violation namespace="StyleCop.CSharp.DocumentationRules" rule="FileMustHaveHeader" ruleCheckId="SA1633">
<context>The file has no header, the header Xml is invalid, or the header is not located at the top of the file.</context>
<line>1</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.OrderingRules" rule="UsingDirectivesMustBePlacedWithinNamespace" ruleCheckId="SA1200">
<context>All using directives must be placed inside of the namespace.</context>
<line>1</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.OrderingRules" rule="UsingDirectivesMustBePlacedWithinNamespace" ruleCheckId="SA1200">
<context>All using directives must be placed inside of the namespace.</context>
<line>2</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.OrderingRules" rule="UsingDirectivesMustBePlacedWithinNamespace" ruleCheckId="SA1200">
<context>All using directives must be placed inside of the namespace.</context>
<line>3</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.OrderingRules" rule="UsingDirectivesMustBePlacedWithinNamespace" ruleCheckId="SA1200">
<context>All using directives must be placed inside of the namespace.</context>
<line>4</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.OrderingRules" rule="UsingDirectivesMustBePlacedWithinNamespace" ruleCheckId="SA1200">
<context>All using directives must be placed inside of the namespace.</context>
<line>5</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.OrderingRules" rule="SystemUsingDirectivesMustBePlacedBeforeOtherUsingDirectives" ruleCheckId="SA1208">
<context>System using directives must be placed before all other using directives.</context>
<line>5</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="CodeMustNotContainMultipleBlankLinesInARow" ruleCheckId="SA1507">
<context>The code must not contain multiple blank lines in a row.</context>
<line>23</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="CodeMustNotContainMultipleBlankLinesInARow" ruleCheckId="SA1507">
<context>The code must not contain multiple blank lines in a row.</context>
<line>24</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.DocumentationRules" rule="ElementsMustBeDocumented" ruleCheckId="SA1600">
<context>The field must have a documentation header.</context>
<line>14</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.MaintainabilityRules" rule="AccessModifierMustBeDeclared" ruleCheckId="SA1400">
<context>The field must have an access modifier.</context>
<line>14</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.DocumentationRules" rule="ElementsMustBeDocumented" ruleCheckId="SA1600">
<context>The field must have a documentation header.</context>
<line>15</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.MaintainabilityRules" rule="AccessModifierMustBeDeclared" ruleCheckId="SA1400">
<context>The field must have an access modifier.</context>
<line>15</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.DocumentationRules" rule="ElementsMustBeDocumented" ruleCheckId="SA1600">
<context>The field must have a documentation header.</context>
<line>17</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.MaintainabilityRules" rule="AccessModifierMustBeDeclared" ruleCheckId="SA1400">
<context>The field must have an access modifier.</context>
<line>17</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.DocumentationRules" rule="ElementsMustBeDocumented" ruleCheckId="SA1600">
<context>The field must have a documentation header.</context>
<line>19</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.MaintainabilityRules" rule="AccessModifierMustBeDeclared" ruleCheckId="SA1400">
<context>The field must have an access modifier.</context>
<line>19</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.DocumentationRules" rule="ElementsMustBeDocumented" ruleCheckId="SA1600">
<context>The field must have a documentation header.</context>
<line>21</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.MaintainabilityRules" rule="AccessModifierMustBeDeclared" ruleCheckId="SA1400">
<context>The field must have an access modifier.</context>
<line>21</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.DocumentationRules" rule="ElementsMustBeDocumented" ruleCheckId="SA1600">
<context>The constructor must have a documentation header.</context>
<line>25</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphics must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>28</line>
<index>601</index>
<endIndex>608</endIndex>
<startLine>28</startLine>
<startColumn>13</startColumn>
<endLine>28</endLine>
<endColumn>20</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphics must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>31</line>
<index>708</index>
<endIndex>715</endIndex>
<startLine>31</startLine>
<startColumn>13</startColumn>
<endLine>31</endLine>
<endColumn>20</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphics must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>32</line>
<index>765</index>
<endIndex>772</endIndex>
<startLine>32</startLine>
<startColumn>13</startColumn>
<endLine>32</endLine>
<endColumn>20</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphics must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>33</line>
<index>819</index>
<endIndex>826</endIndex>
<startLine>33</startLine>
<startColumn>13</startColumn>
<endLine>33</endLine>
<endColumn>20</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="SingleLineCommentsMustNotBeFollowedByBlankLine" ruleCheckId="SA1512">
<context>A single-line comment must not be followed by a blank line. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>
<line>44</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="CurlyBracketsMustNotBeOmitted" ruleCheckId="SA1503">
<context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>
<line>88</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="SingleLineCommentMustBePrecededByBlankLine" ruleCheckId="SA1515">
<context>A single-line comment must be preceded by a blank line or another single-line comment, or must be the first item in its scope. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>
<line>99</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="ParametersMustBeOnSameLineOrSeparateLines" ruleCheckId="SA1117">
<context>All method parameters must be placed on the same line, or each parameter must be placed on a separate line.</context>
<line>90</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="ParameterMustFollowComma" ruleCheckId="SA1115">
<context>The parameter must begin on the line after the previous parameter.</context>
<line>92</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="ParameterMustFollowComma" ruleCheckId="SA1115">
<context>The parameter must begin on the line after the previous parameter.</context>
<line>93</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="ParameterMustFollowComma" ruleCheckId="SA1115">
<context>The parameter must begin on the line after the previous parameter.</context>
<line>94</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to spriteBatch must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>56</line>
<index>1712</index>
<endIndex>1722</endIndex>
<startLine>56</startLine>
<startColumn>13</startColumn>
<endLine>56</endLine>
<endColumn>23</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphicsWidth must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>58</line>
<index>1774</index>
<endIndex>1786</endIndex>
<startLine>58</startLine>
<startColumn>13</startColumn>
<endLine>58</endLine>
<endColumn>25</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphicsHeight must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>59</line>
<index>1834</index>
<endIndex>1847</endIndex>
<startLine>59</startLine>
<startColumn>13</startColumn>
<endLine>59</endLine>
<endColumn>26</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to GraphicsDevice must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>61</line>
<index>1917</index>
<endIndex>1930</endIndex>
<startLine>61</startLine>
<startColumn>32</startColumn>
<endLine>61</endLine>
<endColumn>45</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to Content must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>63</line>
<index>1958</index>
<endIndex>1964</endIndex>
<startLine>63</startLine>
<startColumn>22</startColumn>
<endLine>63</endLine>
<endColumn>28</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to spriteBatch must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>66</line>
<index>2061</index>
<endIndex>2071</endIndex>
<startLine>66</startLine>
<startColumn>13</startColumn>
<endLine>66</endLine>
<endColumn>23</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to GraphicsDevice must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>68</line>
<index>2139</index>
<endIndex>2152</endIndex>
<startLine>68</startLine>
<startColumn>29</startColumn>
<endLine>68</endLine>
<endColumn>42</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to backgroundTexture must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>70</line>
<index>2171</index>
<endIndex>2187</endIndex>
<startLine>70</startLine>
<startColumn>13</startColumn>
<endLine>70</endLine>
<endColumn>29</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to titleTexture must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>71</line>
<index>2262</index>
<endIndex>2273</endIndex>
<startLine>71</startLine>
<startColumn>13</startColumn>
<endLine>71</endLine>
<endColumn>24</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to guiRoot must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>73</line>
<index>2344</index>
<endIndex>2350</endIndex>
<startLine>73</startLine>
<startColumn>13</startColumn>
<endLine>73</endLine>
<endColumn>19</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphicsWidth must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>73</line>
<index>2387</index>
<endIndex>2399</endIndex>
<startLine>73</startLine>
<startColumn>56</startColumn>
<endLine>73</endLine>
<endColumn>68</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to graphicsHeight must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>73</line>
<index>2402</index>
<endIndex>2415</endIndex>
<startLine>73</startLine>
<startColumn>71</startColumn>
<endLine>73</endLine>
<endColumn>84</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to guiRoot must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>74</line>
<index>2452</index>
<endIndex>2458</endIndex>
<startLine>74</startLine>
<startColumn>13</startColumn>
<endLine>74</endLine>
<endColumn>19</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to guiRoot must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>76</line>
<index>2616</index>
<endIndex>2622</endIndex>
<startLine>76</startLine>
<startColumn>91</startColumn>
<endLine>76</endLine>
<endColumn>97</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to guiRoot must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>98</line>
<index>3542</index>
<endIndex>3548</endIndex>
<startLine>98</startLine>
<startColumn>122</startColumn>
<endLine>98</endLine>
<endColumn>128</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="UseStringEmptyForEmptyStrings" ruleCheckId="SA1122">
<context>Use string.Empty rather than "".</context>
<line>79</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.SpacingRules" rule="SingleLineCommentsMustBeginWithSingleSpace" ruleCheckId="SA1005">
<context>The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>
<line>99</line>
<index>3565</index>
<endIndex>3593</endIndex>
<startLine>99</startLine>
<startColumn>13</startColumn>
<endLine>99</endLine>
<endColumn>41</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="CurlyBracketsMustNotBeOmitted" ruleCheckId="SA1503">
<context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>
<line>119</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="SingleLineCommentsMustNotBeFollowedByBlankLine" ruleCheckId="SA1512">
<context>A single-line comment must not be followed by a blank line. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>
<line>121</line>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.ReadabilityRules" rule="PrefixCallsCorrectly" ruleCheckId="SA1126">
<context>The call to Exit must begin with the 'this.', 'base.', 'object.' or 'ReporterMain.' or 'Game.' prefix to indicate the intended method call. </context>
<line>119</line>
<index>4396</index>
<endIndex>4399</endIndex>
<startLine>119</startLine>
<startColumn>17</startColumn>
<endLine>119</endLine>
<endColumn>20</endColumn>
<warning>False</warning>
</violation>
<violation namespace="StyleCop.CSharp.LayoutRules" rule="SingleLineCommentsMustNotBeFollowedByBlankLine" ruleCheckId="SA1512">
<context>A single-line comment must not be followed by a blank line. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>
<line>134</line>
<warning>False</warning>
</violation>
</violations>
</sourcecode>
</stylecopresultscache>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
-256
View File
@@ -1,256 +0,0 @@
namespace Launcher
{
partial class LauncherMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LauncherMain));
this.launchButton = new System.Windows.Forms.Button();
this.resolutionBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.fullscreenBox = new System.Windows.Forms.CheckBox();
this.contentPackageBox = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.packageManagerButton = new System.Windows.Forms.Button();
this.installedVersionLabel = new System.Windows.Forms.Label();
this.autoUpdateCheckBox = new System.Windows.Forms.CheckBox();
this.progressBar = new System.Windows.Forms.ProgressBar();
this.patchNoteBox = new System.Windows.Forms.TextBox();
this.updateLabel = new System.Windows.Forms.Label();
this.downloadButton = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// launchButton
//
this.launchButton.BackColor = System.Drawing.Color.OrangeRed;
this.launchButton.FlatAppearance.BorderColor = System.Drawing.Color.OrangeRed;
this.launchButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.launchButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.launchButton.ForeColor = System.Drawing.SystemColors.ControlText;
this.launchButton.Location = new System.Drawing.Point(455, 399);
this.launchButton.Name = "launchButton";
this.launchButton.Size = new System.Drawing.Size(161, 42);
this.launchButton.TabIndex = 1;
this.launchButton.Text = "LAUNCH";
this.launchButton.UseVisualStyleBackColor = false;
this.launchButton.Click += new System.EventHandler(this.launchButton_Click);
//
// resolutionBox
//
this.resolutionBox.AllowDrop = true;
this.resolutionBox.FormattingEnabled = true;
this.resolutionBox.Location = new System.Drawing.Point(369, 236);
this.resolutionBox.Name = "resolutionBox";
this.resolutionBox.Size = new System.Drawing.Size(212, 21);
this.resolutionBox.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.SystemColors.Window;
this.label1.Location = new System.Drawing.Point(366, 220);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Resolution:";
//
// fullscreenBox
//
this.fullscreenBox.AutoSize = true;
this.fullscreenBox.BackColor = System.Drawing.Color.Transparent;
this.fullscreenBox.ForeColor = System.Drawing.SystemColors.Window;
this.fullscreenBox.Location = new System.Drawing.Point(369, 281);
this.fullscreenBox.Name = "fullscreenBox";
this.fullscreenBox.Size = new System.Drawing.Size(74, 17);
this.fullscreenBox.TabIndex = 4;
this.fullscreenBox.Text = "Fullscreen";
this.fullscreenBox.UseVisualStyleBackColor = false;
//
// contentPackageBox
//
this.contentPackageBox.FormattingEnabled = true;
this.contentPackageBox.Location = new System.Drawing.Point(369, 138);
this.contentPackageBox.Name = "contentPackageBox";
this.contentPackageBox.Size = new System.Drawing.Size(212, 21);
this.contentPackageBox.TabIndex = 5;
this.contentPackageBox.SelectedIndexChanged += new System.EventHandler(this.contentPackageBox_SelectedIndexChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.ForeColor = System.Drawing.SystemColors.Window;
this.label2.Location = new System.Drawing.Point(366, 122);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 13);
this.label2.TabIndex = 6;
this.label2.Text = "Content package:";
//
// packageManagerButton
//
this.packageManagerButton.BackColor = System.Drawing.Color.OrangeRed;
this.packageManagerButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.packageManagerButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.packageManagerButton.Location = new System.Drawing.Point(369, 165);
this.packageManagerButton.Name = "packageManagerButton";
this.packageManagerButton.Size = new System.Drawing.Size(120, 35);
this.packageManagerButton.TabIndex = 7;
this.packageManagerButton.Text = "Package manager";
this.packageManagerButton.UseVisualStyleBackColor = false;
this.packageManagerButton.Click += new System.EventHandler(this.packageManagerButton_Click);
//
// installedVersionLabel
//
this.installedVersionLabel.BackColor = System.Drawing.Color.Transparent;
this.installedVersionLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.installedVersionLabel.Location = new System.Drawing.Point(-8, 78);
this.installedVersionLabel.Name = "installedVersionLabel";
this.installedVersionLabel.Size = new System.Drawing.Size(644, 23);
this.installedVersionLabel.TabIndex = 8;
this.installedVersionLabel.Text = "Installed version:";
this.installedVersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// autoUpdateCheckBox
//
this.autoUpdateCheckBox.AutoSize = true;
this.autoUpdateCheckBox.BackColor = System.Drawing.Color.Transparent;
this.autoUpdateCheckBox.ForeColor = System.Drawing.SystemColors.Window;
this.autoUpdateCheckBox.Location = new System.Drawing.Point(47, 122);
this.autoUpdateCheckBox.Name = "autoUpdateCheckBox";
this.autoUpdateCheckBox.Size = new System.Drawing.Size(177, 17);
this.autoUpdateCheckBox.TabIndex = 9;
this.autoUpdateCheckBox.Text = "Automatically check for updates";
this.autoUpdateCheckBox.UseVisualStyleBackColor = false;
//
// progressBar
//
this.progressBar.Location = new System.Drawing.Point(129, 407);
this.progressBar.Name = "progressBar";
this.progressBar.Size = new System.Drawing.Size(207, 30);
this.progressBar.TabIndex = 10;
//
// patchNoteBox
//
this.patchNoteBox.AcceptsReturn = true;
this.patchNoteBox.Location = new System.Drawing.Point(47, 145);
this.patchNoteBox.Multiline = true;
this.patchNoteBox.Name = "patchNoteBox";
this.patchNoteBox.ReadOnly = true;
this.patchNoteBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.patchNoteBox.Size = new System.Drawing.Size(289, 226);
this.patchNoteBox.TabIndex = 11;
//
// updateLabel
//
this.updateLabel.AutoSize = true;
this.updateLabel.BackColor = System.Drawing.Color.Transparent;
this.updateLabel.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.updateLabel.Location = new System.Drawing.Point(44, 383);
this.updateLabel.Name = "updateLabel";
this.updateLabel.Size = new System.Drawing.Size(98, 13);
this.updateLabel.TabIndex = 12;
this.updateLabel.Text = "New update found!";
//
// downloadButton
//
this.downloadButton.BackColor = System.Drawing.Color.OrangeRed;
this.downloadButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.downloadButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.downloadButton.Location = new System.Drawing.Point(47, 407);
this.downloadButton.Name = "downloadButton";
this.downloadButton.Size = new System.Drawing.Size(76, 30);
this.downloadButton.TabIndex = 13;
this.downloadButton.Text = "Download";
this.downloadButton.UseVisualStyleBackColor = false;
this.downloadButton.Click += new System.EventHandler(this.downloadButton_Click);
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(-8, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(644, 63);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// LauncherMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(628, 453);
this.Controls.Add(this.downloadButton);
this.Controls.Add(this.updateLabel);
this.Controls.Add(this.patchNoteBox);
this.Controls.Add(this.progressBar);
this.Controls.Add(this.autoUpdateCheckBox);
this.Controls.Add(this.installedVersionLabel);
this.Controls.Add(this.packageManagerButton);
this.Controls.Add(this.label2);
this.Controls.Add(this.contentPackageBox);
this.Controls.Add(this.fullscreenBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.launchButton);
this.Controls.Add(this.resolutionBox);
this.Controls.Add(this.pictureBox1);
this.DoubleBuffered = true;
this.Name = "LauncherMain";
this.Text = "Launcher";
this.Load += new System.EventHandler(this.LauncherMain_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button launchButton;
private System.Windows.Forms.ComboBox resolutionBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox fullscreenBox;
private System.Windows.Forms.ComboBox contentPackageBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button packageManagerButton;
private System.Windows.Forms.Label installedVersionLabel;
private System.Windows.Forms.CheckBox autoUpdateCheckBox;
private System.Windows.Forms.ProgressBar progressBar;
private System.Windows.Forms.TextBox patchNoteBox;
private System.Windows.Forms.Label updateLabel;
private System.Windows.Forms.Button downloadButton;
private System.Windows.Forms.PictureBox pictureBox1;
}
}
-410
View File
@@ -1,410 +0,0 @@
using RestSharp;
using Barotrauma;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
namespace Launcher
{
public partial class LauncherMain : Form
{
string version = AssemblyName.GetAssemblyName("Barotrauma.exe").Version.ToString();
private const string configPath = "config.xml";
private Barotrauma.GameSettings settings;
private string latestVersionFileList, latestVersionFolder;
[DllImport("user32.dll")]
public static extern bool EnumDisplaySettings(
string deviceName, int modeNum, ref DEVMODE devMode);
const int ENUM_CURRENT_SETTINGS = -1;
const int ENUM_REGISTRY_SETTINGS = -2;
private List<GraphicsMode> supportedModes;
public bool FullScreenEnabled
{
get { return settings.FullScreenEnabled; }
set { settings.FullScreenEnabled = value; }
}
public bool AutoCheckUpdates
{
get { return settings.AutoCheckUpdates; }
set { settings.AutoCheckUpdates = value; }
}
//private GraphicsMode selectedMode;
public LauncherMain()
{
InitializeComponent();
ContentPackage.LoadAll(ContentPackage.Folder);
contentPackageBox.DataSource = ContentPackage.list;
supportedModes = new List<GraphicsMode>();
DEVMODE vDevMode = new DEVMODE();
int i = 0;
while (EnumDisplaySettings(null, i, ref vDevMode))
{
if (vDevMode.dmBitsPerPel < 16 || supportedModes.FirstOrDefault(sm => sm.Width == vDevMode.dmPelsWidth && sm.Height == vDevMode.dmPelsHeight) != null)
{
i++;
continue;
}
supportedModes.Add(
new GraphicsMode(vDevMode.dmPelsWidth,
vDevMode.dmPelsHeight,
vDevMode.dmBitsPerPel, vDevMode.dmDisplayFrequency));
i++;
}
resolutionBox.DataSource = new BindingList<GraphicsMode>(supportedModes);
//resolutionBox.SelectedIndexChanged =
//LoadSettings(configPath);
settings = new GameSettings(configPath);
resolutionBox.SelectedItem = supportedModes.FirstOrDefault(sm => sm.Width == settings.GraphicsWidth && sm.Height == settings.GraphicsHeight);
if (resolutionBox.SelectedItem == null)
{
resolutionBox.SelectedItem = supportedModes.FirstOrDefault(sm =>
sm.Width == Screen.PrimaryScreen.Bounds.Width &&
sm.Height == Screen.PrimaryScreen.Bounds.Height);
if (resolutionBox.SelectedItem == null) resolutionBox.SelectedItem = supportedModes[0];
}
fullscreenBox.DataBindings.Add("Checked", this, "FullscreenEnabled");
autoUpdateCheckBox.DataBindings.Add("Checked", this, "AutoCheckUpdates");
if (settings.SelectedContentPackage == null)
{
if (contentPackageBox.Items.Count > 0) contentPackageBox.SelectedItem = contentPackageBox.Items[0];
}
else
{
contentPackageBox.SelectedItem = settings.SelectedContentPackage;
}
progressBar.Visible = false;
updateLabel.Visible = false;
downloadButton.Visible = false;
installedVersionLabel.Text = "Installed version: " + version;
if (settings.AutoCheckUpdates)
{
CheckForUpdates();
}
//resolutionBox.SelectedItem = selectedMode;
}
private void SaveSettings(string filePath)
{
GraphicsMode selectedMode = resolutionBox.SelectedItem as GraphicsMode;
settings.GraphicsWidth = selectedMode.Width;
settings.GraphicsHeight = selectedMode.Height;
settings.Save(configPath);
}
private void launchButton_Click(object sender, EventArgs e)
{
SaveSettings(configPath);
var executables = settings.SelectedContentPackage.GetFilesOfType(ContentType.Executable);
if (executables.Count == 0)
{
MessageBox.Show("Error", "The game executable isn't configured in the selected content package.");
return;
}
string exePath = Directory.GetCurrentDirectory() + "//" + executables[0];
if (!File.Exists(exePath))
{
MessageBox.Show("Error", "Couldn't find the executable ''" + exePath + "''!");
return;
}
try
{
Process.Start(new ProcessStartInfo(exePath));
}
catch (Exception exception)
{
MessageBox.Show("Error while opening executable ''" + exePath + "''", exception.Message);
return;
}
Application.Exit();
}
private void packageManagerButton_Click(object sender, EventArgs e)
{
var packageManager = new PackageManager(settings.SelectedContentPackage);
packageManager.Show();
}
private void contentPackageBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (settings == null) return;
ComboBox comboBox = sender as ComboBox;
settings.SelectedContentPackage = comboBox.SelectedItem as ContentPackage;
}
private bool CheckForUpdates()
{
patchNoteBox.Text = "Checking for updates...";
XDocument doc = null;
try
{
doc = FetchXML("versioninfo.xml");
}
catch (Exception e)
{
patchNoteBox.Text = "Error while checking for updates: " + e.Message;
return false;
}
CheckUpdateXML(doc);
return true;
}
private XDocument FetchXML(string fileName)
{
var client = new RestClient(settings.MasterServerUrl);
var request = new RestRequest(fileName, Method.GET);
IRestResponse response = client.Execute(request);
if (response.ResponseStatus!= ResponseStatus.Completed) return null;
if (response.StatusCode != HttpStatusCode.OK) return null;
string xml = response.Content;
string _byteOrderMarkUtf8 = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
if (xml.StartsWith(_byteOrderMarkUtf8))
{
xml = xml.Remove(0, _byteOrderMarkUtf8.Length);
}
return XDocument.Parse(xml);
}
private bool CheckUpdateXML(XDocument doc)
{
if (doc.Root==null)
{
patchNoteBox.Text = "Error while checking for updates: could not parse update info";
return false;
}
progressBar.Visible = true;
downloadButton.Visible = true;
updateLabel.Visible = true;
string latestVersion = ToolBox.GetAttributeString(doc.Root, "latestversion", "");
latestVersionFolder = ToolBox.GetAttributeString(doc.Root, "latestversionfolder", "");
latestVersionFileList = ToolBox.GetAttributeString(doc.Root, "latestversionfilelist", "");
if (latestVersion == version)
{
patchNoteBox.Text = "Game is up to date!";
return false;
}
updateLabel.Text = "New update found! (" + latestVersion + ")";
XElement patchNotes = doc.Root.Element("patchnotes");
if (patchNotes!=null)
{
StringBuilder sb = new StringBuilder();
foreach (XElement patchNote in patchNotes.Elements())
{
string patchNumber = ToolBox.GetAttributeString(patchNote, "version", "");
//read the patch notes until we reach the user's version
if (patchNumber == version) break;
sb.AppendLine(ToolBox.ElementInnerText(patchNote));
sb.AppendLine("*************************************\n");
}
patchNoteBox.Text = sb.ToString();
}
return true;
}
private void downloadButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(latestVersionFolder)) return;
Button senderButton = sender as Button;
senderButton.Enabled = false;
XDocument doc = null;
try
{
doc = FetchXML("filelist.xml");
}
catch (Exception exception)
{
patchNoteBox.Text = "Error while checking for updates: " + exception.Message;
return;
}
filesToDownload = UpdaterUtil.GetRequiredFiles(doc);
string dir = Directory.GetCurrentDirectory();
filesToDownloadCount = filesToDownload.Count;
if (filesToDownloadCount>0)
{
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
//webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
webClient.DownloadFileAsync(new Uri(latestVersionFolder + filesToDownload[0]), dir);
}
}
private List<string> filesToDownload;
private int filesDownloaded, filesToDownloadCount;
private void Completed(object sender, AsyncCompletedEventArgs e)
{
filesDownloaded++;
progressBar.Value = (int)(((float)filesDownloaded / (float)filesToDownloadCount) * 100.0f);//e.ProgressPercentage;
filesToDownload.RemoveAt(0);
if (filesToDownload.Count==0)
{
progressBar.Visible = false;
downloadButton.Visible = false;
updateLabel.Visible = false;
MessageBox.Show("Download completed!");
settings.WasGameUpdated = true;
return;
}
updateLabel.Text = "Downloading file "+ filesDownloaded + "/" + filesToDownloadCount + " ("+ filesToDownload[0] + ")";
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
//webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
string dir = Directory.GetCurrentDirectory();
string fileDir = Path.GetDirectoryName(filesToDownload[0]);
if (!string.IsNullOrWhiteSpace(fileDir) && !Directory.Exists(fileDir))
{
Directory.CreateDirectory(fileDir);
}
webClient.DownloadFileAsync(new Uri(latestVersionFolder + filesToDownload[0]), @dir + "\\" + filesToDownload[0]);
}
private void LauncherMain_Load(object sender, EventArgs e)
{
}
}
public class GraphicsMode
{
public readonly int Width, Height;
public readonly int Bits;
public readonly int Frequency;
public GraphicsMode(int width, int height, int bits, int freq)
{
Width = width;
Height = height;
Bits = bits;
Frequency = freq;
}
public override string ToString()
{
return Width + "x" + Height;// +", " + Bits + " bit, " + Frequency + " Hz";
}
}
[StructLayout(LayoutKind.Sequential)]
public struct DEVMODE
{
private const int CCHDEVICENAME = 0x20;
private const int CCHFORMNAME = 0x20;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
public string dmDeviceName;
public short dmSpecVersion;
public short dmDriverVersion;
public short dmSize;
public short dmDriverExtra;
public int dmFields;
public int dmPositionX;
public int dmPositionY;
public ScreenOrientation dmDisplayOrientation;
public int dmDisplayFixedOutput;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
public string dmFormName;
public short dmLogPixels;
public int dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmICMMethod;
public int dmICMIntent;
public int dmMediaType;
public int dmDitherType;
public int dmReserved1;
public int dmReserved2;
public int dmPanningWidth;
public int dmPanningHeight;
}
}
-28663
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

-119
View File
@@ -1,119 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{24420B91-6CD9-4DE3-9ADD-2F2C7E1FB6BB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Launcher</RootNamespace>
<AssemblyName>Launcher</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Subsurface\bin\Windows\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Launcher.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\RestSharp.105.2.3\lib\net45\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="PackageManager.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PackageManager.Designer.cs">
<DependentUpon>PackageManager.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="PackageManager.resx">
<DependentUpon>PackageManager.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Subsurface\Barotrauma.csproj">
<Project>{008c0f83-e914-4966-9135-ea885059edd8}</Project>
<Name>Barotrauma</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
-365
View File
@@ -1,365 +0,0 @@
namespace Launcher
{
partial class PackageManager
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackageManager));
this.packageList = new System.Windows.Forms.ListBox();
this.newPackageName = new System.Windows.Forms.TextBox();
this.newPackage = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.itemList = new System.Windows.Forms.ListBox();
this.itemButton = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.characterList = new System.Windows.Forms.ListBox();
this.characterButton = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.structureList = new System.Windows.Forms.ListBox();
this.structureButton = new System.Windows.Forms.Button();
this.jobButton = new System.Windows.Forms.Button();
this.jobList = new System.Windows.Forms.ListBox();
this.label4 = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.characterFolder = new System.Windows.Forms.Button();
this.itemFolder = new System.Windows.Forms.Button();
this.structureFolder = new System.Windows.Forms.Button();
this.jobFolder = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label5 = new System.Windows.Forms.Label();
this.exeBox = new System.Windows.Forms.TextBox();
this.exeButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// packageList
//
this.packageList.FormattingEnabled = true;
this.packageList.Location = new System.Drawing.Point(12, 87);
this.packageList.Name = "packageList";
this.packageList.Size = new System.Drawing.Size(180, 381);
this.packageList.TabIndex = 3;
this.packageList.SelectedIndexChanged += new System.EventHandler(this.packageList_SelectedIndexChanged);
//
// newPackageName
//
this.newPackageName.Location = new System.Drawing.Point(12, 474);
this.newPackageName.Name = "newPackageName";
this.newPackageName.Size = new System.Drawing.Size(129, 20);
this.newPackageName.TabIndex = 4;
this.newPackageName.TextChanged += new System.EventHandler(this.newPackageName_TextChanged);
//
// newPackage
//
this.newPackage.Enabled = false;
this.newPackage.Location = new System.Drawing.Point(147, 474);
this.newPackage.Name = "newPackage";
this.newPackage.Size = new System.Drawing.Size(45, 20);
this.newPackage.TabIndex = 5;
this.newPackage.Text = "New";
this.newPackage.UseVisualStyleBackColor = true;
this.newPackage.Click += new System.EventHandler(this.newPackage_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.SystemColors.Control;
this.label1.Location = new System.Drawing.Point(215, 338);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(51, 13);
this.label1.TabIndex = 7;
this.label1.Text = "Item files:";
//
// itemList
//
this.itemList.FormattingEnabled = true;
this.itemList.Location = new System.Drawing.Point(218, 360);
this.itemList.Name = "itemList";
this.itemList.Size = new System.Drawing.Size(255, 134);
this.itemList.TabIndex = 8;
this.itemList.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.fileList_KeyPress);
//
// itemButton
//
this.itemButton.Location = new System.Drawing.Point(317, 334);
this.itemButton.Name = "itemButton";
this.itemButton.Size = new System.Drawing.Size(75, 23);
this.itemButton.TabIndex = 9;
this.itemButton.Text = "Add file";
this.itemButton.UseVisualStyleBackColor = true;
this.itemButton.Click += new System.EventHandler(this.addFileButton_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.ForeColor = System.Drawing.SystemColors.Control;
this.label2.Location = new System.Drawing.Point(215, 173);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(77, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Character files:";
//
// characterList
//
this.characterList.FormattingEnabled = true;
this.characterList.Location = new System.Drawing.Point(218, 198);
this.characterList.Name = "characterList";
this.characterList.Size = new System.Drawing.Size(255, 121);
this.characterList.TabIndex = 8;
this.characterList.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.fileList_KeyPress);
//
// characterButton
//
this.characterButton.Location = new System.Drawing.Point(317, 169);
this.characterButton.Name = "characterButton";
this.characterButton.Size = new System.Drawing.Size(75, 23);
this.characterButton.TabIndex = 9;
this.characterButton.Text = "Add file";
this.characterButton.UseVisualStyleBackColor = true;
this.characterButton.Click += new System.EventHandler(this.addFileButton_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.ForeColor = System.Drawing.SystemColors.Control;
this.label3.Location = new System.Drawing.Point(489, 174);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 13);
this.label3.TabIndex = 7;
this.label3.Text = "Map structure files:";
//
// structureList
//
this.structureList.FormattingEnabled = true;
this.structureList.Location = new System.Drawing.Point(492, 198);
this.structureList.Name = "structureList";
this.structureList.Size = new System.Drawing.Size(255, 121);
this.structureList.TabIndex = 8;
this.structureList.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.fileList_KeyPress);
//
// structureButton
//
this.structureButton.Location = new System.Drawing.Point(591, 169);
this.structureButton.Name = "structureButton";
this.structureButton.Size = new System.Drawing.Size(75, 23);
this.structureButton.TabIndex = 9;
this.structureButton.Text = "Add file";
this.structureButton.UseVisualStyleBackColor = true;
this.structureButton.Click += new System.EventHandler(this.addFileButton_Click);
//
// jobButton
//
this.jobButton.Location = new System.Drawing.Point(591, 334);
this.jobButton.Name = "jobButton";
this.jobButton.Size = new System.Drawing.Size(75, 23);
this.jobButton.TabIndex = 12;
this.jobButton.Text = "Add file";
this.jobButton.UseVisualStyleBackColor = true;
this.jobButton.Click += new System.EventHandler(this.addFileButton_Click);
//
// jobList
//
this.jobList.FormattingEnabled = true;
this.jobList.Location = new System.Drawing.Point(492, 360);
this.jobList.Name = "jobList";
this.jobList.Size = new System.Drawing.Size(255, 134);
this.jobList.TabIndex = 11;
this.jobList.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.fileList_KeyPress);
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.ForeColor = System.Drawing.SystemColors.Control;
this.label4.Location = new System.Drawing.Point(489, 339);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 13);
this.label4.TabIndex = 10;
this.label4.Text = "Job files:";
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(623, 513);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(124, 37);
this.okButton.TabIndex = 13;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// characterFolder
//
this.characterFolder.Location = new System.Drawing.Point(398, 169);
this.characterFolder.Name = "characterFolder";
this.characterFolder.Size = new System.Drawing.Size(75, 23);
this.characterFolder.TabIndex = 9;
this.characterFolder.Text = "Add folder";
this.characterFolder.UseVisualStyleBackColor = true;
this.characterFolder.Click += new System.EventHandler(this.addFolderButton_Click);
//
// itemFolder
//
this.itemFolder.Location = new System.Drawing.Point(398, 333);
this.itemFolder.Name = "itemFolder";
this.itemFolder.Size = new System.Drawing.Size(75, 23);
this.itemFolder.TabIndex = 14;
this.itemFolder.Text = "Add folder";
this.itemFolder.UseVisualStyleBackColor = true;
this.itemFolder.Click += new System.EventHandler(this.addFolderButton_Click);
//
// structureFolder
//
this.structureFolder.Location = new System.Drawing.Point(672, 169);
this.structureFolder.Name = "structureFolder";
this.structureFolder.Size = new System.Drawing.Size(75, 23);
this.structureFolder.TabIndex = 15;
this.structureFolder.Text = "Add folder";
this.structureFolder.UseVisualStyleBackColor = true;
this.structureFolder.Click += new System.EventHandler(this.addFolderButton_Click);
//
// jobFolder
//
this.jobFolder.Location = new System.Drawing.Point(672, 334);
this.jobFolder.Name = "jobFolder";
this.jobFolder.Size = new System.Drawing.Size(75, 23);
this.jobFolder.TabIndex = 16;
this.jobFolder.Text = "Add folder";
this.jobFolder.UseVisualStyleBackColor = true;
this.jobFolder.Click += new System.EventHandler(this.addFolderButton_Click);
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(-8, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(802, 56);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 17;
this.pictureBox1.TabStop = false;
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.ForeColor = System.Drawing.SystemColors.Control;
this.label5.Location = new System.Drawing.Point(215, 87);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(63, 13);
this.label5.TabIndex = 18;
this.label5.Text = "Executable:";
//
// exeBox
//
this.exeBox.Enabled = false;
this.exeBox.Location = new System.Drawing.Point(284, 84);
this.exeBox.Name = "exeBox";
this.exeBox.Size = new System.Drawing.Size(176, 20);
this.exeBox.TabIndex = 19;
//
// exeButton
//
this.exeButton.Location = new System.Drawing.Point(466, 84);
this.exeButton.Name = "exeButton";
this.exeButton.Size = new System.Drawing.Size(32, 20);
this.exeButton.TabIndex = 20;
this.exeButton.Text = "...";
this.exeButton.UseVisualStyleBackColor = true;
this.exeButton.Click += new System.EventHandler(this.button1_Click);
//
// PackageManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(784, 562);
this.Controls.Add(this.exeButton);
this.Controls.Add(this.exeBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.jobFolder);
this.Controls.Add(this.structureFolder);
this.Controls.Add(this.itemFolder);
this.Controls.Add(this.okButton);
this.Controls.Add(this.jobButton);
this.Controls.Add(this.jobList);
this.Controls.Add(this.label4);
this.Controls.Add(this.structureButton);
this.Controls.Add(this.characterFolder);
this.Controls.Add(this.characterButton);
this.Controls.Add(this.itemButton);
this.Controls.Add(this.structureList);
this.Controls.Add(this.label3);
this.Controls.Add(this.characterList);
this.Controls.Add(this.label2);
this.Controls.Add(this.itemList);
this.Controls.Add(this.label1);
this.Controls.Add(this.newPackage);
this.Controls.Add(this.newPackageName);
this.Controls.Add(this.packageList);
this.DoubleBuffered = true;
this.Name = "PackageManager";
this.Text = "PackageManager";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListBox packageList;
private System.Windows.Forms.TextBox newPackageName;
private System.Windows.Forms.Button newPackage;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ListBox itemList;
private System.Windows.Forms.Button itemButton;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ListBox characterList;
private System.Windows.Forms.Button characterButton;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ListBox structureList;
private System.Windows.Forms.Button structureButton;
private System.Windows.Forms.Button jobButton;
private System.Windows.Forms.ListBox jobList;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button characterFolder;
private System.Windows.Forms.Button itemFolder;
private System.Windows.Forms.Button structureFolder;
private System.Windows.Forms.Button jobFolder;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox exeBox;
private System.Windows.Forms.Button exeButton;
}
}
-295
View File
@@ -1,295 +0,0 @@
using Barotrauma;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Launcher
{
public partial class PackageManager : Form
{
private ContentPackage selectedPackage;
private List<ListBox> fileBoxes;
private List<TextBox> singleFileBoxes;
private List<Button> fileButtons;
public PackageManager(ContentPackage _selectedPackage)
{
InitializeComponent();
packageList.DisplayMember = "Name";
packageList.ValueMember = "MD5hash";
foreach (ContentPackage package in ContentPackage.list)
{
packageList.Items.Add(package);
}
fileBoxes = new List<ListBox>();
fileButtons = new List<Button>();
singleFileBoxes = new List<TextBox>();
fileBoxes.Add(itemList);
itemList.Tag = ContentType.Item;
itemButton.Tag = ContentType.Item;
itemFolder.Tag = ContentType.Item;
fileButtons.Add(itemButton);
fileButtons.Add(itemFolder);
fileBoxes.Add(characterList);
characterList.Tag = ContentType.Character;
characterButton.Tag = ContentType.Character;
characterFolder.Tag = ContentType.Character;
fileButtons.Add(characterButton);
fileButtons.Add(characterFolder);
fileBoxes.Add(structureList);
structureList.Tag = ContentType.Structure;
structureButton.Tag = ContentType.Structure;
structureFolder.Tag = ContentType.Structure;
fileButtons.Add(structureButton);
fileButtons.Add(structureFolder);
fileBoxes.Add(jobList);
jobList.Tag = ContentType.Jobs;
jobButton.Tag = ContentType.Jobs;
jobFolder.Tag = ContentType.Jobs;
fileButtons.Add(jobButton);
fileButtons.Add(jobFolder);
singleFileBoxes.Add(exeBox);
exeBox.Tag = ContentType.Executable;
exeButton.Tag = ContentType.Executable;
foreach (Button fileButton in fileButtons)
{
fileButton.Enabled = false;
}
selectedPackage = _selectedPackage;
SelectPackage(selectedPackage);
}
private void packageList_SelectedIndexChanged(object sender, EventArgs e)
{
ListBox listBox = sender as ListBox;
SelectPackage(listBox.SelectedItem as ContentPackage);
}
private void SelectPackage(ContentPackage package)
{
selectedPackage = package;
foreach (Button fileButton in fileButtons)
{
fileButton.Enabled = (selectedPackage != null);
}
foreach (ListBox fileBox in fileBoxes)
{
fileBox.Items.Clear();
}
foreach (ListBox fileBox in fileBoxes)
{
ContentType type = (fileBox.Tag is ContentType) ? (ContentType)fileBox.Tag : ContentType.None;
foreach (ContentFile file in selectedPackage.files)
{
if (file.type != type) continue;
fileBox.Items.Add(file);
}
}
}
private void newPackage_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(newPackageName.Text)) return;
ContentPackage newPackage = ContentPackage.CreatePackage(newPackageName.Text);
packageList.Items.Add(newPackage);
packageList.SelectedItem = newPackage;
newPackageName.Text = "";
}
private void newPackageName_TextChanged(object sender, EventArgs e)
{
newPackage.Enabled = !string.IsNullOrEmpty(newPackageName.Text);
}
private void addFileButton_Click(object sender, EventArgs e)
{
Button button = sender as Button;
ContentType type = (button.Tag is ContentType) ? (ContentType)button.Tag : ContentType.None;
Debug.Assert(type != ContentType.None, "ContentType of a button tag was ContentType.None");
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "XML files (*.xml)|*.xml;*.XML";
ofd.RestoreDirectory = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
string[] fileNames = ofd.FileNames;
foreach (string file in fileNames)
{
AddFile(type, file);
}
}
}
private void fileList_KeyPress(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode != Keys.Delete) return;
ListBox listBox = sender as ListBox;
ContentType type = (listBox.Tag is ContentType) ? (ContentType)listBox.Tag : ContentType.None;
Debug.Assert(type != ContentType.None, "ContentType of a button tag was ContentType.None");
List<ContentFile> selectedFiles = new List<ContentFile>();
foreach (ContentFile item in listBox.SelectedItems)
{
selectedFiles.Add(item);
}
foreach (ContentFile file in selectedFiles)
{
RemoveFile(listBox, file);
}
}
private void AddFile(ContentType type, string path)
{
ListBox selectedBox = null;
foreach (ListBox fileBox in fileBoxes)
{
if (type != ((fileBox.Tag is ContentType) ? (ContentType)fileBox.Tag : ContentType.None)) continue;
selectedBox = fileBox;
break;
}
ContentFile newFile = selectedPackage.AddFile(GetRelativePath(path, Directory.GetCurrentDirectory()), type);
if (newFile!=null && selectedBox!=null) selectedBox.Items.Add(newFile);
}
private void RemoveFile(ListBox listBox, ContentFile file)
{
if (file == null) return;
if (listBox != null) listBox.Items.Remove(file);
selectedPackage.RemoveFile(file);
}
private void addFolderButton_Click(object sender, EventArgs e)
{
Button button = sender as Button;
ContentType type = (button.Tag is ContentType) ? (ContentType)button.Tag : ContentType.None;
Debug.Assert(type != ContentType.None, "ContentType of a button tag was ContentType.None");
FolderBrowserDialog fbd = new FolderBrowserDialog();
//OpenFileDialog ofd = new OpenFileDialog();
//ofd.Filter = "XML files (*.xml)|*.xml;*.XML";
//ofd.RestoreDirectory?
if (fbd.ShowDialog() == DialogResult.OK)
{
AddFilesInFolder(type, fbd.SelectedPath);
}
}
private void AddFilesInFolder(ContentType type, string folder, string searchPattern ="*xml")
{
if (!Directory.Exists(folder)) return;
string[] files = Directory.GetFiles(folder, "*.xml");
foreach (string filePath in files)
{
AddFile(type, filePath);
}
string[] subDirectories = Directory.GetDirectories(folder, "*");
foreach (string subDir in subDirectories)
{
AddFilesInFolder(type, subDir, searchPattern);
}
}
string GetRelativePath(string filespec, string folder)
{
Uri pathUri = new Uri(filespec);
// Folders must end in a slash
if (!folder.EndsWith(Path.DirectorySeparatorChar.ToString()))
{
folder += Path.DirectorySeparatorChar;
}
Uri folderUri = new Uri(folder);
return Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', Path.DirectorySeparatorChar));
}
private void okButton_Click(object sender, EventArgs e)
{
if (selectedPackage!=null) selectedPackage.Save(ContentPackage.Folder);
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
Button button = sender as Button;
ContentType type = (button.Tag is ContentType) ? (ContentType)button.Tag : ContentType.None;
Debug.Assert(type != ContentType.None, "ContentType of a button tag was ContentType.None");
TextBox selectedBox = null;
foreach (TextBox fileBox in singleFileBoxes)
{
if (type != ((fileBox.Tag is ContentType) ? (ContentType)fileBox.Tag : ContentType.None)) continue;
selectedBox = fileBox;
break;
}
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = (type == ContentType.Executable) ? "Executable (*.exe)|*.exe" : "XML files (*.xml)|*.xml;*.XML";
ofd.Multiselect = false;
if (ofd.ShowDialog() == DialogResult.OK)
{
var existingFile = selectedPackage.files.Find(f => f.type == type);
if (existingFile!=null)
{
RemoveFile(null, existingFile);
}
AddFile(type, ofd.FileName);
selectedBox.Text = GetRelativePath(ofd.FileName, Directory.GetCurrentDirectory());
}
}
}
}
File diff suppressed because it is too large Load Diff
-22
View File
@@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Launcher
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LauncherMain());
}
}
}
-36
View File
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OldLauncher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Launcher")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ef69d08c-36d1-4c9b-ac73-198db7d6e904")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
-71
View File
@@ -1,71 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Launcher.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Launcher.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
-117
View File
@@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
-30
View File
@@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Launcher.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
-7
View File
@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.2.3" targetFramework="net45" />
</packages>
Binary file not shown.
+18
View File
@@ -104,6 +104,7 @@
<Compile Include="Source\ContentPackage.cs" />
<Compile Include="Source\CoroutineManager.cs" />
<Compile Include="Source\Events\Missions\CargoMission.cs" />
<Compile Include="Source\Events\Missions\CombatMission.cs" />
<Compile Include="Source\Events\Missions\Mission.cs" />
<Compile Include="Source\Events\Missions\MonsterMission.cs" />
<Compile Include="Source\Events\Missions\SalvageMission.cs" />
@@ -137,6 +138,7 @@
<Compile Include="Source\Map\EntityGrid.cs" />
<Compile Include="Source\Map\FireSource.cs" />
<Compile Include="Source\Map\Levels\CaveGenerator.cs" />
<Compile Include="Source\Map\Levels\LevelGenerationParams.cs" />
<Compile Include="Source\Map\Levels\LevelRenderer.cs" />
<Compile Include="Source\Map\Levels\Ruins\BTRoom.cs" />
<Compile Include="Source\Map\Levels\Ruins\Corridor.cs" />
@@ -348,6 +350,15 @@
<Content Include="Content\BackgroundSprites\vegetation2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\BackgroundSprites\vegetation3.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\BackgroundSprites\vegetation4.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\BackgroundSprites\vegetation5.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Characters\Charybdis\charybdis.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -768,6 +779,10 @@
<Content Include="Content\Map\iceWall.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Map\LevelGenerationParameters.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Map\locationNames.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -793,6 +808,9 @@
<Content Include="Content\Map\ruins2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Map\ruins3.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Map\shaft.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -1,34 +1,86 @@
<?xml version="1.0" encoding="utf-8" ?>
<backgroundsprites>
<hanging1 alignment="Bottom" minsize="0.5" maxsize="1.5" commonness="5">
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="0,0,242,543" origin="0.5,0.0"/>
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="0,0,242,543" origin="0.5,0.15"/>
</hanging1>
<hanging2 alignment="Bottom" minsize="0.5" maxsize="1.5" commonness="5">
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="241,0,322,720" origin="0.5,0.0"/>
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="241,0,322,720" origin="0.5,0.15"/>
</hanging2>
<kelp1 alignment="Top" minsize="0.5" maxsize="1.5" commonness="10">
<overridecommonness commonness="0" leveltype="Open" />
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="0,667,275,357" origin="0.5,1.0"/>
</kelp1>
<stalk alignment="Top" minsize="0.5" maxsize="1.5" commonness="1" randomrotation="-10,10">
<stalk alignment="Top" minsize="0.5" maxsize="1.5" commonness="1" swingamount="2" randomrotation="-10,10">
<overridecommonness commonness="0" leveltype="Open" />
<overridecommonness commonness="5" leveltype="Maze" />
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="775,0,249,849" origin="0.5,0.95"/>
</stalk>
<spike alignment="Top" minsize="0.5" maxsize="1.5" alignwithsurface="true" randomrotation="-20,20" commonness="2">
<overridecommonness commonness="0" leveltype="Open" />
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="544,0,228,561" origin="0.5,0.95"/>
</spike>
<branches1 minsize="0.5" maxsize="2.0" alignwithsurface="true" randomrotation="-20,20" commonness="4">
<leaves minsize="0.5" maxsize="1.5" alignwithsurface="true" commonness="3">
<Sprite texture="Content/BackgroundSprites/vegetation.png" sourcerect="305,722,461,301" origin="0.6,0.8"/>
</leaves>
<branches1 minsize="0.5" maxsize="2.0" alignwithsurface="true" swingamount="3" randomrotation="-20,20" commonness="4">
<overridecommonness commonness="10" leveltype="Maze" />
<Sprite texture="Content/BackgroundSprites/vegetation2.png" sourcerect="0,0,525,484" origin="0.5,0.9"/>
</branches1>
<branches2 minsize="0.5" maxsize="2.0" alignwithsurface="true" randomrotation="-20,20" commonness="4">
<Sprite texture="Content/BackgroundSprites/vegetation2.png" sourcerect="255,0,246,479" origin="0.5,0.9"/>
<branches2 minsize="0.5" maxsize="2.0" alignwithsurface="true" swingamount="3" randomrotation="-20,20" commonness="4">
<overridecommonness commonness="10" leveltype="Maze" />
<Sprite texture="Content/BackgroundSprites/vegetation2.png" sourcerect="247,0,278,479" origin="0.2,0.9"/>
</branches2>
<fungus minsize="0.5" maxsize="1.5" alignwithsurface="true" commonness="3">
<branches3 minsize="0.5" maxsize="2.0" alignwithsurface="true" swingamount="3" randomrotation="-20,20" commonness="4">
<overridecommonness commonness="10" leveltype="Maze" />
<Sprite texture="Content/BackgroundSprites/vegetation2.png" sourcerect="526,0,245,479" origin="0.4,0.9"/>
</branches3>
<fungus minsize="0.5" maxsize="1.5" alignwithsurface="true" swingamount="1" commonness="3">
<overridecommonness commonness="10" leveltype="Maze" />
<Sprite texture="Content/BackgroundSprites/vegetation2.png" sourcerect="0,681,442,343" origin="0.5,0.9"/>
</fungus>
<thistle alignment="Top" minsize="0.5" maxsize="1.5" randomrotation="-10,10" swingamount="5" commonness="3">
<overridecommonness commonness="0" leveltype="Open" />
<Sprite texture="Content/BackgroundSprites/vegetation2.png" sourcerect="449,500,252,524" origin="0.5,0.95"/>
</thistle>
<branch alignment="Top" minsize="1" maxsize="3" randomrotation="-30,30" swingamount="10" commonness="10">
<overridecommonness commonness="0" leveltype="Open" />
<overridecommonness commonness="1" leveltype="Pillars" />
<overridecommonness commonness="1" leveltype="Slabs" />
<Sprite texture="Content/BackgroundSprites/vegetation3.png" origin="0.5,0.95"/>
</branch>
<branch alignment="Top" minsize="1" maxsize="3" randomrotation="-30,30" swingamount="8" commonness="10">
<overridecommonness commonness="0" leveltype="Open" />
<overridecommonness commonness="1" leveltype="Pillars" />
<overridecommonness commonness="1" leveltype="Slabs" />
<Sprite texture="Content/BackgroundSprites/vegetation4.png" sourcerect="0,0,818,1024" origin="0.5,0.95"/>
</branch>
<hay alignment="Top" minsize="0.5" maxsize="1.5" randomrotation="-10,10" swingamount="5" commonness="3">
<overridecommonness commonness="0" leveltype="Open" />
<Sprite texture="Content/BackgroundSprites/vegetation4.png" sourcerect="820,245,204,779" origin="0.5,0.95"/>
</hay>
<branch minsize="1" maxsize="3" alignwithsurface="true" randomrotation="-30,30" swingamount="10" commonness="0">
<overridecommonness commonness="10" leveltype="Pillars" />
<overridecommonness commonness="10" leveltype="Slabs" />
<Sprite texture="Content/BackgroundSprites/vegetation5.png" sourcerect="0,0,555,1024" origin="0.6,0.95"/>
</branch>
<branch minsize="1" maxsize="3" alignwithsurface="true" randomrotation="-30,30" swingamount="10" commonness="0">
<overridecommonness commonness="10" leveltype="Pillars" />
<overridecommonness commonness="10" leveltype="Slabs" />
<Sprite texture="Content/BackgroundSprites/vegetation5.png" sourcerect="580,151,444,873" origin="0.3,0.95"/>
</branch>
</backgroundsprites>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 984 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 KiB

@@ -30,7 +30,7 @@
<limb id = "3" width="13" height="45" mass = "6" ignorecollisions="true" flip="true" impacttolerance="50.0">
<sprite texture="Content/Characters/Crawler/crawler.png" sourcerect="65,131,36,50" depth="0.15" origin="0.4,0.5"/>
<attack range="120" duration="0.5" damage="30" stun="0.1" bleedingdamage="3" structuredamage="50" damagetype="slash" torque="-20" targetforce="-30"/>
<attack range="120" duration="0.5" damage="30" stun="0.1" bleedingdamage="3" structuredamage="50" damagetype="slash" force="20" torque="-20" targetforce="-30"/>
</limb>
<limb id = "4" width="11" height="34" mass = "4" type="RightLeg" flip="true">
@@ -11,7 +11,7 @@
<!-- head -->
<limb id = "0" radius="230" height="500" type="Head" steerforce="1.0" flip="true" armorsector="0.0,180.0" armorvalue="100.0" impacttolerance="100">
<sprite texture="Content/Characters/Moloch/moloch.png" sourcerect="0,0,628,1024" depth="0.02" origin ="0.4,0.5"/>
<attack range="700" duration="0.2" damage="200" stun="5" force="25" damagetype="blunt" targetforce="100"/>
<attack range="700" duration="0.2" damage="200" stun="5" force="20" damagetype="blunt" targetforce="100"/>
</limb>
<limb id = "1" width="50" height="440" flip="true">
@@ -16,7 +16,7 @@
linkable="true"
pickdistance ="150">
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,0,48,64"/>
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,0,48,64" canflipx="false"/>
<ItemContainer capacity="20" canbeselected="true" hideitems="true">
<Containable name="chem"/>
@@ -29,7 +29,7 @@
linkable="true"
pickdistance ="150">
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,64,48,64"/>
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,64,48,64" canflipx="false"/>
<ItemContainer capacity="20" canbeselected="true" hideitems="true">
<Containable name="chem"/>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

@@ -10,8 +10,8 @@
<Sprite texture="lamp.png" sourcerect="0,0,16,32" depth="0.8"/>
<LightComponent color="1.0,1.0,1.0,1.0" range ="800.0" powerconsumption="5">
<sprite texture="Content/Items/Electricity/lamp.png" sourcerect="33,0,31,39"/>
<LightComponent lightcolor="1.0,1.0,1.0,1.0" range ="800.0" powerconsumption="5">
<sprite texture="Content/Items/Electricity/lamp.png" sourcerect="33,0,31,37"/>
</LightComponent>
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
@@ -20,8 +20,25 @@
<input name="toggle"/>
<input name="set_state"/>
</ConnectionPanel>
</Item>
<Item
name="Emergency Light"
category="Electrical"
Tags="smallitem"
pickdistance="150">
<Sprite texture="lamp.png" sourcerect="0,48,48,16" depth="0.8"/>
<LightComponent lightcolor="1.0,0.0,0.0,0.2" range="500.0" IsOn="true">
<sprite texture="Content/Items/Electricity/lamp.png" sourcerect="0,48,48,16"/>
</LightComponent>
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
<requireditem name="Screwdriver,Wire" type="Equipped"/>
<input name="toggle"/>
<input name="set_state"/>
</ConnectionPanel>
</Item>
</Items>
@@ -7,7 +7,7 @@
pickdistance="150"
description="Serves as a hub for power distribution and relaying signals between devices.">
<Sprite texture ="junctionbox.png" depth="0.8"/>
<Sprite texture="junctionbox.png" depth="0.8" canflipx="false"/>
<fixrequirement name="Electrical repairs">
<skill name="Electrical Engineering" level="40"/>
+2 -2
View File
@@ -8,7 +8,7 @@
pickthroughwalls="true"
pickdistance="150">
<Sprite texture ="engine.png" depth="0.8" sourcerect="0,0,373,113"/>
<Sprite texture ="engine.png" depth="0.8" sourcerect="0,0,373,113" canflipx="true"/>
<fixrequirement name="Mechanical repairs">
<skill name="Construction" level="40"/>
@@ -36,7 +36,7 @@
pickthroughwalls="true"
pickdistance="150">
<Sprite texture ="engine.png" depth="0.8" sourcerect="0,115,224,73"/>
<Sprite texture ="engine.png" depth="0.8" sourcerect="0,115,224,73" canflipx="true"/>
<fixrequirement name="Mechanical repairs">
<skill name="Construction" level="30"/>
+38 -19
View File
@@ -51,7 +51,8 @@
name="Iron Powder"
category="Material"
Tags="smallitem,chem"
pickdistance="150">
pickdistance="150"
price="5">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6" color="0.2,0.2,0.2,1.0"/>
@@ -66,7 +67,8 @@
spritecolor="1.0,1.0,0.7,1.0"
Tags="smallitem,chem,medical"
pickdistance="150"
description="A mild stimulant which is used as an incredient in the manufacture of various medicines.">
description="A mild stimulant which is used as an incredient in the manufacture of various medicines."
price="10">
<Sprite texture ="med.png" sourcerect="15,15,8,17" depth="0.6" />
@@ -91,7 +93,8 @@
Tags="smallitem,chem,medical"
pickdistance="150"
canuseonself="true"
description="Most commonly used for treating oxygen deprivation.">
description="Most commonly used for treating oxygen deprivation."
price="50">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6" />
@@ -111,7 +114,8 @@
Tags="smallitem,chem,medical"
pickdistance="150"
canuseonself="true"
description="A hemostatic agent that slows down bleeding.">
description="A hemostatic agent that slows down bleeding."
price="50">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6" />
@@ -136,7 +140,8 @@
Tags="smallitem,chem,medical"
pickdistance="150"
canuseonself="true"
description="Highly effective at treating various types of physical trauma.">
description="Highly effective at treating various types of physical trauma."
price="50">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -160,7 +165,8 @@
spritecolor="1.0,1.0,0.0,1.0"
Tags="smallitem,chem,medical"
pickdistance="150"
description="A highly potent corrigodone-based stimulant.">
description="A highly potent corrigodone-based stimulant."
price="150">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -178,7 +184,8 @@
category="Material"
spritecolor="1.0,1.0,1.0,0.6"
Tags="smallitem,chem,medical"
pickdistance="150">
pickdistance="150"
price="20">
<Sprite texture ="med.png" sourcerect="15,15,8,17" depth="0.6"/>
@@ -197,7 +204,8 @@
spritecolor="0.0,0.9,0.1,1.0"
Tags="smallitem,chem,medical"
canuseonself="true"
pickdistance="150">
pickdistance="150"
price="20">
<ItemComponent>
<StatusEffect type="OnUse" target="This" Condition="-25.0" disabledeltatime="true"/>
@@ -220,7 +228,8 @@
category="Material"
spritecolor="0.7,0.7,0.7,1.0"
Tags="smallitem,chem,medical"
pickdistance="150">
pickdistance="150"
price="20">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -238,7 +247,8 @@
category="Material"
spritecolor="0.8,0.8,0.8,1.0"
Tags="smallitem,chem,medical"
pickdistance="150">
pickdistance="150"
price="20">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -256,7 +266,8 @@
category="Material"
spritecolor="0.1,0.1,0.1,1.0"
Tags="smallitem,chem,explosive"
pickdistance="150">
pickdistance="150"
price="50">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -276,7 +287,8 @@
category="Material"
spritecolor="1.0,1.0,1.0,0.8"
Tags="smallitem,chem,medical"
pickdistance="150">
pickdistance="150"
price="20">
<Sprite texture ="med.png" sourcerect="15,15,8,17" depth="0.6"/>
@@ -294,7 +306,8 @@
category="Material"
spritecolor="0.5,0.0,0.0,1.0"
Tags="smallitem,chem,medical"
pickdistance="150">
pickdistance="150"
price="20">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -312,7 +325,8 @@
category="Material"
spritecolor="0.5,0.0,0.0,1.0"
Tags="smallitem,chem,medical"
pickdistance="150">
pickdistance="150"
price="50">
<Sprite texture ="med.png" sourcerect="15,15,8,17" depth="0.6"/>
@@ -330,7 +344,8 @@
category="Material"
spritecolor="0.2,0.35,0.06,1.0"
Tags="smallitem,chem,medical"
pickdistance="150">
pickdistance="150"
price="50">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -349,7 +364,8 @@
spritecolor="0.8,0.3,0.8,1.0"
Tags="smallitem,chem,medical"
pickdistance="150"
description="A potent muscle stimulant.">
description="A potent muscle stimulant."
price="50">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -368,7 +384,8 @@
spritecolor="0.0,0.0,0.0,1.0"
Tags="smallitem,chem,medical"
pickdistance="150"
description="A highly potent neurotoxin.">
description="A highly potent neurotoxin."
price="200">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -387,7 +404,8 @@
spritecolor="0.0,0.0,0.0,1.0"
Tags="smallitem,chem,medical"
pickdistance="150"
description="Dormant eggs of the Europan lifeform colloquially referred to as 'husk parasite'.">
description="Dormant eggs of the Europan lifeform colloquially referred to as 'husk parasite'."
price="200">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -406,7 +424,8 @@
spritecolor="0.0,0.0,0.0,1.0"
Tags="smallitem,chem,medical"
pickdistance="150"
description="An antiparasitic drug used in the treatment of husk parasite infections.">
description="An antiparasitic drug used in the treatment of husk parasite infections."
price="300">
<Sprite texture ="med.png" sourcerect="24,16,8,16" depth="0.6"/>
@@ -38,7 +38,7 @@
name="Depth Charge Shell"
category="Misc"
pickdistance="150"
price="50">
price="200">
<Deconstruct time="10">
<Item name="Steel Bar"/>
@@ -66,7 +66,7 @@
name="Nuclear Depth Charge"
category="Misc"
pickdistance="150"
price="50">
price="500">
<Deconstruct time="20">
<Item name="Steel Bar"/>
+11 -2
View File
@@ -66,7 +66,7 @@
name="Railgun Shell"
category="Misc"
pickdistance="200"
price="100">
price="200">
<Deconstruct time="10">
<Item name="Steel Bar"/>
@@ -82,6 +82,10 @@
<Projectile launchimpulse="80.0">
<Attack damage="100" bleedingdamage="10" structuredamage="200" damagetype="Blunt"/>
<StatusEffect type="OnActive" target="This">
<ParticleEmitter particle="bubbles" anglemin="0" anglemax="360" particleamount="10" velocitymin="0" velocitymax="50" scalemin="2" scalemax="5"/>
</StatusEffect>
</Projectile>
<ItemContainer hideitems="true" capacity="1" canbeselected = "true">
@@ -93,7 +97,7 @@
name="Nuclear Shell"
category="Misc"
pickdistance="200"
price="100">
price="500">
<Deconstruct time="10">
<Item name="Steel Bar"/>
@@ -110,9 +114,14 @@
<Projectile launchimpulse="80.0">
<Attack damage="1000" bleedingdamage="10" structuredamage="200" damagetype="Blunt"/>
<StatusEffect type="OnUse" Condition="-100.0" stun="10.0" disabledeltatime="true" sound="Content/Items/Weapons/bigexplosion.ogg">
<Explosion range="1000.0" structuredamage="1000" damage="1000" stun="10" force="50.0"/>
</StatusEffect>
<StatusEffect type="OnActive" target="This">
<ParticleEmitter particle="bubbles" anglemin="0" anglemax="360" particleamount="10" velocitymin="0" velocitymax="50" scalemin="2" scalemax="5"/>
</StatusEffect>
</Projectile>
<ItemContainer hideitems="true" capacity="1" canbeselected = "true">
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8" ?>
<LevelGenerationParameters>
<Default
width="150000"
height="60000"
VoronoiSiteInterval="2000,2000"
VoronoiSiteVariance="800,800"
MainPathNodeIntervalRange="10000,30000"
BackgroundColor="29,36,50"
SmallTunnelCount="5"
SmallTunnelLengthRange="5000,10000"
RuinCount="1"
BottomHoleProbability="0.4"
BackgroundSpriteAmount="1000"
/>
<Open
width="200000"
height="50000"
VoronoiSiteInterval="2000,2000"
VoronoiSiteVariance="800,800"
MainPathNodeIntervalRange="5000,10000"
BackgroundColor="55,61,72"
SmallTunnelCount="3"
SmallTunnelLengthRange="5000,10000"
RuinCount="1"
BottomHoleProbability="1"
BackgroundSpriteAmount="800"
/>
<Pillars
width="100000"
height="80000"
VoronoiSiteInterval="1000,8000"
VoronoiSiteVariance="100,1400"
MainPathNodeIntervalRange="5000,10000"
BackgroundColor="55,72,58"
SmallTunnelCount="10"
SmallTunnelLengthRange="5000,10000"
RuinCount="1"
BottomHoleProbability="0.5"
BackgroundSpriteAmount="1000"
/>
<Slabs
width="150000"
height="50000"
VoronoiSiteInterval="8000,1000"
VoronoiSiteVariance="1400,100"
MainPathNodeIntervalRange="5000,10000"
BackgroundColor="55,72,58"
SmallTunnelCount="10"
SmallTunnelLengthRange="5000,10000"
RuinCount="1"
BottomHoleProbability="0.0"
BackgroundSpriteAmount="1000"
/>
<Maze
width="100000"
height="70000"
VoronoiSiteInterval="1500,1500"
VoronoiSiteVariance="700,700"
MainPathNodeIntervalRange="6000,10000"
BackgroundColor="25,23,10"
SmallTunnelCount="10"
SmallTunnelLengthRange="5000,50000"
RuinCount="3"
BottomHoleProbability="0.5"
BackgroundSpriteAmount="1000"
/>
</LevelGenerationParameters>
+5 -1
View File
@@ -6,7 +6,12 @@
<structure prefab="RuinWallVertical" alignment="Left,Right" type="Wall"/>
<structure prefab="RuinWallVerticalSmall" alignment="Left,Right" type="CorridorWall"/>
<structure prefab="RuinWallHeavyHorizontal" alignment="Top, Bottom" type="HeavyWall"/>
<structure prefab="RuinWallHeavyVertical" alignment="Left,Right" type="HeavyWall"/>
<structure prefab="RuinBack" alignment="Center" type="Back" commonness="3"/>
<structure prefab="RuinBackFractal" alignment="Center" type="Back" commonness="2"/>
<structure prefab="RuinBackCarvings" alignment="Center" type="Back" commonness="1"/>
<item prefab="RuinBlock" alignment="Right,Top,Bottom,Left" type="Prop" commonness="5"/>
@@ -15,7 +20,6 @@
<item prefab="RuinClaw" alignment="Bottom" type="Prop" commonness="5"/>
<item prefab="Oxygenite Shard" alignment="Center,Right,Top,Bottom,Left" type="Prop" commonness="5"/>
<item prefab="Sulphurite Shard" alignment="Center,Right,Top,Bottom,Left" type="Prop" commonness="5"/>
+22 -5
View File
@@ -29,23 +29,23 @@
</smallverticalback2>
<engineeringLabel width="153" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,426,153,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,426,153,16" depth="0.99" canflipx="false"/>
</engineeringLabel>
<commandLabel width="128" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,443,128,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,443,128,16" depth="0.99" canflipx="false"/>
</commandLabel>
<airlockLabel width = "99" height ="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,460,199,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,460,199,16" depth="0.99" canflipx="false"/>
</airlockLabel>
<cabinsLabel width="83" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,477,83,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,477,83,16" depth="0.99" canflipx="false"/>
</cabinsLabel>
<medicalLabel width="110" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,494,110,16" depth="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,494,110,16" depth="0.99" canflipx="false"/>
</medicalLabel>
<arrowUp width="16" height="16">
@@ -200,6 +200,18 @@
<sprite texture="Content/Map/ruins.png" sourcerect="896,192,128,832" depth ="0.061"/>
</RuinWallVertical>
<RuinWallHeavyHorizontal category="Alien" castshadow="true"
width="128" height="128" resizehorizontal="true" body="true" health="100000">
<sprite texture="Content/Map/ruins3.png" sourcerect="352,896,672,128" depth ="0.06"/>
</RuinWallHeavyHorizontal>
<RuinWallHeavyVertical category="Alien" castshadow="true"
width="128" height="128" resizevertical="true" body="true" health="100000">
<sprite texture="Content/Map/ruins3.png" sourcerect="896,0,128,672" depth ="0.061"/>
</RuinWallHeavyVertical>
<RuinWallHorizontalSmall category="Alien" castshadow="true"
width="128" height="54" resizehorizontal="true" body="true" health="500">
<sprite texture="Content/Map/ruins.png" sourcerect="0,842,832,54" depth ="0.062"/>
@@ -221,6 +233,11 @@
<sprite texture="Content/Map/ruins.png" sourcerect="512,0,233,512" depth ="0.981" />
</RuinBackCarvings>
<RuinBackFractal category="Alien"
width="64" height="64" resizehorizontal="true" resizevertical="true">
<sprite texture="Content/Map/ruins3.png" sourcerect="0,0,640,896" depth ="0.98"/>
</RuinBackFractal>
<RuinBlock category="Alien"
width="514" height="296">
<sprite texture="Content/Map/ruins.png" sourcerect="0,513,514,296" depth ="0.99" />
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

+21
View File
@@ -174,4 +174,25 @@
</Item>
</Items>
</CargoMission>
<CombatMission
name="Search and Destroy"
descriptionneutral="A Coalition vessel has been dispatched from [location1] to destroy a renegade vessel at the outskirts of [location2]."
description1="A renegade vessel has been detected at the outskirts of [location2]. Treason against the Europa Coalition is punishable by death - eliminate the renegades and return to [location1]!"
description2="You're a member of a renegade group opposing the Europa Coalition. According to your informants at [location1], a Coalition ship has just been dispatched on a mission to take down your vessel. Eliminate their crew and return to [location2]."
teamname1="Coalition"
teamname2="Renegade"
multiplayeronly="true"
commonness="20"
reward="2000"
successmessage="The [loser] vessel has been defeated by the [winner] crew!"
failuremessage="Both crews have perished.">
<message header="Crew eliminated" text="The renegade crew has been defeated! The Coalition vessel has to make its way back to [location1]."/>
<message header="Crew eliminated" text="The Coalition crew has been defeated! The renegade vessel has to make its way back to [location2]."/>
</CombatMission>
</Missions>
Binary file not shown.
@@ -46,6 +46,7 @@
<BackgroundSpritePrefabs file="Content/BackgroundSprites/BackgroundSpritePrefabs.xml" />
<RandomEvents file="Content/randomevents.xml" />
<LocationTypes file="Content/Map/locationTypes.xml" />
<LevelGenerationParameters file="Content/Map/LevelGenerationParameters.xml" />
<Missions file="Content/Missions.xml" />
<Jobs file="Content/Jobs.xml" />
<Executable file="Barotrauma.exe" />
-719
View File
@@ -1,719 +0,0 @@
<StyleCopSettings Version="105">
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="ElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="EnumerationItemsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustContainValidXml">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotHaveDefaultSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustMatchElementParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="VoidReturnValueMustNotBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumentedPartialClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustMatchTypeParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustMatchAccessors">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotBeCopiedAndPasted">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SingleLineCommentsMustNotUseDocumentationStyleSlashes">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustNotBeEmpty">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustContainWhitespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustMeetCharacterPercentage">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludedDocumentationXPathDoesNotExist">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludeNodeDoesNotContainValidFileAndPath">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="InheritDocMustBeUsedWithInheritingClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustBeSpelledCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMustHaveHeader">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustShowCopyright">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveCopyrightText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
<Rules>
<Rule Name="CurlyBracketsForMultiLineStatementsMustNotShareLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StatementMustNotBeOnSingleLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementMustNotBeOnSingleLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CurlyBracketsMustNotBeOmitted">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="AllAccessorsMustBeMultiLineOrSingleLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningCurlyBracketsMustNotBeFollowedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationHeadersMustNotBeFollowedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainMultipleBlankLinesInARow">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingCurlyBracketsMustNotBePrecededByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningCurlyBracketsMustNotBePrecededByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ChainedStatementBlocksMustNotBePrecededByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="WhileDoFooterMustNotBePrecededByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SingleLineCommentsMustNotBeFollowedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingCurlyBracketMustBeFollowedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationHeaderMustBePrecededByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SingleLineCommentMustBePrecededByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeSeparatedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainBlankLinesAtStartOfFile">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainBlankLinesAtEndOfFile">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
<Rules>
<Rule Name="FileMayOnlyContainASingleClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="AccessModifierMustBeDeclared">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FieldsMustBePrivate">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeAnalysisSuppressionMustHaveJustification">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DebugAssertMustProvideMessageText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DebugFailMustProvideMessageText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMayOnlyContainASingleNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustAppearInTheCorrectOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeOrderedByAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstantsMustAppearBeforeFields">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticElementsMustAppearBeforeInstanceElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DeclarationKeywordsMustFollowOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ProtectedMustComeBeforeInternal">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertyAccessorsMustFollowOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="EventAccessorsMustFollowOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SystemUsingDirectivesMustBePlacedBeforeOtherUsingDirectives">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UsingAliasDirectivesMustBePlacedAfterOtherUsingDirectives">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UsingDirectivesMustBeOrderedAlphabeticallyByNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UsingAliasDirectivesMustBeOrderedAlphabeticallyByAliasName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
<Rules>
<Rule Name="CommentsMustContainText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DoNotPrefixCallsWithBaseUnlessLocalImplementationExists">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixLocalCallsWithThis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixCallsCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningParenthesisMustBeOnDeclarationLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingParenthesisMustBeOnLineOfLastParameter">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingParenthesisMustBeOnLineOfOpeningParenthesis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CommaMustBeOnSameLineAsPreviousParameter">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParameterListMustFollowDeclaration">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParameterMustFollowComma">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SplitParametersMustStartOnLineAfterDeclaration">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParametersMustBeOnSameLineOrSeparateLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParameterMustNotSpanMultipleLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="QueryClauseMustFollowPreviousClause">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="QueryClausesMustBeOnSeparateLinesOrAllOnOneLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="QueryClauseMustBeginOnNewLineWhenPreviousClauseSpansMultipleLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="QueryClausesSpanningMultipleLinesMustBeginOnOwnLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DoNotPlaceRegionsWithinElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainEmptyStatements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainMultipleStatementsOnOneLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="BlockStatementsMustNotContainEmbeddedComments">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="BlockStatementsMustNotContainEmbeddedRegions">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseStringEmptyForEmptyStrings">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseBuiltInTypeAlias">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseShorthandForNullableTypes">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
<Rules>
<Rule Name="KeywordsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CommasMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SemicolonsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationLinesMustBeginWithSingleSpace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SingleLineCommentsMustBeginWithSingleSpace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PreprocessorKeywordsMustNotBePrecededBySpace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OperatorKeywordMustBeFollowedBySpace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningParenthesisMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingParenthesisMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningSquareBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingSquareBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningCurlyBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingCurlyBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningGenericBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingGenericBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningAttributeBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingAttributeBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="NullableTypeSymbolsMustNotBePrecededBySpace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="MemberAccessSymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncrementDecrementSymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="NegativeSignsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PositiveSignsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DereferenceAndAccessOfSymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ColonsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainMultipleWhitespaceInARow">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="TabsMustNotBeUsed">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>
+8 -2
View File
@@ -110,6 +110,8 @@ namespace Barotrauma
viewMatrix =
Matrix.CreateTranslation(new Vector3(GameMain.GraphicsWidth / 2.0f, GameMain.GraphicsHeight / 2.0f, 0));
UpdateTransform();
}
public Vector2 TargetPos
@@ -193,9 +195,13 @@ namespace Barotrauma
}
}
moveCam = moveCam * deltaTime * 60.0f;
moveCam = moveCam * deltaTime * 60.0f;
Zoom = MathHelper.Clamp(zoom + (PlayerInput.ScrollWheelSpeed / 1000.0f) * zoom, GameMain.DebugDraw ? 0.01f : 0.1f, 2.0f);
Vector2 mouseInWorld = ScreenToWorld(PlayerInput.MousePosition);
Vector2 diffViewCenter;
diffViewCenter = ((mouseInWorld - Position) * Zoom);
Zoom = MathHelper.Clamp(zoom + (PlayerInput.ScrollWheelSpeed / 1000.0f) * zoom, GameMain.DebugDraw ? 0.01f : 0.1f, 2.0f);
if (!PlayerInput.KeyDown(Keys.F)) Position = mouseInWorld - (diffViewCenter / Zoom);
}
else
{
@@ -341,7 +341,7 @@ namespace Barotrauma
{
wallAttackPos = Vector2.Zero;
limb.AttackTimer = 0.0f;
if (Vector2.Distance(limb.SimPosition, attackPosition)<5.0) coolDownTimer = attackCoolDown;
coolDownTimer = attackCoolDown;
}
}
@@ -180,8 +180,8 @@ namespace Barotrauma
{
if (selectedAiTarget != null)
{
GUI.DrawLine(spriteBatch,
new Vector2(Character.WorldPosition.X, -Character.WorldPosition.Y),
GUI.DrawLine(spriteBatch,
new Vector2(Character.DrawPosition.X, -Character.DrawPosition.Y),
new Vector2(selectedAiTarget.WorldPosition.X, -selectedAiTarget.WorldPosition.Y), Color.Red);
}
@@ -189,16 +189,16 @@ namespace Barotrauma
if (pathSteering == null || pathSteering.CurrentPath == null || pathSteering.CurrentPath.CurrentNode==null) return;
GUI.DrawLine(spriteBatch,
new Vector2(Character.WorldPosition.X, -Character.WorldPosition.Y),
new Vector2(pathSteering.CurrentPath.CurrentNode.WorldPosition.X, -pathSteering.CurrentPath.CurrentNode.WorldPosition.Y),
new Vector2(Character.DrawPosition.X, -Character.DrawPosition.Y),
new Vector2(pathSteering.CurrentPath.CurrentNode.DrawPosition.X, -pathSteering.CurrentPath.CurrentNode.DrawPosition.Y),
Color.LightGreen);
for (int i = 1; i < pathSteering.CurrentPath.Nodes.Count; i++)
{
GUI.DrawLine(spriteBatch,
new Vector2(pathSteering.CurrentPath.Nodes[i].WorldPosition.X, -pathSteering.CurrentPath.Nodes[i].WorldPosition.Y),
new Vector2(pathSteering.CurrentPath.Nodes[i - 1].WorldPosition.X, -pathSteering.CurrentPath.Nodes[i-1].WorldPosition.Y),
new Vector2(pathSteering.CurrentPath.Nodes[i].DrawPosition.X, -pathSteering.CurrentPath.Nodes[i].DrawPosition.Y),
new Vector2(pathSteering.CurrentPath.Nodes[i - 1].DrawPosition.X, -pathSteering.CurrentPath.Nodes[i - 1].DrawPosition.Y),
Color.LightGreen);
}
}
+2 -2
View File
@@ -64,9 +64,9 @@ namespace Barotrauma
aiController.Update(deltaTime);
}
public override void DrawFront(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
public override void DrawFront(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch,Camera cam)
{
base.DrawFront(spriteBatch);
base.DrawFront(spriteBatch,cam);
if (GameMain.DebugDraw && !isDead) aiController.DebugDraw(spriteBatch);
}
@@ -426,7 +426,11 @@ namespace Barotrauma
float volume = stairs == null ? impact / 5.0f : impact;
volume = Math.Min(impact, 1.0f);
if (impact > 0.8f && l.HitSound != null && l.soundTimer <= 0.0f) l.HitSound.Play(volume, impact * 100.0f, l.WorldPosition);
if (impact > 0.5f && l.HitSound != null && l.soundTimer <= 0.0f)
{
l.soundTimer = Limb.SoundInterval;
l.HitSound.Play(volume, impact * 250.0f, l.WorldPosition);
}
if (impact > l.impactTolerance)
{
@@ -464,7 +468,7 @@ namespace Barotrauma
if (limb.pullJoint != null)
{
Vector2 pos = ConvertUnits.ToDisplayUnits(limb.pullJoint.WorldAnchorA);
if (currentHull != null) pos += currentHull.Submarine.Position;
if (currentHull != null) pos += currentHull.Submarine.DrawPosition;
pos.Y = -pos.Y;
GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X, (int)pos.Y, 5, 5), Color.Red, true, 0.01f);
@@ -492,7 +496,7 @@ namespace Barotrauma
if (limb.body.TargetPosition != Vector2.Zero)
{
Vector2 pos = ConvertUnits.ToDisplayUnits(limb.body.TargetPosition);
if (currentHull != null) pos += currentHull.Submarine.Position;
if (currentHull != null) pos += currentHull.Submarine.DrawPosition;
pos.Y = -pos.Y;
GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X - 10, (int)pos.Y - 10, 20, 20), Color.Cyan, false, 0.01f);
@@ -35,10 +35,11 @@ namespace Barotrauma
const int GridSize = 1000;
private List<BackgroundSpritePrefab> prefabs = new List<BackgroundSpritePrefab>();
private List<BackgroundSprite>[,] sprites;
private float swingTimer;
public BackgroundSpriteManager(string configPath)
{
LoadConfig(configPath);
@@ -83,38 +84,37 @@ namespace Barotrauma
for (int i = 0 ; i < amount; i++)
{
BackgroundSpritePrefab prefab = GetRandomPrefab();
BackgroundSpritePrefab prefab = GetRandomPrefab(level.GenerationParams.Name);
GraphEdge selectedEdge = null;
Vector2? pos = FindSpritePosition(level, prefab, out selectedEdge);
Vector2 edgeNormal = Vector2.One;
Vector2? pos = FindSpritePosition(level, prefab, out selectedEdge, out edgeNormal);
if (pos == null) continue;
float rotation = 0.0f;
if (prefab.AlignWithSurface)
{
Vector2 leftPoint = selectedEdge.point2;
Vector2 rightPoint = selectedEdge.point1;
rotation = -MathUtils.VectorToAngle(rightPoint - leftPoint);
rotation = MathUtils.VectorToAngle(new Vector2(edgeNormal.Y, edgeNormal.X));
}
rotation += Rand.Range(prefab.RandomRotation.X, prefab.RandomRotation.Y, false);
var newSprite = new BackgroundSprite(prefab,
(Vector2)pos, Rand.Range(prefab.Scale.X, prefab.Scale.Y, false), rotation);
int x = (int)Math.Floor(((Vector2)pos).X / GridSize);
if (x<0 || x >= sprites.GetLength(0)) continue;
if (x < 0 || x >= sprites.GetLength(0)) continue;
int y = (int)Math.Floor(((Vector2)pos).Y / GridSize);
if (y<0 || y >= sprites.GetLength(1)) continue;
if (y < 0 || y >= sprites.GetLength(1)) continue;
sprites[x,y].Add(newSprite);
}
}
private Vector2? FindSpritePosition(Level level, BackgroundSpritePrefab prefab, out GraphEdge closestEdge)
private Vector2? FindSpritePosition(Level level, BackgroundSpritePrefab prefab, out GraphEdge closestEdge, out Vector2 edgeNormal)
{
closestEdge = null;
edgeNormal = Vector2.One;
Vector2 randomPos = new Vector2(
Rand.Range(0.0f, level.Size.X, false),
@@ -126,68 +126,67 @@ namespace Barotrauma
VoronoiCell cell = cells[Rand.Int(cells.Count, false)];
List<GraphEdge> edges = new List<GraphEdge>();
List<Vector2> normals = new List<Vector2>();
foreach (GraphEdge edge in cell.edges)
{
if (!edge.isSolid) continue;
if (!edge.isSolid || edge.OutsideLevel) continue;
Vector2 normal = edge.GetNormal(cell);
if (prefab.Alignment.HasFlag(Alignment.Bottom))
{
if (Math.Abs(edge.point1.X - edge.point2.X) < Math.Abs(edge.point1.Y - edge.point2.Y)) continue;
if (edge.Center.Y < cell.Center.Y) edges.Add(edge);
}
else if (prefab.Alignment.HasFlag(Alignment.Top))
{
if (Math.Abs(edge.point1.X - edge.point2.X) < Math.Abs(edge.point1.Y - edge.point2.Y)) continue;
if (edge.Center.Y > cell.Center.Y) edges.Add(edge);
}
else if (prefab.Alignment.HasFlag(Alignment.Left))
{
if (edge.Center.X < cell.Center.X) edges.Add(edge);
}
else if (prefab.Alignment.HasFlag(Alignment.Right))
{
if (edge.Center.X > cell.Center.X) edges.Add(edge);
}
else
if (prefab.Alignment.HasFlag(Alignment.Bottom) && normal.Y < -0.5f)
{
edges.Add(edge);
}
else if (prefab.Alignment.HasFlag(Alignment.Top) && normal.Y > 0.5f)
{
edges.Add(edge);
}
else if (prefab.Alignment.HasFlag(Alignment.Left) && normal.X < -0.5f)
{
edges.Add(edge);
}
else if (prefab.Alignment.HasFlag(Alignment.Right) && normal.X > 0.5f)
{
edges.Add(edge);
}
else
{
continue;
}
normals.Add(normal);
}
if (!edges.Any()) return null;
closestEdge = edges[Rand.Int(edges.Count,false)];
int index = Rand.Int(edges.Count,false);
closestEdge = edges[index];
edgeNormal = normals[index];
float length = Vector2.Distance(closestEdge.point1, closestEdge.point2);
Vector2 dir = (closestEdge.point1 - closestEdge.point2) / length;
Vector2 pos = closestEdge.Center;
pos = closestEdge.point2 + dir * Rand.Range(prefab.Sprite.size.X / 2.0f, length - prefab.Sprite.size.X / 2.0f, false);
if (prefab.Alignment.HasFlag(Alignment.Top))
{
pos.Y -= Math.Abs(dir.Y) * prefab.Sprite.size.X / Math.Abs(dir.X);
}
else if (prefab.Alignment.HasFlag(Alignment.Bottom))
{
pos.Y += Math.Abs(dir.Y) * prefab.Sprite.size.X / Math.Abs(dir.X);
}
Vector2 pos = closestEdge.point2 + dir * Rand.Range(prefab.Sprite.size.X / 2.0f, length - prefab.Sprite.size.X / 2.0f, false);
return pos;
}
public void Update(float deltaTime)
{
swingTimer += deltaTime;
}
public void DrawSprites(SpriteBatch spriteBatch, Camera cam)
{
Rectangle indices = Rectangle.Empty;
indices.X = (int)Math.Floor(cam.WorldView.X / (float)GridSize) - 1;
indices.X = (int)Math.Floor(cam.WorldView.X / (float)GridSize) - 2;
if (indices.X >= sprites.GetLength(0)) return;
indices.Y = (int)Math.Floor((cam.WorldView.Y - cam.WorldView.Height) / (float)GridSize) - 1;
indices.Y = (int)Math.Floor((cam.WorldView.Y - cam.WorldView.Height) / (float)GridSize) - 2;
if (indices.Y >= sprites.GetLength(1)) return;
indices.Width = (int)Math.Ceiling(cam.WorldView.Right / (float)GridSize) + 1;
indices.Width = (int)Math.Ceiling(cam.WorldView.Right / (float)GridSize) + 2;
if (indices.Width < 0) return;
indices.Height = (int)Math.Ceiling(cam.WorldView.Y / (float)GridSize) + 1;
indices.Height = (int)Math.Ceiling(cam.WorldView.Y / (float)GridSize) + 2;
if (indices.Height < 0) return;
indices.X = Math.Max(indices.X, 0);
@@ -195,6 +194,8 @@ namespace Barotrauma
indices.Width = Math.Min(indices.Width, sprites.GetLength(0));
indices.Height = Math.Min(indices.Height, sprites.GetLength(1));
float swingState = (float)Math.Sin(swingTimer * 0.1f);
float z = 0.0f;
for (int x = indices.X; x < indices.Width; x++)
{
@@ -202,31 +203,44 @@ namespace Barotrauma
{
foreach (BackgroundSprite sprite in sprites[x, y])
{
sprite.Prefab.Sprite.Draw(spriteBatch, new Vector2(sprite.Position.X, -sprite.Position.Y), Color.White, sprite.Rotation, sprite.Scale, SpriteEffects.None, z);
sprite.Prefab.Sprite.Draw(
spriteBatch,
new Vector2(sprite.Position.X, -sprite.Position.Y),
Color.White,
sprite.Rotation + swingState*sprite.Prefab.SwingAmount,
sprite.Scale,
SpriteEffects.None,
z);
if (GameMain.DebugDraw)
{
GUI.DrawRectangle(spriteBatch, new Vector2(sprite.Position.X, -sprite.Position.Y), new Vector2(10.0f, 10.0f), Color.Red, true);
}
z += 0.0001f;
}
}
}
}
private BackgroundSpritePrefab GetRandomPrefab()
private BackgroundSpritePrefab GetRandomPrefab(string levelType)
{
int totalCommonness = 0;
foreach (BackgroundSpritePrefab prefab in prefabs)
{
totalCommonness += prefab.Commonness;
totalCommonness += prefab.GetCommonness(levelType);
}
float randomNumber = Rand.Int(totalCommonness+1, false);
foreach (BackgroundSpritePrefab prefab in prefabs)
{
if (randomNumber <= prefab.Commonness)
if (randomNumber <= prefab.GetCommonness(levelType))
{
return prefab;
}
randomNumber -= prefab.Commonness;
randomNumber -= prefab.GetCommonness(levelType);
}
return null;
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Barotrauma
@@ -16,13 +17,20 @@ namespace Barotrauma
public readonly Vector2 RandomRotation;
public readonly float SwingAmount;
public readonly int Commonness;
public Dictionary<string, int> OverrideCommonness;
public BackgroundSpritePrefab(XElement element)
{
string alignmentStr = ToolBox.GetAttributeString(element, "alignment", "BottomCenter");
string alignmentStr = ToolBox.GetAttributeString(element, "alignment", "");
if (!Enum.TryParse(alignmentStr, out Alignment)) Alignment = Alignment.BottomCenter;
if (string.IsNullOrEmpty(alignmentStr) || !Enum.TryParse(alignmentStr, out Alignment))
{
Alignment = Alignment.Top | Alignment.Bottom | Alignment.Left | Alignment.Right;
}
Commonness = ToolBox.GetAttributeInt(element, "commonness", 1);
@@ -35,14 +43,39 @@ namespace Barotrauma
RandomRotation.X = MathHelper.ToRadians(RandomRotation.X);
RandomRotation.Y = MathHelper.ToRadians(RandomRotation.Y);
SwingAmount = MathHelper.ToRadians(ToolBox.GetAttributeFloat(element, "swingamount", 0.0f));
OverrideCommonness = new Dictionary<string, int>();
foreach (XElement subElement in element.Elements())
{
if (subElement.Name.ToString().ToLowerInvariant() != "sprite") continue;
switch(subElement.Name.ToString().ToLowerInvariant())
{
case "sprite":
Sprite = new Sprite(subElement);
break;
case "overridecommonness":
string levelType = ToolBox.GetAttributeString(subElement, "leveltype", "");
if (!OverrideCommonness.ContainsKey(levelType))
{
OverrideCommonness.Add(levelType, ToolBox.GetAttributeInt(subElement, "commonness", 1));
}
break;
Sprite = new Sprite(subElement);
break;
}
}
}
public int GetCommonness(string levelType)
{
int commonness = 0;
if (!OverrideCommonness.TryGetValue(levelType, out commonness))
{
return Commonness;
}
return commonness;
}
}
}
+49 -14
View File
@@ -72,6 +72,9 @@ namespace Barotrauma
}
}
public Hull PreviousHull = null;
public Hull CurrentHull = null;
public readonly bool IsNetworkPlayer;
private bool networkUpdateSent;
@@ -92,7 +95,9 @@ namespace Barotrauma
private Item selectedConstruction;
private Item[] selectedItems;
public byte TeamID = 0;
public AnimController AnimController;
private Vector2 cursorPosition;
@@ -833,19 +838,39 @@ namespace Barotrauma
attackPos,
AnimController.Limbs.Select(l => l.body.FarseerBody).ToList(),
Physics.CollisionCharacter | Physics.CollisionWall);
IDamageable attackTarget = null;
if (body != null)
{
if (body.UserData is IDamageable)
{
attackTarget = (IDamageable)body.UserData;
}
else if (body.UserData is Limb)
{
attackTarget = ((Limb)body.UserData).character;
}
attackPos = Submarine.LastPickedPosition;
if (body != null && body.UserData is Submarine)
{
var sub = ((Submarine)body.UserData);
body = Submarine.PickBody(
attackLimb.SimPosition - ((Submarine)body.UserData).SimPosition,
attackPos - ((Submarine)body.UserData).SimPosition,
AnimController.Limbs.Select(l => l.body.FarseerBody).ToList(),
Physics.CollisionWall);
if (body != null)
{
attackPos = Submarine.LastPickedPosition + sub.SimPosition;
attackTarget = body.UserData as IDamageable;
}
}
else
{
if (body.UserData is IDamageable)
{
attackTarget = (IDamageable)body.UserData;
}
else if (body.UserData is Limb)
{
attackTarget = ((Limb)body.UserData).character;
}
}
}
attackLimb.UpdateAttack(deltaTime, attackPos, attackTarget);
@@ -1195,6 +1220,10 @@ namespace Barotrauma
{
if (!Enabled) return;
PreviousHull = CurrentHull;
CurrentHull = Hull.FindHull(WorldPosition, CurrentHull, true);
//if (PreviousHull != CurrentHull && Character.Controlled == this) Hull.DetectItemVisibility(this); //WIP item culling
speechBubbleTimer = Math.Max(0.0f, speechBubbleTimer - deltaTime);
obstructVisionAmount = Math.Max(obstructVisionAmount - deltaTime, 0.0f);
@@ -1406,7 +1435,7 @@ namespace Barotrauma
CharacterHUD.Draw(spriteBatch, this, cam);
}
public virtual void DrawFront(SpriteBatch spriteBatch)
public virtual void DrawFront(SpriteBatch spriteBatch, Camera cam)
{
if (!Enabled) return;
@@ -1424,9 +1453,15 @@ namespace Barotrauma
if (info != null)
{
Vector2 namePos = new Vector2(pos.X, pos.Y - 120.0f) - GUI.Font.MeasureString(Info.Name) * 0.5f;
spriteBatch.DrawString(GUI.Font, Info.Name, namePos - new Vector2(1.0f, 1.0f), Color.Black);
spriteBatch.DrawString(GUI.Font, Info.Name, namePos, Color.White);
Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f/cam.Zoom)) - GUI.Font.MeasureString(Info.Name) * 0.5f / cam.Zoom;
Color nameColor = Color.White;
if (Character.Controlled != null && TeamID!=Character.Controlled.TeamID)
{
nameColor = Color.Red;
}
spriteBatch.DrawString(GUI.Font, Info.Name, namePos + new Vector2(1.0f/cam.Zoom, 1.0f / cam.Zoom), Color.Black, 0.0f,Vector2.Zero, 1.0f / cam.Zoom,SpriteEffects.None,0.001f);
spriteBatch.DrawString(GUI.Font, Info.Name, namePos, nameColor, 0.0f, Vector2.Zero, 1.0f/cam.Zoom, SpriteEffects.None, 0.0f);
if (GameMain.DebugDraw)
{
+4 -3
View File
@@ -462,14 +462,14 @@ namespace Barotrauma
Vector2 normal = new Vector2(-line.Y, line.X);
normal = Vector2.Normalize(-normal);
float dragDot = Vector2.Dot(normal, velDir);
float dragDot = Math.Abs(Vector2.Dot(normal, velDir));
Vector2 dragForce = Vector2.Zero;
if (dragDot > 0)
{
float vel = LinearVelocity.Length()*2.0f;
float drag = dragDot * vel * vel
* ConvertUnits.ToSimUnits(sprite.size.Y);
dragForce = drag * -velDir;
dragForce = Math.Min(drag, Mass*1000.0f) * -velDir;
//if (dragForce.Length() > 100.0f) { }
}
@@ -499,7 +499,8 @@ namespace Barotrauma
float dist = ConvertUnits.ToDisplayUnits(Vector2.Distance(SimPosition, attackPosition));
AttackTimer += deltaTime;
body.ApplyTorque(Mass * character.AnimController.Dir * attack.Torque);
body.ApplyTorque(Mass * character.AnimController.Dir * attack.Torque);
if (dist < attack.Range * 0.5f)
{
+11 -1
View File
@@ -10,7 +10,17 @@ namespace Barotrauma
{
public enum ContentType
{
None, Jobs, Item, Character, Structure, Executable, LocationTypes, RandomEvents, Missions, BackgroundCreaturePrefabs, BackgroundSpritePrefabs
None,
Jobs,
Item,
Character,
Structure,
Executable,
LocationTypes,
LevelGenerationParameters,
RandomEvents,
Missions,
BackgroundCreaturePrefabs, BackgroundSpritePrefabs
}
public class ContentPackage
+1 -1
View File
@@ -86,7 +86,7 @@ namespace Barotrauma
}
catch (Exception e)
{
DebugConsole.ThrowError("Coroutine " + handle.Name + " threw an exception: " + e.Message);
DebugConsole.ThrowError("Coroutine " + handle.Name + " threw an exception: " + e.Message + "\n" + e.StackTrace.ToString());
return true;
}
}
+7 -9
View File
@@ -240,7 +240,7 @@ namespace Barotrauma
break;
case "near":
case "close":
float closestDist = 0.0f;
float closestDist = -1.0f;
foreach (WayPoint wp in WayPoint.WayPointList)
{
if (wp.Submarine != null) continue;
@@ -250,25 +250,27 @@ namespace Barotrauma
float dist = Vector2.Distance(wp.WorldPosition, GameMain.GameScreen.Cam.WorldViewCenter);
if (spawnPoint == null || dist < closestDist)
if (closestDist < 0.0f || dist < closestDist)
{
spawnPoint = wp;
closestDist = dist;
}
}
break;
case "cursor":
spawnPosition = GameMain.GameScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);
break;
default:
spawnPoint = WayPoint.GetRandom(commands[1].ToLowerInvariant()=="human" ? SpawnType.Human : SpawnType.Enemy);
spawnPoint = WayPoint.GetRandom(commands[1].ToLowerInvariant() == "human" ? SpawnType.Human : SpawnType.Enemy);
break;
}
}
else
{
spawnPoint = WayPoint.GetRandom(commands[1].ToLowerInvariant() == "human" ? SpawnType.Human : SpawnType.Enemy);
}
spawnPosition = spawnPoint == null ? Vector2.Zero : spawnPoint.WorldPosition;
if (spawnPoint != null) spawnPosition = spawnPoint.WorldPosition;
if (commands[1].ToLowerInvariant()=="human")
{
@@ -495,10 +497,6 @@ namespace Barotrauma
case "fire":
if (GameMain.Client == null) Hull.EditFire = !Hull.EditFire;
break;
case "generatelevel":
GameMain.Level = new Level("asdf", 50.0f, 500,500, 50);
GameMain.Level.Generate();
break;
case "fixitems":
foreach (Item it in Item.ItemList)
@@ -10,15 +10,14 @@ namespace Barotrauma
{
class CargoMission : Mission
{
private XElement itemConfig;
private List<Item> items;
private int requiredDeliveryAmount;
public CargoMission(XElement element)
: base(element)
public CargoMission(XElement element, Location[] locations)
: base(element, locations)
{
itemConfig = element.Element("Items");
@@ -71,7 +70,7 @@ namespace Barotrauma
Vector2 position = new Vector2(
cargoSpawnPos.Position.X + Rand.Range(-20.0f, 20.0f, false),
cargoRoom.Rect.Y - cargoRoom.Rect.Height);
cargoRoom.Rect.Y - cargoRoom.Rect.Height + itemPrefab.Size.Y / 2);
var item = new Item(itemPrefab, position, cargoRoom.Submarine);
item.FindHull();
@@ -0,0 +1,231 @@
using Barotrauma.Networking;
using Microsoft.Xna.Framework;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Barotrauma
{
class CombatMission : Mission
{
private Submarine[] subs;
private List<Character>[] crews;
private int state = 0;
private int winner = -1;
private string[] descriptions;
private static string[] teamNames;
public override string Description
{
get
{
if (GameMain.NetworkMember==null || GameMain.NetworkMember.Character==null)
{
//non-team-specific description
return descriptions[0];
}
//team specific
return descriptions[GameMain.NetworkMember.Character.TeamID];
}
}
public override string SuccessMessage
{
get
{
if (winner == -1) return "";
return successMessage
.Replace("[loser]", teamNames[1 - winner])
.Replace("[winner]", teamNames[winner]);
}
}
public CombatMission(XElement element, Location[] locations)
: base(element, locations)
{
descriptions = new string[]
{
ToolBox.GetAttributeString(element, "descriptionneutral", ""),
ToolBox.GetAttributeString(element, "description1", ""),
ToolBox.GetAttributeString(element, "description2", "")
};
for (int i = 0; i < descriptions.Length; i++ )
{
for (int n = 0; n < 2;n++ )
{
descriptions[i] = descriptions[i].Replace("[location" + (n + 1) + "]", Locations[n]);
}
}
teamNames = new string[]
{
ToolBox.GetAttributeString(element, "teamname1", "Team A"),
ToolBox.GetAttributeString(element, "teamname2", "Team B")
};
}
public static string GetTeamName(int teamID)
{
//team IDs start from 1, while teamName array starts from 0
teamID--;
if (teamID < 0 || teamID >= teamNames.Length)
{
return "Team " + teamID;
}
return teamNames[teamID];
}
public override bool AssignTeamIDs(List<Client> clients, out int hostTeam)
{
List<Client> randList = new List<Client>(clients);
for (int i = 0; i < randList.Count; i++)
{
Client a = randList[i];
int oi = Rand.Range(0, randList.Count - 1);
Client b = randList[oi];
randList[i] = b;
randList[oi] = a;
}
int halfPlayers = randList.Count / 2;
for (int i = 0; i < randList.Count; i++)
{
if (i < halfPlayers)
{
randList[i].TeamID = 1;
}
else
{
randList[i].TeamID = 2;
}
}
if (halfPlayers * 2 == randList.Count)
{
hostTeam = Rand.Range(1, 2);
}
else if (halfPlayers * 2 < randList.Count)
{
hostTeam = 1;
}
else
{
hostTeam = 2;
}
return true;
}
public override void Start(Level level)
{
if (GameMain.Server != null)
{
GameMain.Server.AllowRespawn = false;
}
if (GameMain.NetworkMember == null)
{
DebugConsole.ThrowError("Combat missions cannot be played in the single player mode.");
return;
}
Items.Components.Radar.StartMarker = Locations[0];
Items.Components.Radar.EndMarker = Locations[1];
subs = new Submarine[] { Submarine.MainSubs[0], Submarine.MainSubs[1] };
subs[1].SetPosition(Level.Loaded.EndPosition - new Vector2(0.0f, 2000.0f));
subs[1].FlipX();
crews = new List<Character>[] { new List<Character>(), new List<Character>() };
foreach (Submarine submarine in Submarine.Loaded)
{
//hide all subs from radar to make sneak attacks possible
submarine.OnRadar = false;
}
}
public override void Update(float deltaTime)
{
if (crews[0].Count == 0 && crews[1].Count == 0)
{
if (GameMain.Server != null)
{
GameMain.Server.AllowRespawn = false;
}
foreach (Character character in Character.CharacterList)
{
if (character.TeamID == 1)
{
crews[0].Add(character);
}
else if (character.TeamID == 2)
{
crews[1].Add(character);
}
}
}
bool[] teamDead =
{
crews[0].All(c => c.IsDead || c.IsUnconscious),
crews[1].All(c => c.IsDead || c.IsUnconscious)
};
if (state == 0)
{
for (int i = 0; i < teamDead.Length; i++)
{
if (!teamDead[i] && teamDead[1-i])
{
//make sure nobody in the other team can be revived because that would be pretty weird
crews[1-i].ForEach(c => { if (!c.IsDead) c.Kill(CauseOfDeath.Damage); });
winner = i;
ShowMessage(i);
state = 1;
break;
}
}
}
else
{
if (winner>=0 && subs[winner] != null &&
(winner == 0 && subs[winner].AtStartPosition) || (winner == 1 && subs[winner].AtEndPosition) &&
crews[winner].Any(c => !c.IsDead && c.Submarine == subs[winner]))
{
GameMain.GameSession.CrewManager.WinningTeam = winner+1;
if (GameMain.Server != null) GameMain.Server.EndGame();
}
}
if (teamDead[0] && teamDead[1])
{
GameMain.GameSession.CrewManager.WinningTeam = 0;
winner = -1;
if (GameMain.Server != null) GameMain.Server.EndGame();
}
}
public override void End()
{
if (GameMain.NetworkMember == null) return;
if (winner > -1)
{
GiveReward();
completed = true;
}
}
}
}
+37 -20
View File
@@ -27,12 +27,14 @@ namespace Barotrauma
private int reward;
protected string[] Locations = new string[2];
public string Name
{
get { return name; }
}
public string Description
public virtual string Description
{
get { return description; }
}
@@ -57,7 +59,7 @@ namespace Barotrauma
get { return Vector2.Zero; }
}
public string SuccessMessage
virtual public string SuccessMessage
{
get { return successMessage; }
}
@@ -86,7 +88,7 @@ namespace Barotrauma
}
}
public Mission(XElement element)
public Mission(XElement element, Location[] locations)
{
name = ToolBox.GetAttributeString(element, "name", "");
@@ -109,9 +111,24 @@ namespace Barotrauma
headers.Add(ToolBox.GetAttributeString(subElement, "header", ""));
messages.Add(ToolBox.GetAttributeString(subElement, "text", ""));
}
for (int n = 0; n < 2; n++)
{
Locations[n] = locations[n].Name;
description = description.Replace("[location" + (n + 1) + "]", locations[n].Name);
successMessage = successMessage.Replace("[location" + (n + 1) + "]", locations[n].Name);
failureMessage = failureMessage.Replace("[location" + (n + 1) + "]", locations[n].Name);
for (int m = 0; m < messages.Count; m++)
{
messages[m] = messages[m].Replace("[location" + (n + 1) + "]", locations[n].Name);
}
}
}
public static Mission LoadRandom(Location[] locations, MTRandom rand, string missionType = "")
public static Mission LoadRandom(Location[] locations, MTRandom rand, string missionType = "", bool isSinglePlayer = false)
{
missionType = missionType.ToLowerInvariant();
@@ -146,8 +163,15 @@ namespace Barotrauma
matchingElements = doc.Root.Elements().ToList().FindAll(m => m.Name.ToString().ToLowerInvariant().Replace("mission", "") == missionType);
}
if (isSinglePlayer)
{
matchingElements.RemoveAll(m => ToolBox.GetAttributeBool(m, "multiplayeronly", false));
}
else
{
matchingElements.RemoveAll(m => ToolBox.GetAttributeBool(m, "singleplayeronly", false));
}
int i = 0;
foreach (XElement element in matchingElements)
{
@@ -182,22 +206,13 @@ namespace Barotrauma
DebugConsole.ThrowError("Error in " + configFile + "! Could not find a mission class of the type \"" + type + "\".");
continue;
}
ConstructorInfo constructor = t.GetConstructor(new[] { typeof(XElement) });
object instance = constructor.Invoke(new object[] { element });
ConstructorInfo constructor = t.GetConstructor(new[] { typeof(XElement), typeof(Location[]) });
object instance = constructor.Invoke(new object[] { element, locations });
Mission mission = (Mission)instance;
for (int n = 0; n<2; n++)
{
mission.description = mission.description.Replace("[location"+(n+1)+"]", locations[n].Name);
mission.successMessage = mission.successMessage.Replace("[location" + (n + 1) + "]", locations[n].Name);
mission.failureMessage = mission.failureMessage.Replace("[location" + (n + 1) + "]", locations[n].Name);
}
return mission;
}
@@ -212,6 +227,8 @@ namespace Barotrauma
public virtual void Update(float deltaTime) { }
public virtual bool AssignTeamIDs(List<Networking.Client> clients,out int hostTeam) { clients.ForEach(client => { client.TeamID = 1; }); hostTeam = 1; return false; }
public void ShowMessage(int index)
{
if (index >= headers.Count && index >= messages.Count) return;
@@ -20,25 +20,15 @@ namespace Barotrauma
get { return monster != null && !monster.IsDead ? radarPosition : Vector2.Zero; }
}
public MonsterMission(XElement element)
: base(element)
public MonsterMission(XElement element, Location[] locations)
: base(element, locations)
{
monsterFile = ToolBox.GetAttributeString(element, "monsterfile", "");
}
public override void Start(Level level)
{
float minDist = Math.Max(Submarine.MainSub.Borders.Width, Submarine.MainSub.Borders.Height);
//find a random spawnpos that isn't too close to the main sub
int tries = 0;
Vector2 spawnPos = Vector2.Zero;
do
{
spawnPos = Level.Loaded.GetRandomInterestingPosition(true, Level.PositionType.MainPath);
tries++;
} while (tries < 50 && Vector2.Distance(spawnPos, Submarine.MainSub.WorldPosition) < minDist);
Vector2 spawnPos = Level.Loaded.GetRandomInterestingPosition(true, Level.PositionType.MainPath, true);
monster = Character.Create(monsterFile, spawnPos, null, GameMain.Client != null);
monster.Enabled = false;
@@ -26,8 +26,8 @@ namespace Barotrauma
}
}
public SalvageMission(XElement element)
: base(element)
public SalvageMission(XElement element, Location[] locations)
: base(element, locations)
{
string itemName = ToolBox.GetAttributeString(element, "itemname", "");
+24 -16
View File
@@ -1,6 +1,8 @@
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Barotrauma
{
@@ -14,6 +16,8 @@ namespace Barotrauma
private bool spawnDeep;
private bool disallowed;
private Level.PositionType spawnPosType;
public override string ToString()
@@ -38,6 +42,16 @@ namespace Barotrauma
}
spawnDeep = ToolBox.GetAttributeBool(element, "spawndeep", false);
if (GameMain.Server != null)
{
List<string> monsterNames = GameMain.Server.monsterEnabled.Keys.ToList();
string tryKey = monsterNames.Find(s => characterFile.ToLower().Contains(s.ToLower()));
if (!string.IsNullOrWhiteSpace(tryKey))
{
if (!GameMain.Server.monsterEnabled[tryKey]) disallowed = true; //spawn was disallowed by host
}
}
}
protected override void Start()
@@ -47,29 +61,18 @@ namespace Barotrauma
private void SpawnMonsters()
{
float minDist = Math.Max(Submarine.MainSub.Borders.Width, Submarine.MainSub.Borders.Height);
//find a random spawnpos that isn't too close to the main sub
int tries = 0;
Vector2 spawnPos = Vector2.Zero;
do
{
spawnPos = Level.Loaded.GetRandomInterestingPosition(true, spawnPosType);
tries++;
} while (tries < 50 && Vector2.Distance(spawnPos, Submarine.MainSub.WorldPosition) < minDist);
if (disallowed) return;
Vector2 spawnPos = Level.Loaded.GetRandomInterestingPosition(true, spawnPosType, true);
int amount = Rand.Range(minAmount, maxAmount, false);
monsters = new Character[amount];
if (spawnDeep) spawnPos.Y -= Level.Loaded.Size.Y;
for (int i = 0; i < amount; i++)
{
if (spawnDeep)
{
spawnPos.Y -= Level.Loaded.Size.Y;
}
spawnPos.X += Rand.Range(-0.5f, 0.5f, false);
spawnPos.Y += Rand.Range(-0.5f, 0.5f, false);
monsters[i] = Character.Create(characterFile, spawnPos, null, GameMain.Client != null);
@@ -78,6 +81,11 @@ namespace Barotrauma
public override void Update(float deltaTime)
{
if (disallowed)
{
Finished();
return;
}
if (monsters == null) SpawnMonsters();
//base.Update(deltaTime);
+1 -1
View File
@@ -65,12 +65,12 @@ namespace Barotrauma
while (tries < 5)
{
ScriptedEvent scriptedEvent = ScriptedEvent.LoadRandom(rand);
DebugConsole.Log("Created scripted event "+scriptedEvent.ToString());
if (scriptedEvent==null || scriptedEvent.Difficulty > totalDifficulty)
{
tries++;
continue;
}
DebugConsole.Log("Created scripted event " + scriptedEvent.ToString());
AddTask(new ScriptedTask(scriptedEvent));
totalDifficulty -= scriptedEvent.Difficulty;
+46 -9
View File
@@ -241,12 +241,22 @@ namespace Barotrauma
sb.DrawString(font, text, pos, color);
}
public static void DrawRectangle(SpriteBatch sb, Vector2 start, Vector2 size, Color clr, bool isFilled = false, float depth = 0.0f)
public static void DrawRectangle(SpriteBatch sb, Vector2 start, Vector2 size, Color clr, bool isFilled = false, float depth = 0.0f, int thickness = 1)
{
DrawRectangle(sb, new Rectangle((int)start.X, (int)start.Y, (int)size.X, (int)size.Y), clr, isFilled, depth);
if (size.X < 0)
{
start.X += size.X;
size.X = -size.X;
}
if (size.Y < 0)
{
start.Y += size.Y;
size.Y = -size.Y;
}
DrawRectangle(sb, new Rectangle((int)start.X, (int)start.Y, (int)size.X, (int)size.Y), clr, isFilled, depth, thickness);
}
public static void DrawRectangle(SpriteBatch sb, Rectangle rect, Color clr, bool isFilled = false, float depth = 0.0f)
public static void DrawRectangle(SpriteBatch sb, Rectangle rect, Color clr, bool isFilled = false, float depth = 0.0f, int thickness = 1)
{
if (isFilled)
{
@@ -254,10 +264,10 @@ namespace Barotrauma
}
else
{
sb.Draw(t, new Rectangle(rect.X, rect.Y, rect.Width, 1), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
sb.Draw(t, new Rectangle(rect.X, rect.Y+rect.Height-1, rect.Width, 1), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
sb.Draw(t, new Rectangle(rect.X, rect.Y, 1, rect.Height), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
sb.Draw(t, new Rectangle(rect.X+rect.Width-1, rect.Y, 1, rect.Height), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
sb.Draw(t, new Rectangle(rect.X, rect.Y, rect.Width, thickness), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
sb.Draw(t, new Rectangle(rect.X, rect.Y+rect.Height- thickness, rect.Width, thickness), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
sb.Draw(t, new Rectangle(rect.X, rect.Y, thickness, rect.Height), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
sb.Draw(t, new Rectangle(rect.X+rect.Width- thickness, rect.Y, thickness, rect.Height), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
}
}
@@ -439,6 +449,33 @@ namespace Barotrauma
"Sub pos: " + Submarine.MainSub.Position.ToPoint(),
new Vector2(10, 50), Color.White);
}
for (int i = 1; i < Sounds.SoundManager.DefaultSourceCount; i++)
{
Color clr = Color.White;
string soundStr = i+": ";
var playingSound = Sounds.SoundManager.GetPlayingSound(i);
if (playingSound == null)
{
soundStr+= "none";
clr *= 0.5f;
}
else
{
soundStr += System.IO.Path.GetFileNameWithoutExtension(playingSound.FilePath);
if (Sounds.SoundManager.IsLooping(i))
{
soundStr += " (looping)";
clr = Color.Yellow;
}
}
GUI.DrawString(spriteBatch, new Vector2(200, i * 15), soundStr, clr, Color.Black * 0.5f, 0, GUI.SmallFont);
}
}
if (GameMain.NetworkMember != null) GameMain.NetworkMember.Draw(spriteBatch);
@@ -472,12 +509,12 @@ namespace Barotrauma
{
if (pauseMenuOpen)
{
pauseMenu.Update(0.016f);
pauseMenu.Update(deltaTime);
}
if (settingsMenuOpen)
{
GameMain.Config.SettingsFrame.Update(0.016f);
GameMain.Config.SettingsFrame.Update(deltaTime);
}
if (GUIMessageBox.MessageBoxes.Count > 0)
+16 -5
View File
@@ -116,6 +116,21 @@ namespace Barotrauma
}
}
public override Rectangle Rect
{
get
{
return rect;
}
set
{
base.Rect = value;
frame.Rect = new Rectangle(value.X, value.Y, frame.Rect.Width, frame.Rect.Height);
textBlock.Rect = value;
}
}
public bool Selected { get; set; }
public GUIButton(Rectangle rect, string text, GUIStyle style, GUIComponent parent = null)
@@ -176,13 +191,11 @@ namespace Barotrauma
//if (!Enabled) GUI.DrawRectangle(spriteBatch, rect, Color.Gray*0.5f, true);
}
public override void Update(float deltaTime)
{
if (!Visible) return;
base.Update(deltaTime);
if (rect.Contains(PlayerInput.MousePosition) && CanBeSelected && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn)))
{
state = ComponentState.Hover;
@@ -196,7 +209,6 @@ namespace Barotrauma
else if (PlayerInput.LeftButtonClicked())
{
GUI.PlayUISound(GUISoundType.Click);
if (OnClicked != null)
{
if (OnClicked(this, UserData) && CanBeSelected) state = ComponentState.Selected;
@@ -212,7 +224,6 @@ namespace Barotrauma
{
state = Selected ? ComponentState.Selected : ComponentState.None;
}
frame.State = state;
}
}
+6
View File
@@ -286,9 +286,15 @@ namespace Barotrauma
toolTipBlock.rect.Height = toolTipBlock.WrappedText.Split('\n').Length * 18;
toolTipBlock.Color = Color.Black * 0.7f;
toolTipBlock.userData = ToolTip;
}
toolTipBlock.rect = new Rectangle(MouseOn.Rect.Center.X, MouseOn.rect.Bottom, toolTipBlock.rect.Width, toolTipBlock.rect.Height);
if (toolTipBlock.rect.Right > GameMain.GraphicsWidth - 10)
{
toolTipBlock.rect.Location -= new Point(toolTipBlock.rect.Right - (GameMain.GraphicsWidth - 10), 0);
}
toolTipBlock.Draw(spriteBatch);
}
+107 -29
View File
@@ -103,15 +103,6 @@ namespace Barotrauma
get { return scrollBarEnabled; }
set
{
if (value)
{
if (!scrollBarEnabled && scrollBarHidden) ShowScrollBar();
}
else
{
if (scrollBarEnabled && !scrollBarHidden) HideScrollBar();
}
scrollBarEnabled = value;
}
}
@@ -122,7 +113,7 @@ namespace Barotrauma
}
public GUIListBox(Rectangle rect, GUIStyle style, Alignment alignment, GUIComponent parent = null)
: this(rect, null, style, parent)
: this(rect, null, alignment, style, parent, false)
{
}
@@ -185,11 +176,101 @@ namespace Barotrauma
}
}
private void UpdateChildrenRect(float deltaTime)
{
int x = rect.X, y = rect.Y;
if (!scrollBarHidden)
{
if (scrollBar.IsHorizontal)
{
x -= (int)((totalSize - rect.Width) * scrollBar.BarScroll);
}
else
{
y -= (int)((totalSize - rect.Height) * scrollBar.BarScroll);
}
}
for (int i = 0; i < children.Count; i++)
{
GUIComponent child = children[i];
if (child == frame || !child.Visible) continue;
child.Rect = new Rectangle(x, y, child.Rect.Width, child.Rect.Height);
if (scrollBar.IsHorizontal)
{
x += child.Rect.Width + spacing;
}
else
{
y += child.Rect.Height + spacing;
}
if (scrollBar.IsHorizontal)
{
if (child.Rect.Right < rect.X) continue;
if (child.Rect.Right > rect.Right) break;
if (child.Rect.X < rect.X && child.Rect.Right >= rect.X)
{
x = rect.X;
continue;
}
}
else
{
if (child.Rect.Y + child.Rect.Height < rect.Y) continue;
if (child.Rect.Y + child.Rect.Height > rect.Y + rect.Height) break;
if (child.Rect.Y < rect.Y && child.Rect.Y + child.Rect.Height >= rect.Y)
{
y = rect.Y;
continue;
}
}
if (deltaTime>0.0f) child.Update(deltaTime);
if (enabled && child.CanBeFocused &&
(MouseOn == this || (MouseOn != null && this.IsParentOf(MouseOn))) && child.Rect.Contains(PlayerInput.MousePosition))
{
child.State = ComponentState.Hover;
if (PlayerInput.LeftButtonClicked())
{
Debug.WriteLine("clicked");
Select(i);
//selected = child;
//if (OnSelected != null)
//{
// if (!OnSelected(selected, child.UserData)) selected = null;
//}
}
}
else if (selected.Contains(child))
{
child.State = ComponentState.Selected;
if (CheckSelected != null)
{
if (CheckSelected() != child.UserData) selected.Remove(child);
}
}
else
{
child.State = ComponentState.None;
}
}
}
public override void Update(float deltaTime)
{
if (!Visible) return;
base.Update(deltaTime);
UpdateChildrenRect(deltaTime);
//base.Update(deltaTime);
if (scrollBarEnabled && !scrollBarHidden) scrollBar.Update(deltaTime);
@@ -277,17 +358,28 @@ namespace Barotrauma
Math.Max(Math.Min((float)rect.Width / (float)totalSize, 1.0f), 5.0f / rect.Width) :
Math.Max(Math.Min((float)rect.Height / (float)totalSize, 1.0f), 5.0f / rect.Height);
if (scrollBar.BarSize < 1.0f && scrollBarHidden) ShowScrollBar();
if (scrollBar.BarSize >= 1.0f && !scrollBarHidden) HideScrollBar();
scrollBarHidden = scrollBar.BarSize >= 1.0f;
}
public override void AddChild(GUIComponent child)
{
//temporarily reduce the size of the rect to prevent the child from expanding over the scrollbar
if (scrollBar.IsHorizontal)
rect.Height -= scrollBar.Rect.Height;
else
rect.Width -= scrollBar.Rect.Width;
base.AddChild(child);
if (scrollBar.IsHorizontal)
rect.Height += scrollBar.Rect.Height;
else
rect.Width += scrollBar.Rect.Width;
//float oldScroll = scrollBar.BarScroll;
//float oldSize = scrollBar.BarSize;
UpdateScrollBarSize();
UpdateChildrenRect(0.0f);
//if (oldSize == 1.0f && scrollBar.BarScroll == 0.0f) scrollBar.BarScroll = 1.0f;
@@ -312,25 +404,12 @@ namespace Barotrauma
UpdateScrollBarSize();
}
private void ShowScrollBar()
{
if (scrollBarHidden && !scrollBar.IsHorizontal) Rect = new Rectangle(rect.X, rect.Y, rect.Width - scrollBar.Rect.Width, rect.Height);
scrollBarHidden = false;
}
private void HideScrollBar()
{
if (!scrollBarHidden && !scrollBar.IsHorizontal) Rect = new Rectangle(rect.X, rect.Y, rect.Width + scrollBar.Rect.Width, rect.Height);
scrollBarHidden = true;
}
public override void Draw(SpriteBatch spriteBatch)
{
if (!Visible) return;
base.Draw(spriteBatch);
//base.Draw(spriteBatch);
frame.Draw(spriteBatch);
//GUI.DrawRectangle(spriteBatch, rect, color*alpha, true);
@@ -355,7 +434,6 @@ namespace Barotrauma
GUIComponent child = children[i];
if (child == frame || !child.Visible) continue;
child.Rect = new Rectangle(x, y, child.Rect.Width, child.Rect.Height);
if (scrollBar.IsHorizontal)
{
x += child.Rect.Width + spacing;
+7 -2
View File
@@ -61,7 +61,12 @@ namespace Barotrauma
set
{
if (base.Rect == value) return;
base.Rect = value;
foreach (GUIComponent child in children)
{
child.Rect = new Rectangle(child.Rect.X + value.X - rect.X, child.Rect.Y + value.Y - rect.Y, child.Rect.Width, child.Rect.Height);
}
rect = value;
SetTextPos();
}
}
@@ -163,7 +168,7 @@ namespace Barotrauma
}
}
private void SetTextPos()
public void SetTextPos()
{
if (text==null) return;
+15
View File
@@ -40,6 +40,21 @@ namespace Barotrauma
}
}
public override Rectangle Rect
{
get
{
return rect;
}
set
{
base.Rect = value;
box.Rect = new Rectangle(value.X,value.Y,box.Rect.Width,box.Rect.Height);
text.Rect = new Rectangle(box.Rect.Right + 10, box.Rect.Y + 2, 20, box.Rect.Height);
}
}
public GUITickBox(Rectangle rect, string label, Alignment alignment, GUIComponent parent)
: this(rect, label, alignment, GUI.Font, parent)
{
+13 -20
View File
@@ -78,7 +78,7 @@ namespace Barotrauma
//private Stopwatch renderTimer;
//public static int renderTimeElapsed;
public Camera Cam
{
get { return GameScreen.Cam; }
@@ -217,6 +217,7 @@ namespace Barotrauma
Mission.Init();
MapEntityPrefab.Init();
LevelGenerationParams.LoadPresets();
TitleScreen.LoadState = 10.0f;
yield return CoroutineStatus.Running;
@@ -294,21 +295,25 @@ namespace Barotrauma
Timing.Accumulator += gameTime.ElapsedGameTime.TotalSeconds;
PlayerInput.UpdateVariable();
bool paused = true;
while (Timing.Accumulator >= Timing.Step)
{
fixedTime.IsRunningSlowly = gameTime.IsRunningSlowly;
TimeSpan addTime = new TimeSpan(0,0,0,0,16);
TimeSpan addTime = new TimeSpan(0, 0, 0, 0, 16);
fixedTime.ElapsedGameTime = addTime;
fixedTime.TotalGameTime.Add(addTime);
base.Update(fixedTime);
PlayerInput.Update(Timing.Step);
bool paused = false;
if (titleScreenOpen)
{
//TitleScreen.Update();
if (TitleScreen.LoadState >= 100.0f &&
(!waitForKeyHit || PlayerInput.GetKeyboardState.GetPressedKeys().Length>0 || PlayerInput.LeftButtonClicked()))
{
titleScreenOpen = false;
}
}
else if (hasLoaded)
{
@@ -320,7 +325,7 @@ namespace Barotrauma
paused = (DebugConsole.IsOpen || GUI.PauseMenuOpen || GUI.SettingsMenuOpen) &&
(NetworkMember == null || !NetworkMember.GameStarted);
if (!paused)
{
Screen.Selected.Update(Timing.Step);
@@ -333,13 +338,14 @@ namespace Barotrauma
GUI.Update((float)Timing.Step);
}
CoroutineManager.Update((float)Timing.Step, paused ? 0.0f : (float)Timing.Step);
Timing.Accumulator -= Timing.Step;
}
Timing.Alpha = Timing.Accumulator / Timing.Step;
if (!paused) Timing.Alpha = Timing.Accumulator / Timing.Step;
}
@@ -348,8 +354,6 @@ namespace Barotrauma
/// </summary>
protected override void Draw(GameTime gameTime)
{
//renderTimer.Restart();
double deltaTime = gameTime.ElapsedGameTime.TotalSeconds;
FrameCounter.Update(deltaTime);
@@ -357,22 +361,11 @@ namespace Barotrauma
if (titleScreenOpen)
{
TitleScreen.Draw(spriteBatch, GraphicsDevice, (float)deltaTime);
if (TitleScreen.LoadState>=100.0f &&
(!waitForKeyHit || PlayerInput.GetKeyboardState.GetPressedKeys().Length>0 || PlayerInput.LeftButtonClicked()))
{
titleScreenOpen = false;
}
}
else if (hasLoaded)
{
Screen.Selected.Draw(deltaTime, GraphicsDevice, spriteBatch);
}
//double elapsed = sw.Elapsed.TotalSeconds;
//if (elapsed < Physics.step)
//{
// System.Threading.Thread.Sleep((int)((Physics.step - elapsed) * 1000.0));
//}
}
static bool waitForKeyHit = true;
@@ -5,14 +5,14 @@ namespace Barotrauma
{
class CargoManager
{
private List<MapEntityPrefab> purchasedItems;
private List<ItemPrefab> purchasedItems;
public CargoManager()
{
purchasedItems = new List<MapEntityPrefab>();
purchasedItems = new List<ItemPrefab>();
}
public void AddItem(MapEntityPrefab item)
public void AddItem(ItemPrefab item)
{
purchasedItems.Add(item);
}
@@ -35,11 +35,11 @@ namespace Barotrauma
return;
}
foreach (MapEntityPrefab prefab in purchasedItems)
foreach (ItemPrefab prefab in purchasedItems)
{
Vector2 position = new Vector2(
Rand.Range(cargoRoom.Rect.X + 20, cargoRoom.Rect.Right - 20),
Rand.Range(cargoRoom.Rect.Y - cargoRoom.Rect.Height, cargoRoom.Rect.Y));
cargoRoom.Rect.Y - cargoRoom.Rect.Height + prefab.Size.Y/2);
new Item(prefab as ItemPrefab, position, wp.Submarine);
}
+37 -22
View File
@@ -12,6 +12,8 @@ namespace Barotrauma
{
public List<Character> characters;
public List<CharacterInfo> characterInfos;
public int WinningTeam = 1;
private int money;
@@ -206,35 +208,48 @@ namespace Barotrauma
public void CreateCrewFrame(List<Character> crew, GUIFrame crewFrame)
{
//crewFrame = new GUIFrame(new Rectangle(GameMain.GraphicsWidth / 2 - width / 2, GameMain.GraphicsHeight / 2 - height / 2, width, height), GUI.Style);
//crewFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
List<byte> teamIDs = crew.Select(c => c.TeamID).Distinct().ToList();
GUIListBox crewList = new GUIListBox(new Rectangle(0, 0, 280, 300), Color.White * 0.7f, GUI.Style, crewFrame);
crewList.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
crewList.OnSelected = SelectCrewCharacter;
if (!teamIDs.Any()) teamIDs.Add(0);
foreach (Character character in crew)
int listBoxHeight = 300 / teamIDs.Count;
int y = 20;
for (int i = 0; i < teamIDs.Count; i++)
{
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 40), Color.Transparent, null, crewList);
frame.UserData = character;
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
frame.Color = (GameMain.NetworkMember != null && GameMain.NetworkMember.Character == character) ? Color.Gold * 0.2f : Color.Transparent;
frame.HoverColor = Color.LightGray * 0.5f;
frame.SelectedColor = Color.Gold * 0.5f;
if (teamIDs.Count > 1)
{
new GUITextBlock(new Rectangle(0, y - 20, 100, 20), CombatMission.GetTeamName(teamIDs[i]), GUI.Style, crewFrame);
}
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(40, 0, 0, 25),
character.Info.Name + " (" + character.Info.Job.Name + ")",
Color.Transparent, Color.White,
Alignment.Left, Alignment.Left,
null, frame);
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
GUIListBox crewList = new GUIListBox(new Rectangle(0, y, 280, listBoxHeight), Color.White * 0.7f, GUI.Style, crewFrame);
crewList.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
crewList.OnSelected = SelectCrewCharacter;
foreach (Character character in crew.FindAll(c => c.TeamID == teamIDs[i]))
{
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 40), Color.Transparent, null, crewList);
frame.UserData = character;
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
frame.Color = (GameMain.NetworkMember != null && GameMain.NetworkMember.Character == character) ? Color.Gold * 0.2f : Color.Transparent;
frame.HoverColor = Color.LightGray * 0.5f;
frame.SelectedColor = Color.Gold * 0.5f;
new GUIImage(new Rectangle(-10, 0, 0, 0), character.AnimController.Limbs[0].sprite, Alignment.Left, frame);
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(40, 0, 0, 25),
character.Info.Name + " (" + character.Info.Job.Name + ")",
Color.Transparent, Color.White,
Alignment.Left, Alignment.Left,
null, frame);
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
new GUIImage(new Rectangle(-10, 0, 0, 0), character.AnimController.Limbs[0].sprite, Alignment.Left, frame);
}
y += crewList.Rect.Height + 30;
}
//var closeButton = new GUIButton(new Rectangle(0, 0, 80, 20), "Close", Alignment.BottomCenter, GUI.Style, crewFrame);
//closeButton.OnClicked = ToggleCrewFrame;
}
protected virtual bool SelectCrewCharacter(GUIComponent component, object obj)
@@ -75,6 +75,8 @@ namespace Barotrauma
isRunning = true;
}
public virtual void MsgBox() { }
public virtual void Update(float deltaTime)
{
//if (!isRunning) return;
@@ -29,13 +29,12 @@ namespace Barotrauma
mission = Mission.LoadRandom(locations, rand, param as string);
}
public override void Start()
public override void MsgBox()
{
base.Start();
if (mission == null) return;
new GUIMessageBox(mission.Name, mission.Description, 400, 400);
var missionMsg = new GUIMessageBox(mission.Name, mission.Description, 400, 400);
missionMsg.UserData = "missionstartmessage";
Networking.GameServer.Log("Mission: " + mission.Name, Color.Cyan);
Networking.GameServer.Log(mission.Description, Color.Cyan);
@@ -26,6 +26,11 @@ namespace Barotrauma
private bool savedOnStart;
private List<Submarine> subsToLeaveBehind;
private Submarine leavingSub;
private bool atEndPosition;
public override Mission Mission
{
get
@@ -80,18 +85,28 @@ namespace Barotrauma
public SinglePlayerMode(XElement element)
: this(GameModePreset.list.Find(gm => gm.Name == "Single Player"), null)
{
string mapSeed = ToolBox.GetAttributeString(element, "mapseed", "a");
GenerateMap(mapSeed);
Map.SetLocation(ToolBox.GetAttributeInt(element, "currentlocation", 0));
{
foreach (XElement subElement in element.Elements())
{
if (subElement.Name.ToString().ToLowerInvariant() != "crew") continue;
GameMain.GameSession.CrewManager = new CrewManager(subElement);
switch (subElement.Name.ToString().ToLowerInvariant())
{
case "crew":
GameMain.GameSession.CrewManager = new CrewManager(subElement);
break;
case "map":
Map = Map.Load(subElement);
break;
}
}
//backwards compatibility with older save files
if (Map==null)
{
string mapSeed = ToolBox.GetAttributeString(element, "mapseed", "a");
GenerateMap(mapSeed);
Map.SetLocation(ToolBox.GetAttributeInt(element, "currentlocation", 0));
}
savedOnStart = true;
@@ -198,12 +213,6 @@ namespace Barotrauma
}
endShiftButton.Draw(spriteBatch);
//chatBox.Draw(spriteBatch);
//textBox.Draw(spriteBatch);
//timerBar.Draw(spriteBatch);
//if (Game1.Client == null) endShiftButton.Draw(spriteBatch);
}
public override void Update(float deltaTime)
@@ -230,30 +239,33 @@ namespace Barotrauma
public override void End(string endMessage = "")
{
isRunning = false;
//if (endMessage != "" || this.endMessage == null) this.endMessage = endMessage;
bool success = CrewManager.characters.Any(c => !c.IsDead);
if (success)
{
if (subsToLeaveBehind == null || leavingSub == null)
{
DebugConsole.ThrowError("Leaving submarine not selected -> selecting the closest one");
leavingSub = GetLeavingSub();
subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub);
}
}
GameMain.GameSession.EndShift("");
if (success)
{
var leavingSub = GetLeavingSub();
if (!Submarine.MainSub.AtEndPosition && !Submarine.MainSub.AtStartPosition)
if (leavingSub != Submarine.MainSub && !leavingSub.DockedTo.Contains(Submarine.MainSub))
{
System.Diagnostics.Debug.Assert(leavingSub != Submarine.MainSub);
Submarine oldMainSub = Submarine.MainSub;
Submarine.MainSub = leavingSub;
GameMain.GameSession.Submarine = leavingSub;
List<Submarine> subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub);
foreach (Submarine sub in subsToLeaveBehind)
{
MapEntity.mapEntityList.RemoveAll(e => e.Submarine == sub && e is LinkedSubmarine);
@@ -261,13 +273,11 @@ namespace Barotrauma
}
}
if (Submarine.MainSub.AtEndPosition)
if (atEndPosition)
{
Map.MoveToNextLocation();
}
SaveUtil.SaveGame(GameMain.GameSession.SaveFile);
}
@@ -302,18 +312,18 @@ namespace Barotrauma
private bool TryEndShift(GUIButton button, object obj)
{
List<Submarine> subsNotDocked = new List<Submarine>();
var leavingSub = obj as Submarine;
leavingSub = obj as Submarine;
if (leavingSub != null)
{
subsNotDocked = GetSubsToLeaveBehind(leavingSub);
subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub);
}
if (subsNotDocked.Any())
atEndPosition = leavingSub.AtEndPosition;
if (subsToLeaveBehind.Any())
{
string msg = "";
if (subsNotDocked.Count==1)
if (subsToLeaveBehind.Count == 1)
{
msg = "One of your vessels isn't at the exit yet. Do you want to leave it behind?";
}
@@ -325,7 +335,7 @@ namespace Barotrauma
var msgBox = new GUIMessageBox("Warning", msg, new string[] {"Yes", "No"});
msgBox.Buttons[0].OnClicked += EndShift;
msgBox.Buttons[0].OnClicked += msgBox.Close;
msgBox.Buttons[0].UserData = Submarine.Loaded.FindAll(s => !subsNotDocked.Contains(s));
msgBox.Buttons[0].UserData = Submarine.Loaded.FindAll(s => !subsToLeaveBehind.Contains(s));
msgBox.Buttons[1].OnClicked += msgBox.Close;
}
@@ -343,7 +353,7 @@ namespace Barotrauma
List<Submarine> leavingSubs = obj as List<Submarine>;
if (leavingSubs == null) leavingSubs = new List<Submarine>() { GetLeavingSub() };
var cinematic = new TransitionCinematic(leavingSubs, GameMain.GameScreen.Cam, 5.0f);
SoundPlayer.OverrideMusicType = CrewManager.characters.Any(c => !c.IsDead) ? "endshift" : "crewdead";
@@ -378,13 +388,14 @@ namespace Barotrauma
//element.Add(new XAttribute("day", day));
XElement modeElement = new XElement("gamemode");
modeElement.Add(new XAttribute("currentlocation", Map.CurrentLocationIndex));
modeElement.Add(new XAttribute("mapseed", Map.Seed));
//modeElement.Add(new XAttribute("currentlocation", Map.CurrentLocationIndex));
//modeElement.Add(new XAttribute("mapseed", Map.Seed));
CrewManager.Save(modeElement);
Map.Save(modeElement);
element.Add(modeElement);
}
}
}
@@ -283,7 +283,7 @@ namespace Barotrauma.Tutorials
infoBox = CreateInfoFrame("Steer the submarine downwards, heading further into the cavern.");
while (Submarine.MainSub.WorldPosition.Y > 24600.0f)
while (Submarine.MainSub.WorldPosition.Y > 31900.0f)
{
yield return CoroutineStatus.Running;
}
@@ -39,7 +39,7 @@ namespace Barotrauma.Tutorials
GameMain.GameSession = new GameSession(Submarine.MainSub, "", GameModePreset.list.Find(gm => gm.Name.ToLowerInvariant() == "tutorial"));
(GameMain.GameSession.gameMode as TutorialMode).tutorialType = this;
GameMain.GameSession.StartShift("tuto1");
GameMain.GameSession.StartShift("tuto2");
GameMain.GameSession.TaskManager.Tasks.Clear();
+25 -11
View File
@@ -107,14 +107,14 @@ namespace Barotrauma
}
}
public void StartShift(string levelSeed)
public void StartShift(string levelSeed, bool loadSecondSub = true)
{
Level level = Level.CreateRandom(levelSeed);
StartShift(level);
StartShift(level,true,loadSecondSub);
}
public void StartShift(Level level, bool reloadSub = true)
public void StartShift(Level level, bool reloadSub = true, bool loadSecondSub = false)
{
GameMain.LightManager.LosEnabled = (GameMain.Server==null || GameMain.Server.CharacterInfo!=null);
@@ -128,6 +128,18 @@ namespace Barotrauma
if (reloadSub || Submarine.MainSub != submarine) submarine.Load(true);
Submarine.MainSub = submarine;
if (loadSecondSub)
{
if (Submarine.MainSubs[1] == null)
{
Submarine.MainSubs[1] = new Submarine(Submarine.MainSub.FilePath,Submarine.MainSub.MD5Hash.Hash,true);
Submarine.MainSubs[1].Load(false);
}
else if (reloadSub)
{
Submarine.MainSubs[1].Load(false);
}
}
//var secondSub = new Submarine(submarine.FilePath, submarine.MD5Hash.Hash);
//secondSub.Load(false);
@@ -152,10 +164,14 @@ namespace Barotrauma
if (gameMode!=null) gameMode.Start();
Items.Components.Radar.StartMarker = "Start";
Items.Components.Radar.EndMarker = "End";
if (gameMode.Mission != null) Mission.Start(Level.Loaded);
TaskManager.StartShift(level);
if (gameMode != null) gameMode.MsgBox();
GameMain.GameScreen.ColorFade(Color.Black, Color.TransparentBlack, 5.0f);
SoundPlayer.SwitchMusic();
}
@@ -303,19 +319,15 @@ namespace Barotrauma
if (gameMode != null) gameMode.Update(deltaTime);
if (Mission != null) Mission.Update(deltaTime);
if (infoFrame != null) infoFrame.Update(deltaTime);
}
public void Draw(SpriteBatch spriteBatch)
{
//guiRoot.Draw(spriteBatch);
infoButton.Draw(spriteBatch);
if (gameMode != null) gameMode.Draw(spriteBatch);
if (infoFrame != null)
{
infoFrame.Update(0.016f);
infoFrame.Draw(spriteBatch);
}
if (infoFrame != null) infoFrame.Draw(spriteBatch);
}
public void Save(string filePath)
@@ -324,10 +336,12 @@ namespace Barotrauma
new XElement("Gamesession"));
var now = DateTime.Now;
doc.Root.Add(new XAttribute("savetime", now.Hour + ":" + now.Minute + ", " + now.ToShortDateString()));
doc.Root.Add(new XAttribute("savetime", now.ToShortTimeString() + ", " + now.ToShortDateString()));
doc.Root.Add(new XAttribute("submarine", submarine==null ? "" : submarine.Name));
doc.Root.Add(new XAttribute("mapseed", Map.Seed));
((SinglePlayerMode)gameMode).Save(doc.Root);
try
+10 -5
View File
@@ -66,6 +66,12 @@ namespace Barotrauma
int x = 0;
foreach (Character character in gameSession.CrewManager.characters)
{
if (GameMain.GameSession.Mission is CombatMission &&
character.TeamID != GameMain.GameSession.CrewManager.WinningTeam)
{
continue;
}
var characterFrame = new GUIFrame(new Rectangle(x, y, 170, 70), Color.Transparent, GUI.Style, listBox);
characterFrame.OutlineColor = Color.Transparent;
characterFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
@@ -74,10 +80,9 @@ namespace Barotrauma
character.Info.CreateCharacterFrame(characterFrame,
character.Info.Job != null ? (character.Info.Name + '\n' + "(" + character.Info.Job.Name + ")") : character.Info.Name, null);
string statusText = "OK";
Color statusColor = Color.DarkGreen;
if (character.IsDead)
{
statusText = InfoTextManager.GetInfoText("CauseOfDeath." + character.CauseOfDeath.ToString());
@@ -85,7 +90,7 @@ namespace Barotrauma
}
else
{
if (character.IsUnconscious)
{
statusText = "Unconscious";
@@ -96,13 +101,13 @@ namespace Barotrauma
statusText = "Injured";
statusColor = Color.DarkOrange;
}
}
new GUITextBlock(new Rectangle(0, 0, 0, 20), statusText,
GUI.Style, Alignment.BottomLeft, Alignment.TopCenter, characterFrame, true, GUI.SmallFont).Color = statusColor * 0.7f;
x += characterFrame.Rect.Width + 10;
x += characterFrame.Rect.Width + 10;
}
y += 120;
+8 -19
View File
@@ -25,10 +25,8 @@ namespace Barotrauma
private KeyOrMouse[] keyMapping;
private bool unsavedSettings;
public GUIFrame SettingsFrame
{
get
@@ -291,7 +289,7 @@ namespace Barotrauma
private bool ChangeSoundVolume(GUIScrollBar scrollBar, float barScroll)
{
UnsavedSettings = true;
SoundVolume = MathHelper.Clamp(barScroll, 0.0f, 1.0f);
SoundVolume = barScroll;
return true;
}
@@ -299,22 +297,11 @@ namespace Barotrauma
private bool ChangeMusicVolume(GUIScrollBar scrollBar, float barScroll)
{
UnsavedSettings = true;
MusicVolume = MathHelper.Clamp(barScroll, 0.0f, 1.0f);
MusicVolume = barScroll;
return true;
}
//private bool ToggleFullScreen(object userData)
//{
// UnsavedSettings = true;
// FullScreenEnabled = !FullScreenEnabled;
// GameMain.Graphics.IsFullScreen = FullScreenEnabled;
// GameMain.Graphics.ApplyChanges();
// return true;
//}
public void ResetSettingsFrame()
{
settingsFrame = null;
@@ -381,14 +368,16 @@ namespace Barotrauma
y += 70;
new GUITextBlock(new Rectangle(0, y, 100, 20), "Sound volume:", GUI.Style, settingsFrame);
GUIScrollBar soundScrollBar = new GUIScrollBar(new Rectangle(0, y+20, 150, 20), GUI.Style,0.1f, settingsFrame);
GUIScrollBar soundScrollBar = new GUIScrollBar(new Rectangle(0, y + 20, 150, 20), GUI.Style, 0.1f, settingsFrame);
soundScrollBar.BarScroll = SoundVolume;
soundScrollBar.OnMoved = ChangeSoundVolume;
soundScrollBar.Step = 0.05f;
new GUITextBlock(new Rectangle(0, y+40, 100, 20), "Music volume:", GUI.Style, settingsFrame);
GUIScrollBar musicScrollBar = new GUIScrollBar(new Rectangle(0, y+60, 150, 20), GUI.Style, 0.1f, settingsFrame);
new GUITextBlock(new Rectangle(0, y + 40, 100, 20), "Music volume:", GUI.Style, settingsFrame);
GUIScrollBar musicScrollBar = new GUIScrollBar(new Rectangle(0, y + 60, 150, 20), GUI.Style, 0.1f, settingsFrame);
musicScrollBar.BarScroll = MusicVolume;
musicScrollBar.OnMoved = ChangeMusicVolume;
musicScrollBar.Step = 0.05f;
x = 200;
y = 10;
@@ -310,10 +310,10 @@ namespace Barotrauma
MergeSlots();
}
public override void Update(float deltaTime)
public override void Update(float deltaTime, bool subInventory = false)
{
base.Update(deltaTime);
if (doubleClickedItem != null)
{
if (doubleClickedItem.ParentInventory != this)
@@ -349,7 +349,7 @@ namespace Barotrauma
}
}
}
if (selectedSlot > -1)
{
UpdateSubInventory(deltaTime, selectedSlot);
@@ -467,7 +467,7 @@ namespace Barotrauma
(draggingItem == null || draggingItem.Container != Items[selectedSlot]))
{
selectedSlot = -1;
}
}
}
}
@@ -395,9 +395,7 @@ namespace Barotrauma.Items.Components
public void Undock()
{
if (dockingTarget == null || !docked) return;
item.NewComponentEvent(this, false, true);
PlaySound(ActionType.OnUse, item.WorldPosition);
dockingTarget.item.Submarine.DockedTo.Remove(item.Submarine);
@@ -512,8 +510,6 @@ namespace Barotrauma.Items.Components
if (!item.linkedTo.Any(e => e is Hull) && !dockingTarget.item.linkedTo.Any(e => e is Hull))
{
CreateHull();
item.NewComponentEvent(this, false, true);
}
}
dockingState = MathHelper.Lerp(dockingState, 0.5f, deltaTime * 10.0f);
+17 -6
View File
@@ -56,10 +56,15 @@ namespace Barotrauma.Items.Components
get
{
if (linkedGap != null) return linkedGap;
foreach (MapEntity e in item.linkedTo)
{
linkedGap = e as Gap;
if (linkedGap != null) return linkedGap;
linkedGap = e as Gap;
if (linkedGap != null)
{
linkedGap.PassAmbientLight = window != Rectangle.Empty;
return linkedGap;
}
}
Rectangle rect = item.Rect;
if (isHorizontal)
@@ -75,6 +80,7 @@ namespace Barotrauma.Items.Components
linkedGap = new Gap(rect, Item.Submarine);
linkedGap.Submarine = item.Submarine;
linkedGap.PassAmbientLight = window != Rectangle.Empty;
linkedGap.Open = openState;
item.linkedTo.Add(linkedGap);
return linkedGap;
@@ -95,6 +101,11 @@ namespace Barotrauma.Items.Components
}
}
public Rectangle WindowRect
{
get { return window; }
}
[Editable, HasDefaultValue(false, true)]
public bool IsOpen
{
@@ -444,11 +455,11 @@ namespace Barotrauma.Items.Components
}
}
public override void ReceiveSignal(int stepsTaken, string signal, Connection connection, Item sender, float power=0.0f)
public override void ReceiveSignal(int stepsTaken, string signal, Connection connection, Item sender, float power = 0.0f)
{
if (isStuck || GameMain.Client != null) return;
if (connection.Name=="toggle")
if (connection.Name == "toggle")
{
SetState(!isOpen, false, true);
}
@@ -480,7 +491,7 @@ namespace Barotrauma.Items.Components
public override void ServerWrite(Lidgren.Network.NetOutgoingMessage msg, Barotrauma.Networking.Client c)
{
msg.Write(isOpen);
msg.WriteRangedSingle(stuck, 0.0f, 100.0f, 8);
msg.WriteRangedSingle(stuck, 0.0f, 100.0f, 8);
}
public override void ClientRead(Lidgren.Network.NetIncomingMessage msg)
@@ -488,6 +499,6 @@ namespace Barotrauma.Items.Components
SetState(msg.ReadBoolean(), true);
Stuck = msg.ReadRangedSingle(0.0f, 100.0f, 8);
}
}
}
@@ -228,9 +228,7 @@ namespace Barotrauma.Items.Components
Msg = prevMsg;
attached = true;
if (character != null) item.NewComponentEvent(this, true, true);
return true;
}
@@ -585,6 +585,8 @@ namespace Barotrauma.Items.Components
return (average+100.0f)/2.0f;
}
public virtual void FlipX() { }
public bool HasRequiredContainedItems(bool addMessage)
{
List<RelatedItem> requiredContained = requiredItems.FindAll(ri=> ri.Type == RelatedItem.RelationType.Contained);
@@ -11,6 +11,12 @@ namespace Barotrauma.Items.Components
{
public LimbType limbType;
public Vector2 position;
public LimbPos(LimbType limbType, Vector2 position)
{
this.limbType = limbType;
this.position = position;
}
}
class Controller : ItemComponent
@@ -243,5 +249,31 @@ namespace Barotrauma.Items.Components
return true;
}
public override void FlipX()
{
if (dir != Direction.None)
{
dir = dir == Direction.Left ? Direction.Right : Direction.Left;
}
if (userPos != 0.0f)
{
float diff = (item.Rect.X + UserPos) - item.Rect.Center.X;
userPos = item.Rect.Center.X - diff - item.Rect.X;
}
for (int i = 0; i < limbPositions.Count; i++)
{
float diff = (item.Rect.X + limbPositions[i].position.X) - item.Rect.Center.X;
Vector2 flippedPos =
new Vector2(
item.Rect.Center.X - diff - item.Rect.X,
limbPositions[i].position.Y);
limbPositions[i] = new LimbPos(limbPositions[i].limbType, flippedPos);
}
}
}
}
@@ -95,9 +95,7 @@ namespace Barotrauma.Items.Components
SetActive(!IsActive);
currPowerConsumption = IsActive ? powerConsumption : 0.0f;
item.NewComponentEvent(this, true, true);
return true;
}
@@ -53,8 +53,7 @@ namespace Barotrauma.Items.Components
button.OnClicked = (GUIButton btn, object obj) =>
{
targetForce -= 1.0f;
item.NewComponentEvent(this, true, false);
return true;
};
@@ -62,8 +61,7 @@ namespace Barotrauma.Items.Components
button.OnClicked = (GUIButton btn, object obj) =>
{
targetForce += 1.0f;
item.NewComponentEvent(this, true, false);
return true;
};
}
@@ -240,14 +240,10 @@ namespace Barotrauma.Items.Components
if (fabricatedItem == null)
{
StartFabricating(obj as FabricableItem);
item.NewComponentEvent(this, true, true);
}
else
{
CancelFabricating();
item.NewComponentEvent(this, true, true);
}
return true;
@@ -16,7 +16,7 @@ namespace Barotrauma.Items.Components
private float lastUpdate;
private Hull hull1;
public Hull hull1;
private GUITickBox isActiveTickBox;
@@ -74,7 +74,6 @@ namespace Barotrauma.Items.Components
targetLevel = null;
IsActive = !IsActive;
if (!IsActive) currPowerConsumption = 0.0f;
item.NewComponentEvent(this, true, true);
return true;
};
@@ -83,7 +82,6 @@ namespace Barotrauma.Items.Components
button.OnClicked = (GUIButton btn, object obj) =>
{
FlowPercentage -= 10.0f;
item.NewComponentEvent(this, true, true);
return true;
};
@@ -92,7 +90,6 @@ namespace Barotrauma.Items.Components
button.OnClicked = (GUIButton btn, object obj) =>
{
FlowPercentage += 10.0f;
item.NewComponentEvent(this, true, true);
return true;
};
@@ -21,6 +21,9 @@ namespace Barotrauma.Items.Components
private List<RadarBlip> radarBlips;
private float prevPingRadius;
public static string StartMarker = "Start";
public static string EndMarker = "End";
[HasDefaultValue(10000.0f, false)]
public float Range
{
@@ -57,7 +60,6 @@ namespace Barotrauma.Items.Components
isActiveTickBox.OnSelected = (GUITickBox box) =>
{
IsActive = box.Selected;
item.NewComponentEvent(this, true, false);
return true;
};
@@ -100,6 +102,11 @@ namespace Barotrauma.Items.Components
return pingState > 1.0f;
}
public override void UpdateHUD(Character character)
{
GuiFrame.Update((float)Timing.Step);
}
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
{
GuiFrame.Draw(spriteBatch);
@@ -109,12 +116,7 @@ namespace Barotrauma.Items.Components
int radius = GuiFrame.Rect.Height / 2 - 30;
DrawRadar(spriteBatch, new Rectangle((int)GuiFrame.Center.X - radius, (int)GuiFrame.Center.Y - radius, radius * 2, radius * 2));
}
public override void UpdateHUD(Character character)
{
GuiFrame.Update(1.0f / 60.0f);
}
private void DrawRadar(SpriteBatch spriteBatch, Rectangle rect)
{
Vector2 center = new Vector2(rect.X + rect.Width*0.5f, rect.Center.Y);
@@ -263,11 +265,11 @@ namespace Barotrauma.Items.Components
DrawMarker(spriteBatch,
(GameMain.GameSession.Map == null) ? "Start" : GameMain.GameSession.Map.CurrentLocation.Name,
(GameMain.GameSession.Map == null) ? StartMarker : GameMain.GameSession.Map.CurrentLocation.Name,
(Level.Loaded.StartPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.5f));
DrawMarker(spriteBatch,
(GameMain.GameSession.Map == null) ? "End" : GameMain.GameSession.Map.SelectedLocation.Name,
(GameMain.GameSession.Map == null) ? EndMarker : GameMain.GameSession.Map.SelectedLocation.Name,
(Level.Loaded.EndPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.5f));
if (GameMain.GameSession.Mission != null)
@@ -284,6 +286,7 @@ namespace Barotrauma.Items.Components
foreach (Submarine sub in Submarine.Loaded)
{
if (!sub.OnRadar) continue;
if (item.Submarine == sub || sub.DockedTo.Contains(item.Submarine)) continue;
if (sub.WorldPosition.Y > Level.Loaded.Size.Y) continue;
@@ -324,7 +324,6 @@ namespace Barotrauma.Items.Components
if (unsentChanges && sendUpdateTimer<= 0.0f)
{
item.NewComponentEvent(this, true, true);
sendUpdateTimer = NetworkUpdateInterval;
unsentChanges = false;
}
@@ -128,7 +128,6 @@ namespace Barotrauma.Items.Components
networkUpdateTimer -= deltaTime;
if (networkUpdateTimer <= 0.0f)
{
item.NewComponentEvent(this, true, false);
networkUpdateTimer = 0.5f;
valueChanged = false;
}

Some files were not shown because too many files have changed in this diff Show More