コード例 #1
0
ファイル: museum.cpp プロジェクト: joequant/raceintospace
void Museum(char plr)
{
    int i, tots = 7, beg;
    char AName[7][22] = {"DIRECTOR RANKING", "SPACE HISTORY", "MISSION RECORDS", "PRESTIGE SUMMARY",
                         "HARDWARE EFFICIENCY", "ASTRONAUT HISTORY", "EXIT THE MUSEUM"
                        };
    char AImg[7] = {8, 9, 10, 11, 13, 14, 0};

    if (Data->P[plr].AstroCount == 0) {
        memcpy(&AName[5][0], &AName[6][0], 22); // move up Exit
        AImg[5] = AImg[6];
        tots = 6;
    } else if (plr == 1) {
        strncpy(&AName[5][0], "COSMO", 5);
    }

    AImg[3] += plr;
    // FadeOut(2,pal,10,0,0);
    music_start(M_THEME);
    beg = 0;

    do {
        if (beg == 0) {
            beg = (Data->P[plr].AstroCount > 0) ? 7 : 6;    // mods for astros
        } else {
            FadeOut(2, display::graphics.palette(), 10, 0, 0);

            DrawSpaceport(plr);
            PortPal(plr);
            fill_rectangle(166, 191, 318, 198, 3);
            display::graphics.setForegroundColor(0);
            draw_string(257, 197, "CASH:");
            draw_megabucks(285, 197, Data->P[plr].Cash);
            display::graphics.setForegroundColor(11);
            draw_string(256, 196, "CASH:");
            draw_megabucks(284, 196, Data->P[plr].Cash);
            display::graphics.setForegroundColor(0);

            if (Data->Season == 0) {
                draw_string(166, 197, "SPRING 19");
            } else {
                draw_string(166, 197, "FALL 19");
            }

            draw_number(0, 0, Data->Year);
            display::graphics.setForegroundColor(11);

            if (Data->Season == 0) {
                draw_string(165, 196, "SPRING 19");
            } else {
                draw_string(165, 196, "FALL 19");
            }

            draw_number(0, 0, Data->Year);

            FadeIn(2, display::graphics.palette(), 10, 0, 0);
        }

        helpText = (plr == 0) ? "i700" : "i701";
        keyHelpText = (plr == 0) ? "k603" : "k604";
        i = BChoice(plr, tots, &AName[0][0], &AImg[0]);

        switch (i) {
        case 1:
            RankMe(plr);
            break;

        case 2:
            helpText = "i130";
            keyHelpText = "k031";
            ShowSpHist(plr);
            break;

        case 3:
            helpText = "i131";
            keyHelpText = "k321";
            Records(plr);
            break;

        case 4:
            helpText = "i132";
            keyHelpText = "k033";
            ShowPrest(plr);
            break;

        case 5:
            helpText = "i034";
            ShowHard(plr);
            break;

        case 6:
            helpText = (plr == 0) ? "i133" : "i134";
            keyHelpText = (plr == 0) ? "k035" : "k441";

            if (Data->P[plr].AstroCount > 0) {
                ShowAstrosHist(plr);
            }

            break;

        case 7:
        default:
            break;
        }

        helpText = "i000";
        keyHelpText = "k000";
    } while (i != beg);

    music_stop();
    return;
}
コード例 #2
0
ファイル: aipur.cpp プロジェクト: dvrasp/raceintospace
void Stat(char Win)
{
    int j, i, starty;
    DrawStatistics(Win);
    WaitForMouseUp();
    i = 0;
    key = 0;
    starty = 118;

    while (i == 0) {
        key = 0;
        GetMouse();

        if ((x >= 193 && y >= 42 && x <= 278 && y <= 60 && mousebuttons > 0) || key == K_ENTER) {
            InBox(193, 42, 278, 60);
            WaitForMouseUp();

            if (key > 0) {
                delay(150);
            }

            i = 1;
            key = 0;
            OutBox(193, 42, 278, 60);
        } else if ((x >= 152 && y >= 41 && x <= 183 && y <= 61 && mousebuttons > 0) || key == 'D') {
            InBox(152, 41, 183, 61);
            WaitForMouseUp();

            if (key > 0) {
                delay(150);
            }

            RankMe(Win);
            DrawStatistics(Win);
            key = 0;
            i = 0;
            OutBox(152, 41, 183, 61);
        };

        for (j = 0; j < 5; j++) {
            if (AI[Win] == 0) {
                if ((x >= starty + (j * 33) && y >= 87 && x <= 31 + starty + (j * 33) && y <= 107 && mousebuttons > 0) || ((key >= '1' && key <= '4') || key == '0')) {
                    if (key > 0) {
                        switch (key) {
                        case '0':
                            j = 0;
                            break;

                        case '1':
                            j = 1;
                            break;

                        case '2':
                            j = 2;
                            break;

                        case '3':
                            j = 3;
                            break;

                        case '4':
                            j = 4;
                            break;

                        default:
                            break;
                        }
                    }

                    InBox(starty + (j * 33), 87, 31 + starty + (j * 33), 107);
                    WaitForMouseUp();
                    key = 0;
                    strncpy(keyhelpIndex, "k999", 4);

                    switch (j) {
                    case 0:
                        strncpy(helptextIndex, "i130", 4);
                        strncpy(keyhelpIndex, "k031", 4);

                        if (Option == -1 || (Option == Win)) {
                            ShowSpHist(Win);
                        }

                        //ShowSpHist(Win);
                        break;

                    case 1:
                        strncpy(helptextIndex, "i131", 4);
                        strncpy(keyhelpIndex, "k321", 4);
                        Records(Win);
                        break;

                    case 2:
                        strncpy(helptextIndex, "i132", 4);
                        strncpy(keyhelpIndex, "k033", 4);
                        ShowPrest(Win);
                        break;

                    case 3:
                        strncpy(helptextIndex, "i034", 4);
                        ShowHard(Win);
                        break;

                    case 4:
                        strncpy(helptextIndex, (Win == 0) ? "i133" : "i134", 4);
                        strncpy(keyhelpIndex, (Win == 0) ? "k035" : "k441", 4);

                        if (Data->P[Win].AstroCount > 0)
                            if (Option == -1 || Option == Win) {
                                ShowAstrosHist(Win);
                            }

                    default:
                        break;
                    }

                    strncpy(helptextIndex, "i000", 4);
                    strncpy(keyhelpIndex, "k000", 4);
                    DrawStatistics(Win);
                    key = 0;
                    i = 0;
                    OutBox(starty + (j * 33), 87, 31 + starty + (j * 33), 107);
                }
            } // matches AI[Win]==0
        }

        for (j = 0; j < 5; j++) {
            if (AI[other(Win)] == 0) {
                if ((x >= starty + (j * 33) && y >= 132 && x <= 31 + starty + (j * 33) && y <= 152 && mousebuttons > 0) || (key >= '5' && key <= '9')) {
                    if (key > 0) {
                        switch (key) {
                        case '5':
                            j = 0;
                            break;

                        case '6':
                            j = 1;
                            break;

                        case '7':
                            j = 2;
                            break;

                        case '8':
                            j = 3;
                            break;

                        case '9':
                            j = 4;
                            break;

                        default:
                            break;
                        }
                    }

                    InBox(starty + (j * 33), 132, 31 + starty + (j * 33), 152);
                    WaitForMouseUp();
                    key = 0;

                    switch (j) {
                    case 0:
                        strncpy(helptextIndex, "i130", 4);
                        strncpy(keyhelpIndex, "k031", 4);

                        if (Option == -1 || Option == other(Win)) {
                            ShowSpHist(other(Win));
                        }

                        //ShowSpHist(other(Win));
                        break;

                    case 1:
                        strncpy(helptextIndex, "i131", 4);
                        strncpy(keyhelpIndex, "k321", 4);
                        Records(other(Win));
                        break;

                    case 2:
                        strncpy(helptextIndex, "i132", 4);
                        strncpy(keyhelpIndex, "k033", 4);
                        ShowPrest(other(Win));
                        break;

                    case 3:
                        strncpy(helptextIndex, "i034", 4);
                        strncpy(keyhelpIndex, "k999", 4);
                        ShowHard(other(Win));
                        break;

                    case 4:
                        strncpy(helptextIndex, (Win == 0) ? "i133" : "i134", 4);
                        strncpy(keyhelpIndex, (Win == 0) ? "k035" : "k441", 4);

                        if (Data->P[other(Win)].AstroCount > 0)
                            if (Option == -1 || Option == other(Win)) {
                                ShowAstrosHist(other(Win));
                            }

                        break;

                    default:
                        break;
                    }

                    strncpy(helptextIndex, "i000", 4);
                    strncpy(keyhelpIndex, "k000", 4);
                    DrawStatistics(Win);
                    key = 0;
                    i = 0;
                    OutBox(starty + (j * 33), 132, 31 + starty + (j * 33), 152);
                }
            }
        }
    }

    return;
}