예제 #1
0
void MenuSystem::process()
{	
	ClientStateSystem* gameState = static_cast<ClientStateSystem*>(
		m_world->getSystem(SystemType::ClientStateSystem));

	if(gameState->getStateDelta(GameStates::LOADING) == EnumGameDelta::ENTEREDTHISFRAME){
		auto rocketEventManager = static_cast<LibRocketEventManagerSystem*>(
			m_world->getSystem(SystemType::LibRocketEventManagerSystem));
		rocketEventManager->clearDocumentStack();
		rocketEventManager->loadWindow("loading");
	}
	else if(gameState->getStateDelta(GameStates::LOBBY) == EnumGameDelta::ENTEREDTHISFRAME){
		auto rocketEventManager = static_cast<LibRocketEventManagerSystem*>(
			m_world->getSystem(SystemType::LibRocketEventManagerSystem));

		static_cast<LobbySystem*>(
			m_world->getSystem(SystemType::LobbySystem))->resetAllPlayers();
		
		auto rocketBackend = static_cast<LibRocketBackendSystem*>(
			m_world->getSystem(SystemType::LibRocketBackendSystem));
		rocketBackend->updateElement(m_lobbyDocIdx, "player_ready", "Ready");

		string temp = "Name: ";
		temp += m_tcpClient->getServerName();
		rocketBackend->updateElement(m_lobbyDocIdx, "server_name", temp.c_str());
		temp = "Round Time(sec): ";
		temp += toString(m_tcpClient->getServerGameTime());
		rocketBackend->updateElement(m_lobbyDocIdx, "server_time", temp.c_str());

		rocketEventManager->clearDocumentStack();
		rocketEventManager->loadWindow("lobby");

		SettingsSystem* settings = static_cast<SettingsSystem*>
			(m_world->getSystem(SystemType::SettingsSystem));
		settings->writeSettingsFile();

	}
	else if(gameState->getStateDelta(GameStates::MENU) == EnumGameDelta::ENTEREDTHISFRAME){
		auto rocketEventManager = static_cast<LibRocketEventManagerSystem*>(
			m_world->getSystem(SystemType::LibRocketEventManagerSystem));

		rocketEventManager->clearDocumentStack();
		rocketEventManager->loadWindow("main_menu");

		if (gameState->getStateDelta(GameStates::INGAME) == EnumGameDelta::EXITTHISFRAME){
			auto menuBackgroundSys = static_cast<MenuBackgroundSceneSystem*>(
				m_world->getSystem(SystemType::MenuBackgroundSceneSystem));
			menuBackgroundSys->setEnabled(true);
		}
	}

}
예제 #2
0
static int onCreate(int mode, activity *act) {
    if( onCreateSanityCheck(act) != MKD_OK ) {
        return MKD_ERR;
    }
    //Start to construct the window
    loadWindow(act);

    //Set event notify
    getInfoManager()->register_event_notify(act, EC_RKE, UR_CBS | UR_CODING, hero3_event_notify);

    setup_labels();
    switch_ui();
    return MKD_OK;
}
예제 #3
0
void MenuSystem::displayDisconnectPopup()
{
	auto rocketBackend = static_cast<LibRocketBackendSystem*>(
		m_world->getSystem(SystemType::LibRocketBackendSystem));

	// Must check that it isn't visible first!
	if (!rocketBackend->isDocumentVisible(m_disconnectPopupIdx))
	{
		auto rocketEventManager = static_cast<LibRocketEventManagerSystem*>(
			m_world->getSystem(SystemType::LibRocketEventManagerSystem));

		rocketEventManager->loadWindow("connection_lost", Rocket::Core::ElementDocument::FOCUS);
	}
}
ConnectionDisplayWindow::ConnectionDisplayWindow(const boost::shared_ptr<cryomesh::components::Node> & nd) :
	node(nd) {
	std::cout<<"ConnectionDisplayWindow::ConnectionDisplayWindow: "<<"DEBUG START"<<std::endl;
	loadWindow("Data/connectiondisplaywindow.glade");
	// set title
	{
		std::stringstream ss;
		ss << "Node: " << node->getUUIDString();
		this->setTitle(ss.str());
	}

	mainWindow->show_all();
	this->initialise();
	std::cout<<"ConnectionDisplayWindow::ConnectionDisplayWindow: "<<"DEBUG END"<<std::endl;
}
예제 #5
0
static int onCreate(int mode, activity *act) {
    if( onCreateSanityCheck(act) != MKD_OK ) {
        return MKD_ERR;
    }
    //Start to construct the window
    loadWindow(act);

    first_icon_initialized = false;
    //Set event notify
    getInfoManager()->register_event_notify(act, EC_RKE, UR_CBS | UR_CODING, hero3_event_notify);

    setup_labels();
    update_cbs_status();
    update_cbs_button();
    lite_on_button_press(serviceButton, servicePressed, act->window);
    return MKD_OK;
}
예제 #6
0
static int onCreate(int mode, activity *act) {
    if( onCreateSanityCheck(act) != MKD_OK ) {
        return MKD_ERR;
    }
    //Start to construct the window
    loadWindow(act);

    //Set event notify
    getInfoManager()->register_event_notify(act, EC_RKE, UR_RANGE | UR_CODING, hero2sub2_event_notify);
    getInfoManager()->register_event_notify(act, EC_CHANGE, EVENT_CONNECTION_STATUS, hero2sub2_event_notify);

    setup_labels();
    setElectricity();
    setFuel();
    setMile();
    update_fully_charge_time();
    return MKD_OK;
}
예제 #7
0
void MenuSystem::initialize()
{
	auto rocketBackend = static_cast<LibRocketBackendSystem*>(
		m_world->getSystem(SystemType::LibRocketBackendSystem));

	auto rocketEventManager = static_cast<LibRocketEventManagerSystem*>(
		m_world->getSystem(SystemType::LibRocketEventManagerSystem));

	auto connectToServerSys = static_cast<ClientConnectToServerSystem*>(
		m_world->getSystem(SystemType::ClientConnectoToServerSystem));

	rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"main_menu");
	rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"play");
	m_joinIdx = rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"join");
	m_hostIdx = rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"host");
	rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"options");
	rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"credits");
	m_lobbyDocIdx = rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"lobby");
	m_disconnectPopupIdx = rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),
		"connection_lost");
	m_loadingWindowIdx = rocketBackend->loadDocument(GUI_MENU_PATH.c_str(),"loading");

	rocketEventManager->loadWindow("main_menu");
}
예제 #8
0
static int onCreate(int mode, activity *act) {
    LOG_DBG("temperature %s\n", __func__);
    loadWindow(act->window);
    return MKD_OK;
}
	CEGUI::Window* AbstractWindow::loadWindow(const CeGuiString& xmlfile)
	{
		CeGuiString prefix = "";
		return loadWindow(xmlfile, prefix);
	}
예제 #10
0
/***** calls all init functions *****/
void initAll(Main *main, Wind *wind, int *max)
{
    loadWindow(&*wind);
}
예제 #11
0
static int onCreate(int mode, activity *act) {
    LOG_DBG("batterylow %s\n", __func__);
    loadWindow(act->window);
    return MKD_OK;
}