Exemplo n.º 1
0
void GameObject::sleep()
{
	if (isAwake)
	{
		onSleep();
	}
	isAwake = false;
}
Exemplo n.º 2
0
void GameObject::disable()
{
	if (isEnable)
	{
		onSleep();
		onDisable();
	}
	isEnable = false;
	isAwake = false;
}
Exemplo n.º 3
0
void GuiProgressBitmapCtrl::setBitmap( const char* name )
{
   bool awake = mAwake;
   if( awake )
      onSleep();

   mBitmapName = StringTable->insert( name );
   if( awake )
      onWake();
      
   setUpdate();
}
Exemplo n.º 4
0
	void IComponent::putToSleep(bool deepSleep) {
		if(_tickMask == 0)
			std::cerr << "Warning! Estas mandando a dormir a un componente que no tiene tick." << std::endl;

		if(_state != ComponentState::eSLEEPING) {
			_state = ComponentState::eSLEEPING;
			this->_deepSleep = deepSleep;
			_wantsTick = _wantsFixedTick = false;
			
			onSleep();
		}
	}
Exemplo n.º 5
0
void Window::render()
{
	Eigen::Affine3f transform = Eigen::Affine3f::Identity();

	mRenderedHelpPrompts = false;

	// draw only bottom and top of GuiStack (if they are different)
	if(mGuiStack.size())
	{
		auto& bottom = mGuiStack.front();
		auto& top = mGuiStack.back();

		bottom->render(transform);
		if(bottom != top)
		{
			mBackgroundOverlay->render(transform);
			top->render(transform);
		}
	}

	if(!mRenderedHelpPrompts)
		mHelp->render(transform);

	if(Settings::getInstance()->getBool("DrawFramerate") && mFrameDataText)
	{
		Renderer::setMatrix(Eigen::Affine3f::Identity());
		mDefaultFonts.at(1)->renderTextCache(mFrameDataText.get());
	}

	unsigned int screensaverTime = (unsigned int)Settings::getInstance()->getInt("ScreenSaverTime");
	if(mTimeSinceLastInput >= screensaverTime && screensaverTime != 0 && mAllowSleep)
	{
		// go to sleep
		mSleeping = true;
		onSleep();
	}
}
Exemplo n.º 6
0
void SystemMenu::rebuildMenu(bool dockHiding)
{
	if (menu()) {
		menu()->clear();
	}
	
	QMenu *menu = new QMenu(this);

	about = new QAction("About this computer", this);
	menu->addAction(about);
	connect(about, SIGNAL(triggered()), this, SLOT(onAbout()));

/* TODO: Removed for now until I found clear way for managing software on different distros 
	QAction *software = new QAction("Software management ...", this);
	menu->addAction(software);
*/
	menu->addSeparator();

	QAction *pref = new QAction("System preferences ...", this);
	menu->addAction(pref);
	connect(pref, SIGNAL(triggered()), this, SLOT(onPreferences()));

	menu->addSeparator();

	if (dockHiding) {
		adock_on = new QAction("Turn Hiding Off", this);
	} else {
		int s = app->dock->dockState;
		if (s == Dockbar::Normal || s == Dockbar::Showing || s == Dockbar::AboutToShow) {
			adock_on = new QAction("Turn Hiding On", this);
		} else if (s == Dockbar::Hidden || s == Dockbar::Hiding) {
			adock_on = new QAction("Turn Hiding Off", this);
		}
	}
	//QAction *adock_magn = new QAction("Turn Magnification On", this);
	adock_pref = new QAction("Dock Preferences ...", this);
	QMenu *dock_menu = menu->addMenu("Dock");
	dock_menu->addAction(adock_on);
	connect(adock_on, SIGNAL(triggered()), this, SLOT(onShowHideDock()));
	connect(adock_pref, SIGNAL(triggered()), this, SLOT(onDockPref()));
	
	//dock_menu->addAction(adock_magn);
	dock_menu->addSeparator();
	dock_menu->addAction(adock_pref);

	menu->addSeparator();
	
/* TODO: Removed for now until I implement the features

	QAction *force_quit = new QAction("Force Quit ...", this);
	menu->addAction(force_quit);
	menu->addSeparator();
*/
	sleep = new QAction("Sleep", this);
	menu->addAction(sleep);
	connect(sleep, SIGNAL(triggered()), this, SLOT(onSleep()));

	restart = new QAction("Restart ...", this);
	menu->addAction(restart);
	connect(restart, SIGNAL(triggered()), this, SLOT(onRestart()));

	shutdown = new QAction("Shutdown ...", this);
	menu->addAction(shutdown);
	connect(shutdown, SIGNAL(triggered()), this, SLOT(onShutdown()));

	menu->addSeparator();
	logout = new QAction("Logout ...", this);
	menu->addAction(logout);
	connect(logout, SIGNAL(triggered()), this, SLOT(onLogout()));

	setMenu(menu);
	
	connect(this, SIGNAL(clicked()), this, SLOT(showMenu()));
}