From cd0b45de22cc4ab6887d15931001c348e209be57 Mon Sep 17 00:00:00 2001 From: wcko87 Date: Thu, 4 May 2017 21:38:49 +0800 Subject: [PATCH] Detect minimap change. Debug log on minimap change and music change. --- rabi_splitter_WPF/MemorySnapshot.cs | 5 ++++- rabi_splitter_WPF/RabiRibiDisplay.cs | 22 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/rabi_splitter_WPF/MemorySnapshot.cs b/rabi_splitter_WPF/MemorySnapshot.cs index 6eea932..f2226f8 100644 --- a/rabi_splitter_WPF/MemorySnapshot.cs +++ b/rabi_splitter_WPF/MemorySnapshot.cs @@ -53,6 +53,7 @@ namespace rabi_splitter_WPF public readonly int nPackUps; public readonly int nRegenUps; + public readonly int minimapPosition; public MemorySnapshot(Process process, int veridx) { @@ -67,7 +68,9 @@ namespace rabi_splitter_WPF carrotXp = MemoryHelper.GetMemoryValue(process, 0xD654BC); hammerXp = MemoryHelper.GetMemoryValue(process, 0xD654B4); ribbonXp = MemoryHelper.GetMemoryValue(process, 0xD654B8); - itemPercent = MemoryHelper.GetMemoryValue(process, 0xA730E8); + itemPercent = MemoryHelper.GetMemoryValue(process, 0xA730E8); + + minimapPosition = MemoryHelper.GetMemoryValue(process, 0xA72E08); nAttackUps = countItems(process, 0xD6352C, 0xD63628); nHpUps = countItems(process, 0xD6342C, 0xD63528); diff --git a/rabi_splitter_WPF/RabiRibiDisplay.cs b/rabi_splitter_WPF/RabiRibiDisplay.cs index 9e7db88..cbabc39 100644 --- a/rabi_splitter_WPF/RabiRibiDisplay.cs +++ b/rabi_splitter_WPF/RabiRibiDisplay.cs @@ -79,9 +79,27 @@ namespace rabi_splitter_WPF } #endregion - + + #region Detect Music change + + if (MusicChanged()) + { + DebugLog($"Music Change: {StaticData.GetMusicName(prevSnapshot.musicid)} -> {StaticData.GetMusicName(snapshot.musicid)}"); + } + + #endregion + + #region Detect Minimap Change + + if (prevSnapshot != null && (prevSnapshot.minimapPosition != snapshot.minimapPosition)) + { + DebugLog($"Minimap Shift! {prevSnapshot.minimapPosition} -> {snapshot.minimapPosition}"); + } + + #endregion + #region Detect Reload - + bool reloaded = (prevSnapshot != null) && (snapshot.playtime < prevSnapshot.playtime); if (gameState.IsGameStarted() && snapshot.playtime > 0) {