Added a few OpenMenus, also HasMerc() (#60)

* wpList, LoadingScreen, GetSelectedCharacterName
Credits to gogigogi1

* Class offset updated

* TZ online

* IsCorpse Offset

* Added a few OpenMenus, also HasMerc()
PortraitsShown,BeltRows,QuestLog,MercInventory,NewStats
then  func  HasMerc()  return true if we have merc.
This commit is contained in:
elb
2024-12-20 03:50:33 -05:00
committed by GitHub
parent bfd86a6535
commit 444f4b0e9b
2 changed files with 45 additions and 27 deletions

View File

@@ -1,10 +1,11 @@
package data package data
import ( import (
"github.com/hectorgimenez/d2go/pkg/data/mode"
"math" "math"
"strings" "strings"
"github.com/hectorgimenez/d2go/pkg/data/mode"
"github.com/hectorgimenez/d2go/pkg/data/quest" "github.com/hectorgimenez/d2go/pkg/data/quest"
"github.com/hectorgimenez/d2go/pkg/data/area" "github.com/hectorgimenez/d2go/pkg/data/area"
@@ -49,6 +50,7 @@ type Data struct {
IsInCharCreationScreen bool IsInCharCreationScreen bool
IsInCharSelectionScreen bool IsInCharSelectionScreen bool
IsInLobby bool IsInLobby bool
HasMerc bool
} }
type Room struct { type Room struct {
@@ -282,12 +284,18 @@ type OpenMenus struct {
Stash bool Stash bool
Waypoint bool Waypoint bool
MapShown bool MapShown bool
NewSkills bool
NewStats bool
SkillTree bool SkillTree bool
Character bool Character bool
QuitMenu bool QuitMenu bool
Cube bool Cube bool
SkillSelect bool SkillSelect bool
Anvil bool Anvil bool
MercInventory bool
BeltRows bool
QuestLog bool
PortraitsShown bool
} }
func (om OpenMenus) IsMenuOpen() bool { func (om OpenMenus) IsMenuOpen() bool {

View File

@@ -70,6 +70,7 @@ func (gd *GameReader) GetData() data.Data {
IsInCharCreationScreen: gd.IsInCharacterCreationScreen(), IsInCharCreationScreen: gd.IsInCharacterCreationScreen(),
IsInLobby: gd.IsInLobby(), IsInLobby: gd.IsInLobby(),
IsInCharSelectionScreen: gd.IsInCharacterSelectionScreen(), IsInCharSelectionScreen: gd.IsInCharacterSelectionScreen(),
HasMerc: gd.HasMerc(),
} }
return d return d
@@ -97,11 +98,17 @@ func (gd *GameReader) openMenus() data.OpenMenus {
Waypoint: buffer[0x13] != 0, Waypoint: buffer[0x13] != 0,
MapShown: isMapShown != 0, MapShown: isMapShown != 0,
SkillTree: buffer[0x04] != 0, SkillTree: buffer[0x04] != 0,
NewSkills: buffer[0x07] != 0,
NewStats: buffer[0x06] != 0,
Character: buffer[0x02] != 0, Character: buffer[0x02] != 0,
QuitMenu: buffer[0x09] != 0, QuitMenu: buffer[0x09] != 0,
Cube: buffer[0x19] != 0, Cube: buffer[0x19] != 0,
SkillSelect: buffer[0x03] != 0, SkillSelect: buffer[0x03] != 0,
Anvil: buffer[0x0D] != 0, Anvil: buffer[0x0D] != 0,
MercInventory: buffer[0x1E] != 0,
BeltRows: buffer[0x1A] != 0,
QuestLog: buffer[0xE] != 0,
PortraitsShown: buffer[0x1D] != 0,
} }
} }
@@ -257,6 +264,9 @@ func (gd *GameReader) FPS() int {
return int(gd.ReadUInt(gd.moduleBaseAddressPtr+0x2140DF4, 4)) return int(gd.ReadUInt(gd.moduleBaseAddressPtr+0x2140DF4, 4))
} }
func (gd *GameReader) HasMerc() bool {
return gd.ReadUInt(gd.moduleBaseAddressPtr+0x22e51d0+0x12, Uint8) != 0
}
func (gd *GameReader) UpdateWidgets() map[string]map[string]interface{} { func (gd *GameReader) UpdateWidgets() map[string]map[string]interface{} {
widgets := map[string]map[string]interface{}{} widgets := map[string]map[string]interface{}{}