Skip to content

Commit

Permalink
update user template manager, add pipt presets
Browse files Browse the repository at this point in the history
  • Loading branch information
igorseabra4 committed Apr 28, 2020
1 parent 27ba693 commit 59ff16e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,11 @@ public void ApplyScale(Vector3 factor)

TRIG.FixPosition();
}
else if (a is IClickableAsset clickableAsset)
else if (a is IClickableAsset ica)
{
((IClickableAsset)a).PositionX *= factor.X;
((IClickableAsset)a).PositionY *= factor.Y;
((IClickableAsset)a).PositionZ *= factor.Z;
ica.PositionX *= factor.X;
ica.PositionY *= factor.Y;
ica.PositionZ *= factor.Z;

if (a is AssetMVPT MVPT)
{
Expand Down
28 changes: 27 additions & 1 deletion IndustrialPark/Assets/Binary/AssetPIPT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ public enum BlendFactorType
SourceAlphaSaturated = 0x0B
}

public enum PiptPreset
{
None = 0,
Default = 9961474,
VertexColors = 9961538,
AlphaBlend = 9987330,
AlphaBlendVertexColors = 9987394,
AdditiveAlpha = 10036486,
AdditiveAlphaVertexColors = 10036550,
}

public class EntryPIPT
{
[Category("PIPT Entry")]
Expand All @@ -30,7 +41,22 @@ public class EntryPIPT
public int SubObjectBits { get; set; }
[Category("PIPT Entry")]
public int PipeFlags { get; set; }

[Category("PIPT Entry")]
public PiptPreset Preset
{
get
{
foreach (PiptPreset v in Enum.GetValues(typeof(PiptPreset)))
if ((int)v == PipeFlags)
return v;
return PiptPreset.None;
}
set
{
PipeFlags = (int)value;
}
}

[Category("PIPT Pipe Flags")]
public byte AlphaCompareValue
{
Expand Down
1 change: 0 additions & 1 deletion IndustrialPark/IndustrialPark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@
<EmbeddedResource Include="MainForm\ViewConfig.resx">
<DependentUpon>ViewConfig.cs</DependentUpon>
</EmbeddedResource>
<None Include="IndustrialPark_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
Expand Down
35 changes: 8 additions & 27 deletions IndustrialPark/MainForm/UserTemplateManager.Designer.cs

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

15 changes: 1 addition & 14 deletions IndustrialPark/MainForm/UserTemplateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,7 @@ protected override void OnFormClosing(FormClosingEventArgs e)
e.Cancel = true;
Hide();
}

private void buttonImportRawData_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog() { Multiselect = true };

if (openFileDialog.ShowDialog() == DialogResult.OK)
{
foreach (string s in openFileDialog.FileNames)
File.Copy(s, Path.Combine(Program.MainForm.userTemplatesFolder, Path.GetFileName(s)));

UpdateListBox();
}
}


private void UpdateListBox()
{
listBoxTemplates.Items.Clear();
Expand Down

0 comments on commit 59ff16e

Please sign in to comment.