Skip to content

Commit

Permalink
Re-add hex data code
Browse files Browse the repository at this point in the history
Fixes blank hex data
  • Loading branch information
burninrubber0 committed Jun 10, 2023
1 parent 939fb98 commit 9c939a3
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions BundleManager/EntryEditor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
Expand Down Expand Up @@ -88,6 +89,76 @@ private void FocusTab()
}
}

private delegate byte[] GetDataHex();
private delegate void SetDataHex(byte[] hex);
private byte[] DataHex
{
get
{
if (hexData.InvokeRequired)
{
GetDataHex method = () =>
{
return hexData.HexData;
};
return (byte[])Invoke(method);
}
else
{
return hexData.HexData;
}
}
set
{
if (hexData.InvokeRequired)
{
SetDataHex method = (byte[] hex) =>
{
hexData.HexData = hex;
};
Invoke(method, value);
}
else
{
hexData.HexData = value;
}
}
}

private byte[] ExtraDataHex
{
get
{
if (hexExtraData.InvokeRequired)
{
GetDataHex method = () =>
{
return hexExtraData.HexData;
};
return (byte[])Invoke(method);
}
else
{
return hexExtraData.HexData;
}
}
set
{
if (hexExtraData.InvokeRequired)
{
SetDataHex method = (byte[] hex) =>
{
hexExtraData.HexData = hex;
};
Invoke(method, value);
}
else
{
hexExtraData.HexData = value;
}
}
}

private delegate Image GetImage();
private delegate void SetImage(Image img);
private Image Image
Expand Down Expand Up @@ -404,6 +475,12 @@ private void UpdateDisplay()
ImageMenuVisible = ImageVisible;
BinaryMenuVisible = TabsVisible;

if (TabsVisible)
{
DataHex = _entry.EntryBlocks[0].Data;
ExtraDataHex = _entry.EntryBlocks[1].Data;
}

MenuVisible = true;

InfoText = GetInfo();
Expand Down

0 comments on commit 9c939a3

Please sign in to comment.