Skip to content

Commit

Permalink
SFSML 1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Exund committed May 27, 2018
1 parent ea59d51 commit aae0308
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 12 deletions.
8 changes: 7 additions & 1 deletion Source/GameSaving.cs
Expand Up @@ -227,7 +227,13 @@ private static Part[] LoadParts(GameSaving.VesselSave vesselToLoad)
array[i].orientation = vesselToLoad.parts[i].orientation;

array[i].partData.tags = new Dictionary<string, object>();
array[i].partData.GUID = vesselToLoad.parts[i].GUID;
try
{
array[i].partData.GUID = new Guid(vesselToLoad.parts[i].GUID);
} catch
{
array[i].partData.GUID = Guid.NewGuid();
}
try
{
if (vesselToLoad.parts[i].tagsString != null)
Expand Down
12 changes: 9 additions & 3 deletions Source/NewBuildSystem/Build.cs
Expand Up @@ -799,7 +799,7 @@ public PlacedPartSave(PlacedPart part)
this.partName = part.partData.name;
this.position = part.position;
this.orientation = part.orientation;
this.GUID = part.partData.GUID;
this.GUID = part.partData.GUID.ToString();

//Tags formatting for save
StringBuilder stringBuilder = new StringBuilder();
Expand Down Expand Up @@ -837,7 +837,13 @@ public static List<PlacedPart> FromSave(List<Build.BuildSave.PlacedPartSave> par
bool flag = partByName != null;
if (flag)
{
partByName.GUID = parts[i].GUID;
try
{
partByName.GUID = new Guid(parts[i].GUID);
} catch
{
partByName.GUID = Guid.NewGuid();
}
//Tags parsing from text back to a Dictionary
partByName.tags = new Dictionary<string, object>();
try
Expand Down Expand Up @@ -893,7 +899,7 @@ public static List<PlacedPart> FromSave(List<Build.BuildSave.PlacedPartSave> par
//Custom field for custom values saving
public string tagsString;

public Guid GUID;
public string GUID;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/NewBuildSystem/PartData.cs
Expand Up @@ -85,7 +85,7 @@ public void OnValidate()
//Custom field for custom values saving
public Dictionary<string, object> tags = new Dictionary<string, object>();

public Guid GUID = new Guid();
public Guid GUID = Guid.NewGuid();

[Space]
public PartData.Area[] areas;
Expand Down
2 changes: 1 addition & 1 deletion Source/NewBuildSystem/PartGrid.cs
Expand Up @@ -577,7 +577,7 @@ public float GetThrust()
return num;
}

private float GetMass()
public float GetMass()
{
float num = 0f;
for (int i = 0; i < this.parts.Count; i++)
Expand Down
4 changes: 2 additions & 2 deletions Source/Part.cs
Expand Up @@ -445,7 +445,7 @@ public Save(Part part, Orientation orientation, List<Part> parts)
}));
}
this.tagsString = sb.ToString();
this.GUID = part.partData.GUID;
this.GUID = part.partData.GUID.ToString();
}

[Header("Part")]
Expand All @@ -457,6 +457,6 @@ public Save(Part part, Orientation orientation, List<Part> parts)

public string tagsString;

public Guid GUID;
public string GUID;
}
}
2 changes: 1 addition & 1 deletion Source/SFSML/ModLoader.cs
Expand Up @@ -363,7 +363,7 @@ static ModLoader()

public MyConsole myConsole;

public static readonly string version = "1.3.1";
public static readonly string version = "1.3.5";

private static string logTag = "ModLoader " + ModLoader.version;

Expand Down
4 changes: 2 additions & 2 deletions Source/SFSML/Translation/Languages/ModLoaderLang.cs
Expand Up @@ -8,9 +8,9 @@ public ModLoaderLang()
{
}

public string Version = "1.3.1";
public string Version = "1.3.5";

public string LoaderTag = "Hydria [1.3.1]";
public string LoaderTag = "Hydria [%Version%]";

public string LoaderVersion = "1.3.1";

Expand Down
2 changes: 1 addition & 1 deletion Source/SFSML/Utility/IMGUIUtil.cs
Expand Up @@ -5,7 +5,7 @@

namespace SFSML.Utility
{
static class IMGUIUtil
public static class IMGUIUtil
{
private static int ID = int.MaxValue;

Expand Down
Binary file modified Source/obj/Debug/Assembly-CSharp.dll
Binary file not shown.
Binary file modified Source/obj/Debug/Assembly-CSharp.pdb
Binary file not shown.

0 comments on commit aae0308

Please sign in to comment.