diff --git a/RE2REmakeSRT/GameMemory.cs b/RE2REmakeSRT/GameMemory.cs index 60b38c7..6095e80 100644 --- a/RE2REmakeSRT/GameMemory.cs +++ b/RE2REmakeSRT/GameMemory.cs @@ -194,6 +194,7 @@ public void Refresh() } public static Bitmap inventoryImage; + public static Bitmap inventoryImagePatch1; public static IReadOnlyDictionary ItemToImageTranslation; public static IReadOnlyDictionary WeaponToImageTranslation; public static void GenerateImages() @@ -202,6 +203,7 @@ public static void GenerateImages() try { inventoryImage = Properties.Resources.ui0100_iam_texout.Clone(new Rectangle(0, 0, Properties.Resources.ui0100_iam_texout.Width, Properties.Resources.ui0100_iam_texout.Height), PixelFormat.Format32bppPArgb); + inventoryImagePatch1 = Properties.Resources._40d_texout.Clone(new Rectangle(0, 0, Properties.Resources._40d_texout.Width, Properties.Resources._40d_texout.Height), PixelFormat.Format32bppPArgb); } catch (Exception ex) { @@ -211,25 +213,17 @@ public static void GenerateImages() // Rescales the image down if the scaling factor is not 1. if (Program.programSpecialOptions.ScalingFactor != 1d) { - double sheetWidth = Math.Round(inventoryImage.Width * Program.programSpecialOptions.ScalingFactor, MidpointRounding.AwayFromZero); - double sheetHeight = Math.Round(inventoryImage.Height * Program.programSpecialOptions.ScalingFactor, MidpointRounding.AwayFromZero); try { - inventoryImage = new Bitmap(inventoryImage, (int)sheetWidth, (int)sheetHeight); + inventoryImage = new Bitmap(inventoryImage, (int)Math.Round(inventoryImage.Width * Program.programSpecialOptions.ScalingFactor, MidpointRounding.AwayFromZero), (int)Math.Round(inventoryImage.Height * Program.programSpecialOptions.ScalingFactor, MidpointRounding.AwayFromZero)); + inventoryImagePatch1 = new Bitmap(inventoryImagePatch1, (int)Math.Round(inventoryImagePatch1.Width * Program.programSpecialOptions.ScalingFactor, MidpointRounding.AwayFromZero), (int)Math.Round(inventoryImagePatch1.Height * Program.programSpecialOptions.ScalingFactor, MidpointRounding.AwayFromZero)); } catch (Exception ex) { Program.FailFast(string.Format(@"[{0}] An unhandled exception has occurred. Please see below for details. --- [{1}] {2} -{3} ---- -Resizing section. -sheetWidth: {4} ({7} * {6}) -sheetHeight: {5} ({8} * {6}) -scalingFactor: {6} -inventoryImage.Width: {7} -inventoryImage.Height: {8}", Program.srtVersion, ex.GetType().ToString(), ex.Message, ex.StackTrace, sheetWidth.ToString(), sheetHeight.ToString(), Program.programSpecialOptions.ScalingFactor.ToString(), inventoryImage.Width.ToString(), inventoryImage.Height.ToString()), ex); +{3}", Program.srtVersion, ex.GetType().ToString(), ex.Message, ex.StackTrace), ex); } } @@ -241,9 +235,9 @@ Resizing section. // Row 0. { ItemEnumeration.FirstAidSpray, new Rectangle(Program.INV_SLOT_WIDTH * (itemColumnInc = 0), Program.INV_SLOT_HEIGHT * ++itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, - { ItemEnumeration.Herb_Green1, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, - { ItemEnumeration.Herb_Red1, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, - { ItemEnumeration.Herb_Blue1, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, + { ItemEnumeration.Herb_Green2, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, + { ItemEnumeration.Herb_Red2, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, + { ItemEnumeration.Herb_Blue2, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, { ItemEnumeration.Herb_Mixed_GG, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, { ItemEnumeration.Herb_Mixed_GR, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, { ItemEnumeration.Herb_Mixed_GB, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, @@ -251,9 +245,9 @@ Resizing section. { ItemEnumeration.Herb_Mixed_GGG, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, { ItemEnumeration.Herb_Mixed_GRB, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, { ItemEnumeration.Herb_Mixed_RB, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, - { ItemEnumeration.Herb_Green2, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, - { ItemEnumeration.Herb_Red2, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, - { ItemEnumeration.Herb_Blue2, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, + { ItemEnumeration.Herb_Green1, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, + { ItemEnumeration.Herb_Red1, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, + { ItemEnumeration.Herb_Blue1, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, // Row 1. { ItemEnumeration.HandgunBullets, new Rectangle(Program.INV_SLOT_WIDTH * (itemColumnInc = 0), Program.INV_SLOT_HEIGHT * ++itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, @@ -400,6 +394,9 @@ Resizing section. // Row 14. { ItemEnumeration.WoodenBox1, new Rectangle(Program.INV_SLOT_WIDTH * (itemColumnInc = 9), Program.INV_SLOT_HEIGHT * ++itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, { ItemEnumeration.WoodenBox2, new Rectangle(Program.INV_SLOT_WIDTH * ++itemColumnInc, Program.INV_SLOT_HEIGHT * itemRowInc, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, + + // Patch Items. + { ItemEnumeration.OldKey, new Rectangle(0, 0, Program.INV_SLOT_WIDTH, Program.INV_SLOT_HEIGHT) }, }; int weaponColumnInc = -1; diff --git a/RE2REmakeSRT/ItemEnumeration.cs b/RE2REmakeSRT/ItemEnumeration.cs index 284525c..8e9f17b 100644 --- a/RE2REmakeSRT/ItemEnumeration.cs +++ b/RE2REmakeSRT/ItemEnumeration.cs @@ -128,6 +128,7 @@ public enum ItemEnumeration : int BoltCutter = 0xF4, StuffedDoll = 0xF5, HipPouch = 0x0106, + OldKey = 0x011E, PortableSafe = 0x0123, TinStorageBox1 = 0x0125, WoodenBox1 = 0x0126, diff --git a/RE2REmakeSRT/MainUI.cs b/RE2REmakeSRT/MainUI.cs index 119bfce..1c4bb61 100644 --- a/RE2REmakeSRT/MainUI.cs +++ b/RE2REmakeSRT/MainUI.cs @@ -244,7 +244,11 @@ private void inventoryPanel_Paint(object sender, PaintEventArgs e) if (inv.IsItem && GameMemory.ItemToImageTranslation.ContainsKey(inv.ItemID)) { imageRect = GameMemory.ItemToImageTranslation[inv.ItemID]; - imageBrush = new TextureBrush(GameMemory.inventoryImage, imageRect); + + if (inv.ItemID == ItemEnumeration.OldKey) + imageBrush = new TextureBrush(GameMemory.inventoryImagePatch1, imageRect); + else + imageBrush = new TextureBrush(GameMemory.inventoryImage, imageRect); } else if (inv.IsWeapon && GameMemory.WeaponToImageTranslation.ContainsKey(weapon = new Weapon() { WeaponID = inv.WeaponID, Attachments = inv.Attachments })) { @@ -258,7 +262,7 @@ private void inventoryPanel_Paint(object sender, PaintEventArgs e) } e.Graphics.FillRectangle(imageBrush, imageX, imageY, imageRect.Width, imageRect.Height); - e.Graphics.DrawString(inv.Quantity.ToString(), new Font("Consolas", 14, FontStyle.Bold), textBrush, textX, textY, invStringFormat); + e.Graphics.DrawString((inv.Quantity != -1) ? inv.Quantity.ToString() : "∞", new Font("Consolas", 14, FontStyle.Bold), textBrush, textX, textY, invStringFormat); } } } @@ -288,8 +292,8 @@ private void statisticsPanel_Paint(object sender, PaintEventArgs e) heightOffset = 25; // Adding an additional offset to accomdate Raw IGT. } - e.Graphics.DrawString(string.Format("Rank: {0}", Program.gameMem.Rank), new Font("Consolas", 9, FontStyle.Bold), Brushes.Gray, 0, heightOffset + (heightGap * ++i), stdStringFormat); - e.Graphics.DrawString(string.Format("Score: {0}", Program.gameMem.RankScore), new Font("Consolas", 9, FontStyle.Bold), Brushes.Gray, 0, heightOffset + (heightGap * ++i), stdStringFormat); + e.Graphics.DrawString(string.Format("DA Rank: {0}", Program.gameMem.Rank), new Font("Consolas", 9, FontStyle.Bold), Brushes.Gray, 0, heightOffset + (heightGap * ++i), stdStringFormat); + e.Graphics.DrawString(string.Format("DA Score: {0}", Program.gameMem.RankScore), new Font("Consolas", 9, FontStyle.Bold), Brushes.Gray, 0, heightOffset + (heightGap * ++i), stdStringFormat); e.Graphics.DrawString("Enemies", new Font("Consolas", 10, FontStyle.Bold), Brushes.Red, 0, heightOffset + (heightGap * ++i), stdStringFormat); foreach (EnemyHP enemyHP in Program.gameMem.EnemyHealth.Where(a => a.IsAlive).OrderBy(a => a.Percentage).ThenByDescending(a => a.CurrentHP)) diff --git a/RE2REmakeSRT/Properties/AssemblyInfo.cs b/RE2REmakeSRT/Properties/AssemblyInfo.cs index 23da3de..dda792b 100644 --- a/RE2REmakeSRT/Properties/AssemblyInfo.cs +++ b/RE2REmakeSRT/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.0")] diff --git a/RE2REmakeSRT/Properties/Resources.Designer.cs b/RE2REmakeSRT/Properties/Resources.Designer.cs index caa64bc..d2c976e 100644 --- a/RE2REmakeSRT/Properties/Resources.Designer.cs +++ b/RE2REmakeSRT/Properties/Resources.Designer.cs @@ -60,6 +60,16 @@ internal Resources() { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap _40d_texout { + get { + object obj = ResourceManager.GetObject("_40d_texout", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/RE2REmakeSRT/Properties/Resources.resx b/RE2REmakeSRT/Properties/Resources.resx index d5d2fac..dbe8f38 100644 --- a/RE2REmakeSRT/Properties/Resources.resx +++ b/RE2REmakeSRT/Properties/Resources.resx @@ -133,4 +133,7 @@ ..\Resources\ui0100_iam.texout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\40d.texout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RE2REmakeSRT/RE2REmakeSRT.csproj b/RE2REmakeSRT/RE2REmakeSRT.csproj index e2d76d5..08a4d8b 100644 --- a/RE2REmakeSRT/RE2REmakeSRT.csproj +++ b/RE2REmakeSRT/RE2REmakeSRT.csproj @@ -142,6 +142,9 @@ + + + "C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /tr "http://timestamp.digicert.com" /td SHA1 /n "Travis J Gutjahr" /sm /fd SHA1 "$(TargetDir)\RE2REmakeSRT.exe" diff --git a/RE2REmakeSRT/Resources/40d.texout.png b/RE2REmakeSRT/Resources/40d.texout.png new file mode 100644 index 0000000..574adae Binary files /dev/null and b/RE2REmakeSRT/Resources/40d.texout.png differ