Beispiel #1
0
void VotingWindow::Create()
{
    InterfaceWindow::Create();

    InvertedBox *box = new InvertedBox();
    box->SetProperties( "invert", 20, 80, m_w-40, 100, " ", " ", false, false );
    RegisterButton( box );

    VoteButton *voteYes = new VoteButton();
    voteYes->SetProperties( "yes", 40, 90, 30, 20, " ", "tooltip_vote_yes", false, true );
    voteYes->m_vote = Vote::VoteYes;
    voteYes->m_voteId = m_voteId;
    RegisterButton( voteYes );

    VoteButton *voteNo = new VoteButton();
    voteNo->SetProperties( "no", 40, 120, 30, 20, " ", "tooltip_vote_no", false, true );
    voteNo->m_vote = Vote::VoteNo;
    voteNo->m_voteId = m_voteId;
    RegisterButton( voteNo );

    VoteButton *voteAbstain = new VoteButton();
    voteAbstain->SetProperties( "abstain", 40, 150, 30, 20, " ", "tooltip_vote_abstain", false, true );
    voteAbstain->m_vote = Vote::VoteAbstain;
    voteAbstain->m_voteId = m_voteId;
    RegisterButton( voteAbstain );

    CloseButton *close = new CloseButton();
    close->SetProperties( "Close", m_w/2 - 50, m_h - 25, 100, 20, "dialog_close", " ", true, false );
    RegisterButton( close );
}
Beispiel #2
0
void BadKeyWindow::Create()
{
    InterfaceWindow::Create();

    InvertedBox *box = new InvertedBox();
    box->SetProperties( "invert", 10, 30, m_w-20, m_h-70, " ", " ", false, false );
    RegisterButton( box );

#if !defined(RETAIL_DEMO)
    if( m_offerDemo )
    {
        PlayDemoButton *demo = new PlayDemoButton();
        demo->SetProperties( "Play Demo", m_w - 330, m_h - 30, 100, 20, "dialog_play_demo", " ", true, false );
        demo->m_forceVisible = true;
        RegisterButton( demo );
    }
#endif

#if !defined(RETAIL)
   // BuyNowButton *buyNow = new BuyNowButton();
  //  buyNow->SetProperties( "Buy Now", m_w - 220, m_h - 30, 100, 20, "dialog_buy_now", " ", true, false );    
   // buyNow->m_closeOnClick = false;
   // RegisterButton( buyNow );
#endif

    CloseButton *close = new CloseButton();
    close->SetProperties( "Close", m_w - 110, m_h - 30, 100, 20, "dialog_close", " ", true, false );
    RegisterButton( close );
}
Beispiel #3
0
void CeaseFireWindow::Create()
{
    ConfirmCeaseFireButton *yes = new ConfirmCeaseFireButton();
    yes->SetProperties( "CeaseFireYes", 20, m_h-30, 80, 20, "dialog_yes", "", true, false );
    RegisterButton( yes );

    CloseButton *no = new CloseButton();
    no->SetProperties( "CeaseFireNo", m_w-100, m_h-30, 80, 20, "dialog_no", "", true, false );
    RegisterButton( no );
}
Beispiel #4
0
void ShareRadarWindow::Create()
{
    ConfirmShareRadarButton *yes = new ConfirmShareRadarButton();
    yes->SetProperties( "ShareRadarWindowYes", 20, m_h-30, 80, 20, "dialog_yes", "", true, false );
    RegisterButton( yes );

    CloseButton *no = new CloseButton();
    no->SetProperties( "ShareRadarWindowNo", m_w-100, m_h-30, 80, 20, "dialog_no", "", true, false );
    RegisterButton( no );
}
Beispiel #5
0
void AuthKeyWindow::Create()
{
    InterfaceWindow::Create();

    InvertedBox *invert = new InvertedBox();
    invert->SetProperties( "invert", 10, 30, m_w-20, m_h - 70, " ", " ", false, false );
    RegisterButton( invert );
    
    AuthInputField *input = new AuthInputField();
    input->SetProperties( "Key", 40, 50, 620, 30, " ", " ", false, false );
    input->RegisterString( m_key );
    RegisterButton( input );

	// Only show the paste button on platforms with a paste implementation
#if defined(TARGET_MSVC) || defined(TARGET_OS_MACOSX)
    PasteKeyButton *paste = new PasteKeyButton();
    paste->SetProperties( "Paste", 10, m_h-30, 100, 20, "dialog_paste", "dialog_paste_tooltip", true, true );
    RegisterButton( paste );
#endif
    
    ApplyKeyButton *apply = new ApplyKeyButton();
    apply->SetProperties( "Apply", m_w-220, m_h-30, 100, 20, "dialog_apply", " ", true, false );
    RegisterButton( apply );

    PlayDemoButton *demo = new PlayDemoButton();
    demo->SetProperties( "Play Demo", m_w/2-50, m_h-30, 100, 20, "dialog_play_demo", " ", true, false );
    demo->m_forceVisible = false;
    RegisterButton( demo );

    CloseButton *close = new CloseButton();
    close->SetProperties( "Close", m_w-110, m_h-30, 100, 20, "dialog_close", " ", true, false );
    RegisterButton(close);



    //
    // Auto-select the chat box if the key is empty

    char authKey[256];
    Authentication_GetKey( authKey );
    if( stricmp(authKey, "authkey not found") == 0 ||
        strlen(authKey) < 3 )
    {
        input->MouseUp();
    }
}
Beispiel #6
0
void AlliancesWindow::Create()
{
    InterfaceWindow::Create();

    float xPos = 20;
    float yPos = 60;
    float width = m_w - 270;
    float height = 30;
    float gap = 7;

    int permitDefection = g_app->GetGame()->GetOptionValue( "PermitDefection" );
    int sharingRadar = g_app->GetGame()->GetOptionValue("RadarSharing");
    

    //
    // Invert box

    InvertedBox *box = new InvertedBox();
    box->SetProperties( "box", xPos-10, yPos-10, width+20, (height+gap) * g_app->GetWorld()->m_teams.Size() + 15, " ", " ", false, false );
    RegisterButton( box );


    //
    // Buttons for each team

    for( int i = 0; i < g_app->GetWorld()->m_teams.Size(); ++i )
    {        
        char name[256];
        sprintf( name, "Team %d", i );

        AllianceTeamButton *team = new AllianceTeamButton();
        team->SetProperties( name, xPos, yPos, width, height, " ", " ", false, false );
        team->m_teamIndex = i;
        RegisterButton( team );

        if( permitDefection )
        {
            sprintf( name, "ceasfire %d", i );
            RequestCeasefireButton *ceasefire = new RequestCeasefireButton();
            ceasefire->SetProperties( name, xPos + 295, yPos+5, 18, 18, " ", " ", false, false );
            ceasefire->m_teamIndex = i;
            RegisterButton( ceasefire );
        }

        if( sharingRadar == 2 )
        {
            sprintf( name, "shareradar %d", i );
            RequestShareRadarButton *shareRadar = new RequestShareRadarButton();
            shareRadar->SetProperties( name, xPos + 235, yPos+5, 18, 18, " ", " ", false, false );
            shareRadar->m_teamIndex = i;
            RegisterButton( shareRadar );
        }
       
        yPos += height;
        yPos += gap;
    }

    yPos += gap * 2;


    //
    // Join / Leave / Kick button
    
    if( permitDefection )
    {
        JoinLeaveButton *joinLeave = new JoinLeaveButton();
        joinLeave->SetProperties( "JoinLeave", xPos+width/2 - 120, yPos, 240, 23, " ", " ", false, false );
        RegisterButton( joinLeave );
    }


    yPos += 25;
    yPos += gap;
    height = 40;


    //
    // Close button

    CloseButton *close = new CloseButton();
    close->SetProperties( "Close", m_w - 110, m_y - 25, 100, 18, "dialog_close", " ", true, false );
    RegisterButton( close );


    //
    // Once button for each vote

    for( int i = 0; i < MAX_TEAMS; ++i )
    {
        char name[256];
        sprintf( name, "Vote %d", i );

        AllianceVoteButton *vote = new AllianceVoteButton();
        vote->SetProperties( name, xPos, yPos, width, height, " ", " ", false, false );
        vote->m_voteIndex = i;
        RegisterButton( vote );

        yPos += height;
        yPos += gap;
    }
}
void InterfaceWindow::Create()
{
    CloseButton *cb = new CloseButton();
    cb->SetProperties( "Close", m_w - 17, 4, 13, 13, " ", "tooltip_close_window", false, true );
    RegisterButton( cb );
}