//-------------------------------------------------------------- void ofxSceneManager::prevScene(bool now) { if(_currentScene-1 < 0) { gotoScene(_scenes.size()-1, now); } else { gotoScene(_currentScene-1, now); } }
//-------------------------------------------------------------- void ofxSceneManager::nextScene(bool now) { if(_currentScene+1 >= (int) _scenes.size()) { gotoScene(0, now); } else { gotoScene(_currentScene+1, now); } }
void Scene::next() { if (_currID + 1 < _scenes.size()) gotoScene(_currID + 1); else shutdown(); }
void MainWindow::enterRoom(){ // add current ip to history if(!Config.HistoryIPs.contains(Config.HostAddress)){ Config.HistoryIPs << Config.HostAddress; Config.HistoryIPs.sort(); Config.setValue("HistoryIPs", Config.HistoryIPs); } ui->actionStart_Game->setEnabled(false); ui->actionStart_Server->setEnabled(false); int player_count = Sanguosha->getPlayerCount(ServerInfo.GameMode); RoomScene *room_scene = new RoomScene(player_count, this); ui->actionView_Discarded->setEnabled(true); ui->actionView_distance->setEnabled(true); ui->actionServerInformation->setEnabled(true); ui->actionKick->setEnabled(true); ui->actionSurrender->setEnabled(true); ui->actionSaveRecord->setEnabled(true); connect(ui->actionView_Discarded, SIGNAL(triggered()), room_scene, SLOT(toggleDiscards())); connect(ui->actionView_distance, SIGNAL(triggered()), room_scene, SLOT(viewDistance())); connect(ui->actionServerInformation, SIGNAL(triggered()), room_scene, SLOT(showServerInformation())); connect(ui->actionKick, SIGNAL(triggered()), room_scene, SLOT(kick())); connect(ui->actionSurrender, SIGNAL(triggered()), room_scene, SLOT(surrender())); connect(ui->actionSaveRecord, SIGNAL(triggered()), room_scene, SLOT(saveReplayRecord())); connect(room_scene, SIGNAL(restart()), this, SLOT(restartConnection())); gotoScene(room_scene); }
//-------------------------------------------------------------- // using the std::distance func to turn iter into index void ofxSceneManager::gotoScene(std::string name, bool now) { map<std::string,ofxScene::RunnerScene*>::iterator iter = _scenes.find(name); if(iter == _scenes.end()) { ofLogWarning("ofxSceneManager") << "could not find \"" << name << "\""; return; } gotoScene(std::distance(_scenes.begin(), iter), now); }
void MainWindow::enterRoom(){ // add current ip to history if(!Config.HistoryIPs.contains(Config.HostAddress)){ Config.HistoryIPs << Config.HostAddress; Config.HistoryIPs.sort(); Config.setValue("HistoryIPs", Config.HistoryIPs); } ui->actionStart_Game->setEnabled(false); ui->actionStart_Server->setEnabled(false); ui->actionAI_Melee->setEnabled(false); RoomScene *room_scene = new RoomScene(this); ui->actionView_Discarded->setEnabled(true); ui->actionView_distance->setEnabled(true); ui->actionServerInformation->setEnabled(true); ui->actionKick->setEnabled(true); ui->actionSurrender->setEnabled(true); ui->actionSaveRecord->setEnabled(true); connect(ui->actionView_Discarded, SIGNAL(triggered()), room_scene, SLOT(toggleDiscards())); connect(ui->actionView_distance, SIGNAL(triggered()), room_scene, SLOT(viewDistance())); connect(ui->actionServerInformation, SIGNAL(triggered()), room_scene, SLOT(showServerInformation())); connect(ui->actionKick, SIGNAL(triggered()), room_scene, SLOT(kick())); connect(ui->actionSurrender, SIGNAL(triggered()), room_scene, SLOT(surrender())); connect(ui->actionSaveRecord, SIGNAL(triggered()), room_scene, SLOT(saveReplayRecord())); connect(ui->actionExpand_dashboard, SIGNAL(toggled(bool)), room_scene, SLOT(adjustDashboard(bool))); if(Config.value("UI/ExpandDashboard").toBool()) ui->actionExpand_dashboard->toggle(); if(ServerInfo.FreeChoose){ ui->menuCheat->setEnabled(true); connect(ui->actionGet_card, SIGNAL(triggered()), ui->actionCard_Overview, SLOT(trigger())); connect(ui->actionDeath_note, SIGNAL(triggered()), room_scene, SLOT(makeKilling())); connect(ui->actionDamage_maker, SIGNAL(triggered()), room_scene, SLOT(makeDamage())); connect(ui->actionRevive_wand, SIGNAL(triggered()), room_scene, SLOT(makeReviving())); connect(ui->actionSend_lowlevel_command, SIGNAL(triggered()), this, SLOT(sendLowLevelCommand())); connect(ui->actionExecute_script_at_server_side, SIGNAL(triggered()), room_scene, SLOT(doScript())); } else{ ui->menuCheat->setEnabled(false); ui->actionGet_card->disconnect(); ui->actionDeath_note->disconnect(); ui->actionDamage_maker->disconnect(); ui->actionRevive_wand->disconnect(); ui->actionSend_lowlevel_command->disconnect(); ui->actionExecute_script_at_server_side->disconnect(); } connect(room_scene, SIGNAL(restart()), this, SLOT(startConnection())); connect(room_scene, SIGNAL(return_to_start()), this, SLOT(gotoStartScene())); room_scene->adjustItems(); gotoScene(room_scene); }
void MainMenu::handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) { switch (command) { // Main menu case kCmdNewGame: close(); _vm->newGame(); break; case kCmdContinue: close(); _vm->continueGameFromQuickSave(); break; case kCmdOptions: gotoMenuScreen(kOptionsMenuScr); break; case kCmdMiniGames: gotoMenuScreen(kMiniGamesMenuScr); break; case kCmdQuit: close(); _vm->quitGame(); break; // Options menu case kCmdUninstall: break; case kCmdCredits: gotoScene(45); break; case kCmdOpening: gotoScene(43); break; case kCmdChicksNStuff: gotoScene(41); break; // Minigames menu case kCmdHockALoogie: gotoScene(27); break; case kCmdBugJustice: gotoScene(29); break; case kCmdCourtChaos: gotoScene(28); break; case kCmdAirGuitar: gotoScene(30); break; case kCmdBack: gotoMenuScreen(kMainMenuScr); break; default: Dialog::handleCommand(sender, command, data); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), server(NULL) { ui->setupUi(this); setWindowTitle(tr("Sanguosha") + " " + Sanguosha->getVersionNumber()); scene = NULL; connection_dialog = new ConnectionDialog(this); connect(ui->actionStart_Game, SIGNAL(triggered()), connection_dialog, SLOT(exec())); connect(connection_dialog, SIGNAL(accepted()), this, SLOT(startConnection())); config_dialog = new ConfigDialog(this); connect(ui->actionConfigure, SIGNAL(triggered()), config_dialog, SLOT(show())); connect(config_dialog, SIGNAL(bg_changed()), this, SLOT(changeBackground())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(ui->actionAcknowledgement_2, SIGNAL(triggered()), this, SLOT(on_actionAcknowledgement_triggered())); StartScene *start_scene = new StartScene; QList<QAction *> actions; actions << ui->actionStart_Game << ui->actionStart_Server << ui->actionReplay << ui->actionConfigure << ui->actionGeneral_Overview << ui->actionCard_Overview << ui->actionScenario_Overview << ui->actionAbout; foreach(QAction *action, actions) start_scene->addButton(action); view = new FitView(scene); setCentralWidget(view); restoreFromConfig(); BackLoader::preload(); gotoScene(start_scene); addAction(ui->actionShow_Hide_Menu); addAction(ui->actionFullscreen); connect(ui->actionRestart_Game, SIGNAL(triggered()), this, SLOT(startConnection())); connect(ui->actionReturn_to_Main_Menu, SIGNAL(triggered()), this, SLOT(gotoStartScene())); systray = NULL; }
MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); scene = NULL; // initialize random seed for later use qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); connection_dialog = new ConnectionDialog(this); connect(ui->actionStart_Game, SIGNAL(triggered()), connection_dialog, SLOT(exec())); connect(connection_dialog, SIGNAL(accepted()), this, SLOT(startConnection())); config_dialog = new ConfigDialog(this); connect(ui->actionConfigure, SIGNAL(triggered()), config_dialog, SLOT(show())); connect(config_dialog, SIGNAL(bg_changed()), this, SLOT(changeBackground())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); StartScene *start_scene = new StartScene; QList<QAction*> actions; actions << ui->actionStart_Game << ui->actionStart_Server << ui->actionPC_Console_Start << ui->actionReplay << ui->actionConfigure << ui->actionGeneral_Overview << ui->actionCard_Overview << ui->actionScenario_Overview << ui->actionAbout << ui->actionAcknowledgement; foreach(QAction *action, actions) start_scene->addButton(action); view = new FitView(scene); setCentralWidget(view); restoreFromConfig(); gotoScene(start_scene); addAction(ui->actionShow_Hide_Menu); addAction(ui->actionFullscreen); addAction(ui->actionMinimize_to_system_tray); systray = NULL; }
void MainWindow::enterRoom(){ // add current ip to history if(!Config.HistoryIPs.contains(Config.HostAddress)){ Config.HistoryIPs << Config.HostAddress; Config.HistoryIPs.sort(); Config.setValue("HistoryIPs", Config.HistoryIPs); } ui->actionStart_Game->setEnabled(false); ui->actionStart_Server->setEnabled(false); RoomScene *room_scene = new RoomScene(this); ui->actionView_Discarded->setEnabled(true); ui->actionView_distance->setEnabled(true); ui->actionServerInformation->setEnabled(true); ui->actionKick->setEnabled(true); ui->actionSurrender->setEnabled(true); ui->actionSaveRecord->setEnabled(true); connect(ui->actionView_Discarded, SIGNAL(triggered()), room_scene, SLOT(toggleDiscards())); connect(ui->actionView_distance, SIGNAL(triggered()), room_scene, SLOT(viewDistance())); connect(ui->actionServerInformation, SIGNAL(triggered()), room_scene, SLOT(showServerInformation())); connect(ui->actionKick, SIGNAL(triggered()), room_scene, SLOT(kick())); connect(ui->actionSurrender, SIGNAL(triggered()), room_scene, SLOT(surrender())); connect(ui->actionSaveRecord, SIGNAL(triggered()), room_scene, SLOT(saveReplayRecord())); connect(ui->actionExpand_dashboard, SIGNAL(triggered()), room_scene, SLOT(adjustDashboard())); if(ServerInfo.FreeChoose){ ui->menuCheat->setEnabled(true); connect(ui->actionGet_card, SIGNAL(triggered()), ui->actionCard_Overview, SLOT(trigger())); connect(ui->actionDeath_note, SIGNAL(triggered()), room_scene, SLOT(makeKilling())); connect(ui->actionDamage_maker, SIGNAL(triggered()), room_scene, SLOT(makeDamage())); connect(ui->actionRevive_wand, SIGNAL(triggered()), room_scene, SLOT(makeReviving())); //modify by ce connect(ui->actionMp_maker, SIGNAL(triggered()), room_scene, SLOT(makeMp())); } connect(room_scene, SIGNAL(restart()), this, SLOT(startConnection())); gotoScene(room_scene); }
void MainWindow::gotoStartScene(){ StartScene *start_scene = new StartScene; QList<QAction*> actions; actions << ui->actionStart_Game << ui->actionStart_Server << ui->actionPC_Console_Start << ui->actionReplay << ui->actionConfigure << ui->actionGeneral_Overview << ui->actionCard_Overview << ui->actionScenario_Overview << ui->actionAbout << ui->actionAcknowledgement; foreach(QAction *action, actions) start_scene->addButton(action); setCentralWidget(view); restoreFromConfig(); ui->menuCheat->setEnabled(false); ui->actionGet_card->disconnect(); ui->actionDeath_note->disconnect(); ui->actionDamage_maker->disconnect(); ui->actionRevive_wand->disconnect(); ui->actionSend_lowlevel_command->disconnect(); ui->actionExecute_script_at_server_side->disconnect(); gotoScene(start_scene); addAction(ui->actionShow_Hide_Menu); addAction(ui->actionFullscreen); addAction(ui->actionMinimize_to_system_tray); systray = NULL; delete ClientInstance; }
void Scene::previous() { if (_currID - 1 >= 0) gotoScene(_currID - 1); }
void sceneManager::prevScene(){ gotoScene(currentScene - 1); }
void sceneManager::nextScene(){ gotoScene(currentScene + 1); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), isLeftPressDown(false), scene(NULL), ui(new Ui::MainWindow), server(NULL), about_window(NULL), minButton(NULL), maxButton(NULL), normalButton(NULL), closeButton(NULL), versionInfomationReply(NULL), changeLogReply(NULL) { ui->setupUi(this); setWindowTitle(tr("QSanguosha-Hegemony") + " " + Sanguosha->getVersion()); #ifdef Q_OS_WIN setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); #endif setAttribute(Qt::WA_TranslucentBackground); setMouseTracking(true); setMinimumWidth(800); setMinimumHeight(580); fetchUpdateInformation(); connection_dialog = new ConnectionDialog(this); connect(ui->actionStart_Game, SIGNAL(triggered()), connection_dialog, SLOT(exec())); connect(connection_dialog, SIGNAL(accepted()), this, SLOT(startConnection())); config_dialog = new ConfigDialog(this); connect(ui->actionConfigure, SIGNAL(triggered()), config_dialog, SLOT(show())); connect(config_dialog, SIGNAL(bg_changed()), this, SLOT(changeBackground())); connect(config_dialog, SIGNAL(tableBg_changed()), this, SLOT(changeBackground())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(ui->actionAcknowledgement_2, SIGNAL(triggered()), this, SLOT(on_actionAcknowledgement_triggered())); StartScene *start_scene = new StartScene(this); QList<QAction *> actions; actions << ui->actionStart_Game << ui->actionStart_Server << ui->actionPC_Console_Start << ui->actionReplay << ui->actionConfigure << ui->actionGeneral_Overview << ui->actionCard_Overview << ui->actionAbout; foreach(QAction *action, actions) start_scene->addButton(action); #if defined(Q_OS_WIN) || defined(Q_OS_ANDROID) ui->menuSumMenu->setAttribute(Qt::WA_TranslucentBackground); ui->menuGame->setAttribute(Qt::WA_TranslucentBackground); ui->menuView->setAttribute(Qt::WA_TranslucentBackground); ui->menuOptions->setAttribute(Qt::WA_TranslucentBackground); ui->menuDIY->setAttribute(Qt::WA_TranslucentBackground); ui->menuCheat->setAttribute(Qt::WA_TranslucentBackground); ui->menuHelp->setAttribute(Qt::WA_TranslucentBackground); #endif view = new FitView(scene); setCentralWidget(view); restoreFromConfig(); roundCorners(); BackLoader::preload(); gotoScene(start_scene); addAction(ui->actionFullscreen); #if defined(Q_OS_WIN) || defined(Q_OS_ANDROID) menu = new QPushButton(this); menu->setMenu(ui->menuSumMenu); menu->setProperty("control", true); StyleHelper::getInstance()->setIcon(menu, QChar(0xf0c9), 15); menu->setToolTip(tr("<font color=%1>Config</font>").arg(Config.SkillDescriptionInToolTipColor.name())); #endif #if defined(Q_OS_WIN) minButton = new QPushButton(this); minButton->setProperty("control", true); maxButton = new QPushButton(this); maxButton->setProperty("bold", true); maxButton->setProperty("control", true); normalButton = new QPushButton(this); normalButton->setProperty("bold", true); normalButton->setProperty("control", true); closeButton= new QPushButton(this); closeButton->setObjectName("closeButton"); closeButton->setProperty("control", true); StyleHelper::getInstance()->setIcon(minButton, QChar(0xf068), 15); StyleHelper::getInstance()->setIcon(maxButton, QChar(0xf106), 15); StyleHelper::getInstance()->setIcon(normalButton, QChar(0xf107), 15); StyleHelper::getInstance()->setIcon(closeButton, QChar(0xf00d), 15); minButton->setToolTip(tr("<font color=%1>Minimize</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(minButton, SIGNAL(clicked()), this, SLOT(showMinimized())); maxButton->setToolTip(tr("<font color=%1>Maximize</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(maxButton, SIGNAL(clicked()), this, SLOT(showMaximized())); normalButton->setToolTip(tr("<font color=%1>Restore downward</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(normalButton, SIGNAL(clicked()), this, SLOT(showNormal())); closeButton->setToolTip(tr("<font color=%1>Close</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); menuBar()->hide(); #elif defined(Q_OS_ANDROID) ui->menuSumMenu->removeAction(ui->menuView->menuAction()); #endif repaintButtons(); #ifndef Q_OS_ANDROID QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); animation->setDuration(1000); animation->setStartValue(0); animation->setEndValue(1); animation->setEasingCurve(QEasingCurve::OutCurve); animation->start(QAbstractAnimation::DeleteWhenStopped); #endif start_scene->showOrganization(); systray = NULL; }