// Build the screen LTBOOL CScreenJoin::Build() { // Make sure to call the base class if (!CBaseScreen::Build()) return LTFALSE; CreateTitle(IDS_TITLE_JOIN); // Very, very temporary.... // NYI NYI NYI int kColumn0 = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_HOST,"ColumnWidth"); int kColumn1 = (640 - GetPageLeft()) - kColumn0; m_pFindCtrl = AddTextItem(IDS_FIND_SERVERS,CMD_SEARCH,IDS_HELP_FIND_SERVERS); m_pFindCtrl->Enable(LTFALSE); m_pStatusCtrl = AddTextItem("Status: Waiting", 0, IDS_HELP_FIND_SERVERS); m_pStatusCtrl->Enable(LTFALSE); m_pCDKeyCtrl = AddColumnCtrl(CMD_EDIT_CDKEY, IDS_HELP_FIND_SERVERS); m_pCDKeyCtrl->AddColumn("CD Key", kColumn0); m_pCDKeyCtrl->AddColumn(m_sCurCDKey.c_str(), kColumn1, LTTRUE); CLTGUIColumnCtrl* pCtrl = AddColumnCtrl(LTNULL, LTNULL, kDefaultPos, LTTRUE); char aTemp[256]; FormatString(IDS_SERVER_NAME,aTemp,sizeof(aTemp)); pCtrl->AddColumn(aTemp, kColumnWidth_ServerName); pCtrl->AddColumn("Map", kColumnWidth_MapName); pCtrl->AddColumn("Players", kColumnWidth_Players); pCtrl->Enable(LTFALSE); uint16 height = GetPageBottom() - m_nextPos.y; m_pServerListCtrl = AddList(m_nextPos,height,LTTRUE,kColumnWidth); m_pServerListCtrl->SetScrollWrap(LTFALSE); return LTTRUE; }
// Build the screen LTBOOL CScreenTeam::Build() { CreateTitle(IDS_TITLE_TEAM); int kColumn0 = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_TEAM,"ColumnWidth"); int kColumn1 = (640 - GetPageLeft()) - kColumn0; int kArrow = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_TEAM,"ArrowWidth"); m_pName = AddColumnCtrl(CMD_EDIT_NAME, IDS_HELP_TEAM_NAME); m_pName->AddColumn(LoadTempString(IDS_TEAM_NAME), kColumn0); m_pName->AddColumn("<Team name>", kColumn1, LTTRUE); m_pModel = AddTextItem(IDS_TEAM_MODEL, LTNULL, IDS_HELP_TEAM_MODEL); LTIntPt arrowPos = m_pModel->GetBasePos(); arrowPos.x += kColumn0; HTEXTURE hLeft = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowlt.dtx"); HTEXTURE hLeftH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowlt_h.dtx"); m_pLeft = debug_new(CLTGUIButton); if (m_pLeft) { m_pLeft->Create(CMD_LEFT,LTNULL,hLeft,hLeftH); m_pLeft->SetBasePos(arrowPos); AddControl(m_pLeft); m_pLeft->SetCommandHandler(this); } arrowPos.x += kArrow; HTEXTURE hRight = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowrt.dtx"); HTEXTURE hRightH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowrt_h.dtx"); m_pRight = debug_new(CLTGUIButton); if (m_pRight) { m_pRight->Create(CMD_RIGHT,LTNULL,hRight,hRightH); m_pRight->SetBasePos(arrowPos); AddControl(m_pRight); m_pRight->SetCommandHandler(this); } // Make sure to call the base class return CBaseScreen::Build(); }
LTBOOL CMenuPlayer::Init() { m_MenuID = MENU_ID_PLAYER; s_pSklMenu = this; if (!CBaseMenu::Init()) return LTFALSE; int nNameWidth = g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"NameWidth"); int nLevelWidth = g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"LevelWidth"); int nUpgradeWidth = s_Size.x - ( (m_Indent.x * 2) + nNameWidth + nLevelWidth); LTVector vColor = g_pLayoutMgr->GetMenuCustomVector(m_MenuID,"HighlightColor"); uint8 nA = 255; uint8 nR = (uint8)vColor.x; uint8 nG = (uint8)vColor.y; uint8 nB = (uint8)vColor.z; skillHighlightColor= SET_ARGB(nA,nR,nG,nB); uint8 nSmallerFont = (uint8)g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"SmallerFontSize"); SetTitle(IDS_TITLE_SUMMARY); LTIntPt popupSize = g_pLayoutMgr->GetMenuCustomPoint(m_MenuID,"PopupSize"); m_Popup.Init(s_Frame,s_FrameTip,popupSize); m_Popup.m_bWaitForUpdate = LTFALSE; LTIntPt offset = m_Indent; offset.y = 8; CUIFont* pFont = g_pInterfaceResMgr->GetFont(m_TitleFontFace); m_Name.Create("name",LTNULL,LTNULL,pFont,m_TitleFontSize,LTNULL); m_Name.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); m_Name.Enable(LTFALSE); m_Popup.AddControl(&m_Name,offset); offset.y += (m_Name.GetHeight() + 4); pFont = g_pInterfaceResMgr->GetFont(m_FontFace); m_Level.Create("level",LTNULL,LTNULL,pFont,m_FontSize,LTNULL); m_Level.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); m_Level.Enable(LTFALSE); m_Popup.AddControl(&m_Level,offset); offset.y += (m_Level.GetHeight() + 12); m_Header.Create(LTNULL,LTNULL,pFont,m_FontSize, LTNULL); m_Header.AddColumn(" ",nNameWidth); m_Header.AddColumn(LoadTempString(IDS_CURRENT),60); m_Header.AddColumn(LoadTempString(IDS_UPGRADE),60); m_Header.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); m_Header.Enable(LTFALSE); m_Popup.AddControl(&m_Header,offset); offset.y += (m_Header.GetHeight() + 2); for (uint8 m = 0; m < kMaxModifiers; ++m) { m_Mods[m].Create(LTNULL,LTNULL,pFont,m_FontSize,LTNULL); m_Mods[m].AddColumn(" ",nNameWidth); m_Mods[m].AddColumn("100",60); m_Mods[m].AddColumn("100",60); m_Mods[m].SetColors(skillHighlightColor,m_NonSelectedColor,m_DisabledColor); m_Mods[m].Enable(LTTRUE); m_Popup.AddControl(&m_Mods[m],offset); offset.y += (m_Mods[m].GetHeight() + 2); } offset.y += 8; m_Upgrade.Create("Upgrade",MC_UPGRADE,IDS_HELP_UPGRADE,pFont,m_FontSize,this); m_Upgrade.SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor); m_Popup.AddControl(&m_Upgrade,offset); offset.y += (m_Upgrade.GetHeight() + 4); m_Points.Create("avail",LTNULL,LTNULL,pFont,m_FontSize,LTNULL); m_Points.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); m_Points.SetFont(LTNULL,nSmallerFont); m_Points.Enable(LTFALSE); m_Popup.AddControl(&m_Points,offset); uint8 nHelpFont = (uint8)g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"HelpFontSize"); offset = g_pLayoutMgr->GetMenuCustomPoint(m_MenuID,"HelpOffset"); uint16 nWidth = 600 - 2* offset.x; if (!nHelpFont) nHelpFont = m_FontSize; m_ModDesc.Create("description",LTNULL,LTNULL,pFont,nHelpFont,LTNULL); m_ModDesc.SetColors(m_SelectedColor,m_SelectedColor,m_SelectedColor); m_ModDesc.SetFixedWidth(nWidth); m_ModDesc.Enable(LTFALSE); m_Popup.AddControl(&m_ModDesc,offset); int nPopupPos = g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"PopupPos"); m_Popup.SetBasePos(LTIntPt(0,nPopupPos)); g_pInterfaceMgr->GetMenuMgr()->RegisterCommand(COMMAND_ID_STATUS,MENU_ID_PLAYER); //Rank control m_pRank = AddColumnCtrl(); m_pRank->AddColumn(LoadTempString(IDS_RANK),nNameWidth); m_pRank->AddColumn("Novice",nNameWidth); //Total points control m_pTotal = AddColumnCtrl(); m_pTotal->AddColumn(LoadTempString(IDS_SCORE),nNameWidth); m_pTotal->AddColumn("0",nNameWidth); //Avail points control m_pAvail = AddColumnCtrl(); m_pAvail->AddColumn(LoadTempString(IDS_SKILL_PTS),nNameWidth); m_pAvail->AddColumn("0",nNameWidth); AddControl(" ",0,LTTRUE); // CUIFont* pFont = g_pInterfaceResMgr->GetFont(m_FontFace); for (uint8 i = 0; i < kNumSkills; i++) { eSkill skl = (eSkill)i; if (g_pSkillsButeMgr->IsAvailable(skl) ) { m_pSkills[i] = debug_new(CSkillCtrl); m_pSkills[i]->Create(skl,(MC_CUSTOM+i),pFont,m_FontSize,this,nNameWidth); m_List.AddControl(m_pSkills[i]); } } return LTTRUE; }
// Build the screen LTBOOL CScreenMulti::Build() { CreateTitle(IDS_TITLE_MULTI); //basic controls AddTextItem(IDS_PLAYER_SETUP, CMD_PLAYER, IDS_HELP_PLAYER); m_pCDKeyCtrl = AddColumnCtrl(CMD_EDIT_CDKEY, IDS_HELP_CDKEY); m_pCDKeyCtrl->AddColumn(LoadTempString(IDS_CDKEY), 200); m_pCDKeyCtrl->AddColumn(" ", 320, LTTRUE); m_pJoin = AddTextItem(IDS_JOIN, CMD_JOIN, IDS_HELP_JOIN); m_pHost = AddTextItem(IDS_HOST, CMD_HOST, IDS_HELP_HOST); m_pUpdate = AddTextItem(IDS_LAUNCH_UPDATE, CMD_UPDATE, IDS_HELP_LAUNCH_UPDATE); HTEXTURE hUp = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowup.dtx"); HTEXTURE hUpH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowup_h.dtx"); HTEXTURE hDown = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowdn.dtx"); HTEXTURE hDownH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowdn_h.dtx"); char szFrame[128]; g_pLayoutMgr->GetScreenCustomString(SCREEN_ID_MULTI,"FrameTexture",szFrame,sizeof(szFrame)); HTEXTURE hFrame = g_pInterfaceResMgr->GetTexture(szFrame); LTRect rect = g_pLayoutMgr->GetScreenCustomRect(SCREEN_ID_MULTI,"SystemMOTDRect"); LTIntPt pos(rect.left,rect.top); LTIntPt size( (rect.right - rect.left),(rect.bottom - rect.top)); uint8 nMOTDSize = (uint8)g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_MULTI,"MessageFontSize"); uint8 nFont = g_pLayoutMgr->GetScreenFontFace((eScreenID)m_nScreenID); CUIFont* pFont = g_pInterfaceResMgr->GetFont(nFont); m_pSysFrame = debug_new(CLTGUIFrame); m_pSysFrame->Create(hFrame,size.x+16,size.y,LTTRUE); m_pSysFrame->SetBasePos(pos); AddControl(m_pSysFrame); m_pSysMOTD = debug_new(CLTGUILargeText); m_pSysMOTD->Create("",pFont,nMOTDSize,size); m_pSysMOTD->SetBasePos(pos); m_pSysMOTD->SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor); m_pSysMOTD->Enable(LTTRUE); m_pSysMOTD->SetFrameWidth(1); m_pSysMOTD->SetIndent(2); m_pSysMOTD->UseArrows(1.0f,hUp,hUpH,hDown,hDownH); AddControl(m_pSysMOTD); rect = g_pLayoutMgr->GetScreenCustomRect(SCREEN_ID_MULTI,"GameMOTDRect"); pos.x = rect.left; pos.y = rect.top; size.x = (rect.right - rect.left); size.y = (rect.bottom - rect.top); m_pGameFrame = debug_new(CLTGUIFrame); m_pGameFrame->Create(hFrame,size.x+16,size.y,LTTRUE); m_pGameFrame->SetBasePos(pos); AddControl(m_pGameFrame); m_pGameMOTD = debug_new(CLTGUILargeText); m_pGameMOTD->Create("",pFont,nMOTDSize,size); m_pGameMOTD->SetBasePos(pos); m_pGameMOTD->SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor); m_pGameMOTD->Enable(LTTRUE); m_pGameMOTD->SetFrameWidth(1); m_pGameMOTD->SetIndent(2); m_pGameMOTD->UseArrows(1.0f,hUp,hUpH,hDown,hDownH); AddControl(m_pGameMOTD); nFont = g_pLayoutMgr->GetDialogFontFace(); pFont = g_pInterfaceResMgr->GetFont(nFont); uint8 nFontSize = g_pLayoutMgr->GetDialogFontSize(); m_pWaitText = debug_new(CLTGUITextCtrl); if (!m_pWaitText->Create(LoadTempString(IDS_INTERNET), NULL, LTNULL, pFont, nFontSize, this)) { debug_delete(m_pWaitText); return LTFALSE; } m_pWaitText->SetColors(argbBlack, argbBlack, argbBlack); m_pWaitText->Enable(LTFALSE); uint16 w = 16+m_pWaitText->GetBaseWidth(); uint16 h = 16+m_pWaitText->GetBaseHeight(); m_pWait = debug_new(CLTGUIWindow); char szBack[128] = ""; g_pLayoutMgr->GetDialogFrame(szBack,sizeof(szBack)); m_pWait->Create(g_pInterfaceResMgr->GetTexture(szBack),w,h); uint16 x = (640-w)/2; uint16 y = (480-h)/2; m_pWait->SetBasePos(LTIntPt(x,y)); AddControl(m_pWait); m_pWait->AddControl(m_pWaitText,LTIntPt(8,8)); // status text ----------------------------------------------- pos = g_pLayoutMgr->GetScreenCustomPoint(SCREEN_ID_MULTI,"StatusPos"); char szTmp[256] = ""; LoadString(IDS_WAITING,szTmp,sizeof(szTmp)); m_pStatusCtrl = AddTextItem(FormatTempString(IDS_STATUS_STRING,szTmp), 0, 0, pos, LTTRUE); m_pStatusCtrl->SetFont(NULL, nMOTDSize); CreateDMMissionFile(); // CreateTDMMissionFile(); CreateDDMissionFile(); // Make sure to call the base class return CBaseScreen::Build(); }