Browse Source

Consistently trigger menu/movie transitions on mouse up instead of down

Keypresses still occur on keydown to allow for repetition (e.g. when scrolling)
pull/3859/head
ephphatha 4 years ago committed by Anders Jenbo
parent
commit
1abc617e1a
  1. 2
      Source/DiabloUI/credits.cpp
  2. 2
      Source/DiabloUI/diabloui.cpp
  3. 2
      Source/DiabloUI/title.cpp
  4. 4
      Source/movie.cpp

2
Source/DiabloUI/credits.cpp

@ -142,7 +142,7 @@ bool TextDialog(char const *const *text, std::size_t textLines)
while (PollEvent(&event) != 0) {
switch (event.type) {
case SDL_KEYDOWN:
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
endMenu = true;
break;
default:

2
Source/DiabloUI/diabloui.cpp

@ -907,7 +907,7 @@ void RenderItem(UiItemBase *item)
bool HandleMouseEventArtTextButton(const SDL_Event &event, const UiArtTextButton *uiButton)
{
if (event.type != SDL_MOUSEBUTTONDOWN || event.button.button != SDL_BUTTON_LEFT) {
if (event.type != SDL_MOUSEBUTTONUP || event.button.button != SDL_BUTTON_LEFT) {
return false;
}

2
Source/DiabloUI/title.cpp

@ -64,7 +64,7 @@ void UiTitleDialog()
}
switch (event.type) {
case SDL_KEYDOWN:
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
endMenu = true;
break;
}

4
Source/movie.cpp

@ -40,8 +40,8 @@ void play_movie(const char *pszMovie, bool userCanClose)
while (movie_playing && FetchMessage(&msg)) {
switch (msg.message) {
case DVL_WM_KEYDOWN:
case DVL_WM_LBUTTONDOWN:
case DVL_WM_RBUTTONDOWN:
case DVL_WM_LBUTTONUP:
case DVL_WM_RBUTTONUP:
if (userCanClose || (msg.message == DVL_WM_KEYDOWN && msg.wParam == DVL_VK_ESCAPE))
movie_playing = false;
break;

Loading…
Cancel
Save