mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-10-01 15:46:17 -04: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:
parent
ec9c0c3d95
commit
7d5cd10850
@ -521,6 +521,21 @@ func (v *MainMenu) OnMouseButtonDown(event d2interface.MouseEvent) bool {
|
|||||||
return false
|
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)
|
// SetScreenMode sets the screen mode (which sub-menu the screen is on)
|
||||||
func (v *MainMenu) SetScreenMode(screenMode mainMenuScreenMode) {
|
func (v *MainMenu) SetScreenMode(screenMode mainMenuScreenMode) {
|
||||||
v.screenMode = screenMode
|
v.screenMode = screenMode
|
||||||
|
Loading…
Reference in New Issue
Block a user