示例#1
0
void Viewport::customizeUI(Ui::MainWindow* ui)
{
    ui->menuReference->deleteLater();

    QActionGroup* view_actions = new QActionGroup(this);
    view_actions->addAction(ui->actionShaded);
    view_actions->addAction(ui->actionHeightmap);
    view_actions->setExclusive(true);

    // Accept the global command-line argument '--heightmap'
    // to always open scenes in height-map view.
    if (App::instance()->arguments().contains("--heightmap"))
        ui->actionHeightmap->setChecked(true);

    connect(ui->actionShaded, &QAction::triggered,
            [&]{ scene->invalidate(); });
    connect(ui->actionHeightmap, &QAction::triggered,
            [&]{ scene->invalidate(); });

    connect(ui->actionHideUI, &QAction::triggered,
            [&](bool b){ if (b) hideUI();
                         else   showUI(); });

    connect(ui->actionCopy, &QAction::triggered,
            this, &Viewport::onCopy);
    connect(ui->actionCut, &QAction::triggered,
            this, &Viewport::onCut);
    connect(ui->actionPaste, &QAction::triggered,
            this, &Viewport::onPaste);
}
示例#2
0
bool RuntimeEngine::startNetwork()
{
    ConsoleCommand::getShareInstance()->init();
    showUI();

    return true;
}
示例#3
0
void UI_Main::reloadUI( void )
{
	// clear the navigation stack
	navigator->popAllDocuments();

	// clear the navigation stack from previous installment
	navigator->getCache()->clearCaches();

	// forget about all previously registed shaders
	rocketModule->clearShaderCache();

	if( serverBrowser ) {
		serverBrowser->stopUpdate();
	}
	if( demos ) {
		demos->Reset();
	}

	destroyDataSources();

	createDataSources();

	preloadUI();

	showUI( true );
}
void ShutdownBusinessLogic::systemStateChanged(MeeGo::QmSystemState::StateIndication what)
{
    switch (what) {
        case MeeGo::QmSystemState::Shutdown:
            // To avoid early quitting on shutdown
            restoreSignalHandlers();
            showUI();
            break;

        case MeeGo::QmSystemState::ThermalStateFatal:
            thermalShutdown();
            break;

        case MeeGo::QmSystemState::ShutdownDeniedUSB:
            shutdownDeniedUSB();
            break;

        case MeeGo::QmSystemState::BatteryStateEmpty:
            batteryShutdown();
            break;

        default:
            break;
    }
}
示例#5
0
bool BuildingSprite::init(int index)
{
    if ( !Sprite::init() ) {
        return false;
    }
    
    _isSelected = false;
    _isTouched = false;
    _canTouched = true;
    
    _index = index;
    
    loadData(index);
    
    showUI();
    showUpgradePro();
    showBubble();
    
    addTouch();
    scheduleUpdate();
    
    // 设置名称
    this->setName("BuildingSprite");
    
    return true;
}
示例#6
0
文件: canvas.cpp 项目: denji/antimony
void Canvas::keyReleaseEvent(QKeyEvent *event)
{
    if (scene->focusItem())
    {
        QGraphicsView::keyPressEvent(event);
    }
    else if (event->key() == Qt::Key_Alt)
    {
        showUI();
    }
}
示例#7
0
bool GameMissionSet::init()
{
	do 
	{
		CC_BREAK_IF(!Layer::init());
		showUI();

		return true;
	} while (false);
	return false;
}
示例#8
0
bool NoticeScene::init(){
	if (!Layer::init()){
		return false;
	}
	showUI("NoticeScene");
	btnClose = static_cast<Button*>(rootNode->getChildByName("btnClose"));
	text_desc = static_cast<Text*>(rootNode->getChildByName("Text_desc"));
	text_desc->ignoreContentAdaptWithSize(false);
	addWidgetTouchListener(btnClose);
	refresh();
	return true;
}
示例#9
0
void UI_Main::refreshScreen( unsigned int time, int clientState, int serverState, bool demoPaused, unsigned int demoTime, bool backGround, bool showCursor )
{
	setRefreshState( time, clientState, serverState, demoPaused, demoTime, backGround );

	// postponed showing of the stacked document, we need to set the refresh state first
	if( showNavigationStack ) {
		navigator->showStack( true );
		showNavigationStack = false;
	}

	// update necessary modules
	if( serverBrowser )
		serverBrowser->updateFrame();
	if( demos )
		demos->UpdateFrame();
	if( ircchannels )
		ircchannels->UpdateFrame();

	// TODO: handle the intervalled functions in AS somehow,
	// taking care that they are not called when menu is hidden.
	// i may need to make the interface public..
	BindFrame( asmodule );

	// run incremental garbage collection
	asmodule->garbageCollectOneStep();

	if( showCursor ) { 
		rocketModule->showCursor();
	}
	else {
		rocketModule->hideCursor();
	}

	if( !menuVisible ) {
		return;
	}

	if( !navigator->hasDocuments() ) {
		// no documents on stack, release the key dest
		showUI( false );
		return;
	}

	// rocket update+render
	rocketModule->update();
	rocketModule->render();

	// mark the top stack document as viwed for history tracking
	navigator->markTopAsViewed();

	// stuff we need to render without using rocket
	customRender();
}
示例#10
0
bool BattleHudLayer::init()
{
    if ( !Layer::init() )
    {
        return false;
    }
    
    loadData();
    showUI();
    
    return true;
}
示例#11
0
bool PostScene::init(){
	if (!Layer::init()){
		return false;
	}
	showUI("PostScene");
	btnBack = static_cast<Button*>(rootNode->getChildByName("btnBack"));
	btnSubmit = static_cast<Button*>(rootNode->getChildByName("btnSubmit"));


	addWidgetTouchListener(btnBack);
	addWidgetTouchListener(btnSubmit);
	refresh();
	return true;
}
示例#12
0
//Think method
void 
World::Think(float time)
{
	if(mGameOver){
		if(!mShowFinalUI){
			mShowFinalUI = true;
			showFinalUI();
		} else{
			handleFinalUI();
		}
	} else {

		if(mInputHandler->IsKeyDown(OIS::KC_ESCAPE) && !mShowUI && !mShowInitialUI){
			UICount = UICount + 1;
			if(UICount > 10){
				showUI();
				mShowUI = true;
				UICount = 0;
			}
		
		} else if(mInputHandler->IsKeyDown(OIS::KC_ESCAPE) && mShowUI && !mShowInitialUI){
		
			UICount = UICount + 1;
			if(UICount > 10){
				hideUI();
				mShowUI = false;
				UICount = 0;
			}
		}
		if(mShowUI || mShowInitialUI){
			//Handle UI
			handleUI();
			hideSpeed();
		} else {
			PhysicsWorld::getInstance()->simulate(time);
			//Control Player
			controlPlayer(time);
			updateLaps();
			showSpeed();
		
		}
	}
	
	
	
}
示例#13
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    infoloader(new InfoLoader(this))
{
    ui->setupUi(this);
    ui->clipboardButton->setVisible(false);
    ui->emailButton->setVisible(false);
    ui->closeButton->setVisible(false);
    ui->jsbinButton->setVisible(false);
    ui->saveButton->setVisible(false);
//    this->statusBar()->setVisible(false);
//    connect(infoloader, SIGNAL(finished()), SLOT(showUI()));
    connect(infoloader, SIGNAL(newInfoAvailable(QString)), SLOT(updateLoadScreen(QString)), Qt::DirectConnection);
    connect(infoloader, SIGNAL(progressChange(int)), ui->progressBar, SLOT(setValue(int)), Qt::DirectConnection);
    QTimer::singleShot(0,this,SLOT(showUI()));
}
示例#14
0
void UI_Main::drawConnectScreen( const char *serverName, const char *rejectMessage, 
	int downloadType, const char *downloadFilename, float downloadPercent, int downloadSpeed, 
	int connectCount, bool backGround )
{
	DownloadInfo dlinfo( downloadFilename, downloadType );
	dlinfo.setPercent( downloadPercent );
	dlinfo.setSpeed( downloadSpeed );

	this->serverName = serverName ? serverName : "";
	this->rejectMessage = rejectMessage ? rejectMessage : "";
	this->downloadInfo = dlinfo;

	navigator->pushDocument( ui_connectscreen, true, true );

	forceUI( true );
	showUI( true );
}
static int update(void* user_data, PDUI* uiFuncs, PDReader* inEvents, PDWriter* outEvents) {
    uint32_t event;
    RegistersData* data = (RegistersData*)user_data;

    (void)outEvents;

    // Loop over all the in events

    while ((event = PDRead_get_event(inEvents)) != 0) {
        switch (event) {
            case PDEventType_SetRegisters:
                updateRegisters(data, inEvents); break;
        }
    }

    showUI(data, uiFuncs);

    return 0;
}
示例#16
0
bool Soilder::init(int soilderID, Vec2 pos, AIManager* ai)
{
    if ( !BaseSprite::init() ) {
        return false;
    }
    
    _soilderID = soilderID;
    _pos = pos;
    _target = nullptr;
    _ai = ai;
    
    loadData();
    showUI();
    addHPBar();
    
    schedule(schedule_selector(Soilder::update), 0.8f);
    
    return true;
}
示例#17
0
void UI_Main::drawConnectScreen( const char *serverName, const char *rejectMessage,
								 int downloadType, const char *downloadFilename, float downloadPercent, int downloadSpeed,
								 int connectCount, bool backGround ) {
	DownloadInfo dlinfo( downloadFilename, downloadType );

	dlinfo.setPercent( downloadPercent );
	dlinfo.setSpeed( downloadSpeed );

	connectInfo.serverName = serverName ? serverName : "";
	connectInfo.rejectMessage = rejectMessage ? rejectMessage : "";
	connectInfo.downloadInfo = dlinfo;
	connectInfo.connectCount = connectCount;

	UI_Navigation &navigation = navigations[UI_CONTEXT_MAIN];
	NavigationStack *navigator = navigation.front();
	navigator->pushDocument( ui_connectscreen, false, true );

	forceUI( true );
	showUI( true );
}
示例#18
0
void CheckUpdateThreadLauncher::onMonitoringTick()
{
  // If we do not receive a response yet...
  if (!m_received)
    return;                     // Skip and wait the next call.

  // Depending on the type of update received
  switch (m_response.getUpdateType()) {

    case updater::CheckUpdateResponse::NoUpdate:
      // Clear
      m_preferences.updater.newVersion("");
      m_preferences.updater.newUrl("");
      break;

    case updater::CheckUpdateResponse::Critical:
    case updater::CheckUpdateResponse::Major:
      m_preferences.updater.newVersion(m_response.getLatestVersion());
      m_preferences.updater.newUrl(m_response.getUrl());
      break;
  }

  showUI();

  // Save the new UUID
  if (!m_response.getUuid().empty()) {
    m_uuid = m_response.getUuid();
    m_preferences.updater.uuid(m_uuid);
  }

  // Set the date of the last "check for updates" and the "WaitDays" parameter.
  m_preferences.updater.lastCheck((int)std::time(NULL));
  m_preferences.updater.waitDays(m_response.getWaitDays());

  // Save the config file right now
  m_preferences.save();

  // Stop the monitoring timer.
  m_timer.stop();
}
示例#19
0
void UI_Main::reloadUI( void )
{
	int i;

	for( i = 0; i < UI_NUM_CONTEXTS; i++ ) {
		UI_Navigation &navigation = navigations[i];
		NavigationStack *navigator = navigation.front();

		while( !navigation.empty() ) {
			NavigationStack *stack = navigation.front();
			navigation.pop_front();

			// clear the navigation stack
			stack->popAllDocuments();
			stack->getCache()->clearCaches();
			if( stack != navigator ) {
				__delete__( stack );
			}
		}

		navigation.push_front( navigator );
	}

	if( serverBrowser ) {
		serverBrowser->stopUpdate();
	}
	if( demos ) {
		demos->Reset();
	}

	destroyDataSources();

	createDataSources();

	preloadUI();

	showUI( true );
}
示例#20
0
void CheckUpdateThreadLauncher::launch()
{
  // In this case we are in the "wait days" period, so we don't check
  // for updates.
  if (!m_doCheck) {
    showUI();
    return;
  }

  if (m_uuid.empty())
    m_uuid = m_preferences.updater.uuid();

  m_delegate->onCheckingUpdates();

  m_bgJob.reset(new CheckUpdateBackgroundJob);
  m_thread.reset(new base::thread(Bind<void>(&CheckUpdateThreadLauncher::checkForUpdates, this)));

  // Start a timer to monitoring the progress of the background job
  // executed in "m_thread". The "onMonitoringTick" method will be
  // called periodically by the GUI main thread.
  m_timer.Tick.connect(&CheckUpdateThreadLauncher::onMonitoringTick, this);
  m_timer.start();
}
示例#21
0
void UI_Main::refreshScreen( unsigned int time, int clientState, int serverState, 
	bool demoPlaying, const char *demoName, bool demoPaused, unsigned int demoTime, 
	bool backGround, bool showCursor )
{
	int i;
	UI_Navigation::iterator it, it_next;

	refreshState.time = time;
	refreshState.clientState = clientState;
	refreshState.serverState = serverState;
	refreshState.drawBackground = backGround;

	if( demoPlaying && !demoInfo.getPlaying() ) {
		demoInfo.setName( demoName );
	}
	demoInfo.setTime( demoTime );
	demoInfo.setPaused( demoPaused );
	demoInfo.setPlaying( demoPlaying );

	// postponed showing of the stacked document, we need to set the refresh state first
	if( showNavigationStack ) {
		UI_Navigation &navigation = navigations[UI_CONTEXT_MAIN];
		NavigationStack *navigator = navigation.front();
		navigator->showStack( true );
		showNavigationStack = false;
	}

	// update necessary modules
	if( serverBrowser )
		serverBrowser->updateFrame();
	if( demos )
		demos->UpdateFrame();
	if( ircchannels )
		ircchannels->UpdateFrame();

	if( clientState == CA_ACTIVE && invalidateAjaxCache ) {
		gameajax->FlushCache();
		invalidateAjaxCache = false;
	}

	// TODO: handle the intervalled functions in AS somehow,
	// taking care that they are not called when menu is hidden.
	// i may need to make the interface public..
	BindFrame( asmodule );

	// run incremental garbage collection
	asmodule->garbageCollectOneStep();

	for( i = 0; i < UI_NUM_CONTEXTS; i++ ) {
		UI_Navigation &navigation = navigations[i];
		NavigationStack *navigator = navigation.front();

		// free empty navigation stacks
		for( it = navigation.begin(); it != navigation.end(); it = it_next ) {
			it_next = it;
			it_next++;

			NavigationStack *stack = *it;
			if( stack != navigator && stack->empty() ) {
				__delete__( stack );
				navigation.erase( it );
			}
		}
	}

	// handle main menu context
	if( menuVisible ) {
		NavigationStack *navigator = navigations[UI_CONTEXT_MAIN].front();
		if( !navigator->hasDocuments() ) {
			// no documents on stack, release the key dest
			showUI( false );
		}
		else {
			if( showCursor ) { 
				rocketModule->hideCursor( UI_CONTEXT_MAIN, 0, RocketModule::HIDECURSOR_REFRESH );
				gamepadCursorMove();
			}
			else {
				rocketModule->hideCursor( UI_CONTEXT_MAIN, RocketModule::HIDECURSOR_REFRESH, 0 );
			}
		}
	}

	// rocket update+render
	rocketModule->update();

	if( quickMenuVisible ) {
		rocketModule->render( UI_CONTEXT_QUICK );
	}
	if( menuVisible ) {
		rocketModule->render( UI_CONTEXT_MAIN );
	}

	// mark the top stack document as viwed for history tracking
	for( i = 0; i < UI_NUM_CONTEXTS; i++ ) {
		UI_Navigation &navigation = navigations[i];
		for( it = navigation.begin(); it != navigation.end(); ++it ) {
			(*it)->markTopAsViewed();
		}
	}

	// stuff we need to render without using rocket
	customRender();
}
示例#22
0
void TownSprite::setTown(int index)
{
    loadData(index);
    showUI();
    scheduleUpdate();
}
示例#23
0
void UI_Main::forceMenuOff(void)
{
	forceUI( false );
	showUI( false );
}
示例#24
0
static int update(void* user_data, PDUI* uiFuncs, PDReader* reader, PDWriter* writer) {
    uint32_t event;

    CallstackData* data = (CallstackData*)user_data;

    data->request = false;
    data->setSelectedFrame = false;

    while ((event = PDRead_get_event(reader)) != 0) {
        switch (event) {
            case PDEventType_SetCallstack:
            {
                updateCallstack(data, reader);
                break;
            }

            case PDEventType_SelectFrame:
            {
                PDRead_find_u32(reader, &data->selectedFrame, "frame", 0);
                break;
            }

            case PDEventType_SetExceptionLocation:
            {
                const char* filename = 0;
                uint32_t line = 0;
                uint64_t location = 0;

                PDRead_find_u64(reader, &location, "address", 0);

                if (location != data->location) {
                    data->location = location;
                    data->request = true;
                }

                PDRead_find_string(reader, &filename, "filename", 0);
                PDRead_find_u32(reader, &line, "line", 0);

                if (!filename || line == 0)
                    break;

                if (strcmp(data->filename, filename)) {
                    strcpy(data->filename, filename);
                    data->line = (int)line;
                    data->request = true;
                }
            }
        }
    }

    showUI(uiFuncs, data);

    if (data->setSelectedFrame) {
        PDWrite_event_begin(writer, PDEventType_SelectFrame);
        PDWrite_u32(writer, "frame", (uint32_t)data->selectedFrame);
        PDWrite_event_end(writer);
    }

    if (data->request) {
        PDWrite_event_begin(writer, PDEventType_GetCallstack);
        PDWrite_event_end(writer);
    }

    return 0;
}
示例#25
0
void simpleRadioMode(unsigned char keys, char encoderDir)
{
  switch(keys)
  {
    case VOL_KEY:
      updateLoc++;
      if (updateLoc > 6)
        updateLoc = 0;
      break;
    case FA_KEY:
      radioSettings.transmitting = !radioSettings.transmitting;
      if (radioSettings.transmitting)
      {
        LCD_BACKLIGHT = 1;
        rda1846TX();
      }
      else
      {
        rda1846RX(1);
        radioSettings.txTime = 0;
        LCD_BACKLIGHT = 0;
      }
      break;
  }

  switch(updateLoc)
  {
    case 0: resetEditLoc(); break;
    case 1: uiSetEditLoc(UI_TL, 0); break;
    case 2: uiSetEditLoc(UI_TL, 1); break;
    case 3: uiSetEditLoc(UI_TL, 2); break;
    case 4: uiSetEditLoc(UI_TR, 0); break;
    case 5: uiSetEditLoc(UI_TR, 1); break;
    case 6: uiSetEditLoc(UI_TR, 2); break;
  }

  if (encoderDir && (!radioSettings.transmitting)) //Dont change while transmitting
  {
    uiSetEditValue(encoderDir);
    updateRDA1846Freq(radioSettings.rxFreqM, radioSettings.rxFreqK);
  }

  initUI();
  if (radioSettings.transmitting)
  {
    uiAddBigNum(UI_TR, &radioSettings.txTime);
    radioSettings.txTime++;
    if (radioSettings.txTime > 10000)
    {
      radioSettings.transmitting = 0;
      rda1846RX(1);
      radioSettings.txTime = 0;
      LCD_BACKLIGHT = 0;
    }
  } else {
    uiAddSmallNum(UI_TL, &radioSettings.rxFreqM);
    uiAddSmallNum(UI_TR, &radioSettings.rxFreqK);
  }
  showUI();

}
示例#26
0
//--------------------------------------------------------------
ofxUICanvas* Animation::hideUI()
{
    return showUI(false);
}