Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Minor update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuree committed Aug 22, 2014
1 parent ab81d55 commit b5dfb8c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
1 change: 0 additions & 1 deletion s4pe/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions s4pe/MainForm.cs
Expand Up @@ -553,6 +553,10 @@ private void fileOpen()
{
openFileDialog1.FileName = "";
openFileDialog1.FilterIndex = 1;

string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Electronic Arts", "The Sims 4 Create A Sim Demo", "Mods");
if (System.IO.Directory.Exists(path)) openFileDialog1.CustomPlaces.Add(path);

DialogResult dr = openFileDialog1.ShowDialog();
if (dr != DialogResult.OK) return;

Expand Down
2 changes: 1 addition & 1 deletion s4pe/Properties/AssemblyVersion.cs
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("1408.18.0145.*")]
[assembly: AssemblyVersion("1408.22.0153.*")]
3 changes: 0 additions & 3 deletions s4pe/s4pe.csproj
Expand Up @@ -295,9 +295,6 @@
<Content Include="Acknowledgements-s3pe.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="s4pi.DefaultResource.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="squishinterface_Win32.dll" />
<Content Include="squishinterface_x64.dll" />
<None Include="App.config" />
Expand Down
Binary file removed s4pe/s4pi.DefaultResource.dll
Binary file not shown.
31 changes: 16 additions & 15 deletions s4pi Wrappers/CASPartResource/CASPartResourceTS4.cs
Expand Up @@ -32,7 +32,7 @@ public class CASPartResourceTS4 : AResource
DataBlobHandler unknown4;
uint[] swatchColorCode;
DataBlobHandler unknown5;
UnknownClassList unknown6;
LODBlockList lodBlockList;
DataBlobHandler unknown7;
public TGIBlockList tgiList;
#endregion
Expand Down Expand Up @@ -79,7 +79,7 @@ void Parse(Stream s)
tgiList.Add(new TGIBlock(1, null, "IGT", s));
r.BaseStream.Position = currentPosition;

unknown6 = new UnknownClassList(null, s, tgiList);
lodBlockList = new LODBlockList(null, s, tgiList);

unknown7 = new DataBlobHandler(1, null, r.ReadBytes(10));
}
Expand All @@ -105,7 +105,7 @@ protected override Stream UnParse()
w.Write((byte)swatchColorCode.Length);
foreach(var value in swatchColorCode) w.Write(value);
unknown5.UnParse(s);
unknown6.UnParse(s);
lodBlockList.UnParse(s);
unknown7.UnParse(s);

long tgiPosition = w.BaseStream.Position;
Expand Down Expand Up @@ -152,7 +152,7 @@ protected override Stream UnParse()
[ElementPriority(14)]
public DataBlobHandler Unknown5 { get { return unknown5; } set { if (!unknown5.Equals(value)) unknown5 = value; OnResourceChanged(this, EventArgs.Empty); } }
[ElementPriority(15)]
public UnknownClassList Unknown6 { get { return unknown6; } set { if (!unknown6.Equals(value)) unknown6 = value; OnResourceChanged(this, EventArgs.Empty); } }
public LODBlockList LodBlockList { get { return lodBlockList; } set { if (!lodBlockList.Equals(value)) lodBlockList = value; OnResourceChanged(this, EventArgs.Empty); } }
[ElementPriority(16)]
public DataBlobHandler Unknown7 { get { return unknown7; } set { if (!unknown7.Equals(value)) unknown7 = value; OnResourceChanged(this, EventArgs.Empty); } }
[ElementPriority(17)]
Expand All @@ -161,7 +161,7 @@ protected override Stream UnParse()
#endregion

#region Sub-Class
public class UnknownClass : AHandlerElement, IEquatable<UnknownClass>
public class LODBlock : AHandlerElement, IEquatable<LODBlock>
{
const int recommendedApiVersion = 1;

Expand All @@ -170,8 +170,8 @@ public class UnknownClass : AHandlerElement, IEquatable<UnknownClass>
ushort unknown1;
DataBlobHandler unknown2;
IndexList<byte> indexList;
public UnknownClass(int APIversion, EventHandler handler, TGIBlockList tgiList) : base(APIversion, handler) { this.tgiList = tgiList; }
public UnknownClass(int APIversion, EventHandler handler, Stream s, TGIBlockList tgiList) : base(APIversion, handler) { this.tgiList = tgiList; Parse(s); }
public LODBlock(int APIversion, EventHandler handler, TGIBlockList tgiList) : base(APIversion, handler) { this.tgiList = tgiList; }
public LODBlock(int APIversion, EventHandler handler, Stream s, TGIBlockList tgiList) : base(APIversion, handler) { this.tgiList = tgiList; Parse(s); }
public void Parse(Stream s)
{
BinaryReader r = new BinaryReader(s);
Expand Down Expand Up @@ -211,22 +211,22 @@ public void UnParse(Stream s)
#endregion

#region IEquatable
public bool Equals(UnknownClass other)
public bool Equals(LODBlock other)
{
return this.unknown1 == other.unknown1 && this.unknown2.Equals(other.unknown2) && this.indexList.Equals(other.indexList);
}
#endregion
}

public class UnknownClassList : DependentList<UnknownClass>
public class LODBlockList : DependentList<LODBlock>
{
#region Attributes
TGIBlockList tgiList;
#endregion

#region Constructors
public UnknownClassList(EventHandler handler, TGIBlockList tgiList) : base(handler) { this.tgiList = tgiList; }
public UnknownClassList(EventHandler handler, Stream s, TGIBlockList tgiList) : base(handler, s) { this.tgiList = tgiList; }
public LODBlockList(EventHandler handler, TGIBlockList tgiList) : base(handler) { this.tgiList = tgiList; }
public LODBlockList(EventHandler handler, Stream s, TGIBlockList tgiList) : base(handler, s) { this.tgiList = tgiList; }
#endregion


Expand All @@ -237,7 +237,7 @@ protected override void Parse(Stream s)
byte count = r.ReadByte();
for (int i = 0; i < count; i++)
{
base.Add(new UnknownClass(1, handler, s, tgiList));
base.Add(new LODBlock(1, handler, s, tgiList));
}
}

Expand All @@ -251,8 +251,8 @@ public override void UnParse(Stream s)
}
}

protected override UnknownClass CreateElement(Stream s) { return new UnknownClass(1, handler, tgiList); }
protected override void WriteElement(Stream s, UnknownClass element) { element.UnParse(s); }
protected override LODBlock CreateElement(Stream s) { return new LODBlock(1, handler, tgiList); }
protected override void WriteElement(Stream s, LODBlock element) { element.UnParse(s); }
#endregion

}
Expand Down Expand Up @@ -290,7 +290,8 @@ public bool Equals(Flag other)
public CASPFlags FlagCatagory { get { return this.flagCatagory; } set { if (value != this.flagCatagory) { OnElementChanged(); this.flagCatagory = value; } } }
[ElementPriority(1)]
public ushort FlagValue { get { return this.flagValue; } set { if (value != this.flagValue) { OnElementChanged(); this.flagValue = value; } } }


public string Value { get { return ValueBuilder; } }
}

public class FlagList : DependentList<Flag>
Expand Down

0 comments on commit b5dfb8c

Please sign in to comment.