Exemple #1
0
void Window::input(InputConfig* config, Input input)
{
	if(mSleeping)
	{
		// wake up
		mTimeSinceLastInput = 0;
		mSleeping = false;
		onWake();
		return;
	}

	mTimeSinceLastInput = 0;

	if(config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_g && SDL_GetModState() & KMOD_LCTRL && Settings::getInstance()->getBool("Debug"))
	{
		// toggle debug grid with Ctrl-G
		Settings::getInstance()->setBool("DebugGrid", !Settings::getInstance()->getBool("DebugGrid"));
	}
	else if(config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_t && SDL_GetModState() & KMOD_LCTRL && Settings::getInstance()->getBool("Debug"))
	{
		// toggle TextComponent debug view with Ctrl-T
		Settings::getInstance()->setBool("DebugText", !Settings::getInstance()->getBool("DebugText"));
	}
	else
	{
		if(peekGui())
			this->peekGui()->input(config, input);
	}
	
	ListenForPassKeySequence(config, input);
}
void GuiProgressBitmapCtrl::setBitmap( const char* name )
{
   bool awake = mAwake;
   if( awake )
      onSleep();

   mBitmapName = StringTable->insert( name );
   if( awake )
      onWake();
      
   setUpdate();
}
Exemple #3
0
	void IComponent::wakeUp() {
		if(_tickMask == 0)
			std::cerr << "Warning! Estas despertando a un componente que no tiene ningun tipo de tick" << std::endl;

		if(_state == ComponentState::eSLEEPING) {
			_state = ComponentState::eAWAKE;
			_wantsTick = _tickMask & TickMode::eTICK;
			_wantsFixedTick = _tickMask & TickMode::eFIXED_TICK;
			_deepSleep = false;

			_entity->wakeUp(this);

			onWake();
		}
	}