Example #1
0
iwMilitary::iwMilitary(const GameWorldViewer& gwv, GameCommandFactory& gcFactory):
    IngameWindow(CGI_MILITARY, IngameWindow::posAtMouse,  168, 330, _("Military"), LOADER.GetImageN("io", 5)),
    gwv(gwv), gcFactory(gcFactory), settings_changed(false)
{
    // Einzelne Balken
    AddProgress(0, 17, 25, 132, 26, TC_GREY, 119, 120, MILITARY_SETTINGS_SCALE[0], "", 4, 4, 0, _("Fewer recruits"), _("More recruits")); /* pitch: 4, 4 */
    AddProgress(1, 17, 57, 132, 26, TC_GREY, 121, 122, MILITARY_SETTINGS_SCALE[1], "", 4, 4, 0, _("Weak defense"), _("Strong defense"));
    AddProgress(2, 17, 89, 132, 26, TC_GREY, 123, 124, MILITARY_SETTINGS_SCALE[2], "", 4, 4, 0, _("Fewer defenders"), _("More defenders"));
    AddProgress(3, 17, 121, 132, 26, TC_GREY, 209, 210, MILITARY_SETTINGS_SCALE[3], "", 4, 4, 0, _("Less attackers"), _("More attackers"));
    AddProgress(4, 17, 153, 132, 26, TC_GREY, 129, 130, MILITARY_SETTINGS_SCALE[4], "", 4, 4, 0, _("Interior"), _("Interior"));
    AddProgress(5, 17, 185, 132, 26, TC_GREY, 127, 128, MILITARY_SETTINGS_SCALE[5], "", 4, 4, 0, _("Center of country"), _("Center of country"));
    AddProgress(6, 17, 217, 132, 26, TC_GREY, 1000, 1001, MILITARY_SETTINGS_SCALE[6], "", 4, 4, 0, _("Near harbor points"), _("Near harbor points"));
    AddProgress(7, 17, 249, 132, 26, TC_GREY, 125, 126, MILITARY_SETTINGS_SCALE[7], "", 4, 4, 0, _("Border areas"), _("Border areas"));

    // unteren 2 Buttons
    AddImageButton(20, 18, 282, 30, 32, TC_GREY, LOADER.GetImageN("io", 225), _("Help"));
    AddImageButton(21, 120, 282, 30, 32, TC_GREY, LOADER.GetImageN("io", 191), _("Default"));

    // Falls Verteidiger ändern verboten ist, einfach die Bar ausblenden
    if (gwv.GetWorld().GetGGS().getSelection(AddonId::DEFENDER_BEHAVIOR) == 1)
    {
        GetCtrl<ctrlProgress>(2)->SetVisible(false);
    }

    // Absendetimer, in 2s-Abschnitten wird jeweils das ganze als Netzwerknachricht ggf. abgeschickt
    AddTimer(22, 2000);
    UpdateSettings();
}
Example #2
0
/**
 *  Konstruktor von @p ctrlProgress.
 *
 *  @author Devil
 *  @author FloSoft
 */
ctrlProgress::ctrlProgress(Window* parent,
                           const unsigned int id,
                           const unsigned short x,
                           const unsigned short y,
                           const unsigned short width,
                           const unsigned short height,
                           const TextureColor tc,
                           unsigned short button_minus,
                           unsigned short button_plus,
                           const unsigned short maximum,
                           const unsigned short x_padding,
                           const unsigned short y_padding,
                           const unsigned int force_color,
                           const std::string& tooltip,
                           const std::string& button_minus_tooltip,
                           const std::string& button_plus_tooltip,
                           unsigned short* const write_val)
    : Window(x, y, id, parent, width, height, tooltip),
      tc(tc), position(0), maximum(maximum), x_padding(x_padding), y_padding(y_padding), force_color(force_color)
{
    const char* str1 = "io", * str2 = "io";
    if(button_minus >= 1000)
    {
        str1 = "io_new";
        button_minus -= 1000;
    }
    if(button_plus >= 1000)
    {
        str2 = "io_new";
        button_plus -= 1000;
    }

    AddImageButton(0, 0,              0, height, height, tc, LOADER.GetImageN(str1, button_minus), (button_minus_tooltip.length() ? button_minus_tooltip : _("Less")) );
    AddImageButton(1, width - height, 0, height, height, tc, LOADER.GetImageN(str2, button_plus),  (button_plus_tooltip.length( ) ? button_plus_tooltip  : _("More")) );
}
/**
 *  Konstruktor von @p iwOptionsWindow.
 *
 *  @author OLiver
 */
iwOptionsWindow::iwOptionsWindow(dskGameInterface* gameDesktop)
    : IngameWindow(CGI_OPTIONSWINDOW, 0xFFFF, 0xFFFF, 300, 515, _("Game menu"), LOADER.GetImageN("resource", 41))
{
    this->gameDesktop = gameDesktop;

    // Der Soldat oben
    AddImage(1, 150, 36, LOADER.GetImageN("io", 30));

    // Versionszeile
    AddVarText(2, 150, 76, _("Return To The Roots v%s-%s"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevisionShort());
    // Copyright
    AddVarText(3, 150, 96, _("© 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear());

    // "Tastaturbelegung"
    AddImageButton(4, 35, 120, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 79));
    AddText(5, 85, 140, _("Keyboard layout"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "'Lies mich'-Datei laden"
    AddImageButton(6, 35, 160, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 79));
    AddText(7, 85, 180, _("Load 'ReadMe' file"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "Spiel laden!"
    // TODO: Implement
    //AddImageButton( 8, 35, 210, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 48));
    //AddText(9, 85, 230, _("Load game!"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "Spiel speichern!"
    // TODO: Move back down to y=250 (Button) 270 (Text) after Load button is implemented
    AddImageButton(10, 35, 230, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 47));
    AddText(11, 85, 255, _("Save game!"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // Geräusche an/aus
    AddImageButton(12, 35, 300, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 114 + !SETTINGS.sound.effekte)); //-V807

    // Musik an/aus
    AddImageButton(13, 35, 340, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 116 + !SETTINGS.sound.musik));

    // Geräuschlautstärke
    AddProgress(14, 100, 306, 160, 22, TC_GREEN2, 139, 138, 10)
    ->SetPosition(SETTINGS.sound.effekte_volume * 10 / 255);

    // Musiklautstärke
    AddProgress(15, 100, 346, 160, 22, TC_GREEN2, 139, 138, 10)
    ->SetPosition(SETTINGS.sound.musik_volume * 10 / 255);

    //// Music Player
    AddTextButton(16, 100, 380, 160, 22, TC_GREEN2, _("Music player"), NormalFont);

    // Advanced Options
    AddTextButton(18, 67, 412, 168, 24, TC_GREEN2, _("Advanced"), NormalFont);

    // "Spiel aufgeben"
    AddTextButton(17, 67, 443, 168, 24, TC_RED1, _("Surrender"), NormalFont);
    // "Spiel beenden"
    AddTextButton(0, 67, 474, 168, 24, TC_RED1, _("End game"), NormalFont);

}
iwSurrender::iwSurrender()
    : IngameWindow(CGI_ENDGAME, IngameWindow::posLastOrCenter, Extent(240, 100), _("Surrender game?"), LOADER.GetImageN("resource", 41))
{
    // Ok
    AddImageButton(0, DrawPoint(85, 24), Extent(68, 57), TC_GREEN2, LOADER.GetImageN("io", 32), _("Surrender"));
    // Ok + Abbrennen
    AddImageButton(2, DrawPoint(16, 24), Extent(68, 57), TC_GREEN2, LOADER.GetImageN("io", 23), _("Destroy all buildings and surrender"));
    // Abbrechen
    AddImageButton(1, DrawPoint(158, 24), Extent(68, 57), TC_RED1, LOADER.GetImageN("io", 40), _("Don't surrender"));
}
Example #5
0
/**
 *  Konstruktor von @p iwEndgame.
 *
 *  @author OLiver
 */
iwEndgame::iwEndgame()
    : IngameWindow(CGI_ENDGAME, 0xFFFF, 0xFFFF, 240, 100, _("End game?"), LOADER.GetImageN("resource", 41))
{
    // Ok
    AddImageButton(0,  16, 24, 71, 57, TC_GREEN2, LOADER.GetImageN("io", 32)); //-V525
    // Abbrechen
    AddImageButton(1,  88, 24, 71, 57, TC_RED1, LOADER.GetImageN("io", 40));
    // Ok + Speichern
    AddImageButton(2, 160, 24, 65, 57, TC_GREY, LOADER.GetImageN("io", 47));
}
Example #6
0
/**
 *  Konstruktor von @p iwShip.
 *
 *  @todo überprüfen und die restlichen Steuerelemente zur Funktion bringen
 *
 *  @author OLiver
 */
iwShip::iwShip(GameWorldViewer* const gwv, dskGameInterface* const gi, noShip* const ship)
    : IngameWindow(CGI_SHIP, (unsigned short) - 2, (unsigned short) - 2, 252, 238, _("Ship register"), LOADER.GetImageN("resource", 41)),
      gwv(gwv), gi(gi), ship_id(ship ? GameClient::inst().GetPlayer(ship->GetPlayer())->GetShipID(ship) : 0), player(ship ? ship->GetPlayer() : GameClient::inst().GetPlayerID())
{
    AddImage(  0, 126, 101, LOADER.GetImageN("io", 228));
    AddImageButton( 2, 18, 192, 30, 35, TC_GREY, LOADER.GetImageN("io", 225));  // Viewer: 226 - Hilfe
    AddImageButton( 3, 51, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 102));  // Viewer: 103 - Schnell zurück
    AddImageButton( 4, 81, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 103));  // Viewer: 104 - Zurück
    AddImageButton( 5, 111, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 104)); // Viewer: 105 - Vor
    AddImageButton( 6, 141, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 105)); // Viewer: 106 - Schnell vor
    AddImageButton( 7, 181, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place")); // "Gehe Zu Ort"

    // Die Expeditionsweiterfahrbuttons
    AddImageButton(10, 60, 81, 18, 18, TC_GREY, LOADER.GetImageN("io", 187), _("Found colony"))->SetVisible(false);

    const int BUTTON_POS[6][2] =
    {
        {60, 61}, {80, 70}, {80, 90}, {60, 101}, {40, 90}, {40, 70}
    };

    // Expedition abbrechen
    AddImageButton(11, 200, 143, 18, 18, TC_RED1, LOADER.GetImageN("io", 40), _("Return to harbor"))->SetVisible(false);

    // Die 6 Richtungen
    for(unsigned i = 0; i < 6; ++i)
        AddImageButton(12 + i, BUTTON_POS[i][0], BUTTON_POS[i][1], 18, 18, TC_GREY, LOADER.GetImageN("io", 181 + (i + 4) % 6))->SetVisible(false);

}
Example #7
0
iwDiplomacy::iwDiplomacy(const GameWorldViewer& gwv, GameCommandFactory& gcFactory):
    IngameWindow(CGI_DIPLOMACY, (unsigned short) - 1, (unsigned short) - 1, 500, FIRST_LINE_Y + gwv.GetWorld().GetPlayerCount() * (CELL_HEIGHT + SPACE_HEIGHT) + 20,
        _("Diplomacy"), LOADER.GetImageN("resource", 41)),
    gwv(gwv), gcFactory(gcFactory)
{
    // "Header" der Tabelle
    AddText(0, LINE_DISTANCE_TO_MARGINS + PING_FIELD_POS, HEADER_Y, _("Ping"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER, NormalFont);
    AddText(1, LINE_DISTANCE_TO_MARGINS + TREATIES_POS, HEADER_Y, _("Treaties"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER, NormalFont);



    for(unsigned i = 0; i < gwv.GetWorld().GetPlayerCount(); ++i)
    {
        const GamePlayer& player = gwv.GetWorld().GetPlayer(i);
        if(player.isUsed())
        {
            // Einzelne Spielernamen
            AddText(100 + i, LINE_DISTANCE_TO_MARGINS + 10, FIRST_LINE_Y + i * (CELL_HEIGHT + SPACE_HEIGHT) + CELL_HEIGHT / 2,
                    player.name, player.color, glArchivItem_Font::DF_VCENTER,
                    NormalFont);

            if(player.ps == PS_OCCUPIED)
                // Ping
                AddDeepening(200 + i, LINE_DISTANCE_TO_MARGINS + PING_FIELD_POS - PING_FIELD_WIDTH / 2,
                             FIRST_LINE_Y + i * (CELL_HEIGHT + SPACE_HEIGHT) + CELL_HEIGHT / 2 - 11, PING_FIELD_WIDTH, 22, TC_GREY, "0", NormalFont, COLOR_YELLOW);

            // An sich selber braucht man keine Bündnisse zu schließen
            if(gwv.GetPlayerId() != i)
            {
                // Bündnisvertrag-Button
                glArchivItem_Bitmap* image = LOADER.GetImageN("io", 61);
                ctrlButton* button = AddImageButton(300 + i, LINE_DISTANCE_TO_MARGINS + TREATIES_POS - TREATIE_BUTTON_SPACE / 2 - (image->getWidth() + 8),
                                                    FIRST_LINE_Y + i * (CELL_HEIGHT + SPACE_HEIGHT) + CELL_HEIGHT / 2 - 40 / 2, 40,
                                                    40, TC_GREY, image, _("Treaty of alliance"));

                // Verbleibende Zeit unter dem Button
                AddText(500 + i, button->GetX(false) + button->GetWidth() / 2, button->GetY(false) + button->GetHeight() + 4, "", COLOR_YELLOW, glArchivItem_Font::DF_CENTER, SmallFont);

                // Nichtangriffspakt
                image = LOADER.GetImageN("io", 100);
                button = AddImageButton(400 + i, LINE_DISTANCE_TO_MARGINS + TREATIES_POS + TREATIE_BUTTON_SPACE / 2,
                                        FIRST_LINE_Y + i * (CELL_HEIGHT + SPACE_HEIGHT) + CELL_HEIGHT / 2 - 40 / 2, 40,
                                        40, TC_GREY, image, _("Non-aggression pact"));

                // Verbleibende Zeit unter dem Button
                AddText(600 + i, button->GetX(false) + button->GetWidth() / 2, button->GetY(false) + button->GetHeight() + 4, "", COLOR_YELLOW, glArchivItem_Font::DF_CENTER, SmallFont);

            }
        }
    }

    // Farben festlegen
    Msg_PaintAfter();
}
/**
 *  Konstruktor von @p iwMerchandiseStatistics.
 *
 *  @author jh
 */
iwMerchandiseStatistics::iwMerchandiseStatistics()
    : IngameWindow(CGI_MERCHANDISE_STATISTICS, 0xFFFE, 0xFFFE, 252, 310, _("Merchandise"), LOADER.GetImageN("resource", 41)), currentTime(STAT_1H)
{
    // Statistikfeld
    AddImage(0, 10 + 115, 23 + 81, LOADER.GetImageN("io", 228));

    // Waren-Buttons
    // obere Reihe
    ctrlMultiSelectGroup* types = AddMultiSelectGroup(22, ctrlOptionGroup::ILLUMINATE);
    types->AddImageButton(1, 17, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_WOOD), _("Wood"));
    types->AddImageButton(2, 48, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_BOARDS), _("Boards"));
    types->AddImageButton(3, 79, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_STONES), _("Stones"));
    types->AddImageButton(4, 110, 192, 30, 30, TC_GREY, LOADER.GetImageN("io", 80), _("Food"));
    types->AddImageButton(5, 141, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_WATER), _("Water"));
    types->AddImageButton(6, 172, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_BEER), _("Beer"));
    types->AddImageButton(7, 203, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_COAL), _("Coal"));

    // untere Reihe
    types->AddImageButton(8, 17, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_IRONORE), _("Ironore"));
    types->AddImageButton(9, 48, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_GOLD), _("Gold"));
    types->AddImageButton(10, 79, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_IRON), _("Iron"));
    types->AddImageButton(11, 110, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_COINS), _("Coins"));
    types->AddImageButton(12, 141, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_HAMMER), _("Tools"));
    types->AddImageButton(13, 172, 227, 30, 30, TC_GREY, LOADER.GetImageN("io", 111), _("Weapons"));
    types->AddImageButton(14, 203, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_BOAT), _("Boats"));

    // Hilfe
    AddImageButton(16, 17, 261, 30, 32, TC_GREY, LOADER.GetImageN("io", 21), _("Help"));

    // Mülleimer
    AddImageButton(17, 49, 263, 30, 28, TC_GREY, LOADER.GetImageN("io", 106), _("Delete all"));

    // Zeiten
    ctrlOptionGroup* times = AddOptionGroup(23, ctrlOptionGroup::ILLUMINATE);
    times->AddTextButton(18, 81, 263, 36, 28, TC_GREY, _("15 m"), NormalFont);
    times->AddTextButton(19, 119, 263, 36, 28, TC_GREY, _("1 h"), NormalFont);
    times->AddTextButton(20, 155, 263, 36, 28, TC_GREY, _("4 h"), NormalFont);
    times->AddTextButton(21, 191, 263, 36, 28, TC_GREY, _("16 h"), NormalFont);
    times->SetSelection(19);


    // Zeit-Werte an der x-Achse
    timeAnnotations = std::vector<ctrlText*>(7);
    for (unsigned i = 0; i < 7; ++i)
    {
        timeAnnotations[i] = AddText(32 + i, 211 + i, 125 + i, "", MakeColor(255, 136, 96, 52),
                                     glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_TOP, LOADER.GetFontN("resource", 0));
    }

    // Aktueller Maximalwert an der y-Achse
    maxValue = AddText(31, 211, 55, "1", MakeColor(255, 136, 96, 52),
                       glArchivItem_Font::DF_RIGHT | glArchivItem_Font::DF_VCENTER, LOADER.GetFontN("resource", 0));
}
iwDiplomacy::iwDiplomacy(const GameWorldViewer& gwv, GameCommandFactory& gcFactory)
    : IngameWindow(CGI_DIPLOMACY, IngameWindow::posLastOrCenter,
                   Extent(500, FIRST_LINE_Y + gwv.GetWorld().GetNumPlayers() * (CELL_HEIGHT + SPACE_HEIGHT) + 20), _("Diplomacy"),
                   LOADER.GetImageN("resource", 41)),
      gwv(gwv), gcFactory(gcFactory)
{
    // "Header" der Tabelle
    AddText(0, DrawPoint(LINE_DISTANCE_TO_MARGINS + PING_FIELD_POS, HEADER_Y), _("Ping"), COLOR_YELLOW, FontStyle::CENTER, NormalFont);
    AddText(1, DrawPoint(LINE_DISTANCE_TO_MARGINS + TREATIES_POS, HEADER_Y), _("Treaties"), COLOR_YELLOW, FontStyle::CENTER, NormalFont);

    DrawPoint curTxtPos(LINE_DISTANCE_TO_MARGINS + 10, FIRST_LINE_Y + CELL_HEIGHT / 2 - CELL_HEIGHT - SPACE_HEIGHT);
    for(unsigned i = 0; i < gwv.GetWorld().GetNumPlayers(); ++i)
    {
        const GamePlayer& player = gwv.GetWorld().GetPlayer(i);
        curTxtPos.y += CELL_HEIGHT + SPACE_HEIGHT;
        if(!player.isUsed())
            continue;
        // Einzelne Spielernamen
        AddText(100 + i, curTxtPos, player.name, player.color, FontStyle::VCENTER, NormalFont);

        if(player.ps == PS_OCCUPIED)
        {
            // Ping
            DrawPoint pingPos(LINE_DISTANCE_TO_MARGINS + PING_FIELD_POS - PING_FIELD_SIZE.x / 2, curTxtPos.y);
            AddTextDeepening(200 + i, pingPos, PING_FIELD_SIZE, TC_GREY, "0", NormalFont, COLOR_YELLOW);
        }

        // An sich selber braucht man keine Bündnisse zu schließen
        if(gwv.GetPlayerId() == i)
            continue;
        // Bündnisvertrag-Button
        glArchivItem_Bitmap* image = LOADER.GetImageN("io", 61);
        Extent btSize(40, 40);
        DrawPoint btPos(LINE_DISTANCE_TO_MARGINS + TREATIES_POS - TREATIE_BUTTON_SPACE / 2 - (image->getWidth() + 8),
                        curTxtPos.y - btSize.y / 2);
        ctrlButton* button = AddImageButton(300 + i, btPos, btSize, TC_GREY, image, _("Treaty of alliance"));

        // Verbleibende Zeit unter dem Button
        DrawPoint remainingTimePos = button->GetPos() + DrawPoint(btSize.x / 2, btSize.y + 4);
        AddText(500 + i, remainingTimePos, "", COLOR_YELLOW, FontStyle::CENTER, SmallFont);

        // Nichtangriffspakt
        image = LOADER.GetImageN("io", 100);
        btPos.x = LINE_DISTANCE_TO_MARGINS + TREATIES_POS + TREATIE_BUTTON_SPACE / 2;
        button = AddImageButton(400 + i, btPos, btSize, TC_GREY, image, _("Non-aggression pact"));

        // Verbleibende Zeit unter dem Button
        remainingTimePos = button->GetPos() + DrawPoint(btSize.x / 2, btSize.y + 4);
        AddText(600 + i, remainingTimePos, "", COLOR_YELLOW, FontStyle::CENTER, SmallFont);
    }
    // Farben festlegen
    Msg_PaintAfter();
}
iwDemolishBuilding::iwDemolishBuilding(GameWorldViewer* const gwv, const noBaseBuilding* building, const bool flag)
    : IngameWindow(building->CreateGUIID(), 0xFFFE, 0xFFFE, 200, 200, _("Demolish?"), LOADER.GetImageN("resource", 41)), gwv(gwv), building(building), flag(flag)
{
    // Ja
    AddImageButton(0, 14, 140, 66, 40, TC_RED1, LOADER.GetImageN("io", 32)); //-V525
    // Nein
    AddImageButton(1, 82, 140, 66, 40, TC_GREY, LOADER.GetImageN("io", 40));
    // Gehe zum Standort
    AddImageButton(2, 150, 140, 36, 40, TC_GREY, LOADER.GetImageN("io", 107));
    // Gebäudebild
    AddImage(3, 104, 109, building->GetBuildingImage());
    // Gebäudename
    AddText(4, 100, 125, _(BUILDING_NAMES[building->GetBuildingType()]), 0xFFFFFF00, glArchivItem_Font::DF_CENTER, NormalFont);
}
Example #11
0
iwMusicPlayer::iwMusicPlayer()
    : IngameWindow(CGI_MUSICPLAYER, (unsigned short) - 1, (unsigned short) - 1, 430, 330, _("Music player"),
                   LOADER.GetImageN("resource", 41)), changed(false)
{

    AddList(0, 20, 30, 330, 200, TC_GREEN1, NormalFont);
    AddText(1, 20, 240, _("Playlist:"), COLOR_YELLOW, 0, NormalFont);
    AddComboBox(2, 20, 260, 330, 22, TC_GREEN1, NormalFont, 200);

    // Playlistbuttons
    const unsigned short button_distance = 10;
    const unsigned short button_width = (330 - button_distance) / 2;
    ctrlButton* b1 = AddTextButton(3, 20, 290, button_width, 22, TC_GREEN2, _("Add"), NormalFont);
    AddTextButton(4, b1->GetX(false) + button_width + button_distance, 290, button_width, 22, TC_GREEN2, _("Remove"), NormalFont);
    //AddTextButton(5,b1->GetX(false),320,button_width,22,TC_GREEN2,_("Save"),NormalFont);
    //AddTextButton(6,b2->GetX(false),320,button_width,22,TC_GREEN2,_("Load"),NormalFont);

    // Buttons für die Musikstücke
    AddImageButton(7, 370, 30, 40, 40, TC_GREY, LOADER.GetImageN("io", 138), _("Add track"));
    AddImageButton(8, 370, 80, 40, 40, TC_GREY, LOADER.GetImageN("io_new", 2), _("Add directory of tracks"));
    AddImageButton(9, 370, 130, 40, 40, TC_RED1, LOADER.GetImageN("io", 220), _("Remove track"));
    AddImageButton(10, 370, 180, 40, 15, TC_GREY, LOADER.GetImageN("io", 33), _("Upwards"));
    AddImageButton(11, 370, 195, 40, 15, TC_GREY, LOADER.GetImageN("io", 34), _("Downwards"));
    AddDeepening(12, 370, 220, 40, 20, TC_GREY, "1", NormalFont, COLOR_YELLOW);
    AddImageButton(13, 370, 240, 20, 20, TC_RED1, LOADER.GetImageN("io", 139), _("Less repeats"));
    AddImageButton(14, 390, 240, 20, 20, TC_GREY, LOADER.GetImageN("io", 138), _("More repeats"));
    AddImageButton(15, 370, 270, 40, 40, TC_GREY, LOADER.GetImageN("io", 107), _("Playback in this order")); //225

    // Mit Werten füllen
    MUSICPLAYER.GetPlaylist().FillMusicPlayer(this);
    UpdatePlaylistCombo(SETTINGS.sound.playlist);
}
Example #12
0
iwLoad::iwLoad(CreateServerInfo csi) : iwSaveLoad(0, _("Load game!")), csi(std::move(csi))
{
    AddEdit(1, DrawPoint(20, 350), Extent(510, 22), TC_GREEN2, NormalFont);
    AddImageButton(2, DrawPoint(540, 346), Extent(40, 40), TC_GREEN2, LOADER.GetImageN("io", 48));
    // Tabelle ausfüllen beim Start
    RefreshTable();
}
Example #13
0
//IngameWindow::IngameWindow(unsigned int id, unsigned short x, unsigned short y, unsigned short width, unsigned short height, const std::string& title, glArchivItem_Bitmap *background, bool modal)
iwObservate::iwObservate(GameWorldViewer * const gwv,const unsigned short selected_x, const unsigned short selected_y)
    : IngameWindow(gwv->CreateGUIID(selected_x, selected_y),0xFFFE,0xFFFE,300,250,_("Observation window"),NULL),
      view(new GameWorldView(gwv, GetX() + 10, GetY() + 15, 300 - 20, 250 - 20)), selected_x(selected_x), selected_y(selected_y), last_x(-1), last_y(-1), scroll(false)
{
    view->MoveToMapObject(selected_x, selected_y);
    SetCloseOnRightClick(false);

    // Lupe: 36
    AddImageButton(1, GetWidth() / 2 - 36*2, GetHeight() - 50, 36, 36, TC_BRICKS, LOADER.GetImageN("io", 36));
    // Kamera (Folgen): 43
    AddImageButton(2, GetWidth() / 2 - 36, GetHeight() - 50, 36, 36, TC_BRICKS, LOADER.GetImageN("io", 43));
    // Zum Ort
    AddImageButton(3, GetWidth() / 2, GetHeight() - 50, 36, 36, TC_GREY, LOADER.GetImageN("io", 107));
    // Fenster vergroessern/verkleinern
    AddImageButton(4, GetWidth() / 2 + 36, GetHeight() - 50, 36, 36, TC_GREY, LOADER.GetImageN("io", 109));
}
Example #14
0
iwLoad::iwLoad(const CreateServerInfo& csi) : iwSaveLoad(0, _("Load game!")),  csi(csi)
{
    AddEdit(1, 20, 350, 510, 22, TC_GREEN2, NormalFont);
    AddImageButton(2, 540, 346, 40, 40, TC_GREEN2, LOADER.GetImageN("io", 48));
    // Tabelle ausfüllen beim Start
    RefreshTable();
}
/// Konstruktor von @p iwBuildingProductivities.
iwBuildingProductivities::iwBuildingProductivities()
    : IngameWindow(CGI_BUILDINGSPRODUCTIVITY, 0xFFFE, 0xFFFE,
                   left_x + 2 * percent_width + 2 * image_percent_x + percent_image_x + right_x,
                   top_y + (BUILDINGS_COUNT / 2 + 1) * (distance_y + 1), _("Productivity"), LOADER.GetImageN("resource", 41)),
    percents(40, 0)
{
    for(unsigned y = 0; y < BUILDINGS_COUNT / 2 + BUILDINGS_COUNT % 2; ++y)
    {
        for(unsigned x = 0; x < 2; ++x)
        {
            if(y * 2 + x < BUILDINGS_COUNT)
            {
				if(bts[y*2+x]!=BLD_CHARBURNER)
					AddImage((y * 2 + x) * 2, left_x + x * (percent_image_x + percent_width + image_percent_x), top_y + distance_y * y + percent_height / 2,LOADER.GetImageN(NATION_ICON_IDS[GameClient::inst().GetLocalPlayer()->nation], bts[y * 2 + x]), _(BUILDING_NAMES[bts[y * 2 + x]]));
				else
					AddImage((y * 2 + x) * 2, left_x + x * (percent_image_x + percent_width + image_percent_x), top_y + distance_y * y + percent_height / 2,LOADER.GetImageN("charburner", GameClient::inst().GetLocalPlayer()->nation * 8 + 8), _(BUILDING_NAMES[bts[y * 2 + x]]));

                AddPercent((y * 2 + x) * 2 + 1, left_x + image_percent_x + x * (percent_image_x + percent_width + image_percent_x), top_y + distance_y * y,
                           percent_width, percent_height, TC_GREY, COLOR_YELLOW, SmallFont, &percents[bts[y * 2 + x]]);
            }
        }
    }

    UpdatePercents();

    // Hilfe-Button
    AddImageButton(500, width - 14 - 30, height - 20 - 32, 30, 32, TC_GREY, LOADER.GetImageN("io", 21), _("Help"));
}
/**
 *  Konstruktor von @p iwBuildingSite.
 *
 *  @author OLiver
 */
iwBuildingSite::iwBuildingSite(GameWorldViewer *const gwv, const noBuildingSite *const buildingsite) 
: IngameWindow(buildingsite->CreateGUIID(), 0xFFFE, 0xFFFE, 226, 194, _(BUILDING_NAMES[buildingsite->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
	gwv(gwv), buildingsite(buildingsite)
{
	// Bild des Gebäudes
	AddImage(0, 113, 130, buildingsite->GetBuildingImage());
	// Gebäudename 
	AddText(1, 113, 44, _("Order of building site"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER, NormalFont);

	// Hilfe
	AddImageButton( 2,  16, 147, 30, 32, TC_GREY, LOADER.GetImageN("io",  21));
	// Gebäude abbrennen
	AddImageButton( 3,  50, 147, 34, 32, TC_GREY, LOADER.GetImageN("io",  23));

	// "Gehe Zu Ort"
	AddImageButton( 4, 179, 147, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));
}
Example #17
0
/// Konstruktor von @p iwMilitary.
iwBuildings::iwBuildings(GameWorldViewer* const gwv, dskGameInterface* const gi) : IngameWindow(CGI_BUILDINGS, 0xFFFE, 0xFFFE, 185, 480, _("Buildings"), LOADER.GetImageN("resource", 41)),gwv(gwv),gi(gi)
{
    // Symbole für die einzelnen Gebäude erstellen
    for(unsigned short y = 0; y < BUILDINGS_COUNT / 4 + (BUILDINGS_COUNT % 4 > 0 ? 1 : 0); ++y)
    {
        for(unsigned short x = 0; x < ((y == BUILDINGS_COUNT / 4) ? BUILDINGS_COUNT % 4 : 4); ++x)
        {
			if(bts[y*4+x] != BLD_CHARBURNER)
				AddImageButton(y * 4 + x, first_x - 16 + icon_distance_x * x, first_y - 16 + icon_distance_y * y,32,32,TC_GREY,LOADER.GetImageN(NATION_ICON_IDS[GAMECLIENT.GetLocalPlayer()->nation], bts[y * 4 + x]), _(BUILDING_NAMES[bts[y * 4 + x]]));
			else
				AddImageButton(y * 4 + x, first_x - 16 + icon_distance_x * x, first_y - 16  + icon_distance_y * y,32,32,TC_GREY,LOADER.GetImageN("charburner", GAMECLIENT.GetLocalPlayer()->nation * 8 + 8) , _(BUILDING_NAMES[bts[y * 4 + x]]));
        }
    }

    // Hilfe-Button
    AddImageButton(32, width - 14 - 30, height - 20 - 32, 30, 32, TC_GREY, LOADER.GetImageN("io", 21), _("Help"));

}
iwBuildingSite::iwBuildingSite(GameWorldView& gwv, const noBuildingSite* const buildingsite)
    : IngameWindow(buildingsite->CreateGUIID(), IngameWindow::posAtMouse, Extent(226, 194),
                   _(BUILDING_NAMES[buildingsite->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
      gwv(gwv), buildingsite(buildingsite)
{
    // Bild des Gebäudes
    AddImage(0, DrawPoint(113, 130), buildingsite->GetBuildingImage());
    // Gebäudename
    AddText(1, DrawPoint(113, 44), _("Order of building site"), COLOR_YELLOW, FontStyle::CENTER, NormalFont);

    // Hilfe
    AddImageButton(2, DrawPoint(16, 147), Extent(30, 32), TC_GREY, LOADER.GetImageN("io", 225), _("Help"));
    // Gebäude abbrennen
    AddImageButton(3, DrawPoint(50, 147), Extent(34, 32), TC_GREY, LOADER.GetImageN("io", 23), _("Demolish house"));

    // "Gehe Zu Ort"
    AddImageButton(4, DrawPoint(179, 147), Extent(30, 32), TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));
}
Example #19
0
/**
 *  Konstruktor von @p iwTools.
 *
 *  @author OLiver
 */
iwTools::iwTools()
    : IngameWindow(CGI_TOOLS, 0xFFFE, 0xFFFE, 166 + (GAMECLIENT.GetGGS().isEnabled(ADDON_TOOL_ORDERING) ? 46 : 0), 432, _("Tools"), LOADER.GetImageN("io", 5)),
      settings_changed(false)
{
    // Einzelne Balken
    AddProgress( 0, 17,  25, 132, 26, TC_GREY, 141, 140, 10, _("Tongs"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 1, 17,  53, 132, 26, TC_GREY, 145, 144, 10, _("Axe"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 2, 17,  81, 132, 26, TC_GREY, 147, 146, 10, _("Saw"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 3, 17, 109, 132, 26, TC_GREY, 149, 148, 10, _("Pick-axe"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 4, 17, 137, 132, 26, TC_GREY, 143, 142, 10, _("Hammer"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 5, 17, 165, 132, 26, TC_GREY, 151, 150, 10, _("Shovel"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 6, 17, 193, 132, 26, TC_GREY, 153, 152, 10, _("Crucible"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 7, 17, 221, 132, 26, TC_GREY, 155, 154, 10, _("Rod and line"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 8, 17, 249, 132, 26, TC_GREY, 157, 156, 10, _("Scythe"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress( 9, 17, 277, 132, 26, TC_GREY, 159, 158, 10, _("Cleaver"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress(10, 17, 305, 132, 26, TC_GREY, 161, 160, 10, _("Rolling pin"), 4, 4, 0, _("Less often"), _("More often"));
    AddProgress(11, 17, 333, 132, 26, TC_GREY, 163, 162, 10, _("Bow"), 4, 4, 0, _("Less often"), _("More often"));

    if (GAMECLIENT.GetGGS().isEnabled(ADDON_TOOL_ORDERING))
    {
        // qx:tools
        for (unsigned i = 0; i < TOOL_COUNT; ++i)
        {
            AddImageButton(100 + i * 2, 174, 25   + i * 28, 20, 13, TC_GREY, LOADER.GetImageN("io",  33), "+1");
            AddImageButton(101 + i * 2, 174, 25 + 13 + i * 28, 20, 13, TC_GREY, LOADER.GetImageN("io",  34), "-1");
            std::stringstream str;
            str << std::max(0, int( GAMECLIENT.GetLocalPlayer().tools_ordered[i] + GAMECLIENT.GetLocalPlayer().tools_ordered_delta[i] ));
            AddDeepening  (200 + i, 151, 25 + 4 + i * 28, 20, 18, TC_GREY, str.str(), NormalFont, COLOR_YELLOW);
        }
    }
    m_Updated = GAMECLIENT.GetGFNumber();

    // Info
    AddImageButton(12,  18, 384, 30, 32, TC_GREY, LOADER.GetImageN("io",  21), _("Help"));
    // Standard
    AddImageButton(13, 118 + (GAMECLIENT.GetGGS().isEnabled(ADDON_TOOL_ORDERING) ? 46 : 0), 384, 30, 32, TC_GREY, LOADER.GetImageN("io", 191), _("Default"));

    // Einstellungen festlegen
    for(unsigned char i = 0; i < TOOL_COUNT; ++i)
        GetCtrl<ctrlProgress>(i)->SetPosition(GAMECLIENT.visual_settings.tools_settings[i]);

    // Netzwerk-Übertragungs-Timer
    AddTimer(14, 2000);
}
iwDistribution::iwDistribution(const GameWorldViewer& gwv, GameCommandFactory& gcFactory)
    : IngameWindow(CGI_DISTRIBUTION, IngameWindow::posLastOrCenter, Extent(290, 312), _("Distribution of goods"),
                   LOADER.GetImageN("resource", 41)),
      gwv(gwv), gcFactory(gcFactory), settings_changed(false)
{
    CreateGroups();

    // Tab Control
    ctrlTab* tab = AddTabCtrl(0, DrawPoint(10, 20), 270);
    DrawPoint txtPos(GetSize().x / 2, 60);
    DrawPoint progPos(PROGRESS_BORDER_DISTANCE - tab->GetPos().x, txtPos.y);
    const Extent progSize(GetSize().x - 2 * PROGRESS_BORDER_DISTANCE, 20);

    for(unsigned groupId = 0; groupId < groups.size(); groupId++)
    {
        const DistributionGroup& group = groups[groupId];
        ctrlGroup* tabGrp = tab->AddTab(group.img, group.name, groupId);
        txtPos.y = progPos.y = 60;
        unsigned curId = 0;
        for(const std::string& entry : group.entries)
        {
            unsigned txtId = group.entries.size() + curId;
            tabGrp->AddText(txtId, txtPos, entry, COLOR_YELLOW, FontStyle::CENTER | FontStyle::BOTTOM, SmallFont);
            tabGrp->AddProgress(curId++, progPos, progSize, TC_GREY, 139, 138, 10);
            txtPos.y = progPos.y += progSize.y * 2;
        }
    }

    // Gruppe auswählen
    tab->SetSelection(0);

    // Timer für die Übertragung der Daten via Netzwerk
    AddTimer(1, 2000);

    const Extent btSize(32, 32);
    // Hilfe
    AddImageButton(2, DrawPoint(15, GetSize().y - 15 - btSize.y), btSize, TC_GREY, LOADER.GetImageN("io", 225), _("Help"));
    // Standardbelegung
    AddImageButton(10, GetSize() - DrawPoint::all(15) - btSize, btSize, TC_GREY, LOADER.GetImageN("io", 191), _("Default"));

    UpdateSettings();
}
Example #21
0
ctrlScrollBar::ctrlScrollBar(Window* parent,
                             unsigned int id,
                             unsigned short x,
                             unsigned short y,
                             unsigned short width,
                             unsigned short height,
                             unsigned short button_height,
                             TextureColor tc,
                             unsigned short pagesize)
    : Window(DrawPoint(x, y), id, parent, width, height),
      button_height(button_height), tc(tc), pagesize(pagesize),
      scroll_range(0), scroll_pos(0), scroll_height(0), sliderHeight(0), sliderPos(0), isMouseScrolling(false), last_y(0)
{
    visible_ = false;

    AddImageButton(0, 0, 0, width, button_height, tc, LOADER.GetImageN("io", 33));
    AddImageButton(1, 0, (height > button_height) ? height - button_height : 1, width, button_height, tc, LOADER.GetImageN("io", 34));

    Resize(width, height);
}
Example #22
0
/**
 *  Konstruktor von @p iwMilitaryBuilding.
 *
 *  @author OLiver
 */
iwMilitaryBuilding::iwMilitaryBuilding(GameWorldViewer* const gwv, dskGameInterface* const gi, nobMilitary* const building)
    : IngameWindow(building->CreateGUIID(), (unsigned short) - 2, (unsigned short) - 2, 226, 194, _(BUILDING_NAMES[building->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
      building(building),gi(gi), gwv(gwv)
{
    // Schwert
    AddImage(0, 28, 39, LOADER.GetMapImageN(2298));
    AddImage(1, 28, 39, LOADER.GetMapImageN(2250 + GD_SWORD));

    // Schild
    AddImage(2, 196, 39, LOADER.GetMapImageN(2298));
    AddImage(3, 196, 39, LOADER.GetMapImageN(2250 + GD_SHIELDROMANS));

    // Hilfe
    AddImageButton(4,  16, 147, 30, 32, TC_GREY, LOADER.GetImageN("io",  21));
    // Abreißen
    AddImageButton(5,  50, 147, 34, 32, TC_GREY, LOADER.GetImageN("io",  23));
    // Gold an/aus (227,226)
    AddImageButton(6,  90, 147, 32, 32, TC_GREY, LOADER.GetImageN("io", ((building->IsGoldDisabledVirtual()) ? 226 : 227)));
    // "Gehe Zu Ort"
    AddImageButton(7, 179, 147, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));

    // Gebäudebild
    AddImage(8, 117, 114, LOADER.GetNationImageN(building->GetNation(), 250 + 5 * building->GetBuildingType()));
	// "Go to next" (building of same type)
    AddImageButton( 9, 179, 115, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to next military building"));
	//addon military control active? -> show button
	if(GAMECLIENT.GetGGS().isEnabled(ADDON_MILITARY_CONTROL))
		AddImageButton( 10, 124, 147, 30, 32, TC_GREY, LOADER.GetImageN("io_new", 4), _("Send max rank soldiers to a warehouse"));
}
Example #23
0
iwBuilding::iwBuilding(GameWorldView& gwv, GameCommandFactory& gcFactory, nobUsual* const building)
    : IngameWindow(building->CreateGUIID(), (unsigned short) - 2, (unsigned short) - 2, 226, 194, _(BUILDING_NAMES[building->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
      gwv(gwv), gcFactory(gcFactory), building(building)
{
    // Arbeitersymbol
    AddImage(0, 28, 39, LOADER.GetMapImageN(2298));

    // Exception: charburner
    if (building->GetBuildingType() != BLD_CHARBURNER)
    {
        AddImage(13, 28, 39, LOADER.GetMapImageN(2300 + USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].job));
    }
    else
    {
        AddImage(13, 28, 39, LOADER.GetImageN("io_new", 5));	
    }

    // Gebäudesymbol
    AddImage(1, 117, 114, building->GetBuildingImage());

    // Symbol der produzierten Ware (falls hier was produziert wird)
    if(USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].produced_ware != GD_NOTHING)
    {
        AddImage(2, 196, 39, LOADER.GetMapImageN(2298));
        AddImage(3, 196, 39, LOADER.GetMapImageN(2250 + USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].produced_ware));
    }

    // Info
    AddImageButton( 4,  16, 147, 30, 32, TC_GREY, LOADER.GetImageN("io",  225), _("Help"));
    // Abreißen
    AddImageButton( 5,  50, 147, 34, 32, TC_GREY, LOADER.GetImageN("io",  23), _("Demolish house"));
    // Produktivität einstellen (196,197) (bei Spähturm ausblenden)
    Window* enable_productivity = AddImageButton( 6,  90, 147, 34, 32, TC_GREY, LOADER.GetImageN("io", ((building->IsProductionDisabledVirtual()) ? 197 : 196)));
    if(building->GetBuildingType() == BLD_LOOKOUTTOWER)
        enable_productivity->SetVisible(false);
    // Bei Bootsbauer Button zum Umwählen von Booten und Schiffen
    if(building->GetBuildingType() == BLD_SHIPYARD)
    {
        // Jenachdem Boot oder Schiff anzeigen
        unsigned io_dat_id = (static_cast<nobShipYard*>(building)->GetMode() == nobShipYard::BOATS)
                             ? IODAT_BOAT_ID : IODAT_SHIP_ID;
        AddImageButton(11, 130, 147, 43, 32, TC_GREY, LOADER.GetImageN("io", io_dat_id));
    }

    // "Gehe Zum Ort"
    AddImageButton( 7, 179, 147, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));	

    // Gebäudebild und dessen Schatten
    AddImage( 8, 117, 114, LOADER.GetNationImage(building->GetNation(), 250 + 5 * building->GetBuildingType()));

    // Produktivitätsanzeige (bei Katapulten und Spähtürmen ausblenden)
    Window* productivity = AddPercent(9, 59, 31, 106, 16, TC_GREY, 0xFFFFFF00, SmallFont, building->GetProductivityPointer());
    if(building->GetBuildingType() == BLD_CATAPULT || building->GetBuildingType() == BLD_LOOKOUTTOWER)
        productivity->SetVisible(false);

    AddText(10, 113, 50, _("(House unoccupied)"), COLOR_RED, glArchivItem_Font::DF_CENTER, NormalFont);

	// "Go to next" (building of same type)
    AddImageButton( 12, 179, 115, 30, 32, TC_GREY, LOADER.GetImageN("io_new", 11), _("Go to next building of same type"));
}
Example #24
0
/**
 *  Konstruktor von @p iwRoadWindow.
 *
 *  @author OLiver
 */
iwRoadWindow::iwRoadWindow(dskGameInterface *const GameInterface, bool flagpossible, int mouse_x, int mouse_y)
	: IngameWindow(CGI_ROADWINDOW, mouse_x, mouse_y, 200, 100, _("Activity window"), LOADER.GetImageN("io", 1)),
	GameInterface(GameInterface), last_x(mouse_x), last_y(mouse_y)
{
	// Bau abbrechen
	ctrlButton *cancel = AddImageButton(1, 10, 20, 36, 36, TC_GREY, LOADER.GetImageN("io", 110), _("Interrupt road building"));

	if(flagpossible)
	{
		// Flagge platzieren
		AddImageButton(0, 10, 20, 36, 36, TC_GREY, LOADER.GetImageN("io", 70), _("Erect flag"));
		// Abbrechenbutton daneben schieben
		cancel->Move(46, 20);
	}

	if(x + GetWidth() > VideoDriverWrapper::inst().GetScreenWidth())
		x = mouse_x - GetWidth() - 40;
	if(y + GetIwHeight() > VideoDriverWrapper::inst().GetScreenHeight())
		y = mouse_y - GetIwHeight() - 40;

	VideoDriverWrapper::inst().SetMousePos(GetX()+20,GetY()+45);
}
ctrlScrollBar::ctrlScrollBar(Window* parent,
                             unsigned int id,
                             unsigned short x,
                             unsigned short y,
                             unsigned short width,
                             unsigned short height,
                             unsigned short button_height,
                             TextureColor tc,
                             unsigned short pagesize)
    : Window(x, y, id, parent, width, height),
      button_height(button_height), tc(tc), pagesize(pagesize),
      move(false), scroll_range(0), scroll_pos(0), scroll_height(0), scrollbar_height(0), scrollbar_pos(0), last_y(0)
{
    visible_ = false;

    AddImageButton(0, 0, 0, width, button_height, tc, LOADER.GetImageN("io", 33));
    AddImageButton(1, 0, (height > button_height) ? height - button_height : 1, width, button_height, tc, LOADER.GetImageN("io", 34));

    Resize_(width, height);

    CalculateScrollBar();
}
iwBuildOrder::iwBuildOrder()
    : IngameWindow(CGI_BUILDORDER, (unsigned short) - 1, (unsigned short) - 1, 320, 300, _("Building sequence"), LOADER.GetImageN("io", 5)),
      settings_changed(false)
{
    ctrlList* list = AddList(0, 15, 60, 150, 220, TC_GREY, NormalFont);

    // Liste füllen
    BuildOrders buildOrders = GAMECLIENT.visual_settings.build_order;
    for(unsigned char i = 0; i < buildOrders.size(); ++i)
        list->AddString(_(BUILDING_NAMES[buildOrders[i]])); //-V807

    // Nach ganz oben
    AddImageButton(1, 250, 194, 48, 20, TC_GREY, LOADER.GetImageN("io", 215), _("Top"));
    // Hoch
    AddImageButton(2, 250, 216, 48, 20, TC_GREY, LOADER.GetImageN("io",  33), _("Up"));
    // Runter
    AddImageButton(3, 250, 238, 48, 20, TC_GREY, LOADER.GetImageN("io",  34), _("Down"));
    // Nach ganz unten
    AddImageButton(4, 250, 260, 48, 20, TC_GREY, LOADER.GetImageN("io", 216), _("Bottom"));

    // Bild der Auswahl
    AddImage(5, 240, 150, LOADER.GetNationImage(GAMECLIENT.GetLocalPlayer().nation, 250 + buildOrders[0] * 5));

    ctrlComboBox* combo = AddComboBox(6, 15, 30, 290, 20, TC_GREY, NormalFont, 100);
    combo->AddString(_("Sequence of given order")); // "Reihenfolge der Auftraggebung"
    combo->AddString(_("After the following order")); // "Nach folgender Reihenfolge"

    // Eintrag in Combobox auswählen
    combo->SetSelection(GAMECLIENT.visual_settings.order_type);

    // Standard
    AddImageButton(10, 200, 250, 48, 30, TC_GREY, LOADER.GetImageN("io", 191), _("Default"));

    // Absendetimer, in 2s-Abschnitten wird jeweils das ganze als Netzwerknachricht ggf. abgeschickt
    AddTimer(11, 2000);

    list->SetSelection(0);
}
iwBuildOrder::iwBuildOrder(const GameWorldViewer& gwv)
    : IngameWindow(CGI_BUILDORDER, IngameWindow::posLastOrCenter, Extent(320, 300), _("Building sequence"), LOADER.GetImageN("io", 5)),
      gwv(gwv), settings_changed(false)
{
    ctrlList* list = AddList(0, DrawPoint(15, 60), Extent(150, 220), TC_GREY, NormalFont);

    // Liste füllen
    BuildOrders buildOrders = GAMECLIENT.visual_settings.build_order;
    for(auto& buildOrder : buildOrders)
        list->AddString(_(BUILDING_NAMES[buildOrder])); //-V807

    // Nach ganz oben
    AddImageButton(1, DrawPoint(250, 194), Extent(48, 20), TC_GREY, LOADER.GetImageN("io", 215), _("Top"));
    // Hoch
    AddImageButton(2, DrawPoint(250, 216), Extent(48, 20), TC_GREY, LOADER.GetImageN("io", 33), _("Up"));
    // Runter
    AddImageButton(3, DrawPoint(250, 238), Extent(48, 20), TC_GREY, LOADER.GetImageN("io", 34), _("Down"));
    // Nach ganz unten
    AddImageButton(4, DrawPoint(250, 260), Extent(48, 20), TC_GREY, LOADER.GetImageN("io", 216), _("Bottom"));

    // Bild der Auswahl
    AddImage(5, DrawPoint(240, 150), LOADER.GetNationImage(gwv.GetPlayer().nation, 250 + buildOrders[0] * 5));

    ctrlComboBox* combo = AddComboBox(6, DrawPoint(15, 30), Extent(290, 20), TC_GREY, NormalFont, 100);
    combo->AddString(_("Sequence of given order"));   // "Reihenfolge der Auftraggebung"
    combo->AddString(_("After the following order")); // "Nach folgender Reihenfolge"

    // Eintrag in Combobox auswählen
    combo->SetSelection(GAMECLIENT.visual_settings.useCustomBuildOrder ? 1 : 0);

    // Standard
    AddImageButton(10, DrawPoint(200, 250), Extent(48, 30), TC_GREY, LOADER.GetImageN("io", 191), _("Default"));

    // Absendetimer, in 2s-Abschnitten wird jeweils das ganze als Netzwerknachricht ggf. abgeschickt
    AddTimer(11, 2000);

    list->SetSelection(0);
}
Example #28
0
iwBuildings::iwBuildings(GameWorldView& gwv, GameCommandFactory& gcFactory):
    IngameWindow(CGI_BUILDINGS, IngameWindow::posAtMouse,  185, 480, _("Buildings"), LOADER.GetImageN("resource", 41)),
    gwv(gwv), gcFactory(gcFactory)
{
    const Nation playerNation = gwv.GetViewer().GetPlayer().nation;
    // Symbole für die einzelnen Gebäude erstellen
    for(unsigned short y = 0; y < BUILDINGS_COUNT / 4 + (BUILDINGS_COUNT % 4 > 0 ? 1 : 0); ++y)
    {
        for(unsigned short x = 0; x < ((y == BUILDINGS_COUNT / 4) ? BUILDINGS_COUNT % 4 : 4); ++x)
        {
			if(bts[y*4+x] != BLD_CHARBURNER)
            {
                AddImageButton(y * 4 + x, iconPadding.x - 16 + iconSpacing.x * x, iconPadding.y - 16 + iconSpacing.y * y, 32, 32, TC_GREY, LOADER.GetImageN(NATION_ICON_IDS[playerNation], bts[y * 4 + x]), _(BUILDING_NAMES[bts[y * 4 + x]]));
            }
			else
				AddImageButton(y * 4 + x, iconPadding.x - 16 + iconSpacing.x * x, iconPadding.y - 16  + iconSpacing.y * y,32,32,TC_GREY,LOADER.GetImageN("charburner", playerNation * 8 + 8) , _(BUILDING_NAMES[bts[y * 4 + x]]));
        }
    }

    // Hilfe-Button
    AddImageButton(32, width_ - 14 - 30, height_ - 20 - 32, 30, 32, TC_GREY, LOADER.GetImageN("io", 225), _("Help"));

}
/**
 *  Konstruktor von @p iwMilitaryBuilding.
 *
 *  @author OLiver
 */
iwMilitaryBuilding::iwMilitaryBuilding(GameWorldViewer * const gwv,nobMilitary *const building)
: IngameWindow(building->CreateGUIID(), (unsigned short)-2, (unsigned short)-2, 226, 194, _(BUILDING_NAMES[building->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
	building(building), gwv(gwv) 
{
	// Schwert
	AddImage(0, 28, 39, LOADER.GetMapImageN(2298));
	AddImage(1, 28, 39, LOADER.GetMapImageN(2250 + GD_SWORD));

	// Schild
	AddImage(2, 196, 39, LOADER.GetMapImageN(2298));
	AddImage(3, 196, 39, LOADER.GetMapImageN(2250 + GD_SHIELDROMANS));

	// Hilfe
	AddImageButton(4,  16, 147, 30, 32, TC_GREY, LOADER.GetImageN("io",  21));
	// Abreißen
	AddImageButton(5,  50, 147, 34, 32, TC_GREY, LOADER.GetImageN("io",  23));
	// Gold an/aus (227,226)
	AddImageButton(6,  90, 147, 32, 32, TC_GREY, LOADER.GetImageN("io", ((building->IsGoldDisabledVirtual())?226:227)));
	// "Gehe Zu Ort"
	AddImageButton(7, 179, 147, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));

	// Gebäudebild
	AddImage(8, 117, 114, LOADER.GetNationImageN(building->GetNation(), 250 + 5*building->GetBuildingType()));
}
Example #30
0
/**
 *  fügt eine Tab hinzu.
 *
 *  @author OLiver
 */
ctrlGroup* ctrlTab::AddTab(glArchivItem_Bitmap* image, std::string tooltip, const unsigned int id)
{
    if(tab_count < MAX_TAB_COUNT)
    {
        if(AddImageButton(tab_count, 36 * tab_count, 0, 36, 45, TC_RED1, image, tooltip))
        {
            tabs[tab_count++] = id;
            ctrlGroup* group = AddGroup(MAX_TAB_COUNT + 1 + id);
            group->SetVisible(false);

            return group;
        }
    }

    return NULL;
}