Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
fixed buff bar
Browse files Browse the repository at this point in the history
  • Loading branch information
joffreybesos committed Sep 26, 2022
1 parent 5e49b3d commit a0585eb
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [3.0.3] - 2022-09-26 - Minor fixes

- Fixed buff bar (thanks @reetah)
- Added sunder charms to list of items
- You will now get a warning if you are running an old version of the map server

## [3.0.2] - 2022-09-24 - Minor fixes

- Fix for reading items from vendors
Expand Down
2 changes: 1 addition & 1 deletion src/d2r-map.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Menu, Tray, Add, Reload, Reload
Menu, Tray, Add
Menu, Tray, Add, Exit, ExitMH

global version := "3.0.2"
global version := "3.0.3"

WriteLog("*******************************************************************")
WriteLog("* Map overlay started https://github.com/joffreybesos/d2r-mapview *")
Expand Down
1 change: 1 addition & 0 deletions src/init/readSettings.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ readSettings(settingsFile, ByRef settings) {
settings["alwaysShowMap"] := 0
settings["hideTown"] := 0
settings["serverScale"] := 3
settings["alertedMapServerVersion"] := false

settings["mapPosition"] := "CENTER" ; can be "TOP_LEFT" or "TOP_RIGHT"
settings["centerModeScale"] := 2.262
Expand Down
Binary file modified src/localization.ini
Binary file not shown.
7 changes: 5 additions & 2 deletions src/memory/initMemory.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ initMemory(gameWindowId) {
if !isObject(d2rprocess)
{
WriteLog(gameWindowId " not found, please make sure game is running, try running MH as admin if still having issues")
errornogame := localizedStrings["errormsg10"]
Msgbox, 48, d2r-mapview %version%, %errormsg10%`n`n%errormsg11%`n%errormsg12%`n`n%errormsg3%
errormsg10 := localizedStrings["errormsg10"]
errormsg11 := localizedStrings["errormsg11"]
errormsg12 := localizedStrings["errormsg12"]
errormsg3 := localizedStrings["errormsg3"]
Msgbox, 48, d2r-mapview %version%, %englishforced%`n%errormsg10%`n`n%errormsg11%`n%errormsg12%`n`n%errormsg3%
ExitApp
}
WriteLog("Initalised memory")
Expand Down
15 changes: 9 additions & 6 deletions src/memory/readStates.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
ReadStates(ByRef d2rprocess, gameMemoryData, ByRef currentStates) {
playerAddress := gameMemoryData["playerPointer"]
pStatsListEx := d2rprocess.read(playerAddress + 0x88, "Int64")
stateByte1 := d2rprocess.read(pStatsListEx + 0xAC8, "UInt")
stateByte2 := d2rprocess.read(pStatsListEx + 0xAC8 + 4, "UInt")
stateByte3 := d2rprocess.read(pStatsListEx + 0xAC8 + 8, "UInt")
stateByte4 := d2rprocess.read(pStatsListEx + 0xAC8 + 12, "UInt")
stateByte5 := d2rprocess.read(pStatsListEx + 0xAC8 + 16, "UInt")
stateByte6 := d2rprocess.read(pStatsListEx + 0xAC8 + 20, "UInt")

stateByte1 := d2rprocess.read(pStatsListEx + 0xAD0, "UInt")
stateByte2 := d2rprocess.read(pStatsListEx + 0xAD0 + 4, "UInt")
stateByte3 := d2rprocess.read(pStatsListEx + 0xAD0 + 8, "UInt")
stateByte4 := d2rprocess.read(pStatsListEx + 0xAD0 + 12, "UInt")
stateByte5 := d2rprocess.read(pStatsListEx + 0xAD0 + 16, "UInt")
stateByte6 := d2rprocess.read(pStatsListEx + 0xAD0 + 20, "UInt")

stats1 := calculateState(stateByte1, -1)
stats2 := calculateState(stateByte2, 31)
Expand Down Expand Up @@ -328,5 +329,7 @@ getStateName(stateNum) {
case 185: return "STATE_COOLDOWN"
case 186: return "STATE_SHAREDSTASH"
case 187: return "STATE_HIDEDEAD"
case 188: return "STATE_IMPALE"
case 189: return "STATE_DESECRATED"
}
}
6 changes: 6 additions & 0 deletions src/types/Item.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,12 @@ class GameItem {
case 398: return localizedStrings["Rainbow Facet"]
case 399: return localizedStrings["Rainbow Facet"]
case 400: return localizedStrings["Hellfire Torch"]
case 401: return localizedStrings["Cold Rupture"]
case 402: return localizedStrings["Flame Rift"]
case 403: return localizedStrings["Crack of the Heavens"]
case 404: return localizedStrings["Rotting Fissure"]
case 405: return localizedStrings["Bone Break"]
case 406: return localizedStrings["Black Cleft"]
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/types/MapImage.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class MapImage {
case "prerotated": prerotated := convertToBool(field[2]), foundFields++
case "originalwidth": originalwidth := Trim(field[2]), foundFields++
case "originalheight": originalheight := Trim(field[2]), foundFields++
case "version": mapServerVersion := Trim(field[2])
}
}
if (foundFields < 9) {
Expand All @@ -156,6 +157,14 @@ class MapImage {
if (serverisv10) {
prerotated := true
}
if (mapServerVersion < 14) {
if (!settings["alertedMapServerVersion"]) {
settings["alertedMapServerVersion"] := true
IniWrite, % 1, settings.ini, Settings, alertedMapServerVersion
errormsg27 := localizedStrings["errormsg27"]
Msgbox, 48, d2r-mapview %version%, %errormsg27%
}
}
this.leftTrimmed := leftTrimmed
this.topTrimmed := topTrimmed
this.topTrimmed := topTrimmed
Expand Down

0 comments on commit a0585eb

Please sign in to comment.