Refactor Checks (#39)
- Refactor IsInLobby - Refactor IsInCharacterCreationScreen - Refactor IsInCharacterSelectionScreen
This commit is contained in:
@@ -66,8 +66,8 @@ func (gd *GameReader) GetData() data.Data {
|
|||||||
IsOnline: gd.IsOnline(),
|
IsOnline: gd.IsOnline(),
|
||||||
IsIngame: gd.IsIngame(),
|
IsIngame: gd.IsIngame(),
|
||||||
IsInCharCreationScreen: gd.IsInCharacterCreationScreen(),
|
IsInCharCreationScreen: gd.IsInCharacterCreationScreen(),
|
||||||
//IsInLobby: gd.IsInLobby(),
|
IsInLobby: gd.IsInLobby(),
|
||||||
//IsInCharSelectionScreen: gd.IsInCharacterSelectionScreen(),
|
IsInCharSelectionScreen: gd.IsInCharacterSelectionScreen(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return d
|
return d
|
||||||
@@ -215,27 +215,40 @@ func (gd *GameReader) IsIngame() bool {
|
|||||||
return gd.ReadUInt(gd.moduleBaseAddressPtr+0x22D5D78, 1) == 1
|
return gd.ReadUInt(gd.moduleBaseAddressPtr+0x22D5D78, 1) == 1
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func (gd *GameReader) IsInLobby() bool {
|
func (gd *GameReader) IsInLobby() bool {
|
||||||
return gd.ReadUInt(gd.moduleBaseAddressPtr+0x21CF488, 1) == 1
|
widgets := gd.UpdateWidgets()
|
||||||
|
if lobbyWidget, found := widgets["LobbyBackgroundPanel"]; found {
|
||||||
|
return lobbyWidget["WidgetActive"].(bool) && lobbyWidget["WidgetVisible"].(bool)
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gd *GameReader) IsInCharacterSelectionScreen() bool {
|
func (gd *GameReader) IsInCharacterSelectionScreen() bool {
|
||||||
return gd.ReadUInt(gd.moduleBaseAddressPtr+0x1DC7276, 1) != 0
|
widgets := gd.UpdateWidgets()
|
||||||
|
if csWidget, found := widgets["CharacterSelectPanel"]; found {
|
||||||
|
return csWidget["WidgetActive"].(bool) && csWidget["WidgetVisible"].(bool)
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
func (gd *GameReader) IsInCharacterCreationScreen() bool {
|
func (gd *GameReader) IsInCharacterCreationScreen() bool {
|
||||||
// Dont use this ;)
|
widgets := gd.UpdateWidgets()
|
||||||
// This will bug out if you switch to legacy graphics in the character select screen and return 1 until you go back to character screen with d2r graphics
|
if ccWidget, found := widgets["CharacterCreatePanel"]; found {
|
||||||
return gd.ReadUInt(gd.moduleBaseAddressPtr+0x234A1CE, 1) == 1
|
return ccWidget["WidgetActive"].(bool) && ccWidget["WidgetVisible"].(bool)
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gd *GameReader) LastGameName() string {
|
func (gd *GameReader) LastGameName() string {
|
||||||
|
// outdated
|
||||||
return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+0x29DBD10+0x8, 0)
|
return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+0x29DBD10+0x8, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gd *GameReader) LastGamePass() string {
|
func (gd *GameReader) LastGamePass() string {
|
||||||
|
// outdated
|
||||||
return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+0x29DBD10+0x60, 0)
|
return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+0x29DBD10+0x60, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user