コード例 #1
0
void dskGameLoader::Msg_Timer(const unsigned /*ctrl_id*/)
{
    auto* timer = GetCtrl<ctrlTimer>(1);
    auto* text = GetCtrl<ctrlText>(10 + position);
    int interval = 50;

    timer->Stop();

    switch(position)
    {
        case 0: // Kartename anzeigen
            text->SetText(GAMECLIENT.GetMapTitle());
            break;

        case 1: // Karte geladen
            text->SetText(_("Map was loaded and pinned at the wall..."));
            break;

        case 2: // Nationen ermitteln
            loader_.initNations();

            text->SetText(_("Tribal chiefs assembled around the table..."));
            break;

        case 3: // Objekte laden
        {
            loader_.initTextures();
            loader_.loadTextures();

            text->SetText(_("Game crate was picked and spread out..."));
            break;
        }
        case 4: // Welt erstellen
            try
            {
                // Do this here as it will init OGL
                gameInterface = std::make_unique<dskGameInterface>(loader_.getGame(), GAMECLIENT.GetNWFInfo(), GAMECLIENT.GetPlayerId());
            } catch(std::runtime_error& e)
            {
                LC_Status_Error(std::string(_("Failed to init GUI: ")) + e.what());
                return;
            }
            // TODO: richtige Messages senden, um das zu laden /*GetMap()->GenerateOpenGL();*/

            // We are done, wait for others
            GAMECLIENT.GameLoaded();

            text->SetText(_("World was put together and glued..."));
            break;

        case 5: // nochmal text anzeigen
            text->SetText(_("And let's go!"));
            text->SetTextColor(COLOR_RED);
            return;
    }

    ++position;
    timer->Start(interval);
}
コード例 #2
0
ファイル: dskGameLoader.cpp プロジェクト: MarcusSt/s25client
/**
 *
 *
 *  @author FloSoft
 */
void dskGameLoader::Msg_Timer(const unsigned int ctrl_id)
{
    static bool load_nations[NATION_COUNT];

    ctrlTimer* timer = GetCtrl<ctrlTimer>(1);
    ctrlText* text = GetCtrl<ctrlText>(10 + position);
    int interval = 500;

    timer->Stop();

    switch(position)
    {
    case 0: // Kartename anzeigen
    {
        text->SetText(GameClient::inst().GetMapTitle());
        interval = 50;
    }
    break;

    case 1: // Karte geladen
    {
        text->SetText(_("Map was loaded and pinned at the wall..."));
        interval = 50;
    }
    break;

    case 2: // Nationen ermitteln
    {
        memset(load_nations, 0, sizeof(bool) * NATION_COUNT);
        for(unsigned char i = 0; i < GAMECLIENT.GetPlayerCount(); ++i)
            load_nations[GAMECLIENT.GetPlayer(i)->nation] = true;

        text->SetText(_("Tribal chiefs assembled around the table..."));
        interval = 50;
    }
    break;

    case 3: // Objekte laden
    {
        if(!LOADER.LoadFilesAtGame(gwv->GetLandscapeType(), load_nations))
        {
            LC_Status_Error(_("Failed to load map objects."));
            return;
        }

        if(GAMECLIENT.GetGGS().isEnabled(ADDON_CATAPULT_GRAPHICS))
        {
            if(!LOADER.LoadFilesFromAddon(ADDON_CATAPULT_GRAPHICS))
            {
                LC_Status_Error(_("Failed to load addon objects."));
                return;
            }
        }

        LOADER.fillCaches();

        text->SetText(_("Game crate was picked and spread out..."));
        interval = 50;
    }
    break;

    case 4: // Welt erstellen
    {
        if(!LOADER.CreateTerrainTextures())
        {
            LC_Status_Error(_("Failed to load terrain data."));
            return;
        }

        // TODO: richtige Messages senden, um das zu laden /*GetMap()->GenerateOpenGL();*/

        text->SetText(_("World was put together and glued..."));
        interval = 50;
    }
    break;

    case 5: // nochmal text anzeigen
    {
        text->SetText(_("And let's go!"));
        text->SetColor(COLOR_RED);
        interval = 50;
    }
    break;

    case 6: // zum Spiel wechseln
    {
        WindowManager::inst().Switch(new dskGameInterface);
        return;
    }
    break;
    }

    ++position;
    timer->Start(interval);
}
コード例 #3
0
ファイル: LobbyInterface.cpp プロジェクト: Flamefire/liblobby
/**
 *  Status: fehlerhafte Anfrage / kaputte Daten.
 *
 *  @author FloSoft
 */
void LobbyInterface::LC_Status_IncompleteMessage()
{
    LC_Status_Error(_("Too short Message received!"));
}
コード例 #4
0
ファイル: LobbyInterface.cpp プロジェクト: Flamefire/liblobby
/**
 *  Status: Verbindung verloren.
 *
 *  @author FloSoft
 */
void LobbyInterface::LC_Status_ConnectionLost()
{
    LC_Status_Error(_("Connection to Host closed!"));
}