Пример #1
0
/* game, and either issuing a 'begin' or 'cancel' command for the created game */
T_void GuildUIConfirmCreateGame (T_void)
{
    DebugRoutine ("GuildUIConfirmCreateGame");

    /* switch control buttons to 'begin game' and 'cancel game' */
    ButtonDelete (G_joinButton);
    ButtonDelete (G_createButton);
    G_joinButton=ButtonCreate (6,
                               127,
                               "UI/GUILD/BEGIN",
                               FALSE,
                               KeyDual(KEY_SCAN_CODE_B,KEY_SCAN_CODE_ALT),
                               NULL,
                               GuildUIBeginGame);

    G_createButton=ButtonCreate (109,
                                 127,
                                 "UI/GUILD/CANCEL",
                                 FALSE,
                                 KeyDual(KEY_SCAN_CODE_C,KEY_SCAN_CODE_ALT),
                                 NULL,
                                 GuildUICancelCreateGame);


    /* delete adventure list box and replace with information */
    /* concerning status */
    TxtboxDelete (G_displayBoxes[GUILD_GAME_LIST]);
    TxtboxDelete (G_displayBoxes[GUILD_MAPS_LIST]);
    ButtonSetCallbacks (G_upButtons[GUILD_GAME_LIST],NULL,NULL);
    ButtonSetCallbacks (G_dnButtons[GUILD_GAME_LIST],NULL,NULL);
    ButtonSetCallbacks (G_upButtons[GUILD_MAPS_LIST],NULL,NULL);
    ButtonSetCallbacks (G_dnButtons[GUILD_MAPS_LIST],NULL,NULL);

    G_displayBoxes[GUILD_GAME_LIST]=TxtboxCreate (6,
                                                  28,
                                                  95,
                                                  75,
                                                  "FontTiny",
                                                  0,
                                                  0,
                                                  FALSE,
                                                  Txtbox_JUSTIFY_CENTER,
                                                  Txtbox_MODE_VIEW_NOSCROLL_FORM,
                                                  NULL);

    TxtboxSetData (G_displayBoxes[GUILD_GAME_LIST],
                   "^003Creating game:^007\r\rplease wait for\rother players\r\r^005Select begin button\rTo start game.");


    DebugEnd();
}
Пример #2
0
static T_void HardFormExit(T_buttonID buttonID)
{
    DebugRoutine("HardFormExit");

    /* Tell others that I'm no longer creating a game. */
    PeopleHereSetOurState(PLAYER_ID_STATE_NONE);

    /* Send out a message that this is what we are doing. */
    ClientSendPlayerIDSelf();

    PeopleHereSetOurAdventure(0);
    ClientSyncSetGameGroupID(*DirectTalkGetNullBlankUniqueAddress());
    /* Send out a message that this is what we are doing. */
    ClientSendPlayerIDSelf();

    ButtonDelete(G_closeButton);
    G_closeButton = NULL;
    if (TownUIIsOpen()) {
        ClientSetNextPlace(0, 0);
    } else {
        ClientSetNextPlace(HARDFORM_GOTO_PLACE_OFFSET + HARD_FORM_TOWN, 0);
    }

    DebugEnd();
}
Пример #3
0
T_void BankUIEnd    (T_void)
{
    T_word16 i;
    DebugRoutine ("BankUIEnd");

    /* destroy ui objects */
    GraphicDelete (G_backgroundPic);
    for (i=0;i<4;i++)
    {
        ButtonDelete(G_depositButtons[i]);
        ButtonDelete(G_withdrawButtons[i]);
        TxtboxDelete(G_financeDisplays[i]);
        TxtboxDelete(G_financeDisplays[i+3]);
    }

    /* close store inventory */
    StoreCloseInventory();

    DebugEnd();
}
Пример #4
0
Файл: FORM.C Проект: LesInk/Test
T_void FormCleanUp(T_void)
{
    T_word16 i;
    T_formObjectStruct *p_object;
    E_Boolean UScrewedUpSomewhere = FALSE;

    DebugRoutine("FormCleanUp");

    /* update the graphics */
    GraphicUpdateAllGraphics();

    /* loop through all objects, deleting structures if available */
    for (i = 0; i < MAX_FORM_OBJECTS; i++) {
        if (G_formObjectArray[i] != NULL ) {
            p_object = (T_formObjectStruct *)G_formObjectArray[i];
            /* first delete the object (button, textfield, ect) */
            DebugCheck(p_object != NULL);
            switch (p_object->objtype) {
                case FORM_OBJECT_BUTTON:
                    ButtonDelete((T_buttonID)p_object->objID);
                    break;
                case FORM_OBJECT_TEXT:
                    TextDelete((T_textID)p_object->objID);
                    break;
                case FORM_OBJECT_GRAPHIC:
                    GraphicDelete((T_graphicID)p_object->objID);
                    break;
                case FORM_OBJECT_TEXTFIELD:
                    TxtfldDelete((T_TxtfldID)p_object->objID);
                    break;
                case FORM_OBJECT_TEXTBOX:
                    TxtboxDelete((T_TxtboxID)p_object->objID);
                    break;
                case FORM_OBJECT_SLIDER:
                    SliderDelete((T_sliderID)p_object->objID);
                    break;
                default:
                    /* something is wrong! */
                    DebugCheck(UScrewedUpSomewhere==TRUE);
                    break;
            }

            /* now delete the object structure */
            MemFree(G_formObjectArray[i]);
            MemCheck(101);
            G_formObjectArray[i] = NULL;
        }
    }

    G_formHasTextBoxes = FALSE;
    G_formHasButtons = FALSE;
    DebugEnd();
}
Пример #5
0
T_void InnUIEnd(T_void)
{
    T_word16 i;
    DebugRoutine("InnUIEnd");

    /* destroy ui objects */
    GraphicDelete(G_backgroundPic);
    for (i = 0; i < 4; i++) {
        ButtonDelete(G_rentButtons[i]);
        TxtboxDelete(G_financeDisplays[i]);
        TxtboxDelete(G_rentCostDisplays[i]);
    }

    DebugEnd();
}
Пример #6
0
/* after a 'join game' command has been issued */
T_void GuildUICancelJoinGame (T_buttonID buttonID)
{
    DebugRoutine ("GuildUICancelJoinGame");

    ButtonDelete (G_joinButton);

    /* Go back to nowhere. */
    /* Tell others that I'm no longer creating a game. */
    PeopleHereSetOurState(PLAYER_ID_STATE_NONE) ;

    /* Send out a message that this is what we are doing. */
    ClientSendPlayerIDSelf() ;

    PeopleHereSetOurAdventure(0) ;
    ClientSyncSetGameGroupID(*DirectTalkGetNullBlankUniqueAddress()) ;

    /* Send out a message that this is what we are doing. */
    ClientSendPlayerIDSelf() ;

    /* reset display */
    GuildUIReset();

    DebugEnd();
}
Пример #7
0
T_void HardFormEnd(T_void)
{
    DebugRoutine("HardFormEnd");

    if (G_closeButton) {
        ButtonDelete(G_closeButton);
        G_closeButton = NULL;
    }
//    if (G_currentForm != HARD_FORM_UNKNOWN)  {
    MessageSetAlternateOutputOff();
    if (BannerIsOpen())
        BannerUIModeOff();

    DebugCheck(G_currentForm != HARD_FORM_UNKNOWN);
    if (G_callbackGroups[G_currentForm].end != NULL )
        G_callbackGroups[G_currentForm].end();

    G_currentForm = HARD_FORM_UNKNOWN;
//    }

    HardFormOpen = FALSE;

    DebugEnd();
}
Пример #8
0
T_void GuildUIEnd    (T_void)
{
    T_word16 i;
    T_mapDescriptionStruct *p_map;
    T_doubleLinkListElement element,nextElement;
    DebugRoutine ("GuildUIEnd");

    /* destroy ui objects */
    GraphicDelete (G_backgroundPic);
    G_backgroundPic=NULL;

    for (i=0;i<4;i++)
    {
        ButtonDelete(G_upButtons[i]);
        G_upButtons[i]=NULL;
        ButtonDelete(G_dnButtons[i]);
        G_dnButtons[i]=NULL;
        TxtboxDelete (G_displayBoxes[i]);
        GraphicDelete (G_scrollBars[i]);
        G_scrollBars[i]=NULL;
    }

    ButtonDelete (G_joinButton);
    ButtonDelete (G_createButton);
    G_joinButton=NULL;
    G_createButton=NULL;

    /* free up maps data */
    element=DoubleLinkListGetFirst(G_mapList);
    while (element != DOUBLE_LINK_LIST_ELEMENT_BAD)
    {
        nextElement=DoubleLinkListElementGetNext(element);
        p_map=(T_mapDescriptionStruct *)DoubleLinkListElementGetData(element);
        MemFree (p_map->name);
        MemFree (p_map->description);
        MemFree (p_map);
        element=nextElement;
    }
    DoubleLinkListDestroy (G_mapList);
    G_mapList=DOUBLE_LINK_LIST_BAD;

    /* free up game list data */
    DoubleLinkListFreeAndDestroy(&G_gameList) ;
#if 0
    element=DoubleLinkListGetFirst(G_gameList);
    while (element != DOUBLE_LINK_LIST_ELEMENT_BAD)
    {
        nextElement=DoubleLinkListElementGetNext(element);
        p_game=(T_gameDescriptionStruct *)DoubleLinkListElementGetData(element);
        MemFree(p_game);
        element=nextElement;
    }
    DoubleLinkListDestroy (G_gameList);
    G_gameList=DOUBLE_LINK_LIST_BAD;
#endif

    /* free up player list data */
//    GuildUIClearPlayers();
    DoubleLinkListFreeAndDestroy (&G_playerList);
//    G_playerList=DOUBLE_LINK_LIST_BAD;

    DebugEnd();
}
Пример #9
0
void CreditsDelete()
{
    ImageDelete(&c_background);
    ButtonDelete(&back);
    TextDelete(&t);
}