コード例 #1
0
int
ReRacemanMenu(void)
{
    char	*str;
    void	*params = ReInfo->params;

    if (racemanMenuHdle) {
        GfuiScreenRelease(racemanMenuHdle);
    }
    racemanMenuHdle = GfuiScreenCreateEx(NULL,
                                         NULL, (tfuiCallback)NULL,
                                         NULL, (tfuiCallback)NULL,
                                         1);

    str = GfParmGetStr(params, RM_SECT_HEADER, RM_ATTR_BGIMG, 0);
    if (str) {
        GfuiScreenAddBgImg(racemanMenuHdle, str);
    }

    GfuiMenuDefaultKeysAdd(racemanMenuHdle);

    str = GfParmGetStr(params, RM_SECT_HEADER, RM_ATTR_NAME, 0);
    if (str) {
        GfuiTitleCreate(racemanMenuHdle, str, strlen(str));
    }


    GfuiMenuButtonCreate(racemanMenuHdle,
                         "New Race", "Start a New Race",
                         NULL, ReStartNewRace);

    GfuiMenuButtonCreate(racemanMenuHdle,
                         "Configure Race", "Configure The Race",
                         NULL, reConfigureMenu);

    /*     GfuiMenuButtonCreate(racemanMenuHdle, */
    /* 			 "Configure Players", "Players configuration menu", */
    /* 			 TorcsDriverMenuInit(racemanMenuHdle), GfuiScreenActivate); */

    if (GfParmGetEltNb(params, RM_SECT_TRACKS) > 1) {
        GfuiMenuButtonCreate(racemanMenuHdle,
                             "Load", "Load a Previously Saved Game",
                             racemanMenuHdle, reLoadMenu);
    }

    GfuiMenuBackQuitButtonCreate(racemanMenuHdle,
                                 "Back to Main", "Return to previous Menu",
                                 ReInfo->_reMenuScreen, GfuiScreenActivate);

    GfuiScreenActivate(racemanMenuHdle);

    return RM_ASYNC | RM_NEXT_STEP;
}
コード例 #2
0
ファイル: mainmenu.cpp プロジェクト: chagge/gym_torcs
/*
 * Function
 *	TorcsMainMenuInit
 *
 * Description
 *	init the main menus
 *
 * Parameters
 *	none
 *
 * Return
 *	0 ok -1 nok
 *
 * Remarks
 *	
 */
int
TorcsMainMenuInit(void)
{
	if (getTextOnly())
		ReSinglePlayerInit(NULL);
	else
	{
	    menuHandle = GfuiScreenCreateEx((float*)NULL, 
					    NULL, TorcsMainMenuActivate, 
					    NULL, (tfuiCallback)NULL, 
					    1);

	    GfuiScreenAddBgImg(menuHandle, "data/img/splash-main.png");

	    GfuiTitleCreate(menuHandle, "TORCS", 0);

	    GfuiLabelCreate(menuHandle,
			    "The Open Racing Car Simulator",
			    GFUI_FONT_LARGE,
			    320,
			    420,
			    GFUI_ALIGN_HC_VB,
			    0);

	    GfuiMenuButtonCreate(menuHandle,
				 "Race", "Races Menu",
				 ReSinglePlayerInit(menuHandle), GfuiScreenActivate);

	    GfuiMenuButtonCreate(menuHandle,
				 "Configure Players", "Players configuration menu",
				 TorcsDriverMenuInit(menuHandle), GfuiScreenActivate);

	    GfuiMenuButtonCreate(menuHandle,
				 "Options", "Configure",
				 TorcsOptionOptionInit(menuHandle), GfuiScreenActivate);
	    
	    GfuiMenuDefaultKeysAdd(menuHandle);

	    GfuiMenuBackQuitButtonCreate(menuHandle,
					 "Quit", "Quit TORCS",
					 TorcsMainExitMenuInit(menuHandle), GfuiScreenActivate);
	}

    return 0;
}
コード例 #3
0
ファイル: mainmenu.cpp プロジェクト: hkeeble/torcs-adaptive
/*
 * Function
 *	TorcsMainMenuInit
 *
 * Description
 *	init the main menus
 *
 * Parameters
 *	none
 *
 * Return
 *	0 ok -1 nok
 *
 * Remarks
 *	
 */
int
TorcsMainMenuInit(void)
{
    menuHandle = GfuiScreenCreateEx((float*)NULL, 
				    NULL, TorcsMainMenuActivate, 
				    NULL, (tfuiCallback)NULL, 
				    1);

    GfuiScreenAddBgImg(menuHandle, "data/img/splash-main.png");

    GfuiTitleCreate(menuHandle, "TORCS Adaptive", 0);

    GfuiLabelCreate(menuHandle,
		    "A TORCS Modification with procedural tracks",
		    GFUI_FONT_LARGE,
		    320,
		    420,
		    GFUI_ALIGN_HC_VB,
		    0);

    GfuiMenuButtonCreate(menuHandle,
			 "Race", "Races Menu",
			 ReSinglePlayerInit(menuHandle), GfuiScreenActivate);

    GfuiMenuButtonCreate(menuHandle,
			 "Configure Players", "Players configuration menu",
			 TorcsDriverMenuInit(menuHandle), GfuiScreenActivate);

    GfuiMenuButtonCreate(menuHandle,
			 "Options", "Configure",
			 TorcsOptionOptionInit(menuHandle), GfuiScreenActivate);
    
    GfuiMenuDefaultKeysAdd(menuHandle);

    GfuiMenuBackQuitButtonCreate(menuHandle,
				 "Quit", "Quit TORCS",
				 TorcsMainExitMenuInit(menuHandle), GfuiScreenActivate);
	
    return 0;
}
コード例 #4
0
ファイル: optionmenu.cpp プロジェクト: JoostvDoorn/TORCS
void *
TorcsOptionOptionInit(void *precMenu)
{
    if (optionHandle) return optionHandle;

    optionHandle = GfuiMenuScreenCreate("OPTIONS");

    GfuiScreenAddBgImg(optionHandle, "data/img/splash-options.png");

    GfuiMenuButtonCreate(optionHandle,
                         "Graphic", "Configure graphic parameters",
                         GraphMenuInit(optionHandle), GfuiScreenActivate);

    GfuiMenuButtonCreate(optionHandle,
                         "Display", "Configure display parameters",
                         GfScrMenuInit(optionHandle), GfuiScreenActivate);

    /*
        GfuiMenuButtonCreate(optionHandle,
    			 "Simulation", "Configure simulation parameters",
    			 SimuMenuInit(optionHandle), GfuiScreenActivate);
    */

    GfuiMenuButtonCreate(optionHandle,
                         "Sound", "Configure sound parameters",
                         SoundMenuInit(optionHandle), GfuiScreenActivate);

    GfuiMenuButtonCreate(optionHandle,
                         "OpenGL", "Configure OpenGL parameters",
                         OpenGLMenuInit(optionHandle), GfuiScreenActivate);

    GfuiMenuBackQuitButtonCreate(optionHandle,
                                 "Back",
                                 "Back to Main",
                                 precMenu,
                                 GfuiScreenActivate);

    return optionHandle;
}