mirror of
https://github.com/4sval/FModel.git
synced 2026-03-29 13:15:44 -05:00
Fixed a bug when extracting rewards that do not exist (encrypted) in challenges.
This commit is contained in:
parent
c1df41bc65
commit
a655a07ff9
|
|
@ -76,10 +76,14 @@ namespace FModel
|
|||
{
|
||||
isSXBanner = true;
|
||||
string textureFile = Path.GetFileName(assetPathName.Value<string>()).Substring(0, Path.GetFileName(assetPathName.Value<string>()).LastIndexOf('.'));
|
||||
Image challengeIcon;
|
||||
using (Bitmap bmpTemp = new Bitmap(JohnWick.AssetToTexture2D(textureFile)))
|
||||
Image challengeIcon = Resources.unknown512;
|
||||
string textureAsset = JohnWick.AssetToTexture2D(textureFile);;
|
||||
if (!string.IsNullOrEmpty(textureAsset))
|
||||
{
|
||||
challengeIcon = new Bitmap(bmpTemp);
|
||||
using (var bmpTemp = new Bitmap(textureAsset))
|
||||
{
|
||||
challengeIcon = new Bitmap(bmpTemp);
|
||||
}
|
||||
}
|
||||
|
||||
toDrawOn.FillRectangle(new SolidBrush(headerColor), new Rectangle(-1, -1, myBitmap.Width + 1, 257));
|
||||
|
|
@ -105,10 +109,14 @@ namespace FModel
|
|||
if (assetPathName != null)
|
||||
{
|
||||
string textureFile = Path.GetFileName(assetPathName.Value<string>()).Substring(0, Path.GetFileName(assetPathName.Value<string>()).LastIndexOf('.'));
|
||||
Image challengeIcon;
|
||||
using (var bmpTemp = new Bitmap(JohnWick.AssetToTexture2D(textureFile)))
|
||||
Image challengeIcon = Resources.unknown512;
|
||||
string textureAsset = JohnWick.AssetToTexture2D(textureFile);
|
||||
if (!string.IsNullOrEmpty(textureAsset))
|
||||
{
|
||||
challengeIcon = new Bitmap(bmpTemp);
|
||||
using (var bmpTemp = new Bitmap(textureAsset))
|
||||
{
|
||||
challengeIcon = new Bitmap(bmpTemp);
|
||||
}
|
||||
}
|
||||
|
||||
toDrawOn.FillRectangle(new SolidBrush(headerColor), new Rectangle(-1, -1, myBitmap.Width + 1, 257));
|
||||
|
|
|
|||
|
|
@ -79,7 +79,11 @@ namespace FModel
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
drawIcon();
|
||||
}
|
||||
else
|
||||
drawIcon();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -144,7 +148,7 @@ namespace FModel
|
|||
private static void drawIcon()
|
||||
{
|
||||
Image itemIcon = null;
|
||||
if (File.Exists(ItemIcon.ItemIconPath))
|
||||
if (!string.IsNullOrEmpty(ItemIcon.ItemIconPath) && File.Exists(ItemIcon.ItemIconPath))
|
||||
{
|
||||
using (var bmpTemp = new Bitmap(ItemIcon.ItemIconPath))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ namespace FModel
|
|||
/// <returns> the path to the png image </returns>
|
||||
public static string AssetToTexture2D(string AssetName)
|
||||
{
|
||||
if (!ThePak.AllpaksDictionary.ContainsKey(AssetName))
|
||||
return string.Empty;
|
||||
|
||||
string textureFilePath = ExtractAsset(ThePak.AllpaksDictionary[AssetName], AssetName);
|
||||
string TexturePath = string.Empty;
|
||||
if (!string.IsNullOrEmpty(textureFilePath))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user