Changeset fd9cdb5 in network-game for client/Client
- Timestamp:
- Jul 5, 2014, 12:52:30 AM (11 years ago)
- Branches:
- master
- Children:
- b28e2bf
- Parents:
- abc4d56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
rabc4d56 rfd9cdb5 77 77 void sendChatMessage(); 78 78 void toggleDebugging(); 79 void goToProfileScreen(); 80 void goToLobbyScreen(); 79 81 void joinGame(); // for joining the game lobby 80 82 void createGame(); // for joining the game lobby … … 107 109 Window* wndLobby; 108 110 Window* wndLobbyDebug; 111 Window* wndProfile; 109 112 Window* wndGameLobby; 110 113 Window* wndGame; … … 430 433 i++; 431 434 } 435 } 436 else if (wndCurrent == wndProfile) 437 { 438 al_draw_text(font, al_map_rgb(0, 255, 0), 65, 90, ALLEGRO_ALIGN_LEFT, "Honor Points: 500"); 439 440 // display records of the last 10 games 441 for (int i=0; i<10; i++) { 442 al_draw_text(font, al_map_rgb(0, 255, 0), 142, 160+30*(i+1), ALLEGRO_ALIGN_CENTRE, "VICTORY"); 443 al_draw_text(font, al_map_rgb(0, 255, 0), 302, 160+30*(i+1), ALLEGRO_ALIGN_CENTRE, "3"); 444 al_draw_text(font, al_map_rgb(0, 255, 0), 462, 160+30*(i+1), ALLEGRO_ALIGN_CENTRE, "2"); 445 al_draw_text(font, al_map_rgb(0, 255, 0), 622, 160+30*(i+1), ALLEGRO_ALIGN_CENTRE, "6/11/2014, 5:12 PM"); 446 } 447 432 448 } 433 449 else if (wndCurrent == wndGameLobby) … … 608 624 609 625 void createGui(ALLEGRO_FONT* font) { 626 610 627 // wndLogin 611 628 … … 663 680 664 681 wndLobby = new Window(0, 0, SCREEN_W, SCREEN_H); 665 vctComponents.push_back(wndLobby->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout))); 682 vctComponents.push_back(wndLobby->addComponent(new Button(920, 10, 80, 20, font, "Profile", goToProfileScreen))); 683 vctComponents.push_back(wndLobby->addComponent(new Button(920, 738, 80, 20, font, "Logout", logout))); 666 684 vctComponents.push_back(wndLobby->addComponent(new TextLabel(SCREEN_W*1/2+15-112, 40, 110, 20, font, "Game Name:", ALLEGRO_ALIGN_RIGHT))); 667 685 wndLobby->addComponent(txtJoinGame); … … 682 700 683 701 wndLobbyDebug = new Window(0, 0, SCREEN_W, SCREEN_H); 684 vctComponents.push_back(wndLobbyDebug->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout))); 702 vctComponents.push_back(wndLobbyDebug->addComponent(new Button(920, 10, 80, 20, font, "Profile", goToProfileScreen))); 703 vctComponents.push_back(wndLobbyDebug->addComponent(new Button(920, 738, 80, 20, font, "Logout", logout))); 685 704 vctComponents.push_back(wndLobbyDebug->addComponent(new TextLabel(SCREEN_W*1/2+15-112, 40, 110, 20, font, "Game Name:", ALLEGRO_ALIGN_RIGHT))); 686 705 wndLobbyDebug->addComponent(txtJoinGame); … … 692 711 693 712 cout << "Created debug lobby screen" << endl; 713 714 715 // wndProfile 716 717 wndProfile = new Window(0, 0, SCREEN_W, SCREEN_H); 718 vctComponents.push_back(wndProfile->addComponent(new TextLabel(450, 40, 124, 20, font, "Profile", ALLEGRO_ALIGN_CENTRE))); 719 vctComponents.push_back(wndProfile->addComponent(new TextLabel(160, 120, 124, 20, font, "Game History", ALLEGRO_ALIGN_CENTRE))); 720 vctComponents.push_back(wndProfile->addComponent(new TextLabel(600, 160, 124, 20, font, "Time", ALLEGRO_ALIGN_CENTRE))); 721 vctComponents.push_back(wndProfile->addComponent(new TextLabel(80, 160, 124, 20, font, "Result", ALLEGRO_ALIGN_CENTRE))); 722 vctComponents.push_back(wndProfile->addComponent(new TextLabel(240, 160, 124, 20, font, "Blue Score", ALLEGRO_ALIGN_CENTRE))); 723 vctComponents.push_back(wndProfile->addComponent(new TextLabel(400, 160, 124, 20, font, "Red Score", ALLEGRO_ALIGN_CENTRE))); 724 vctComponents.push_back(wndProfile->addComponent(new TextLabel(560, 160, 124, 20, font, "Time", ALLEGRO_ALIGN_CENTRE))); 725 vctComponents.push_back(wndProfile->addComponent(new Button(920, 738, 80, 20, font, "Back", goToLobbyScreen))); 694 726 695 727 … … 824 856 { 825 857 chatConsole.addLine(response); 858 859 break; 860 } 861 case MSG_TYPE_PROFILE: 862 { 863 wndCurrent = wndProfile; 826 864 827 865 break; … … 1357 1395 } 1358 1396 1397 void goToProfileScreen() 1398 { 1399 msgTo.type = MSG_TYPE_PROFILE; 1400 1401 msgProcessor.sendMessage(&msgTo, &server); 1402 } 1403 1404 void goToLobbyScreen() 1405 { 1406 wndCurrent = wndLobby; 1407 } 1408 1359 1409 void joinGame() 1360 1410 {
Note:
See TracChangeset
for help on using the changeset viewer.