When in the main menu the intro video should replay if the player doesn't interact with the keyboard or mouse for 30 sec.
I added this in my rewrite by using a single flag. In the message loop add this code:
switch(uMsg) {
case WM_KEYDOWN:
case WM_KEYUP:
case WM_CHAR:
case WM_SYSKEYDOWN:
case WM_SYSCOMMAND:
case WM_MOUSEMOVE:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
gbHasPressed = TRUE;
break;
}
Then in the main loop just reset the timer if the flag is set, or break out of the loop if the tick count is greater:
if(gbHasPressed) {
gbHasPressed = FALSE;
dwTicks = GetTickCount() + introtimer * 1000;
} else if(GetTickCount() >= dwTicks) {
gbRunGame = FALSE;
}
I'd like to take a shot at it.
Galaxyhaxz already presented a solution, but I have a few questions:
gbHasPressed = TRUE on the existing _switch_ in DisableInputWmdProc?PS: Thank you both for bringing this game back. Never thought I'd be able to play it on Linux without Wine.
Note Galaxyhaxz's rewrite isn't public yet so things are a little bit different in DevilutionX, it could probably be implemented here:
https://github.com/diasurgical/devilutionX/blob/master/SourceX/DiabloUI/diabloui.cpp#L213
I don't belive DisableInputWmdProc would be triggered when the user is in the mainmenu.
Yes, create a fork and PR is the right way to go.
I have submitted the PR, took a while to understand the flow but it's complete, tested in 64bit Linux.
Several types of input are accounted for and I resolved a minor issue with the palette.
One thing I was left wondering was if I used the appropriate naming style since the INT is in snake_case and the DWORD is in camelCase.
snake_case is used in Devilution for guessed names, since the original used camelCase, but not all original names are known.