Skip to content

Commit

Permalink
more templates and some refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
igorseabra4 committed Apr 17, 2019
1 parent cb9940c commit d9893f9
Show file tree
Hide file tree
Showing 12 changed files with 513 additions and 436 deletions.
6 changes: 3 additions & 3 deletions IndustrialPark/ArchiveEditor/ArchiveEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ArchiveEditor(string filePath)
if (!string.IsNullOrWhiteSpace(filePath))
OpenFile(filePath);

MainForm.PopulateTemplateMenusAt(addTemplateToolStripMenuItem, TemplateToolStripMenuItem_Click);
ArchiveEditorFunctions.PopulateTemplateMenusAt(addTemplateToolStripMenuItem, TemplateToolStripMenuItem_Click);
listViewAssets_SizeChanged(null, null);
}

Expand Down Expand Up @@ -529,7 +529,7 @@ private void buttonView_Click(object sender, EventArgs e)
if (archive.GetFromAssetID(CurrentlySelectedAssetIDs()[0]) is AssetCAM cam)
Program.MainForm.renderer.Camera.SetPositionCamera(cam);
else if (archive.GetFromAssetID(CurrentlySelectedAssetIDs()[0]) is IClickableAsset a)
Program.MainForm.renderer.Camera.SetPosition(new Vector3(a.PositionX, a.PositionY, a.PositionZ) - 8 * Program.MainForm.renderer.Camera.GetForward());
Program.MainForm.renderer.Camera.SetPosition(new Vector3(a.PositionX, a.PositionY, a.PositionZ) - 8 * Program.MainForm.renderer.Camera.Forward);
}

private void buttonEditAsset_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -883,7 +883,7 @@ private void TemplateToolStripMenuItem_Click(object sender, EventArgs e)
{
if (text == template.ToString())
{
Vector3 Position = Program.MainForm.renderer.Camera.Position + 2 * Program.MainForm.renderer.Camera.GetForward();
Vector3 Position = Program.MainForm.renderer.Camera.Position + 3 * Program.MainForm.renderer.Camera.Forward;
PlaceTemplate(Position, template);
return;
}
Expand Down
20 changes: 19 additions & 1 deletion IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ private void AddAssetToDictionary(Section_AHDR AHDR, bool fast = false)
case AssetType.VIL: newAsset = new AssetVIL(AHDR); break;
case AssetType.VILP: newAsset = new AssetVILP(AHDR); break;
case AssetType.VOLU: newAsset = new AssetVOLU(AHDR); break;

case AssetType.CCRV:
case AssetType.DTRK:
case AssetType.DUPC:
Expand Down Expand Up @@ -482,6 +481,25 @@ private void AddAssetToDictionary(Section_AHDR AHDR, bool fast = false)

assetDictionary.Add(AHDR.assetID, newAsset);

// THIS IS TEMPORARY, REMOVE AFTER FINISHING ENEMY HIPS
//if (newAsset is AssetMINF minf)
//{
// uint hash = BKDRHash(AHDR.ADBG.assetName.Replace(".MINF", ""));
// if (assetDictionary.ContainsKey(hash))
// assetDictionary[hash] = newAsset;
// else
// assetDictionary.Add(hash, newAsset);
//}
//if (newAsset is AssetMODL modl)
//{
// uint hash = BKDRHash(AHDR.ADBG.assetName.ToLower().Replace(".dff", ""));
// if (assetDictionary.ContainsKey(hash))
// assetDictionary[hash] = newAsset;
// else
// assetDictionary.Add(hash, newAsset);
//}
// ...

if (hiddenAssets.Contains(AHDR.assetID))
assetDictionary[AHDR.assetID].isInvisible = true;

Expand Down
472 changes: 377 additions & 95 deletions IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ private void buttonGetPos_Click(object sender, System.EventArgs e)

private void buttonGetDir_Click(object sender, System.EventArgs e)
{
asset.SetNormalizedForward(Program.MainForm.renderer.Camera.GetForward());
asset.SetNormalizedUp(Program.MainForm.renderer.Camera.GetUp());
asset.SetNormalizedLeft(Program.MainForm.renderer.Camera.GetRight());
asset.SetNormalizedForward(Program.MainForm.renderer.Camera.Forward);
asset.SetNormalizedUp(Program.MainForm.renderer.Camera.Up);
asset.SetNormalizedLeft(Program.MainForm.renderer.Camera.Right);
}

public uint GetAssetID()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ private void buttonGetPos_Click(object sender, EventArgs e)

private void buttonGetDir_Click(object sender, EventArgs e)
{
((EntryFLY)propertyGridSpecific.SelectedObject).CameraNormalizedLeft = -Program.MainForm.renderer.Camera.GetRight();
((EntryFLY)propertyGridSpecific.SelectedObject).CameraNormalizedUp = Program.MainForm.renderer.Camera.GetUp();
((EntryFLY)propertyGridSpecific.SelectedObject).CameraNormalizedBackward = -Program.MainForm.renderer.Camera.GetForward();
((EntryFLY)propertyGridSpecific.SelectedObject).CameraNormalizedLeft = -Program.MainForm.renderer.Camera.Right;
((EntryFLY)propertyGridSpecific.SelectedObject).CameraNormalizedUp = Program.MainForm.renderer.Camera.Up;
((EntryFLY)propertyGridSpecific.SelectedObject).CameraNormalizedBackward = -Program.MainForm.renderer.Camera.Forward;
UpdateAssetEntries();
}

Expand Down Expand Up @@ -158,4 +158,4 @@ public void Play()
}
}
}
}
}
5 changes: 5 additions & 0 deletions IndustrialPark/ArchiveEditor/Other/AssetTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public enum AssetTemplate
BungeeHook,
BungeeDrop,

Swinger,
Swinger_PLAT,
Ring,
RingControl,

// ...but not for user
PressurePlateBase,
BusStop_DYNA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public override float ScaleZ
[Category("Ring"), TypeConverter(typeof(FloatTypeConverter))]
public float UnknownFloat1 { get; set; }

[Category("Ring")]
[Category("Ring"), TypeConverter(typeof(FloatTypeConverter))]
public float UnknownFloat2 { get; set; }

[Category("Ring"), TypeConverter(typeof(FloatTypeConverter))]
Expand Down
Loading

0 comments on commit d9893f9

Please sign in to comment.