Exemplo n.º 1
0
// Build the screen
LTBOOL CScreenHostDMOptions::Build()
{
	int kColumn = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_HOST_DM_OPTIONS,"ColumnWidth");
	int kSlider = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_HOST_DM_OPTIONS,"SliderWidth");

	CreateTitle(IDS_TITLE_HOST_OPTIONS);

	m_pMaxPlayers = AddSlider(IDS_MAX_PLAYERS, IDS_MAX_PLAYERS_HELP, kColumn, kSlider, -1, &m_nMaxPlayers);
	m_pMaxPlayers->SetSliderRange(2, 16);
	m_pMaxPlayers->SetSliderIncrement(1);
	m_pMaxPlayers->SetNumericDisplay(LTTRUE);


	char szYes[16];
	char szNo[16];
	FormatString(IDS_YES,szYes,sizeof(szYes));
	FormatString(IDS_NO,szNo,sizeof(szNo));

	CLTGUISlider*	pSlider = AddSlider(IDS_RUN_SPEED, IDS_RUN_SPEED_HELP, kColumn, kSlider, -1, &m_nRunSpeed);
	pSlider->SetSliderRange(100, kMaxRunSpeed);
	pSlider->SetSliderIncrement(10);
	pSlider->SetNumericDisplay(LTTRUE);

	pSlider = AddSlider(IDS_FRAG_LIMIT, IDS_FRAG_LIMIT_HELP, kColumn, kSlider, -1, &m_nScoreLimit);
	pSlider->SetSliderRange(0,kMaxScoreLimit);
	pSlider->SetSliderIncrement(5);
	pSlider->SetNumericDisplay(LTTRUE);

	pSlider = AddSlider(IDS_TIME_LIMIT, IDS_TIME_LIMIT_HELP, kColumn, kSlider, -1, &m_nTimeLimit);
	pSlider->SetSliderRange(0,kMaxTimeLimit);
	pSlider->SetSliderIncrement(5);
	pSlider->SetNumericDisplay(LTTRUE);

	pSlider = AddSlider( IDS_ROUNDS, IDS_ROUNDS_HELP, kColumn, kSlider, -1, &m_nRounds );
	pSlider->SetSliderRange( 1, kMaxRounds );
	pSlider->SetSliderIncrement( 1 );
	pSlider->SetNumericDisplay( LTTRUE );

	pSlider = AddSlider(IDS_FRAG_SCORE, IDS_FRAG_SCORE_HELP, kColumn, kSlider, -1, &m_nFragScore);
	pSlider->SetSliderRange(0,3);
	pSlider->SetSliderIncrement(1);
	pSlider->SetNumericDisplay(LTTRUE);

	pSlider = AddSlider(IDS_TAG_SCORE, IDS_TAG_SCORE_HELP, kColumn, kSlider, -1, &m_nTagScore);
	pSlider->SetSliderRange(0,3);
	pSlider->SetSliderIncrement(1);
	pSlider->SetNumericDisplay(LTTRUE);


 	// Make sure to call the base class
	return CBaseScreen::Build();
}
// Build the screen
LTBOOL CScreenHostTDMOptions::Build()
{
    int kColumn = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_HOST_DM_OPTIONS,"ColumnWidth");
    int kSlider = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_HOST_DM_OPTIONS,"SliderWidth");

    CreateTitle(IDS_TITLE_HOST_OPTIONS);

    m_pTeam1 = AddTextItem(IDS_TEAM_1, CMD_TEAM1, IDS_HELP_TEAM_1);
    m_pTeam2 = AddTextItem(IDS_TEAM_2, CMD_TEAM2, IDS_HELP_TEAM_2);

    LTIntPt tmp = m_nextPos;

    LTIntPt pos = m_pTeam1->GetBasePos();
    pos.x += kColumn;
    m_pTeam1Name = AddTextItem("<team one>",0,0,pos,LTTRUE);

    pos = m_pTeam2->GetBasePos();
    pos.x += kColumn;
    m_pTeam2Name = AddTextItem("<team two>",0,0,pos,LTTRUE);

    m_nextPos = tmp;

    m_pMaxPlayers = AddSlider(IDS_MAX_PLAYERS, IDS_MAX_PLAYERS_HELP, kColumn, kSlider, -1, &m_nMaxPlayers);
    m_pMaxPlayers->SetSliderRange(2, 16);
    m_pMaxPlayers->SetSliderIncrement(1);
    m_pMaxPlayers->SetNumericDisplay(LTTRUE);


    char szYes[16];
    char szNo[16];
    FormatString(IDS_YES,szYes,sizeof(szYes));
    FormatString(IDS_NO,szNo,sizeof(szNo));

    CLTGUIToggle* pToggle = AddToggle(IDS_FRIENDLY_FIRE,IDS_FRIENDLY_FIRE_HELP,kColumn,&m_bFriendlyFire);
    pToggle->SetOnString(szYes);
    pToggle->SetOffString(szNo);

    CLTGUISlider*	pSlider = AddSlider(IDS_RUN_SPEED, IDS_RUN_SPEED_HELP, kColumn, kSlider, -1, &m_nRunSpeed);
    pSlider->SetSliderRange(100, kMaxRunSpeed);
    pSlider->SetSliderIncrement(10);
    pSlider->SetNumericDisplay(LTTRUE);

    pSlider = AddSlider(IDS_FRAG_LIMIT, IDS_FRAG_LIMIT_HELP, kColumn, kSlider, -1, &m_nScoreLimit);
    pSlider->SetSliderRange(0,kMaxScoreLimit);
    pSlider->SetSliderIncrement(10);
    pSlider->SetNumericDisplay(LTTRUE);

    pSlider = AddSlider(IDS_TIME_LIMIT, IDS_TIME_LIMIT_HELP, kColumn, kSlider, -1, &m_nTimeLimit);
    pSlider->SetSliderRange(0,kMaxTimeLimit);
    pSlider->SetSliderIncrement(5);
    pSlider->SetNumericDisplay(LTTRUE);

    pSlider = AddSlider( IDS_ROUNDS, IDS_ROUNDS_HELP, kColumn, kSlider, -1, &m_nRounds );
    pSlider->SetSliderRange( 1, kMaxRounds );
    pSlider->SetSliderIncrement( 1 );
    pSlider->SetNumericDisplay( LTTRUE );

    pSlider = AddSlider(IDS_FRAG_SCORE, IDS_FRAG_SCORE_HELP, kColumn, kSlider, -1, &m_nFragScore);
    pSlider->SetSliderRange(0,3);
    pSlider->SetSliderIncrement(1);
    pSlider->SetNumericDisplay(LTTRUE);

    pSlider = AddSlider(IDS_TAG_SCORE, IDS_TAG_SCORE_HELP, kColumn, kSlider, -1, &m_nTagScore);
    pSlider->SetSliderRange(0,3);
    pSlider->SetSliderIncrement(1);
    pSlider->SetNumericDisplay(LTTRUE);



    // Make sure to call the base class
    return CBaseScreen::Build();
}