1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-17 12:55:24 +00:00

Added an OnKeyUp method to the main menu to emulate retail behavior (#853)

any keyboard event will navigate from trademark screen to the main menu
This commit is contained in:
Zaprit 2020-10-26 19:50:38 +00:00 committed by GitHub
parent ec9c0c3d95
commit 7d5cd10850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -521,6 +521,21 @@ func (v *MainMenu) OnMouseButtonDown(event d2interface.MouseEvent) bool {
return false
}
// OnKeyUp is called when a key is released
func (v *MainMenu) OnKeyUp(event d2interface.KeyEvent) bool {
/*
On retail version of D2 any key event puts you onto the main menu, so this is a supplement to that code up there
on line 515.
*/
if v.screenMode == ScreenModeTrademark {
v.SetScreenMode(ScreenModeMainMenu)
return true
}
return false
}
// SetScreenMode sets the screen mode (which sub-menu the screen is on)
func (v *MainMenu) SetScreenMode(screenMode mainMenuScreenMode) {
v.screenMode = screenMode