Browse Source

Implement keyboard navigation

pull/17/head
Anders Jenbo 7 years ago
parent
commit
4a6009646c
  1. 13
      Stub/init.cpp

13
Stub/init.cpp

@ -20,6 +20,7 @@ bool StartNewGame;
bool CreateSinglePlayerChar;
int HeroChosen = 0;
int menu = 0;
int SelectedItem = 0;
/**
* Case insensitive search for a file name in a directory.
@ -148,7 +149,9 @@ void SetMenu(int MenuId)
pPcxTitleImage = NULL;
mem_free_dbg(tmp);
TitleImageLoaded = false;
menu = MenuId;
SelectedItem = 0;
}
void ExitDiablo()
@ -176,8 +179,6 @@ void SDL_Diablo_UI() // I anticipate to move this later.
int CharsLoaded = 0;
int HeroPortrait = 3;
int Selection[4];
printf("Main Menu Init\n");
// SDL_ShowCursor(SDL_DISABLE);//Doesn't really work... Use HideCursor() instead.
if (!window) {
@ -262,6 +263,14 @@ void SDL_Diablo_UI() // I anticipate to move this later.
}
break;
case SDLK_UP:
SelectedItem--;
break;
case SDLK_DOWN:
SelectedItem++;
break;
case SDLK_RETURN:
default:

Loading…
Cancel
Save