// 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(); }
// Build the screen LTBOOL CScreenCrosshair::Build() { CreateTitle(IDS_TITLE_CROSSHAIR); kGap = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_CROSSHAIR,"ColumnWidth"); kWidth = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_CROSSHAIR,"SliderWidth"); char szYes[16]; char szNo[16]; FormatString(IDS_YES,szYes,sizeof(szYes)); FormatString(IDS_NO,szNo,sizeof(szNo)); //background frame LTRect frameRect = g_pLayoutMgr->GetScreenCustomRect(SCREEN_ID_CROSSHAIR,"FrameRect"); LTIntPt pos(frameRect.left,frameRect.top); int nHt = frameRect.bottom - frameRect.top; int nWd = frameRect.right - frameRect.left; char szFrame[128]; g_pLayoutMgr->GetScreenCustomString(SCREEN_ID_CROSSHAIR,"FrameTexture",szFrame,sizeof(szFrame)); HTEXTURE hFrame = g_pInterfaceResMgr->GetTexture(szFrame); CLTGUIFrame *pFrame = debug_new(CLTGUIFrame); pFrame->Create(hFrame,nWd,nHt+8,LTTRUE); pFrame->SetBasePos(pos); pFrame->SetBorder(2,m_SelectedColor); AddControl(pFrame); CLTGUISlider *pSlider = AddSlider(IDS_CH_R, IDS_HELP_CH_R, kGap, kWidth, -1, &m_nColorR); pSlider->SetSliderRange(15,255); pSlider->SetSliderIncrement(16); pSlider = AddSlider(IDS_CH_G, IDS_HELP_CH_G, kGap, kWidth, -1, &m_nColorG); pSlider->SetSliderRange(15,255); pSlider->SetSliderIncrement(16); pSlider = AddSlider(IDS_CH_B, IDS_HELP_CH_B, kGap, kWidth, -1, &m_nColorB); pSlider->SetSliderRange(15,255); pSlider->SetSliderIncrement(16); CLTGUIToggle* pToggle = AddToggle(IDS_CH_DYNAMIC, IDS_HELP_CH_DYNAMIC, kGap, &m_bDynamic ); m_pStyle = AddCycle(IDS_CH_STYLE,IDS_HELP_CH_STYLE,kGap,&m_nStyle); char szTmp[kMaxStringBuffer]; uint8 style = 0; char *szTag = "HUDCrosshair"; char szAtt[32]; sprintf(szAtt,"Crosshair%d",style); while (g_pLayoutMgr->HasValue(szTag,szAtt)) { g_pLayoutMgr->GetString(szTag,szAtt,szTmp,sizeof(szTmp)); strcat(szTmp,"_A.dtx"); m_styles.push_back(szTmp); sprintf(szTmp,"%d",style); // m_pStyle->AddString(szTmp); m_pStyle->AddString(" "); style++; sprintf(szAtt,"Crosshair%d",style); } g_pDrawPrim->SetRGBA(&m_Poly,argbWhite); // Make sure to call the base class if (! CBaseScreen::Build()) return LTFALSE; UseBack(LTTRUE,LTTRUE); return LTTRUE; }