Pop up "no mouse support" screen if main menu is clicked, from Nick and McM
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1724 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
Changes towards version 0.4:
|
Changes towards version 0.4:
|
||||||
|
- Attempting to click the screen pops up an error message, from
|
||||||
|
Nic, heavily modified (dodge on #533) -Michael
|
||||||
- Fixed potential crash with a truecolor oscilloscope image (thanks
|
- Fixed potential crash with a truecolor oscilloscope image (thanks
|
||||||
jdorje) and made it generally more flexible (bug #729) -Alex
|
jdorje) and made it generally more flexible (bug #729) -Alex
|
||||||
- Added missing Tanaka battle portrait images (new artwork; oldcap) and
|
- Added missing Tanaka battle portrait images (new artwork; oldcap) and
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
uqm_SUBDIRS="comm libs planets ships"
|
uqm_SUBDIRS="comm libs planets ships"
|
||||||
uqm_CFILES="battle.c border.c build.c cleanup.c clock.c collide.c comm.c
|
uqm_CFILES="battle.c border.c build.c cleanup.c clock.c collide.c comm.c
|
||||||
commglue.c confirm.c credits.c cyborg.c demo.c displist.c dummy.c
|
commglue.c confirm.c credits.c cyborg.c demo.c displist.c
|
||||||
encount.c fmv.c galaxy.c gameev.c gameinp.c gameopt.c gendef.c
|
dummy.c encount.c fmv.c galaxy.c gameev.c gameinp.c gameopt.c
|
||||||
getchar.c globdata.c gravity.c gravwell.c grpinfo.c hyper.c init.c
|
gendef.c getchar.c globdata.c gravity.c gravwell.c grpinfo.c
|
||||||
intel.c intro.c ipdisp.c load.c loadship.c master.c melee.c menu.c
|
hyper.c init.c intel.c intro.c ipdisp.c load.c loadship.c
|
||||||
misc.c oscill.c outfit.c pickmele.c pickship.c plandata.c process.c
|
master.c melee.c menu.c misc.c mouse_err.c oscill.c outfit.c
|
||||||
restart.c save.c settings.c setup.c setupmenu.c ship.c shipstat.c
|
pickmele.c pickship.c plandata.c process.c restart.c save.c
|
||||||
shipyard.c sis.c sounds.c starbase.c starcon.c starmap.c state.c
|
settings.c setup.c setupmenu.c ship.c shipstat.c shipyard.c
|
||||||
status.c tactrans.c trans.c uqmdebug.c util.c velocity.c weapon.c"
|
sis.c sounds.c starbase.c starcon.c starmap.c state.c status.c
|
||||||
|
tactrans.c trans.c uqmdebug.c util.c velocity.c weapon.c"
|
||||||
|
|
||||||
if [ "$DEBUG" = 1 ]; then
|
if [ "$DEBUG" = 1 ]; then
|
||||||
uqm_CFILES="$uqm_CFILES uqmdebug.c"
|
uqm_CFILES="$uqm_CFILES uqmdebug.c"
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ extern void MoveMouse (SWORD x, SWORD y);
|
|||||||
extern BYTE LocateMouse (PSWORD px, PSWORD py);
|
extern BYTE LocateMouse (PSWORD px, PSWORD py);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
extern volatile int MouseButtonDown;
|
||||||
|
|
||||||
/* Functions for dealing with Character Mode */
|
/* Functions for dealing with Character Mode */
|
||||||
|
|
||||||
void EnableCharacterMode (void);
|
void EnableCharacterMode (void);
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ ProcessInputEvent(const SDL_Event *Event)
|
|||||||
{
|
{
|
||||||
if (!InputInitialized)
|
if (!InputInitialized)
|
||||||
return;
|
return;
|
||||||
|
ProcessMouseEvent (Event);
|
||||||
if (!_in_character_mode)
|
if (!_in_character_mode)
|
||||||
{
|
{
|
||||||
VControl_HandleEvent (Event);
|
VControl_HandleEvent (Event);
|
||||||
@@ -263,6 +264,25 @@ ProcessInputEvent(const SDL_Event *Event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
volatile int MouseButtonDown = 0;
|
||||||
|
|
||||||
|
void
|
||||||
|
ProcessMouseEvent (SDL_Event *e)
|
||||||
|
{
|
||||||
|
switch (e->type)
|
||||||
|
{
|
||||||
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
|
MouseButtonDown = 1;
|
||||||
|
break;
|
||||||
|
case SDL_MOUSEBUTTONUP:
|
||||||
|
MouseButtonDown = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TFB_ResetControls (void)
|
TFB_ResetControls (void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
#include "libs/inplib.h"
|
#include "libs/inplib.h"
|
||||||
|
|
||||||
|
|
||||||
//Added by Chris
|
//Added by Chris
|
||||||
|
|
||||||
void FreeHyperData (void);
|
void FreeHyperData (void);
|
||||||
@@ -121,6 +120,7 @@ DWORD InTime;
|
|||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
DoRestart (PMENU_STATE pMS)
|
DoRestart (PMENU_STATE pMS)
|
||||||
{
|
{
|
||||||
|
extern void MouseError (void);
|
||||||
static DWORD InactTimeOut;
|
static DWORD InactTimeOut;
|
||||||
|
|
||||||
/* Cancel any presses of the Pause key. */
|
/* Cancel any presses of the Pause key. */
|
||||||
@@ -161,7 +161,7 @@ else if (InputState & DEVICE_EXIT) return (FALSE);
|
|||||||
}
|
}
|
||||||
else if (!(PulsedInputState.key[KEY_MENU_UP] || PulsedInputState.key[KEY_MENU_DOWN] ||
|
else if (!(PulsedInputState.key[KEY_MENU_UP] || PulsedInputState.key[KEY_MENU_DOWN] ||
|
||||||
PulsedInputState.key[KEY_MENU_LEFT] || PulsedInputState.key[KEY_MENU_RIGHT] ||
|
PulsedInputState.key[KEY_MENU_LEFT] || PulsedInputState.key[KEY_MENU_RIGHT] ||
|
||||||
PulsedInputState.key[KEY_MENU_SELECT]))
|
PulsedInputState.key[KEY_MENU_SELECT] || MouseButtonDown))
|
||||||
|
|
||||||
{
|
{
|
||||||
if (GetTimeCounter () - InTime < InactTimeOut)
|
if (GetTimeCounter () - InTime < InactTimeOut)
|
||||||
@@ -245,6 +245,23 @@ else if (InputState & DEVICE_EXIT) return (FALSE);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MouseButtonDown)
|
||||||
|
{
|
||||||
|
LockMutex (GraphicsLock);
|
||||||
|
SetFlashRect (NULL_PTR, (FRAME)0);
|
||||||
|
UnlockMutex (GraphicsLock);
|
||||||
|
MouseError ();
|
||||||
|
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT);
|
||||||
|
InTime = GetTimeCounter ();
|
||||||
|
SetTransitionSource (NULL);
|
||||||
|
BatchGraphics ();
|
||||||
|
DrawRestartMenuGraphic (pMS);
|
||||||
|
DrawRestartMenu ((BYTE)~0, pMS->CurState, pMS->CurFrame);
|
||||||
|
ScreenTransition (3, NULL);
|
||||||
|
UnbatchGraphics ();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
InTime = GetTimeCounter ();
|
InTime = GetTimeCounter ();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
@@ -346,7 +363,7 @@ LastActivity = WON_LAST_BATTLE;
|
|||||||
SetFlashRect ((PRECT)0, (FRAME)0);
|
SetFlashRect ((PRECT)0, (FRAME)0);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
DestroyDrawable (ReleaseDrawable (MenuState.CurFrame));
|
DestroyDrawable (ReleaseDrawable (MenuState.CurFrame));
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
|
if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
|
||||||
goto TimedOut;
|
goto TimedOut;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user