本文整理汇总了C++中LoadResStr函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadResStr函数的具体用法?C++ LoadResStr怎么用?C++ LoadResStr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadResStr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: C4StartupDlg
C4StartupAboutDlg::C4StartupAboutDlg() : C4StartupDlg(LoadResStr("IDS_DLG_ABOUT"))
{
// ctor
UpdateSize();
CStdFont &rUseFont = ::GraphicsResource.TextFont;
C4Rect rcClient = GetContainedClientRect();
// bottom line buttons and copyright messages
C4GUI::ComponentAligner caMain(rcClient, 0,0, true);
C4GUI::ComponentAligner caButtons(caMain.GetFromBottom(caMain.GetHeight()*1/8), 0,0, false);
C4GUI::CallbackButton<C4StartupAboutDlg> *btn;
#if AUDIO_TK == AUDIO_TK_FMOD
AddElement(new C4GUI::Label("Using FMOD Sound System, copyright (c) Firelight Technologies Pty, Ltd., 1994-2010.",
caMain.GetFromBottom(rUseFont.GetLineHeight())));
#endif
int32_t iButtonWidth = caButtons.GetInnerWidth() / 4;
AddElement(btn = new C4GUI::CallbackButton<C4StartupAboutDlg>(LoadResStr("IDS_BTN_BACK"), caButtons.GetGridCell(0,3,0,1,iButtonWidth,C4GUI_ButtonHgt,true), &C4StartupAboutDlg::OnBackBtn));
btn->SetToolTip(LoadResStr("IDS_DLGTIP_BACKMAIN"));
#ifdef WITH_AUTOMATIC_UPDATE
AddElement(btn = new C4GUI::CallbackButton<C4StartupAboutDlg>(LoadResStr("IDS_BTN_CHECKFORUPDATES"), caButtons.GetGridCell(2,3,0,1,iButtonWidth,C4GUI_ButtonHgt,true), &C4StartupAboutDlg::OnUpdateBtn));
btn->SetToolTip(LoadResStr("IDS_DESC_CHECKONLINEFORNEWVERSIONS"));
#endif
AddElement(new C4GUI::Label("'Clonk' is a registered trademark of Matthes Bender.",
caButtons.GetFromBottom(rUseFont.GetLineHeight())));
}
开发者ID:772,项目名称:openclonk,代码行数:27,代码来源:C4StartupAboutDlg.cpp
示例2: ClearRef
void C4StartupNetListEntry::SetRefQuery(const char *szAddress, enum QueryType eQueryType)
{
// safety: clear previous
ClearRef();
// setup layout
const_cast<C4Facet &>(reinterpret_cast<const C4Facet &>(pIcon->GetFacet()))
= (const C4Facet &) C4Startup::Get()->Graphics.fctNetGetRef;
pIcon->SetAnimated(true, 1);
pIcon->SetBounds(rctIconLarge);
// init a new ref client to query
sRefClientAddress.Copy(szAddress);
this->eQueryType = eQueryType;
pRefClient = new C4Network2RefClient();
if (!pRefClient->Init() || !pRefClient->SetServer(szAddress))
{
// should not happen
sInfoText[0].Clear();
SetError(pRefClient->GetError(), TT_RefReqWait);
return;
}
// set info
sInfoText[0].Format(LoadResStr("IDS_NET_CLIENTONNET"), GetQueryTypeName(eQueryType), pRefClient->getServerName());
sInfoText[1].Copy(LoadResStr("IDS_NET_INFOQUERY"));
UpdateSmallState(); UpdateText();
pRefClient->SetNotify(&Application.InteractiveThread);
// masterserver: always on top
if (eQueryType == NRQT_Masterserver)
iSortOrder = 100;
// register proc
C4InteractiveThread &Thread = Application.InteractiveThread;
Thread.AddProc(pRefClient);
// start querying!
QueryReferences();
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:34,代码来源:C4StartupNetDlg.cpp
示例3: time
void C4StartupNetDlg::DoRefresh()
{
// check min refresh timer
time_t tNow = time(nullptr);
if (tLastRefresh && tNow < tLastRefresh + C4NetMinRefreshInterval)
{
// avoid hammering on refresh key
C4GUI::GUISound("UI::Error");
return;
}
tLastRefresh = tNow;
// empty list of all old entries
fUpdatingList = true;
while (pGameSelList->GetFirst()) delete pGameSelList->GetFirst();
pMasterserverClient=nullptr;
// (Re-)Start discovery
if (!DiscoverClient.StartDiscovery())
{
StdCopyStrBuf strNoDiscovery(LoadResStr("IDS_NET_NODISCOVERY"));
::pGUI->ShowMessageModal(
FormatString(LoadResStr("IDS_NET_NODISCOVERY_DESC"), DiscoverClient.GetError()).getData(),
strNoDiscovery.getData(),
C4GUI::MessageDialog::btnAbort,
C4GUI::Ico_Error);
}
iGameDiscoverInterval = C4NetGameDiscoveryInterval;
// restart masterserver query
UpdateMasterserver();
// done; update stuff
fUpdatingList = false;
UpdateList();
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:32,代码来源:C4StartupNetDlg.cpp
示例4: fGameHalted
C4AbortGameDialog::C4AbortGameDialog()
: fGameHalted(false),
C4GUI::ConfirmationDialog(
LoadResStr("IDS_HOLD_ABORT"), LoadResStr("IDS_DLG_ABORT"), NULL,
MessageDialog::btnYesNo, true, C4GUI::Ico_Exit) {
is_shown = true; // assume dlg will be shown, soon
}
开发者ID:ev1313,项目名称:yaC,代码行数:7,代码来源:C4GameDialogs.cpp
示例5: GetRefRes
void C4Network2ResDlg::ListItem::LocalSaveResource(bool fDoOverwrite)
{
// get associated resource
C4Network2Res::Ref pRes = GetRefRes();
if (!pRes) return;
const char *szResFile = pRes->getFile();
StdCopyStrBuf strErrCopyFile(LoadResStr("IDS_NET_ERR_COPYFILE"));
if (!pRes->isTempFile())
{
GetScreen()->ShowMessage(LoadResStr("IDS_NET_ERR_COPYFILE_LOCAL"), strErrCopyFile.getData(), C4GUI::Ico_Error);
return;
}
const char *szFilename = GetFilename(pRes->getCore().getFileName());
/* const char *szSpecialPath = "";
if (WildcardMatch(C4CFN_PlayerFiles, szFilename))
// write players to player path
szSpecialPath = Config.General.PlayerPath;
*/
const char *szTarget = Config.AtUserDataPath(szFilename);
if (!fDoOverwrite && ItemExists(szTarget))
{
// show a confirmation dlg, asking whether the resource should be overwritten
GetScreen()->ShowRemoveDlg(new C4GUI::ConfirmationDialog(
FormatString(LoadResStr("IDS_NET_RES_SAVE_OVERWRITE"), GetFilename(szTarget)).getData(), LoadResStr("IDS_NET_RES_SAVE"),
new C4GUI::CallbackHandler<C4Network2ResDlg::ListItem>(this, &C4Network2ResDlg::ListItem::OnButtonSaveConfirm), C4GUI::MessageDialog::btnYesNo));
return;
}
if (!C4Group_CopyItem(szResFile, szTarget))
GetScreen()->ShowMessage(strErrCopyFile.getData(), strErrCopyFile.getData(), C4GUI::Ico_Error);
else
{
GetScreen()->ShowMessage(FormatString(LoadResStr("IDS_NET_RES_SAVED_DESC"), GetFilename(szTarget)).getData(),
LoadResStr("IDS_NET_RES_SAVED"), C4GUI::Ico_Save);
}
}
开发者ID:TheBlackJokerDevil,项目名称:openclonk,代码行数:35,代码来源:C4Network2ResDlg.cpp
示例6: SAddModule
void C4StartupMainDlg::UpdateParticipants() {
// First validate all participants (files must exist)
StdStrBuf strPlayers, strPlayer;
strPlayer.SetLength(1024 + 1);
strPlayers.Copy(Config.General.Participants);
*Config.General.Participants = 0;
for (int i = 0; SCopySegment(strPlayers.getData(), i, strPlayer.getMData(),
';', 1024, true);
i++) {
const char *szPlayer = strPlayer.getData();
if (!szPlayer || !*szPlayer) continue;
if (!FileExists(szPlayer)) continue;
if (!SEqualNoCase(GetExtension(szPlayer), "c4p"))
continue; // additional sanity check to clear strange exe-path-only
// entries in player list?
SAddModule(Config.General.Participants, szPlayer);
}
// Draw selected players - we are currently displaying the players stored in
// Config.General.Participants.
// Existence of the player files is not validated and player filenames are
// displayed directly
// (names are not loaded from the player core).
strPlayers.Format(LoadResStr("IDS_DESC_PLRS"));
if (!Config.General.Participants[0])
strPlayers.Append(LoadResStr("IDS_DLG_NOPLAYERSSELECTED"));
else
for (int i = 0; SCopySegment(Config.General.Participants, i,
strPlayer.getMData(), ';', 1024, true);
i++) {
if (i > 0) strPlayers.Append(", ");
strPlayers.Append(C4Language::IconvClonk(
GetFilenameOnly(strPlayer.getData())).getData());
}
pParticipantsLbl->SetText(strPlayers.getData());
}
开发者ID:ev1313,项目名称:yaC,代码行数:35,代码来源:C4StartupMainDlg.cpp
示例7: SellFromBase
BOOL SellFromBase(int32_t iPlr, C4Object *pBaseObj, C4ID id, C4Object *pSellObj)
{
C4Object *pThing;
// Valid checks
if (!ValidPlr(iPlr)) return FALSE;
if (!pBaseObj || !ValidPlr(pBaseObj->Base)) return FALSE;
if (~Game.C4S.Game.Realism.BaseFunctionality & BASEFUNC_Sell) return FALSE;
// Base owner eliminated
if (Game.Players.Get(pBaseObj->Base)->Eliminated)
{
StartSoundEffect("Error",false,100,pBaseObj);
sprintf(OSTR,LoadResStr("IDS_PLR_ELIMINATED"),Game.Players.Get(pBaseObj->Base)->GetName());
GameMsgPlayer(OSTR,iPlr); return FALSE;
}
// Base owner hostile
if (Hostile(iPlr,pBaseObj->Base))
{
StartSoundEffect("Error",false,100,pBaseObj);
sprintf(OSTR,LoadResStr("IDS_PLR_HOSTILE"),Game.Players.Get(pBaseObj->Base)->GetName());
GameMsgPlayer(OSTR,iPlr); return FALSE;
}
// check validity of sell object, if specified
if (pThing = pSellObj)
if (!pThing->Status || pThing->Contained != pBaseObj)
pThing = NULL;
// Get object from home pBaseObj via selected id, if no or an anvalid thing has been specified
if (!pThing)
if (!(pThing=pBaseObj->Contents.Find(id))) return FALSE;
// check definition NoSell
if (pThing->Def->NoSell) return FALSE;
// Sell object (pBaseObj owner gets the money)
return Game.Players.Get(pBaseObj->Base)->Sell2Home(pThing);
}
开发者ID:lluchs,项目名称:clonk-rage,代码行数:33,代码来源:C4ObjectCom.cpp
示例8: validator
void C4ConsoleQtLocalizeStringDlg::AddLanguagePressed()
{
bool lang_ok = false;
QRegExpValidator validator(QRegExp("^[a-zA-Z][a-zA-Z]$"), this);
QString lang_id;
while (!lang_ok)
{
bool ok; int q = 0;
lang_id = QInputDialog::getText(this, LoadResStr("IDS_CNS_ADDLANGUAGE"), LoadResStr("IDS_CNS_ADDLANGUAGEID"), QLineEdit::Normal, QString(), &ok);
if (!ok) return;
lang_ok = (validator.validate(lang_id, q) == QValidator::Acceptable);
if (!lang_ok)
{
DoError(LoadResStr("IDS_ERR_INVALIDLANGUAGEID"));
}
}
// Either add or just focus existing editor
QLineEdit *editor = GetEditorByLanguage(lang_id.toUtf8());
if (!editor)
{
editor = AddEditor(lang_id.toUtf8(), nullptr);
adjustSize();
setMinimumSize(size());
}
editor->setFocus();
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:26,代码来源:C4ConsoleQtLocalizeString.cpp
示例9: Close
bool C4GameSave::Save(C4Group &hToGroup, bool fKeepGroup)
{
// close any previous
Close();
// set group
pSaveGroup = &hToGroup; fOwnGroup = fKeepGroup;
// PreSave-actions (virtual call)
if (!OnSaving()) return false;
// always save core
if (!SaveCore()) { Log(LoadResStr("IDS_ERR_SAVE_CORE")); return false; }
// cleanup group
pSaveGroup->Delete(C4CFN_PlayerFiles);
// remove: Title text, image and icon if specified
if (!GetKeepTitle())
{
pSaveGroup->Delete(FormatString("%s.*",C4CFN_ScenarioTitle).getData());
pSaveGroup->Delete(C4CFN_ScenarioIcon);
pSaveGroup->Delete(FormatString(C4CFN_ScenarioDesc,"*").getData());
pSaveGroup->Delete(C4CFN_Titles);
pSaveGroup->Delete(C4CFN_Info);
}
// save additional runtime data
if (GetSaveRuntimeData()) if (!SaveRuntimeData()) return false;
// Desc
if (GetSaveDesc())
if (!SaveDesc(*pSaveGroup))
Log(LoadResStr("IDS_ERR_SAVE_DESC")); /* nofail */
// save specialized components (virtual call)
if (!SaveComponents()) return false;
// done, success
return true;
}
开发者ID:gitMarky,项目名称:openclonk,代码行数:32,代码来源:C4GameSave.cpp
示例10: LogF
bool C4DownloadDlg::DownloadFile(const char *szDLType, C4GUI::Screen *pScreen, const char *szURL, const char *szSaveAsFilename, const char *szNotFoundMessage)
{
// log it
LogF(LoadResStr("IDS_PRC_DOWNLOADINGFILE"), szURL);
// show download dialog
C4DownloadDlg *pDlg = new C4DownloadDlg(szDLType);
if (!pDlg->ShowModal(pScreen, szURL, szSaveAsFilename))
{
// show an appropriate error
const char *szError = pDlg->GetError();
if (!szError || !*szError) szError = LoadResStr("IDS_PRC_UNKOWNERROR");
StdStrBuf sError;
sError.Format(LoadResStr("IDS_PRC_DOWNLOADERROR"), GetFilename(szURL), szError);
// it's a 404: display extended message
if (SSearch(szError, "404") && szNotFoundMessage)
{ sError.Append("|"); sError.Append(szNotFoundMessage); }
// display message
pScreen->ShowMessageModal(sError.getData(), FormatString(LoadResStr("IDS_CTL_DL_TITLE"), szDLType).getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error, NULL);
delete pDlg;
return false;
}
LogF(LoadResStr("IDS_PRC_DOWNLOADCOMPLETE"), szURL);
delete pDlg;
return true;
}
开发者ID:TheBlackJokerDevil,项目名称:openclonk,代码行数:25,代码来源:C4DownloadDlg.cpp
示例11: gtk_menu_new
bool C4EditCursor::Init()
{
#ifdef USE_WIN32_WINDOWS
if (!(hMenu = LoadMenu(Application.GetInstance(),MAKEINTRESOURCE(IDR_CONTEXTMENUS))))
return false;
#else // _WIN32
#ifdef WITH_DEVELOPER_MODE
menuContext = gtk_menu_new();
itemDelete = gtk_menu_item_new_with_label(LoadResStr("IDS_MNU_DELETE"));
itemDuplicate = gtk_menu_item_new_with_label(LoadResStr("IDS_MNU_DUPLICATE"));
itemGrabContents = gtk_menu_item_new_with_label(LoadResStr("IDS_MNU_CONTENTS"));
gtk_menu_shell_append(GTK_MENU_SHELL(menuContext), itemDelete);
gtk_menu_shell_append(GTK_MENU_SHELL(menuContext), itemDuplicate);
gtk_menu_shell_append(GTK_MENU_SHELL(menuContext), itemGrabContents);
g_signal_connect(G_OBJECT(itemDelete), "activate", G_CALLBACK(OnDelete), this);
g_signal_connect(G_OBJECT(itemDuplicate), "activate", G_CALLBACK(OnDuplicate), this);
g_signal_connect(G_OBJECT(itemGrabContents), "activate", G_CALLBACK(OnGrabContents), this);
gtk_widget_show_all(menuContext);
#endif // WITH_DEVELOPER_MODe
#endif // _WIN32
Console.UpdateModeCtrls(Mode);
return true;
}
开发者ID:notprathap,项目名称:openclonk-5.4.1-src,代码行数:29,代码来源:C4EditCursor.cpp
示例12: strPlayers
void C4StartupMainDlg::UpdateParticipants()
{
// First validate all participants (files must exist)
std::string strPlayers(Config.General.Participants);
std::vector<char> strPlayer(1025);
*Config.General.Participants=0;
for (int i = 0; SCopySegment(strPlayers.c_str(), i, &strPlayer[0], ';', strPlayer.size() - 1, true); i++)
{
const char *szPlayer = &strPlayer[0];
std::string strPlayerFile(Config.General.UserDataPath);
strPlayerFile.append(szPlayer);
if (!szPlayer || !*szPlayer) continue;
if (!FileExists(strPlayerFile.c_str())) continue;
if (!SEqualNoCase(GetExtension(szPlayer), "ocp")) continue; // additional sanity check to clear strange exe-path-only entries in player list?
SAddModule(Config.General.Participants, szPlayer);
}
// Draw selected players - we are currently displaying the players stored in Config.General.Participants.
// Existence of the player files is not validated and player filenames are displayed directly
// (names are not loaded from the player core).
strPlayers = LoadResStr("IDS_DESC_PLRS");
if (!Config.General.Participants[0])
strPlayers.append(LoadResStr("IDS_DLG_NOPLAYERSSELECTED"));
else
for (int i = 0; SCopySegment(Config.General.Participants, i, &strPlayer[0], ';', 1024, true); i++)
{
if (i > 0) strPlayers.append(", ");
strPlayers.append(GetFilenameOnly(&strPlayer[0]));
}
pParticipantsLbl->SetText(strPlayers.c_str());
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:30,代码来源:C4StartupMainDlg.cpp
示例13: LoadResStr
bool C4UpdateDlg::DoUpdate(const char *szUpdateURL, C4GUI::Screen *pScreen)
{
if(szUpdateURL == NULL || strlen(szUpdateURL) == 0)
{
pScreen->ShowMessageModal(LoadResStr("IDS_MSG_NEWRELEASEAVAILABLE"), LoadResStr("IDS_TYPE_UPDATE"),C4GUI::MessageDialog::btnOK, C4GUI::Ico_Ex_Update);
RedirectToDownloadPage();
return true;
}
// Determine local filename for update group
StdCopyStrBuf strLocalFilename(Config.AtTempPath(GetFilename(szUpdateURL)));
StdCopyStrBuf strRemoteURL(szUpdateURL);
// cut off http://
strRemoteURL.Replace("http://","");
// Download update group
if (!C4DownloadDlg::DownloadFile(LoadResStr("IDS_TYPE_UPDATE"), pScreen, strRemoteURL.getData(), strLocalFilename.getData(), LoadResStr("IDS_MSG_UPDATENOTAVAILABLE")))
{
// Download failed, open browser so the user can download a full package
RedirectToDownloadPage();
// return success, because error message has already been shown
return true;
}
// Apply downloaded update
return ApplyUpdate(strLocalFilename.getData(), true, pScreen);
}
开发者ID:sarah-russell12,项目名称:openclonk,代码行数:26,代码来源:C4UpdateDlg.cpp
示例14: FindSuitableFile
bool C4GraphicsResource::LoadFile(C4Surface& sfc, const char *szName, C4GroupSet &rGfxSet, int32_t &ridCurrSfc, int iFlags)
{
// find
char FileName[_MAX_FNAME]; int32_t ID = 0;
C4Group *pGrp = FindSuitableFile(szName, rGfxSet, FileName, &ID);
if (!pGrp)
{
LogF(LoadResStr("IDS_PRC_NOGFXFILE"), szName, LoadResStr("IDS_PRC_FILENOTFOUND"));
return false;
}
// check group
if (ID == ridCurrSfc)
// already up-to-date
return true;
// load
if (!sfc.Load(*pGrp, FileName, false, false, iFlags))
{
LogF(LoadResStr("IDS_PRC_NOGFXFILE"), FileName, LoadResStr("IDS_ERR_NOFILE"));
return false;
}
ridCurrSfc = ID;
Game.SetInitProgress(ProgressStart);
ProgressStart += ProgressIncrement;
return true;
}
开发者ID:Rocket-Fish,项目名称:openclonk,代码行数:25,代码来源:C4GraphicsResource.cpp
示例15: SetWindowText
void C4ComponentHost::InitDialog(HWND hDlg) {
hDialog = hDlg;
// Set text
SetWindowText(hDialog, Name);
SetDlgItemText(hDialog, IDOK, LoadResStr("IDS_BTN_OK"));
SetDlgItemText(hDialog, IDCANCEL, LoadResStr("IDS_BTN_CANCEL"));
if (Data.getLength()) SetDlgItemText(hDialog, IDC_EDITDATA, Data.getData());
}
开发者ID:ev1313,项目名称:yaC,代码行数:8,代码来源:C4ComponentHost.cpp
示例16: C4FileSelDlg
C4DefinitionSelDlg::C4DefinitionSelDlg(C4FileSel_BaseCB *pSelCallback,
const char *szFixedSelection)
: C4FileSelDlg(Config.AtExePath(Config.General.DefinitionPath),
FormatString(LoadResStr("IDS_MSG_SELECT"),
LoadResStr("IDS_DLG_DEFINITIONS")).getData(),
pSelCallback) {
if (szFixedSelection) sFixedSelection.Copy(szFixedSelection);
}
开发者ID:ev1313,项目名称:yaC,代码行数:8,代码来源:C4FileSelDlg.cpp
示例17:
void C4GameOptionsList::OptionControlMode::DoDropdownFill(C4GUI::ComboBox_FillCB *pFiller)
{
// change possible?
if (!::Control.isNetwork() || !::Control.Network.IsEnabled() || !::Control.isCtrlHost()) return;
// add possible modes
pFiller->AddEntry(LoadResStr("IDS_NET_CTRLMODE_CENTRAL"), CNM_Central);
pFiller->AddEntry(LoadResStr("IDS_NET_CTRLMODE_DECENTRAL"), CNM_Decentral);
}
开发者ID:notprathap,项目名称:openclonk-5.4.1-src,代码行数:8,代码来源:C4GameOptions.cpp
示例18: GetScreen
void C4StartupNetDlg::OnBtnUpdate(C4GUI::Control *btn)
{
// do update
if (!C4UpdateDlg::DoUpdate(UpdateURL.getData(), GetScreen()))
{
GetScreen()->ShowMessage(LoadResStr("IDS_MSG_UPDATEFAILED"), LoadResStr("IDS_TYPE_UPDATE"), C4GUI::Ico_Ex_Update);
}
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:8,代码来源:C4StartupNetDlg.cpp
示例19: LoadResStr
void C4GameOptionsList::OptionRuntimeJoin::Update()
{
const char *szText;
if (Config.Network.NoRuntimeJoin)
szText = LoadResStr("IDS_NET_RUNTIMEJOINBARRED");
else
szText = LoadResStr("IDS_NET_RUNTIMEJOINFREE");
pDropdownList->SetText(szText);
}
开发者ID:notprathap,项目名称:openclonk-5.4.1-src,代码行数:9,代码来源:C4GameOptions.cpp
示例20: strchr
void C4Application::OnCommand(const char *szCmd) {
// Find parameters
const char *szPar = strchr(szCmd, ' ');
while (szPar && *szPar == ' ') szPar++;
if (SEqual(szCmd, "/quit")) {
Quit();
return;
}
switch (AppState) {
case C4AS_Startup:
// Open a new game
if (SEqual2(szCmd, "/open ")) {
// Try to start the game with given parameters
AppState = C4AS_Game;
Game.ParseCommandLine(szPar);
UseStartupDialog = true;
if (!Game.Init()) AppState = C4AS_Startup;
}
break;
case C4AS_Game:
// Clear running game
if (SEqual(szCmd, "/close")) {
Game.Clear();
Game.Default();
AppState = C4AS_PreInit;
UseStartupDialog = true;
return;
}
// Lobby commands
if (Game.Network.isLobbyActive()) {
if (SEqual2(szCmd, "/start")) {
// timeout given?
int32_t iTimeout = Config.Lobby.CountdownTime;
if (!Game.Network.isHost())
Log(LoadResStr("IDS_MSG_CMD_HOSTONLY"));
else if (szPar && (!sscanf(szPar, "%d", &iTimeout) || iTimeout < 0))
Log(LoadResStr("IDS_MSG_CMD_START_USAGE"));
else
// start new countdown (aborts previous if necessary)
Game.Network.StartLobbyCountdown(iTimeout);
break;
}
}
// Normal commands
Game.MessageInput.ProcessInput(szCmd);
break;
}
}
开发者ID:ev1313,项目名称:clonk-rage,代码行数:56,代码来源:C4Application.cpp
注:本文中的LoadResStr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论