Changeset 53d41ea in network-game


Ignore:
Timestamp:
Dec 16, 2013, 2:09:45 AM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
1a47469
Parents:
e437a19
Message:

The lobby has a chat console

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/Client/main.cpp

    re437a19 r53d41ea  
    255255   wndLobby = new Window(0, 0, SCREEN_W, SCREEN_H);
    256256   wndLobby->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
    257    wndLobby->addComponent(new TextLabel(SCREEN_W*1/4-112, 40, 110, 20, font, "Game Name:", ALLEGRO_ALIGN_RIGHT));
    258    wndLobby->addComponent(new Textbox(SCREEN_W*1/4+4, 40, 100, 20, font));
    259    wndLobby->addComponent(new Button(SCREEN_W*1/4-100, 80, 200, 20, font, "Join Existing Game", joinGame));
     257   wndLobby->addComponent(new TextLabel(SCREEN_W*1/2+15-112, 40, 110, 20, font, "Game Name:", ALLEGRO_ALIGN_RIGHT));
     258   wndLobby->addComponent(new Textbox(SCREEN_W*1/2+15+4, 40, 100, 20, font));
     259   wndLobby->addComponent(new Button(SCREEN_W*1/2+15-100, 80, 200, 20, font, "Join Existing Game", joinGame));
    260260   wndLobby->addComponent(new TextLabel(SCREEN_W*3/4-112, 40, 110, 20, font, "Game Name:", ALLEGRO_ALIGN_RIGHT));
    261261   wndLobby->addComponent(new Textbox(SCREEN_W*3/4+4, 40, 100, 20, font));
    262262   wndLobby->addComponent(new Button(SCREEN_W*3/4-100, 80, 200, 20, font, "Create New Game", createGame));
     263   wndLobby->addComponent(new Textbox(95, 40, 300, 20, font));
     264   wndLobby->addComponent(new Button(95, 70, 60, 20, font, "Send", sendChatMessage));
    263265
    264266   txtJoinGame = (Textbox*)wndLobby->getComponent(2);
    265267   txtCreateGame = (Textbox*)wndLobby->getComponent(5);
     268   txtChat = (Textbox*)wndLobby->getComponent(7);
    266269
    267270   cout << "Created lobby screen" << endl;
    268271
     272   // this is the old game screen
    269273   wndGame = new Window(0, 0, SCREEN_W, SCREEN_H);
    270274   wndGame->addComponent(new Textbox(95, 40, 300, 20, font));
     
    273277   wndGame->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
    274278
    275    txtChat = (Textbox*)wndGame->getComponent(0);
    276 
    277279   wndGameDebug = new Window(0, 0, SCREEN_W, SCREEN_H);
    278280   wndGameDebug->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
     
    281283   cout << "Created game screen" << endl;
    282284
     285   // this is the new game screen, without a debug console
    283286   wndNewGame = new Window(0, 0, SCREEN_W, SCREEN_H);
    284287   wndNewGame->addComponent(new Button(880, 10, 120, 20, font, "Leave Game", leaveGame));
     
    462465
    463466         if (wndCurrent == wndLobby) {
     467            chatConsole.draw(font, al_map_rgb(255,255,255));
     468
    464469            map<string, int>::iterator it;
    465470            int i=0;
Note: See TracChangeset for help on using the changeset viewer.