Example #1
0
/**
 * Traitement d'un message recu par le module
 *
 * @param msg           Message recu recu
 */
void RenderingEngine::processMessage(module_message& msg)
{
    module_message mesg = module_message(getId(), GUI, ACTION_CHANGE_MENU);
    switch(msg.codeAction) {
        case ACTION_AFFICHER_MENU:
            l_guiElement[currentMenu]->setVisible(false);
            currentMenu = msg.intData["menu"];
            l_guiElement[currentMenu]->setVisible(true);
            break;
        case ACTION_INIT_GAME:
            constructLevel(msg.strData["niveau"]);
            mDevice->getCursorControl()->setVisible(false);
            break;
        case ACTION_PAUSE:
            mDevice->getTimer()->stop();
            mSmgr->getActiveCamera()->setInputReceiverEnabled(false);
            mDevice->getCursorControl()->setVisible(true);
            break;
        case ACTION_UNPAUSE:
            mDevice->getTimer()->start();
            mSmgr->getActiveCamera()->setInputReceiverEnabled(true);
            //mDevice->getCursorControl()->setVisible(false);
            mDevice->getCursorControl()->setPosition(
                    config["width"]/2,
                    config["height"]/2
            );
            break;
        case ACTION_SAVE_CONFIG_KEYS:
            applyConfigChanges(GUI_OPTIONSMENU_KEYS);
            mesg.idDestination = EVENTS;
            mesg.codeAction = ACTION_RELOAD_CONFIG_KEYS;
            core->sendMessage(mesg);
        break;
        case ACTION_SAVE_CONFIG_VIDEO:
            applyConfigChanges(GUI_OPTIONSMENU_VIDEO);
            break;
        default: break;


    }
}
Example #2
0
Level2::Level2(sf::Font* font){
	levelnum_ = 2;
	constructLevel(font);
}