本文整理汇总了C++中CVar::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ CVar::getString方法的具体用法?C++ CVar::getString怎么用?C++ CVar::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVar
的用法示例。
在下文中一共展示了CVar::getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NET_Poll
void NET_Poll(void)
{
PollProcedure *pp;
bool useModem;
if (!configRestored)
{
if (serialAvailable)
{
if (config_com_modem.getInt() == 1.0)
useModem = true;
else
useModem = false;
SetComPortConfig (0, config_com_port.getInt(), config_com_irq.getInt(), config_com_baud.getInt(), useModem);
SetModemConfig (0, config_modem_dialtype.getString(), config_modem_clear.getString(), config_modem_init.getString(), config_modem_hangup.getString());
}
configRestored = true;
}
SetNetTime();
for (pp = pollProcedureList; pp; pp = pp->next)
{
if (pp->nextTime > net_time)
break;
pollProcedureList = pp->next;
pp->procedure();//(pp->arg);
}
}
示例2: setValue
void DesuraJSSettings::setValue(gcString name, gcString val)
{
CVar* cvar = GetCVarManager()->findCVar(name.c_str());
if (cvar && val != gcString(cvar->getString()))
cvar->setValue(val.c_str());
}
示例3: run
void run()
{
try
{
MainAppProviderI *pProvider = dynamic_cast<MainAppProviderI*>(g_pMainApp);
if (m_bAltProvider)
{
gcString strProv = gc_login_stage_url.getString();
pProvider->setProvider(strProv.c_str());
}
else
{
pProvider->setProvider(nullptr);
}
g_pMainApp->logIn(m_szUsername.c_str(), m_szPassword.c_str());
if (m_pCaller)
m_pCaller->onLoginEvent();
}
catch (gcException &except)
{
if (m_pCaller)
m_pCaller->onLoginErrorEvent(except);
}
}
示例4: CL_SignonReply
/**
* An svc_signonnum has been received, perform a client side setup
*/
void CL_SignonReply(void) {
char str[8192];
Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
switch (cls.signon) {
case 1:
MSG_WriteByte(&cls.message, clc_stringcmd);
MSG_WriteString(&cls.message, "prespawn");
break;
case 2:
MSG_WriteByte(&cls.message, clc_stringcmd);
MSG_WriteString(&cls.message, va("name \"%s\"\n", cl_name.getString()));
MSG_WriteByte(&cls.message, clc_stringcmd);
MSG_WriteString(&cls.message, va("color %i %i\n", cl_color.getInt() >> 4, cl_color.getInt()&15));
MSG_WriteByte(&cls.message, clc_stringcmd);
sprintf(str, "spawn %s", cls.spawnparms);
MSG_WriteString(&cls.message, str);
break;
case 3:
MSG_WriteByte(&cls.message, clc_stringcmd);
MSG_WriteString(&cls.message, "begin");
MemoryObj::Report(); // print remaining memory
break;
case 4:
SCR_EndLoadingPlaque(); // allow normal screen updates
break;
}
}
示例5: InitLocalManagers
void InitLocalManagers()
{
GetLanguageManager().loadFromFile(LANG_DEF);
GetLanguageManager().loadFromFile(LANG_EXTRA);
GetGCThemeManager()->loadFromFolder(THEMEFOLDER);
GetGCThemeManager()->loadTheme(gc_theme.getString());
}
示例6: onTextChange
void LoginForm::onTextChange(wxCommandEvent& event)
{
gcWString defaultText;
gcTextCtrl* textCtrl;
if (event.GetId() == m_tbUsername->GetId())
{
textCtrl = m_tbUsername;
defaultText = Managers::GetString(L"#LF_USER");
if (gc_saveusername.getBool())
{
const char* str = gc_lastusername.getString();
const char* avatar = gc_lastavatar.getString();
if (gcString(str) != gcString(m_tbUsername->GetValue().c_str().AsWChar()))
{
m_imgAvatar->setImage("#login_default_avatar");
}
else
{
if (avatar && UTIL::FS::isValidFile(UTIL::FS::PathWithFile(avatar)))
m_imgAvatar->setImage(avatar);
}
}
}
else if (event.GetId() == m_tbPasswordDisp->GetId())
{
textCtrl = m_tbPasswordDisp;
defaultText = Managers::GetString(L"#LF_PASS");
}
else
{
return;
}
const char* colorName = "tb-fg";
if (textCtrl->GetValue() == defaultText)
colorName = "tb-default-fg";
wxColor color = wxColor(GetThemeManager().getColor("formlogin", colorName));
textCtrl->SetForegroundColour(color);
textCtrl->Refresh();
}
示例7: onNeedCvar
void MainApp::onNeedCvar(UserCore::Misc::CVar_s& info)
{
if (info.name)
{
CVar* c = GetCVarManager()->findCVar(info.name);
if (c)
info.value = c->getString();
}
}
示例8: getSteamUser
void MainApp::getSteamUser(WCSpecialInfo *info, wxWindow *parent)
{
if (gc_steamuser.getString() && strcmp(gc_steamuser.getString(), "") != 0)
{
info->result = gc_steamuser.getString();
info->handled = true;
}
else
{
SteamUserDialog dlg(parent?parent:this);
dlg.ShowModal();
const char *steamuser = dlg.getSteamUser();
if (steamuser)
{
gc_steamuser.setValue(steamuser);
info->result = steamuser;
info->handled = true;
}
}
}
示例9: onNewAccount
void LoginForm::onNewAccount()
{
gcString strApiUrl;
if (m_comboProvider && m_comboProvider->GetSelection() != 0)
strApiUrl = gc_login_stage_url.getString();
NewAccountDialog naf(this, strApiUrl.c_str());
m_pNewAccount = &naf;
naf.ShowModal();
m_pNewAccount = nullptr;
}
示例10: run
void run()
{
Console::ignoreThisThread();
m_strFilter = g_strUnitTestFilter.getString();
GTEST_FLAG(filter) = m_strFilter;
RUN_ALL_TESTS();
GTEST_FLAG(filter) = "";
#ifdef WIN32
//Reset this as gtest messes with it :'(
_set_error_mode(_OUT_TO_MSGBOX);
#endif
}
示例11: onAltLogin
void LoginForm::onAltLogin(const char* szProvider)
{
if (szProvider == nullptr)
return;
gcString strApiUrl;
if (m_comboProvider && m_comboProvider->GetSelection() != 0)
strApiUrl = gc_login_stage_url.getString();
AltLoginDialog naf(this, szProvider, strApiUrl.c_str());
m_pNewAccount = &naf;
naf.ShowModal();
m_pNewAccount = nullptr;
}
示例12: strStagingUrl
LoginForm::LoginForm(wxWindow* parent)
: gcFrame(parent, wxID_ANY, Managers::GetString(L"#LF_TITLE"), wxDefaultPosition, wxSize(420,286), wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxWANTS_CHARS|wxMINIMIZE_BOX, true)
{
m_comboProvider = nullptr;
m_bAutoLogin = false;
m_pNewAccount = nullptr;
Bind(wxEVT_COMMAND_TEXT_ENTER, &LoginForm::onTextBoxEnter, this);
Bind(wxEVT_CLOSE_WINDOW, &LoginForm::onClose, this);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onButtonClick, this);
Bind(wxEVT_MOVE, &LoginForm::onMove, this);
m_imgLogo = new gcImageControl(this, wxID_ANY, wxDefaultPosition, wxSize( 253,81 ));
m_imgAvatar = new gcImageControl(this, wxID_ANY, wxDefaultPosition, wxSize( 66,66 ));
m_imgLogo->setImage("#login_logo");
m_imgAvatar->setImage("#login_default_avatar");
m_tbUsername = new gcTextCtrl(this, wxID_ANY, Managers::GetString(L"#LF_USER"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxWANTS_CHARS);
m_tbPassword = new gcTextCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxWANTS_CHARS|wxTE_PASSWORD);
m_tbPasswordDisp = new gcTextCtrl(this, wxID_ANY, Managers::GetString(L"#LF_PASS"));
gcString strStagingUrl(gc_login_stage_url.getString());
gcString strStagingLast(gc_login_stage_last.getString());
if (strStagingUrl.size() > 0)
{
wxArrayString choices;
choices.Add("Prod");
choices.Add("Test");
m_comboProvider = new gcChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices);
if (strStagingLast == "Test")
m_comboProvider->SetSelection(1);
else
m_comboProvider->SetSelection(0);
}
m_cbRemPass = new gcCheckBox(this, wxID_ANY, Managers::GetString(L"#LF_AUTO"));
m_cbRemPass->SetToolTip(Managers::GetString(L"#LF_AUTO_TOOLTIP"));
#ifdef WIN32
m_cbProxyOff = new gcCheckBox(this, wxID_ANY, Managers::GetString(L"#LF_PROXYOFF"));
m_cbProxyOff->SetToolTip(Managers::GetString(L"#LF_PROXYOFF_TOOLTIP"));
#endif
m_cbBypassSSLRevocationCheck = new gcCheckBox( this, wxID_ANY, Managers::GetString( L"#LF_REVOCATION" ) );
m_cbBypassSSLRevocationCheck->SetToolTip( Managers::GetString( L"#LF_REVOCATION_TOOLTIP" ) );
m_butSignin = new gcButton(this, wxID_ANY, Managers::GetString(L"#LOGIN"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);
m_butCancel = new gcButton(this, wxID_ANY, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);
m_linkOffline = new LoginLink(this, Managers::GetString(L"#LF_OFFLINE"), wxALIGN_LEFT);
m_linkNewAccount = new LoginLink(this, Managers::GetString(L"#LF_NEWACCOUNT"), wxALIGN_CENTER);
m_linkLostPassword = new LoginLink( this, Managers::GetString(L"#LF_LOSTPASS"), wxALIGN_RIGHT);
m_butTwitter = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));
m_butSteam = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));
m_butFacebook = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));
m_butGoogle = new gcImageButton(this, wxID_ANY, wxDefaultPosition, wxSize(42, 42));
m_butTwitter->setDefaultImage("#login_twitter");
m_butSteam->setDefaultImage("#login_steam");
m_butFacebook->setDefaultImage("#login_facebook");
m_butGoogle->setDefaultImage("#login_google");
m_butTwitter->SetCursor(wxCursor(wxCURSOR_HAND));
m_butSteam->SetCursor(wxCursor(wxCURSOR_HAND));
m_butFacebook->SetCursor(wxCursor(wxCURSOR_HAND));
m_butGoogle->SetCursor(wxCursor(wxCURSOR_HAND));
m_butTwitter->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);
m_butSteam->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);
m_butFacebook->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);
m_butGoogle->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoginForm::onAltLoginClick, this);
//focus gets set to the first child. Redirect input to username box
m_imgLogo->Bind(wxEVT_CHAR, &LoginForm::onFormChar, this);
m_imgAvatar->Bind(wxEVT_CHAR, &LoginForm::onFormChar, this);
#ifdef WIN32
Bind(wxEVT_LEFT_UP, &LoginForm::onMouseUp, this);
Bind(wxEVT_LEFT_DOWN, &LoginForm::onMouseDown, this);
Bind(wxEVT_MOTION, &LoginForm::onMouseMove, this);
m_imgLogo->Bind(wxEVT_LEFT_UP, &LoginForm::onMouseUp, this);
m_imgLogo->Bind(wxEVT_LEFT_DOWN, &LoginForm::onMouseDown, this);
m_imgLogo->Bind(wxEVT_MOTION, &LoginForm::onMouseMove, this);
m_imgAvatar->Bind(wxEVT_LEFT_UP, &LoginForm::onMouseUp, this);
m_imgAvatar->Bind(wxEVT_LEFT_DOWN, &LoginForm::onMouseDown, this);
m_imgAvatar->Bind(wxEVT_MOTION, &LoginForm::onMouseMove, this);
#endif
m_tbUsername->Bind(wxEVT_COMMAND_TEXT_UPDATED, &LoginForm::onTextChange, this);
//.........这里部分代码省略.........
示例13: gc_language
bool isValid = UTIL::FS::isValidFile(path);
if (!isValid)
Warning(gcString("Theme {0} is not a valid theme file.\n", val));
return isValid;
}
CVar gc_language("gc_language", "english", CFLAG_SAVEONEXIT, (CVarCallBackFn)&LangChanged);
CVar gc_theme("gc_theme", "default", CFLAG_SAVEONEXIT, (CVarCallBackFn)&ThemeChanged);
CONCOMMAND(cc_reloadlanguage, "reload_language")
{
gcString lan("{0}{1}.xml", LANGFOLDER(), gc_language.getString());
GetLanguageManager().loadFromFile(lan.c_str());
}
UserCore::UserThreadManagerI* GetThreadManager()
{
if (GetUserCore())
return GetUserCore()->getThreadManager();
return nullptr;
}
UserCore::UploadManagerI* GetUploadMng()
{
if (GetUserCore())
示例14: gcDialog
gcUnitTestForm::gcUnitTestForm(wxWindow* parent)
: gcDialog(parent, wxID_ANY, wxT("Unit Tests Results"), wxDefaultPosition, wxSize(500, 354), wxCAPTION | wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL)
, m_pThread(nullptr)
, m_ImageList(16, 16)
, m_bShouldClose(false)
{
m_nPassed = 0;
m_nFailed = 0;
m_nRunTime = 0;
showEvent += guiDelegate(this, &gcUnitTestForm::onShow);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &gcUnitTestForm::onButtonClicked, this);
Bind(wxEVT_CLOSE_WINDOW, &gcUnitTestForm::OnClose, this);
this->SetSizeHints(wxDefaultSize, wxDefaultSize);
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer(wxHORIZONTAL);
m_cbAssertOnError = new wxCheckBox(this, wxID_ANY, wxT("Assert On Error"), wxDefaultPosition, wxDefaultSize, 0);
m_cbAssertOnError->SetValue(true);
bSizer2->Add(m_cbAssertOnError, 0, wxALL, 5);
m_cbRunOnStartup = new wxCheckBox(this, wxID_ANY, wxT("Run On Startup"), wxDefaultPosition, wxDefaultSize, 0);
m_cbRunOnStartup->SetValue(true);
bSizer2->Add(m_cbRunOnStartup, 0, wxALL, 5);
m_staticText1 = new wxStaticText(this, wxID_ANY, wxT("Filter:"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText1->Wrap(-1);
m_textCtrl1 = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
m_butRun = new wxButton(this, wxID_ANY, wxT("Run"), wxDefaultPosition, wxDefaultSize, 0);
m_lcStats = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 25), wxLC_REPORT | wxLC_SORT_ASCENDING|wxLC_NO_HEADER);
m_lcUnitTests = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SORT_ASCENDING);
m_butClose = new wxButton(this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0);
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer(wxHORIZONTAL);
bSizer1->Add(m_staticText1, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxLEFT, 5);
bSizer1->Add(m_textCtrl1, 1, wxEXPAND | wxALL, 5);
bSizer1->Add(m_butRun, 0, wxTOP | wxBOTTOM | wxRIGHT, 5);
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer(5, 1, 0, 0);
fgSizer1->AddGrowableCol(0);
fgSizer1->AddGrowableRow(3);
fgSizer1->SetFlexibleDirection(wxBOTH);
fgSizer1->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
fgSizer1->Add(bSizer2, 1, wxEXPAND, 5);
fgSizer1->Add(bSizer1, 1, wxEXPAND, 5);
fgSizer1->Add(m_lcStats, 1, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5);
fgSizer1->Add(m_lcUnitTests, 1, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5);
fgSizer1->Add(m_butClose, 0, wxALIGN_RIGHT | wxBOTTOM | wxRIGHT | wxLEFT, 5);
this->SetSizer(fgSizer1);
this->Layout();
this->Centre(wxBOTH);
m_cbRunOnStartup->SetValue(g_bRunOnStartup.getBool());
m_cbAssertOnError->SetValue(g_bAssertOnFailure.getBool());
m_textCtrl1->SetValue(g_strUnitTestFilter.getString());
m_cbRunOnStartup->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &gcUnitTestForm::OnRunOnStartupClicked, this);
m_cbAssertOnError->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &gcUnitTestForm::OnAssertOnErrorClicked, this);
m_textCtrl1->Bind(wxEVT_COMMAND_TEXT_UPDATED, &gcUnitTestForm::OnTextChanged, this);
m_icoTestGood = GetGCThemeManager()->getImageHandle("#test_good");
m_icoTestBad = GetGCThemeManager()->getImageHandle("#test_bad");
m_ImageList.Add(wxBitmap(m_icoTestBad.getImg()->Scale(16, 16)));
m_ImageList.Add(wxBitmap(m_icoTestGood.getImg()->Scale(16, 16)));
m_lcStats->SetImageList(&m_ImageList, wxIMAGE_LIST_NORMAL);
m_lcStats->SetImageList(&m_ImageList, wxIMAGE_LIST_SMALL);
m_lcUnitTests->SetImageList(&m_ImageList, wxIMAGE_LIST_NORMAL);
m_lcUnitTests->SetImageList(&m_ImageList, wxIMAGE_LIST_SMALL);
g_pTestWatcher->onStartEvent += guiDelegate(this, &gcUnitTestForm::onStart);
g_pTestWatcher->onEndEvent += guiDelegate(this, &gcUnitTestForm::onEnd);
g_pTestWatcher->onTestStartEvent += guiDelegate(this, &gcUnitTestForm::onTestStart);
g_pTestWatcher->onTestResultEvent += guiDelegate(this, &gcUnitTestForm::onTestResult);
g_pTestWatcher->onTestEndEnd += guiDelegate(this, &gcUnitTestForm::onTestEnd);
if (g_bRunOnStartup.getBool())
//.........这里部分代码省略.........
示例15: gcFrame
//.........这里部分代码省略.........
wxFlexGridSizer* fgSizer1 = new wxFlexGridSizer( 1, 3, 0, 0 );
fgSizer1->AddGrowableCol( 0 );
fgSizer1->AddGrowableCol( 2 );
fgSizer1->AddGrowableRow( 0 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizer1->Add( fgSizer2, 1, wxEXPAND, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
this->SetSizer( fgSizer1 );
this->Layout();
m_bSavePos = false;
m_vTabOrder.push_back(m_tbUsername);
m_vTabOrder.push_back(m_tbPasswordDisp);
m_vTabOrder.push_back(m_tbPassword);
#ifndef UI_HIDE_AUTOLOGIN
m_vTabOrder.push_back(m_cbRemPass);
#endif
m_vTabOrder.push_back(m_butSignin);
m_vTabOrder.push_back(m_butCancel);
m_vTabOrder.push_back(m_linkOffline);
m_vTabOrder.push_back(m_linkNewAccount);
m_vTabOrder.push_back(m_linkLostPassword);
Centre(wxCENTRE_ON_SCREEN);
SetFocus();
if (gc_login_x.getInt() == -1 || gc_login_y.getInt() == -1)
{
int x = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
int y = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y);
int w=0;
int h=0;
GetSize(&w, &h);
int newX = (x-w)/2;
int newY = (y-h)/2;
if (newX>0 && newY>0)
SetSize(newX, newY, -1, -1);
}
else
{
#ifdef NIX
if (! gc_allow_wm_positioning.getBool())
#endif
setSavedWindowPos(gc_login_x.getInt(), gc_login_y.getInt(), UINT_MAX, UINT_MAX);
}
#ifndef UI_HIDE_AUTOLOGIN
if (gc_savelogin.getBool())
m_cbRemPass->SetValue(true);
#endif
if (gc_saveusername.getBool())
{
const char* str = gc_lastusername.getString();
const char* avatar = gc_lastavatar.getString();
if (gcString(str) != "")
{
m_tbUsername->SetValue(str);
m_tbPasswordDisp->Show(false);
m_tbPassword->Show();
m_tbPassword->SetFocus();
Layout();
}
if (avatar && UTIL::FS::isValidFile(UTIL::FS::PathWithFile(avatar)))
m_imgAvatar->setImage(avatar);
}
m_pLogThread = NULL;
m_bSavePos = true;
m_bMouseDrag = false;
onLoginEvent += guiDelegate(this, &LoginForm::onLogin);
onLoginErrorEvent += guiDelegate(this, &LoginForm::onLoginError);
onStartLoginEvent += guiDelegate(this, &LoginForm::onStartLogin);
Managers::LoadTheme(this, "formlogin");
#ifndef UI_HIDE_AUTOLOGIN
Managers::LoadTheme(m_cbRemPass, "formlogin");
#endif
#ifdef WIN32
SetSize(wxSize(420,246));
#endif
setFrameRegion();
}