Ejemplo n.º 1
0
/*********
IN_PadPlugged
*********/
void IN_PadPlugged(int controller)
{
	if(!wasPlugged[controller])
	{
		Com_Printf("\tController %d plugged\n",controller); 
	}

	if(IN_ControllerMustBePlugged(controller)&& SG_GameAllowedToSaveHere(qtrue))
	{
		//If UI is dealing with this controller, tell it to stop.
		if(uiControllerNotification == controller || (_UIRunning && cls.state != CA_ACTIVE ))
		{
			IN_ClearControllerUnplugged();
		}
	}
	else
	{
		if (controller == IN_GetMainController())
		{
			//store somehow for checking again later
			mainControllerDelayedUnplug &= ~(1 << controller);
		}
	}

	wasPlugged[controller] = true;
	noControllersConnected = false;
	hadAController = true;
}
Ejemplo n.º 2
0
qboolean CurrentStateIsInteractive()
{
	 if (cls.state == CA_UNINITIALIZED ||
			cls.state ==CA_CONNECTING||
			cls.state ==CA_CONNECTED||
			cls.state ==CA_CHALLENGING||
			cls.state ==CA_PRIMED||
			cls.state ==CA_CINEMATIC ||
			!SG_GameAllowedToSaveHere(qtrue))
		return qfalse;
	 return qtrue;
}
Ejemplo n.º 3
0
static void checkAutoSave()
{
	static int timeToCheckpoint = 0;
	static int delayCountdown = 3;		// delay a few frames before saving

	if(sv.time < timeToCheckpoint && timeToCheckpoint != 0)
	{
		allowNormalAutosave = false;
	}
	else
	{
		allowNormalAutosave = true;
		timeToCheckpoint = 0;
	}

	if(autosaveTrigger)
	{
		if( cls.uiStarted && cls.state == CA_ACTIVE && SG_GameAllowedToSaveHere(qfalse)
			&& Cvar_VariableIntegerValue("disableAutoSave") == 0 )
		{
			if(delayCountdown <= 0)
			{
				if(doAutoSave)
				{
					CG_CenterPrint( "@SP_INGAME_CHECKPOINT", SCREEN_HEIGHT * 0.25 );	//jump the network
					Cbuf_AddText( "save auto\n" );
				}
				timeToCheckpoint = sv.time + 10000;
				autosaveTrigger = false;
				doAutoSave = false;
				allowNormalAutosave = false;
				delayCountdown = 3;
			}
			else
			{
				delayCountdown--;
			}
		}
		else
		{
			delayCountdown = 3;
		}

	}
}
Ejemplo n.º 4
0
/*********
IN_PadUnplugged
*********/
void IN_PadUnplugged(int controller)
{
	if(wasPlugged[controller])
	{
		Com_Printf("\tController %d unplugged\n",controller); 
	}
//JLF moved
	wasPlugged[controller] = false;

	//IN_CheckForNoControllers();

	if(IN_ControllerMustBePlugged(controller)&& SG_GameAllowedToSaveHere(qtrue))
	{
		//If UI isn't busy, inform it about controller loss.
		if(uiControllerNotification == -1 && Cvar_VariableIntegerValue("ControllerOutNum")<0)
		{
			IN_DisplayControllerUnplugged(controller);
			mainControllerDelayedUnplug &= ~( 1<< controller);
		}
//		else
//			mainControllerDelayedUnplug = 1 << controller;

	}
	else
	{
		if ( controller == IN_GetMainController())
		{
			//store somehow for checking again later
			mainControllerDelayedUnplug = 1 << controller;
		}
	}
//	wasPlugged[controller] = false;



}