let's use byte instead of uint8

This commit is contained in:
Héctor Giménez
2024-04-19 21:17:30 +09:00
parent 4ec129fa3b
commit 75bd4bcc6a
2 changed files with 86 additions and 86 deletions

View File

@@ -51,6 +51,6 @@ type KeyBindings struct {
} }
type KeyBinding struct { type KeyBinding struct {
Key1 [2]uint8 Key1 [2]byte
Key2 [2]uint8 Key2 [2]byte
} }

View File

@@ -10,183 +10,183 @@ func (gd *GameReader) GetKeyBindings() data.KeyBindings {
skills := [16]data.KeyBinding{} skills := [16]data.KeyBinding{}
for i := 0; i < 7; i++ { for i := 0; i < 7; i++ {
skills[i] = data.KeyBinding{ skills[i] = data.KeyBinding{
Key1: [2]uint8{blob[0x118+(i*0x14)], blob[0x119+(i*0x14)]}, Key1: [2]byte{blob[0x118+(i*0x14)], blob[0x119+(i*0x14)]},
Key2: [2]uint8{blob[0x122+(i*0x14)], blob[0x123+(i*0x14)]}, Key2: [2]byte{blob[0x122+(i*0x14)], blob[0x123+(i*0x14)]},
} }
} }
for i := 0; i < 9; i++ { for i := 0; i < 9; i++ {
skills[i+7] = data.KeyBinding{ skills[i+7] = data.KeyBinding{
Key1: [2]uint8{blob[0x384+(i*0x14)], blob[0x385+(i*0x14)]}, Key1: [2]byte{blob[0x384+(i*0x14)], blob[0x385+(i*0x14)]},
Key2: [2]uint8{blob[0x38e+(i*0x14)], blob[0x38f+(i*0x14)]}, Key2: [2]byte{blob[0x38e+(i*0x14)], blob[0x38f+(i*0x14)]},
} }
} }
belt := [4]data.KeyBinding{} belt := [4]data.KeyBinding{}
for i := 0; i < 4; i++ { for i := 0; i < 4; i++ {
belt[i] = data.KeyBinding{ belt[i] = data.KeyBinding{
Key1: [2]uint8{blob[0x1b8+(i*0x14)], blob[0x1b9+(i*0x14)]}, Key1: [2]byte{blob[0x1b8+(i*0x14)], blob[0x1b9+(i*0x14)]},
Key2: [2]uint8{blob[0x1c2+(i*0x14)], blob[0x1c3+(i*0x14)]}, Key2: [2]byte{blob[0x1c2+(i*0x14)], blob[0x1c3+(i*0x14)]},
} }
} }
return data.KeyBindings{ return data.KeyBindings{
CharacterScreen: data.KeyBinding{ CharacterScreen: data.KeyBinding{
Key1: [2]uint8{blob[0x00], blob[0x01]}, Key1: [2]byte{blob[0x00], blob[0x01]},
Key2: [2]uint8{blob[0xa], blob[0xb]}, Key2: [2]byte{blob[0xa], blob[0xb]},
}, },
Inventory: data.KeyBinding{ Inventory: data.KeyBinding{
Key1: [2]uint8{blob[0x14], blob[0x15]}, Key1: [2]byte{blob[0x14], blob[0x15]},
Key2: [2]uint8{blob[0x1e], blob[0x1f]}, Key2: [2]byte{blob[0x1e], blob[0x1f]},
}, },
HoradricCube: data.KeyBinding{ HoradricCube: data.KeyBinding{
Key1: [2]uint8{blob[0x4b0], blob[0x4b1]}, Key1: [2]byte{blob[0x4b0], blob[0x4b1]},
Key2: [2]uint8{blob[0x4ba], blob[0x4bb]}, Key2: [2]byte{blob[0x4ba], blob[0x4bb]},
}, },
PartyScreen: data.KeyBinding{ PartyScreen: data.KeyBinding{
Key1: [2]uint8{blob[0x28], blob[0x29]}, Key1: [2]byte{blob[0x28], blob[0x29]},
Key2: [2]uint8{blob[0x32], blob[0x33]}, Key2: [2]byte{blob[0x32], blob[0x33]},
}, },
MercenaryScreen: data.KeyBinding{ MercenaryScreen: data.KeyBinding{
Key1: [2]uint8{blob[0x438], blob[0x439]}, Key1: [2]byte{blob[0x438], blob[0x439]},
Key2: [2]uint8{blob[0x442], blob[0x443]}, Key2: [2]byte{blob[0x442], blob[0x443]},
}, },
MessageLog: data.KeyBinding{ MessageLog: data.KeyBinding{
Key1: [2]uint8{blob[0x3c], blob[0x3d]}, Key1: [2]byte{blob[0x3c], blob[0x3d]},
Key2: [2]uint8{blob[0x46], blob[0x47]}, Key2: [2]byte{blob[0x46], blob[0x47]},
}, },
QuestLog: data.KeyBinding{ QuestLog: data.KeyBinding{
Key1: [2]uint8{blob[0x50], blob[0x51]}, Key1: [2]byte{blob[0x50], blob[0x51]},
Key2: [2]uint8{blob[0x5a], blob[0x5b]}, Key2: [2]byte{blob[0x5a], blob[0x5b]},
}, },
HelpScreen: data.KeyBinding{ HelpScreen: data.KeyBinding{
Key1: [2]uint8{blob[0x78], blob[0x79]}, Key1: [2]byte{blob[0x78], blob[0x79]},
Key2: [2]uint8{blob[0x82], blob[0x83]}, Key2: [2]byte{blob[0x82], blob[0x83]},
}, },
SkillTree: data.KeyBinding{ SkillTree: data.KeyBinding{
Key1: [2]uint8{blob[0xf0], blob[0xf1]}, Key1: [2]byte{blob[0xf0], blob[0xf1]},
Key2: [2]uint8{blob[0xfa], blob[0xfb]}, Key2: [2]byte{blob[0xfa], blob[0xfb]},
}, },
SkillSpeedBar: data.KeyBinding{ SkillSpeedBar: data.KeyBinding{
Key1: [2]uint8{blob[0x104], blob[0x105]}, Key1: [2]byte{blob[0x104], blob[0x105]},
Key2: [2]uint8{blob[0x10e], blob[0x10f]}, Key2: [2]byte{blob[0x10e], blob[0x10f]},
}, },
Skills: skills, Skills: skills,
SelectPreviousSkill: data.KeyBinding{ SelectPreviousSkill: data.KeyBinding{
Key1: [2]uint8{blob[0x2f8], blob[0x2f9]}, Key1: [2]byte{blob[0x2f8], blob[0x2f9]},
Key2: [2]uint8{blob[0x302], blob[0x303]}, Key2: [2]byte{blob[0x302], blob[0x303]},
}, },
SelectNextSkill: data.KeyBinding{ SelectNextSkill: data.KeyBinding{
Key1: [2]uint8{blob[0x30c], blob[0x30d]}, Key1: [2]byte{blob[0x30c], blob[0x30d]},
Key2: [2]uint8{blob[0x316], blob[0x317]}, Key2: [2]byte{blob[0x316], blob[0x317]},
}, },
ShowBelt: data.KeyBinding{ ShowBelt: data.KeyBinding{
Key1: [2]uint8{blob[0x1a4], blob[0x1a5]}, Key1: [2]byte{blob[0x1a4], blob[0x1a5]},
Key2: [2]uint8{blob[0x1ae], blob[0x1af]}, Key2: [2]byte{blob[0x1ae], blob[0x1af]},
}, },
UseBelt: belt, UseBelt: belt,
SwapWeapons: data.KeyBinding{ SwapWeapons: data.KeyBinding{
Key1: [2]uint8{blob[0x35c], blob[0x35d]}, Key1: [2]byte{blob[0x35c], blob[0x35d]},
Key2: [2]uint8{blob[0x366], blob[0x367]}, Key2: [2]byte{blob[0x366], blob[0x367]},
}, },
Chat: data.KeyBinding{ Chat: data.KeyBinding{
Key1: [2]uint8{blob[0x64], blob[0x65]}, Key1: [2]byte{blob[0x64], blob[0x65]},
Key2: [2]uint8{blob[0x6e], blob[0x6f]}, Key2: [2]byte{blob[0x6e], blob[0x6f]},
}, },
Run: data.KeyBinding{ Run: data.KeyBinding{
Key1: [2]uint8{blob[0x294], blob[0x295]}, Key1: [2]byte{blob[0x294], blob[0x295]},
Key2: [2]uint8{blob[0x29e], blob[0x29f]}, Key2: [2]byte{blob[0x29e], blob[0x29f]},
}, },
ToggleRunWalk: data.KeyBinding{ ToggleRunWalk: data.KeyBinding{
Key1: [2]uint8{blob[0x2a8], blob[0x2a9]}, Key1: [2]byte{blob[0x2a8], blob[0x2a9]},
Key2: [2]uint8{blob[0x2b2], blob[0x2b3]}, Key2: [2]byte{blob[0x2b2], blob[0x2b3]},
}, },
StandStill: data.KeyBinding{ StandStill: data.KeyBinding{
Key1: [2]uint8{blob[0x2bc], blob[0x2bd]}, Key1: [2]byte{blob[0x2bc], blob[0x2bd]},
Key2: [2]uint8{blob[0x2c6], blob[0x2c7]}, Key2: [2]byte{blob[0x2c6], blob[0x2c7]},
}, },
ForceMove: data.KeyBinding{ ForceMove: data.KeyBinding{
Key1: [2]uint8{blob[0x49c], blob[0x49d]}, Key1: [2]byte{blob[0x49c], blob[0x49d]},
Key2: [2]uint8{blob[0x4a6], blob[0x4a7]}, Key2: [2]byte{blob[0x4a6], blob[0x4a7]},
}, },
ShowItems: data.KeyBinding{ ShowItems: data.KeyBinding{
Key1: [2]uint8{blob[0x2d0], blob[0x2d1]}, Key1: [2]byte{blob[0x2d0], blob[0x2d1]},
Key2: [2]uint8{blob[0x2da], blob[0x2db]}, Key2: [2]byte{blob[0x2da], blob[0x2db]},
}, },
ShowPortraits: data.KeyBinding{ ShowPortraits: data.KeyBinding{
Key1: [2]uint8{blob[0x348], blob[0x349]}, Key1: [2]byte{blob[0x348], blob[0x349]},
Key2: [2]uint8{blob[0x352], blob[0x353]}, Key2: [2]byte{blob[0x352], blob[0x353]},
}, },
Automap: data.KeyBinding{ Automap: data.KeyBinding{
Key1: [2]uint8{blob[0x8c], blob[0x8d]}, Key1: [2]byte{blob[0x8c], blob[0x8d]},
Key2: [2]uint8{blob[0x96], blob[0x97]}, Key2: [2]byte{blob[0x96], blob[0x97]},
}, },
CenterAutomap: data.KeyBinding{ CenterAutomap: data.KeyBinding{
Key1: [2]uint8{blob[0xa0], blob[0xa1]}, Key1: [2]byte{blob[0xa0], blob[0xa1]},
Key2: [2]uint8{blob[0xaa], blob[0xab]}, Key2: [2]byte{blob[0xaa], blob[0xab]},
}, },
FadeAutomap: data.KeyBinding{ FadeAutomap: data.KeyBinding{
Key1: [2]uint8{blob[0xb4], blob[0xb5]}, Key1: [2]byte{blob[0xb4], blob[0xb5]},
Key2: [2]uint8{blob[0xbe], blob[0xbf]}, Key2: [2]byte{blob[0xbe], blob[0xbf]},
}, },
PartyOnAutomap: data.KeyBinding{ PartyOnAutomap: data.KeyBinding{
Key1: [2]uint8{blob[0xc8], blob[0xc9]}, Key1: [2]byte{blob[0xc8], blob[0xc9]},
Key2: [2]uint8{blob[0xd2], blob[0xd3]}, Key2: [2]byte{blob[0xd2], blob[0xd3]},
}, },
NamesOnAutomap: data.KeyBinding{ NamesOnAutomap: data.KeyBinding{
Key1: [2]uint8{blob[0xdc], blob[0xdd]}, Key1: [2]byte{blob[0xdc], blob[0xdd]},
Key2: [2]uint8{blob[0xe6], blob[0xe7]}, Key2: [2]byte{blob[0xe6], blob[0xe7]},
}, },
ToggleMiniMap: data.KeyBinding{ ToggleMiniMap: data.KeyBinding{
Key1: [2]uint8{blob[0x370], blob[0x371]}, Key1: [2]byte{blob[0x370], blob[0x371]},
Key2: [2]uint8{blob[0x37a], blob[0x37b]}, Key2: [2]byte{blob[0x37a], blob[0x37b]},
}, },
SayHelp: data.KeyBinding{ SayHelp: data.KeyBinding{
Key1: [2]uint8{blob[0x208], blob[0x209]}, Key1: [2]byte{blob[0x208], blob[0x209]},
Key2: [2]uint8{blob[0x212], blob[0x213]}, Key2: [2]byte{blob[0x212], blob[0x213]},
}, },
SayFollowMe: data.KeyBinding{ SayFollowMe: data.KeyBinding{
Key1: [2]uint8{blob[0x21c], blob[0x21d]}, Key1: [2]byte{blob[0x21c], blob[0x21d]},
Key2: [2]uint8{blob[0x226], blob[0x227]}, Key2: [2]byte{blob[0x226], blob[0x227]},
}, },
SayThisIsForYou: data.KeyBinding{ SayThisIsForYou: data.KeyBinding{
Key1: [2]uint8{blob[0x230], blob[0x231]}, Key1: [2]byte{blob[0x230], blob[0x231]},
Key2: [2]uint8{blob[0x23a], blob[0x23b]}, Key2: [2]byte{blob[0x23a], blob[0x23b]},
}, },
SayThanks: data.KeyBinding{ SayThanks: data.KeyBinding{
Key1: [2]uint8{blob[0x244], blob[0x245]}, Key1: [2]byte{blob[0x244], blob[0x245]},
Key2: [2]uint8{blob[0x24e], blob[0x24f]}, Key2: [2]byte{blob[0x24e], blob[0x24f]},
}, },
SaySorry: data.KeyBinding{ SaySorry: data.KeyBinding{
Key1: [2]uint8{blob[0x258], blob[0x259]}, Key1: [2]byte{blob[0x258], blob[0x259]},
Key2: [2]uint8{blob[0x262], blob[0x263]}, Key2: [2]byte{blob[0x262], blob[0x263]},
}, },
SayBye: data.KeyBinding{ SayBye: data.KeyBinding{
Key1: [2]uint8{blob[0x26c], blob[0x26d]}, Key1: [2]byte{blob[0x26c], blob[0x26d]},
Key2: [2]uint8{blob[0x276], blob[0x277]}, Key2: [2]byte{blob[0x276], blob[0x277]},
}, },
SayNowYouDie: data.KeyBinding{ SayNowYouDie: data.KeyBinding{
Key1: [2]uint8{blob[0x280], blob[0x281]}, Key1: [2]byte{blob[0x280], blob[0x281]},
Key2: [2]uint8{blob[0x28a], blob[0x28b]}, Key2: [2]byte{blob[0x28a], blob[0x28b]},
}, },
SayRetreat: data.KeyBinding{ SayRetreat: data.KeyBinding{
Key1: [2]uint8{blob[0x44c], blob[0x44d]}, Key1: [2]byte{blob[0x44c], blob[0x44d]},
Key2: [2]uint8{blob[0x456], blob[0x457]}, Key2: [2]byte{blob[0x456], blob[0x457]},
}, },
ClearScreen: data.KeyBinding{ ClearScreen: data.KeyBinding{
Key1: [2]uint8{blob[0x2e4], blob[0x2e5]}, Key1: [2]byte{blob[0x2e4], blob[0x2e5]},
Key2: [2]uint8{blob[0x2ee], blob[0x2ef]}, Key2: [2]byte{blob[0x2ee], blob[0x2ef]},
}, },
ClearMessages: data.KeyBinding{ ClearMessages: data.KeyBinding{
Key1: [2]uint8{blob[0x320], blob[0x321]}, Key1: [2]byte{blob[0x320], blob[0x321]},
Key2: [2]uint8{blob[0x32a], blob[0x32b]}, Key2: [2]byte{blob[0x32a], blob[0x32b]},
}, },
Zoom: data.KeyBinding{ Zoom: data.KeyBinding{
Key1: [2]uint8{blob[0x474], blob[0x475]}, Key1: [2]byte{blob[0x474], blob[0x475]},
Key2: [2]uint8{blob[0x47e], blob[0x47f]}, Key2: [2]byte{blob[0x47e], blob[0x47f]},
}, },
LegacyToggle: data.KeyBinding{ LegacyToggle: data.KeyBinding{
Key1: [2]uint8{blob[0x488], blob[0x489]}, Key1: [2]byte{blob[0x488], blob[0x489]},
Key2: [2]uint8{blob[0x492], blob[0x493]}, Key2: [2]byte{blob[0x492], blob[0x493]},
}, },
} }
} }