Skip to content

Commit

Permalink
prepare for preview 43
Browse files Browse the repository at this point in the history
  • Loading branch information
igorseabra4 committed Jul 6, 2019
1 parent 40a601b commit 4102c54
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 64 deletions.
2 changes: 1 addition & 1 deletion IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs

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

8 changes: 4 additions & 4 deletions IndustrialPark/ArchiveEditor/ArchiveEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,21 +451,21 @@ private void buttonAddAsset_Click(object sender, EventArgs e)

private void importMultipleAssetsToolStripMenuItem_Click(object sender, EventArgs e)
{
List<Section_AHDR> AHDRs = AddMultipleAssets.GetAssets(out bool success);
List<Section_AHDR> AHDRs = AddMultipleAssets.GetAssets(out bool success, out bool overwrite);
if (success)
{
archive.ImportMultipleAssets(comboBoxLayers.SelectedIndex, AHDRs, out List<uint> assetIDs, false);
archive.ImportMultipleAssets(comboBoxLayers.SelectedIndex, AHDRs, out List<uint> assetIDs, overwrite);
comboBoxLayers.Items[comboBoxLayers.SelectedIndex] = archive.LayerToString(comboBoxLayers.SelectedIndex);
SetSelectedIndices(assetIDs, true);
}
}

private void importModelsToolStripMenuItem_Click(object sender, EventArgs e)
{
List<Section_AHDR> AHDRs = ImportModel.GetAssets(out bool success);
List<Section_AHDR> AHDRs = ImportModel.GetAssets(out bool success, out bool overwrite);
if (success)
{
archive.ImportMultipleAssets(comboBoxLayers.SelectedIndex, AHDRs, out List<uint> assetIDs, false);
archive.ImportMultipleAssets(comboBoxLayers.SelectedIndex, AHDRs, out List<uint> assetIDs, overwrite);
comboBoxLayers.Items[comboBoxLayers.SelectedIndex] = archive.LayerToString(comboBoxLayers.SelectedIndex);
SetSelectedIndices(assetIDs, true);
}
Expand Down
27 changes: 21 additions & 6 deletions IndustrialPark/ArchiveEditor/Dialogs/AddMultipleAssets.Designer.cs

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

4 changes: 3 additions & 1 deletion IndustrialPark/ArchiveEditor/Dialogs/AddMultipleAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void buttonOK_Click(object sender, EventArgs e)
Close();
}

public static List<Section_AHDR> GetAssets(out bool success)
public static List<Section_AHDR> GetAssets(out bool success, out bool overwrite)
{
AddMultipleAssets a = new AddMultipleAssets();
DialogResult d = a.ShowDialog();
Expand All @@ -93,11 +93,13 @@ public static List<Section_AHDR> GetAssets(out bool success)
}

success = true;
overwrite = a.checkBoxOverwrite.Checked;
return AHDRs;
}
else
{
success = false;
overwrite = a.checkBoxOverwrite.Checked;
return null;
}
}
Expand Down
17 changes: 16 additions & 1 deletion IndustrialPark/ArchiveEditor/Dialogs/ImportModel.Designer.cs

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

33 changes: 19 additions & 14 deletions IndustrialPark/ArchiveEditor/Dialogs/ImportModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,43 @@ private void buttonOK_Click(object sender, EventArgs e)
Close();
}

public static List<Section_AHDR> GetAssets(out bool success)
public static List<Section_AHDR> GetAssets(out bool success, out bool overwrite)
{
ImportModel a = new ImportModel();
if (a.ShowDialog() == DialogResult.OK)
{
List<Section_AHDR> AHDRs = new List<Section_AHDR>();

for (int i = 0; i < a.filePaths.Count; i++)
foreach (string filePath in a.filePaths)
{
byte[] data;
AssetType assetType;
string assetName = Path.GetFileNameWithoutExtension(a.filePaths[i]); // + ".dff";
string assetName = Path.GetFileNameWithoutExtension(filePath) + ".dff";
AssetType assetType = AssetType.MODL;
byte[] assetData = Path.GetExtension(filePath).ToLower().Equals(".dff") ?
File.ReadAllBytes(filePath) :
ReadFileMethods.ExportRenderWareFile(
CreateDFFFromAssimp(filePath,
a.checkBoxFlipUVs.Checked),
currentRenderWareVersion);

assetType = AssetType.MODL;
data = Path.GetExtension(a.filePaths[i]).ToLower().Equals(".dff") ? File.ReadAllBytes(a.filePaths[i]) :
ReadFileMethods.ExportRenderWareFile(CreateDFFFromAssimp(a.filePaths[i], a.checkBoxFlipUVs.Checked), currentRenderWareVersion);

Section_ADBG ADBG = new Section_ADBG(0, assetName, "", 0);
Section_AHDR AHDR = new Section_AHDR(Functions.BKDRHash(assetName), assetType, ArchiveEditorFunctions.AHDRFlagsFromAssetType(assetType), ADBG, data);

AHDRs.Add(AHDR);
AHDRs.Add(
new Section_AHDR(
Functions.BKDRHash(assetName),
assetType,
ArchiveEditorFunctions.AHDRFlagsFromAssetType(assetType),
new Section_ADBG(0, assetName, "", 0),
assetData));
}

success = true;
overwrite = a.checkBoxOverwrite.Checked;
return AHDRs;
}
else
{
success = false;
overwrite = false;
return null;
}
}

}
}

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows.Forms;
using System;
using System.Windows.Forms;

namespace IndustrialPark
{
Expand All @@ -15,8 +16,7 @@ public InternalAssetEditor(Asset asset, ArchiveEditorFunctions archive)
propertyGridAsset.SelectedObject = asset;
labelAssetName.Text = $"[{asset.AHDR.assetType.ToString()}] {asset.ToString()}";

if (asset is AssetMVPT)
propertyGridAsset.HelpVisible = true;
propertyGridAsset.HelpVisible = true;
}

private void InternalAssetEditor_FormClosing(object sender, FormClosingEventArgs e)
Expand All @@ -32,7 +32,7 @@ public uint GetAssetID()
return asset.AHDR.assetID;
}

private void buttonFindCallers_Click(object sender, System.EventArgs e)
private void buttonFindCallers_Click(object sender, EventArgs e)
{
Program.MainForm.FindWhoTargets(GetAssetID());
}
Expand All @@ -43,7 +43,7 @@ private void propertyGridAsset_PropertyValueChanged(object s, PropertyValueChang
ArchiveEditorFunctions.UpdateGizmoPosition();
}

private void buttonHelp_Click(object sender, System.EventArgs e)
private void buttonHelp_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(AboutBox.WikiLink + asset.AHDR.assetType.ToString());
}
Expand Down

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public byte Padding55
}

[Category("Platform")]
[Description("0 = None\n1 = Shake on Mount\n2 = Unknown\n4=Solid\nAdd numbers to enable multiple")]
[Description("0 = None\n1 = Shake on Mount\n2 = Unknown\n4 = Solid\nAdd numbers to enable multiple flags")]
public short PlatFlags
{
get => ReadShort(0x56 + Offset);
Expand Down
4 changes: 2 additions & 2 deletions IndustrialPark/Assets/Shared/Motion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Motion
[Category("Motion")]
public byte UseBanking { get; set; }
[Category("Motion")]
[Description("0 = None\n1 = Unknown\n2 = Unknown\n4=Don't start moving\nAdd numbers to enable multiple")]
[Description("0 = None\n1 = Unknown\n2 = Unknown\n4 = Don't start moving\nAdd numbers to enable multiple flags")]
public short Flags { get; set; }

public Motion() { }
Expand Down Expand Up @@ -357,7 +357,7 @@ public enum Axis : byte
[Category("Motion: Mechanism")]
public EMovementType MovementType { get; set; }
[Category("Motion: Mechanism")]
[Description("0 = None\n1 = Return to start after moving\n2 = Don't loop\nAdd to enable multiple")]
[Description("0 = None\n1 = Return to start after moving\n2 = Don't loop\n3 = Both")]
public byte MovementLoopMode { get; set; }
[Category("Motion: Mechanism")]
public Axis SlideAxis { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions IndustrialPark/MainForm/Json/IPversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class IPversion
{
public string version = "preview42";
public string versionName = "Preview 42";
public string version = "preview43";
public string versionName = "Preview 43";
}
}
2 changes: 1 addition & 1 deletion IndustrialPark/Models/ChooseTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ChooseTarget()

private void ChooseTarget_Load(object sender, EventArgs e)
{
comboBoxFormat.Items.Add("RenderWare BSP");
comboBoxFormat.Items.Add("RenderWare Stream (raw BSP/DFF)");
foreach (ExportFormatDescription f in formats)
comboBoxFormat.Items.Add(f.Description);

Expand Down
Loading

0 comments on commit 4102c54

Please sign in to comment.