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

Commit 16e1cbd

Browse files
committed
shrines and portals
1 parent 2f3a7cd commit 16e1cbd

7 files changed

+895
-19
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

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

5+
## [2.3.3] - 2021-12-13 - Shrines and portals
6+
7+
- Shrine types will now show on the map
8+
- You have to be in range for it to show, they will not persist
9+
- Town portals will now show on the map as well
10+
- Red portals (such as cow level) should appear in red, normal portals in blue
11+
- Can be turned on/off with `showShrines` and `showPortals` in `settings.ini`
12+
- Can also configure `portalColor`, `redPortalColor`, `shrineColor` and `shrineTextSize`
13+
514
## [2.3.2] - 2021-12-13 - Performance improvements
615

716
- Major refactor of how mobs/player units are drawn, which gives better performance

src/d2r-map.ahk

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ SetWorkingDir, %A_ScriptDir%
1313
#Include %A_ScriptDir%\ui\showMap.ahk
1414
#Include %A_ScriptDir%\ui\showText.ahk
1515
#Include %A_ScriptDir%\ui\showHelp.ahk
16-
#Include %A_ScriptDir%\ui\showPlayer.ahk
16+
#Include %A_ScriptDir%\ui\showUnits.ahk
1717
#Include %A_ScriptDir%\ui\showLastGame.ahk
1818
#Include %A_ScriptDir%\readSettings.ahk
1919

20-
expectedVersion := "2.3.2"
20+
expectedVersion := "2.3.3"
2121

2222
if !FileExist(A_Scriptdir . "\settings.ini") {
2323
MsgBox, , Missing settings, Could not find settings.ini file
@@ -157,7 +157,7 @@ While 1 {
157157
}
158158
; update player layer on each loop
159159
uiData["ticktock"] := ticktock
160-
ShowPlayer(settings, unitHwnd1, imageData, gameMemoryData, uiData)
160+
ShowUnits(settings, unitHwnd1, imageData, gameMemoryData, uiData)
161161
checkAutomapVisibility(d2rprocess, settings, gameMemoryData["levelNo"])
162162

163163
lastlevel := gameMemoryData["levelNo"]
@@ -253,7 +253,7 @@ MapSizeIncrease:
253253
IniWrite, %levelScale%, mapconfig.ini, %levelNo%, scale
254254
imageData["levelScale"] := levelScale
255255
ShowMap(settings, mapHwnd1, imageData, gameMemoryData, uiData)
256-
;ShowPlayer(settings, unitHwnd1, imageData, gameMemoryData, uiData)
256+
;ShowUnits(settings, unitHwnd1, imageData, gameMemoryData, uiData)
257257
WriteLog("Increased level " levelNo " scale by 0.05 to " levelScale)
258258
}
259259
return
@@ -268,7 +268,7 @@ MapSizeDecrease:
268268
IniWrite, %levelScale%, mapconfig.ini, %levelNo%, scale
269269
imageData["levelScale"] := levelScale
270270
ShowMap(settings, mapHwnd1, imageData, gameMemoryData, uiData)
271-
;ShowPlayer(settings, unitHwnd1, imageData, gameMemoryData, uiData)
271+
;ShowUnits(settings, unitHwnd1, imageData, gameMemoryData, uiData)
272272
WriteLog("Decreased level " levelNo " scale by 0.05 to " levelScale)
273273
}
274274
return
@@ -285,7 +285,7 @@ MapSizeDecrease:
285285
IniWrite, %levelxmargin%, mapconfig.ini, %levelNo%, x
286286
imageData["levelxmargin"] := levelxmargin
287287
ShowMap(settings, mapHwnd1, imageData, gameMemoryData, uiData)
288-
;ShowPlayer(settings, unitHwnd1, imageData, gameMemoryData, uiData)
288+
;ShowUnits(settings, unitHwnd1, imageData, gameMemoryData, uiData)
289289
}
290290
return
291291
}
@@ -299,7 +299,7 @@ MapSizeDecrease:
299299
IniWrite, %levelxmargin%, mapconfig.ini, %levelNo%, x
300300
imageData["levelxmargin"] := levelxmargin
301301
ShowMap(settings, mapHwnd1, imageData, gameMemoryData, uiData)
302-
;ShowPlayer(settings, unitHwnd1, imageData, gameMemoryData, uiData)
302+
;ShowUnits(settings, unitHwnd1, imageData, gameMemoryData, uiData)
303303
}
304304
return
305305
}
@@ -313,7 +313,7 @@ MapSizeDecrease:
313313
IniWrite, %levelymargin%, mapconfig.ini, %levelNo%, y
314314
imageData["levelymargin"] := levelymargin
315315
ShowMap(settings, mapHwnd1, imageData, gameMemoryData, uiData)
316-
;ShowPlayer(settings, unitHwnd1, imageData, gameMemoryData, uiData)
316+
;ShowUnits(settings, unitHwnd1, imageData, gameMemoryData, uiData)
317317
}
318318
return
319319
}
@@ -327,7 +327,7 @@ MapSizeDecrease:
327327
IniWrite, %levelymargin%, mapconfig.ini, %levelNo%, y
328328
imageData["levelymargin"] := levelymargin
329329
ShowMap(settings, mapHwnd1, imageData, gameMemoryData, uiData)
330-
;ShowPlayer(settings, unitHwnd1, imageData, gameMemoryData, uiData)
330+
;ShowUnits(settings, unitHwnd1, imageData, gameMemoryData, uiData)
331331
}
332332
return
333333
}

src/memory/readGameMemory.ahk

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#Include %A_ScriptDir%\memory\readOtherPlayers.ahk
44
#Include %A_ScriptDir%\memory\readMobs.ahk
55
#Include %A_ScriptDir%\memory\readItems.ahk
6+
#Include %A_ScriptDir%\memory\readObjects.ahk
67

78
#Include %A_ScriptDir%\include\logging.ahk
89
SetWorkingDir, %A_ScriptDir%
@@ -83,6 +84,12 @@ readGameMemory(d2rprocess, settings, playerOffset, ByRef gameMemoryData) {
8384
ReadItems(d2rprocess, startingOffset, items)
8485
}
8586

87+
; get items
88+
if (settings["showShrines"] or settings["showPortals"]) {
89+
ReadObjects(d2rprocess, startingOffset, objects)
90+
}
91+
92+
8693
; player position
8794
pPath := playerUnit + 0x38
8895
pathAddress := d2rprocess.read(pPath, "Int64")
@@ -94,7 +101,7 @@ readGameMemory(d2rprocess, settings, playerOffset, ByRef gameMemoryData) {
94101
if (!xPos) {
95102
WriteLog("Did not find player position at player offset " playerOffset)
96103
}
97-
gameMemoryData := {"gameName": gameName, "mapSeed": mapSeed, "difficulty": difficulty, "levelNo": levelNo, "xPos": xPos, "yPos": yPos, "mobs": mobs, "otherPlayers": otherPlayerData, "items": items, "playerName": playerName }
104+
gameMemoryData := {"gameName": gameName, "mapSeed": mapSeed, "difficulty": difficulty, "levelNo": levelNo, "xPos": xPos, "yPos": yPos, "mobs": mobs, "otherPlayers": otherPlayerData, "items": items, "objects": objects, "playerName": playerName }
98105
ElapsedTime := A_TickCount - StartTime
99106
;ToolTip % "`n`n`n`n" ElapsedTime
100107
}

0 commit comments

Comments
 (0)