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:
@@ -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 {
|
||||||
@@ -275,19 +277,25 @@ type PointOfInterest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OpenMenus struct {
|
type OpenMenus struct {
|
||||||
Inventory bool
|
Inventory bool
|
||||||
LoadingScreen bool
|
LoadingScreen bool
|
||||||
NPCInteract bool
|
NPCInteract bool
|
||||||
NPCShop bool
|
NPCShop bool
|
||||||
Stash bool
|
Stash bool
|
||||||
Waypoint bool
|
Waypoint bool
|
||||||
MapShown bool
|
MapShown bool
|
||||||
SkillTree bool
|
NewSkills bool
|
||||||
Character bool
|
NewStats bool
|
||||||
QuitMenu bool
|
SkillTree bool
|
||||||
Cube bool
|
Character bool
|
||||||
SkillSelect bool
|
QuitMenu bool
|
||||||
Anvil bool
|
Cube bool
|
||||||
|
SkillSelect bool
|
||||||
|
Anvil bool
|
||||||
|
MercInventory bool
|
||||||
|
BeltRows bool
|
||||||
|
QuestLog bool
|
||||||
|
PortraitsShown bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (om OpenMenus) IsMenuOpen() bool {
|
func (om OpenMenus) IsMenuOpen() bool {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -89,19 +90,25 @@ func (gd *GameReader) openMenus() data.OpenMenus {
|
|||||||
isMapShown := gd.Process.ReadUInt(gd.Process.moduleBaseAddressPtr+gd.offset.UI, Uint8)
|
isMapShown := gd.Process.ReadUInt(gd.Process.moduleBaseAddressPtr+gd.offset.UI, Uint8)
|
||||||
|
|
||||||
return data.OpenMenus{
|
return data.OpenMenus{
|
||||||
Inventory: buffer[0x01] != 0,
|
Inventory: buffer[0x01] != 0,
|
||||||
LoadingScreen: buffer[0x168] != 0,
|
LoadingScreen: buffer[0x168] != 0,
|
||||||
NPCInteract: buffer[0x08] != 0,
|
NPCInteract: buffer[0x08] != 0,
|
||||||
NPCShop: buffer[0x0B] != 0,
|
NPCShop: buffer[0x0B] != 0,
|
||||||
Stash: buffer[0x18] != 0,
|
Stash: buffer[0x18] != 0,
|
||||||
Waypoint: buffer[0x13] != 0,
|
Waypoint: buffer[0x13] != 0,
|
||||||
MapShown: isMapShown != 0,
|
MapShown: isMapShown != 0,
|
||||||
SkillTree: buffer[0x04] != 0,
|
SkillTree: buffer[0x04] != 0,
|
||||||
Character: buffer[0x02] != 0,
|
NewSkills: buffer[0x07] != 0,
|
||||||
QuitMenu: buffer[0x09] != 0,
|
NewStats: buffer[0x06] != 0,
|
||||||
Cube: buffer[0x19] != 0,
|
Character: buffer[0x02] != 0,
|
||||||
SkillSelect: buffer[0x03] != 0,
|
QuitMenu: buffer[0x09] != 0,
|
||||||
Anvil: buffer[0x0D] != 0,
|
Cube: buffer[0x19] != 0,
|
||||||
|
SkillSelect: buffer[0x03] != 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{}{}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user