当前位置: 首页>>代码示例>>C++>>正文


C++ CVar::getBool方法代码示例

本文整理汇总了C++中CVar::getBool方法的典型用法代码示例。如果您正苦于以下问题:C++ CVar::getBool方法的具体用法?C++ CVar::getBool怎么用?C++ CVar::getBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CVar的用法示例。


在下文中一共展示了CVar::getBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onLoginAcceptedCB

void MainApp::onLoginAcceptedCB(std::pair<bool,bool> &loginInfo)
{
	bool saveLoginInfo = loginInfo.first;
	bool autologin = loginInfo.second;

	if (m_wxLoginForm)
	{
		m_wxLoginForm->Show(false);
		m_wxLoginForm->Destroy();
		m_wxLoginForm = nullptr;
	}

	if (saveLoginInfo)
		GetUserCore()->saveLoginInfo();

	GetUserCore()->getAppUpdateProgEvent() += guiDelegate(this, &MainApp::onAppUpdateProg);
	GetUserCore()->getAppUpdateCompleteEvent() += guiDelegate(this, &MainApp::onAppUpdate);
	GetWebCore()->getCookieUpdateEvent() += guiDelegate(this, &MainApp::onCookieUpdate);
	GetWebCore()->getLoggedOutEvent() += delegate(&onLoggedOutEvent);
	GetUserCore()->getPipeDisconnectEvent() += guiDelegate(this, &MainApp::onPipeDisconnect);

	//trigger this so it sets cookies first time around
	onCookieUpdate();


	admin_developer.setValue(GetUserCore()->isAdmin());
	GetCVarManager()->loadUser(GetUserCore()->getUserId());

	gcWString userName(GetUserCore()->getUserName());
	SetCrashDumpSettings(userName.c_str(), gc_uploaddumps.getBool());

	m_bLoggedIn = true;
	m_iMode = APP_MODE::MODE_ONLINE;

	bool showMain = !(autologin && gc_silentlaunch.getBool());
	showMainForm(false, showMain);

	m_pInternalLink = new InternalLink(this);

	if (!m_bQuiteMode)
		GetUserCore()->getItemManager()->checkItems();

	if (m_wxTBIcon)
		m_wxTBIcon->regEvents();

	if (showMain && !m_bQuiteMode)
		showNews();

	if (m_szDesuraCache != "")
	{
		m_pInternalLink->handleInternalLink(m_szDesuraCache.c_str());
		m_szDesuraCache = "";
	}

	onLoginEvent();
}
开发者ID:leayle2a,项目名称:desura-app,代码行数:56,代码来源:MainApp.cpp

示例2: OnTestPartResult

	void OnTestPartResult(const TestPartResult& test_part_result)
	{
		if (!m_bDisableAssertOnFailure && test_part_result.failed() && g_bAssertOnFailure.getBool())
		{
			PAUSE_DEBUGGER();
		}
	}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:7,代码来源:gcUnitTestPage.cpp

示例3: Host_Frame

void Host_Frame(float time) {
    double time1, time2;
    static double timetotal;
    static int timecount;
    int i, c, m;

    if (!serverprofile.getBool()) {
        _Host_Frame(time);
        return;
    }

    time1 = Sys_FloatTime();
    _Host_Frame(time);
    time2 = Sys_FloatTime();

    timetotal += time2 - time1;
    timecount++;

    if (timecount < 1000)
        return;

    m = timetotal * 1000 / timecount;
    timecount = 0;
    timetotal = 0;
    c = 0;
    for (i = 0; i < svs.maxclients; i++) {
        if (svs.clients[i].active)
            c++;
    }

    fps_count++;

    Con_Printf("serverprofile: %2i clients %2i msec\n", c, m);
}
开发者ID:DrLabman,项目名称:QMB,代码行数:34,代码来源:host.cpp

示例4: CL_LerpPoint

/**
 * Determines the fraction between the last two messages that the objects
 * should be put at.
 */
float CL_LerpPoint(void) {
	float f, frac;

	f = cl.mtime[0] - cl.mtime[1];

	if (!f || cl_nolerp.getBool() || cls.timedemo || sv.active) {
		cl.time = cl.mtime[0];
		return 1;
	}

	if (f > 0.1) { // dropped packet, or start of demo
		cl.mtime[1] = cl.mtime[0] - 0.1;
		f = 0.1f;
	}
	frac = (cl.time - cl.mtime[1]) / f;
	//Con_Printf ("frac: %f\n",frac);
	if (frac < 0) {
		if (frac < -0.01) {
			cl.time = cl.mtime[1];
			//				Con_Printf ("low frac\n");
		}
		frac = 0;
	} else if (frac > 1) {
		if (frac > 1.01) {
			cl.time = cl.mtime[0];
			//				Con_Printf ("high frac\n");
		}
		frac = 1;
	}

	return frac;
}
开发者ID:DrLabman,项目名称:QMB,代码行数:36,代码来源:cl_main.cpp

示例5: CL_ReadFromServer

/**
 * Read all incoming data from the server
 */
int CL_ReadFromServer(void) {
	int ret;

	cl.oldtime = cl.time;
	cl.time += host_frametime;

	do {
		ret = CL_GetMessage();
		if (ret == -1)
			Host_Error("CL_ReadFromServer: lost server connection");
		if (!ret)
			break;

		cl.last_received_message = realtime;
		CL_ParseServerMessage();
	} while (ret && cls.state == ca_connected);

	if (cl_shownet.getBool())
		Con_Printf("\n");

	CL_RelinkEntities();
	CL_UpdateTEnts();

	// bring the links up to date
	return 0;
}
开发者ID:DrLabman,项目名称:QMB,代码行数:29,代码来源:cl_main.cpp

示例6: SCR_DrawFPS

void SCR_DrawFPS(void) {
	extern CVar show_fps;
	static double lastframetime;
	double t;
	extern int fps_count;
	static int lastfps;
	static int totalfps;
	static int lastsecond;
	int x, y;
	char st[80];

	if (!show_fps.getBool())
		return;

	t = Sys_FloatTime();
	lastfps = 1 / (t - lastframetime);
	if (((int) (t) % 100) > ((int) (lastframetime) % 100)) {
		lastsecond = totalfps;
		totalfps = 0;
	}
	lastframetime = t;
	totalfps += 1;

	sprintf(st, "%3d FPS", lastfps);

	x = vid.conwidth - strlen(st) * 8 - 16;
	y = 0;
	Draw_String(x, y, st);

	sprintf(st, "%3d Last second", lastsecond);
	x = vid.conwidth - strlen(st) * 8 - 16;
	y = 8;
	Draw_String(x, y, st);
}
开发者ID:DrLabman,项目名称:QMB,代码行数:34,代码来源:gl_screen.cpp

示例7: onLogin

void LoginForm::onLogin()
{
	ASSERT_UITHREAD();
	safe_delete(m_pLogThread);

	bool remPass = m_cbRemPass->GetValue();
	gc_savelogin.setValue(remPass);

	if (gc_saveusername.getBool())
	{
		wxString dastr = m_tbUsername->GetValue();
		gc_lastusername.setValue(dastr.ToUTF8());
	}

	SaveCVars();

	if (m_comboProvider)
		gc_login_stage_last.setValue(m_comboProvider->GetStringSelection().ToUTF8());

	Show(false);

	MainApp* temp = dynamic_cast<MainApp*>(GetParent());

	if (temp)
		temp->onLoginAccepted(remPass, m_bAutoLogin);
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:26,代码来源:LoginForm.cpp

示例8: DESURA_Warn

void DESURA_Warn(const wchar_t* msg)
{
	if (logForm)
		logForm->appendText(msg, Color(0xFF000000));

	if (gc_showerror.getBool())
		ShowLogForm(false);
}
开发者ID:CSRedRat,项目名称:desura-app,代码行数:8,代码来源:Log.cpp

示例9: SCR_DrawPause

void SCR_DrawPause(void) {
	qpic_t *pic;

	if (!scr_showpause.getBool()) // turn off for screenshots
		return;

	if (!cl.paused)
		return;

	pic = Draw_CachePic("gfx/pause.lmp");
	Draw_AlphaPic((vid.conwidth - pic->width) / 2, (vid.conheight - 48 - pic->height) / 2, pic, 1);
}
开发者ID:DrLabman,项目名称:QMB,代码行数:12,代码来源:gl_screen.cpp

示例10: showLogin

void MainApp::showLogin(bool skipAutoLogin)
{
	if (!m_wxLoginForm)
		m_wxLoginForm = new LoginForm(this);

	if (!skipAutoLogin && gc_savelogin.getBool())
		m_wxLoginForm->autoLogin();

	m_wxLoginForm->Show(!m_bQuiteMode);

	if (m_wxLoginForm->IsShown())
		m_wxLoginForm->Raise();

}
开发者ID:aszlig,项目名称:Desurium,代码行数:14,代码来源:MainApp.cpp

示例11: Scr_ShowNumP

void Scr_ShowNumP(void) {
	extern CVar show_fps;
	int x, y;
	char st[80];
	extern int numParticles;

	if (!show_fps.getBool())
		return;

	sprintf(st, "%i Particles in world", numParticles);

	x = vid.conwidth - strlen(st) * 8 - 16;
	y = 16; //vid.conheight - (sb_lines * (vid.conheight/240) )- 16;
	//Draw_TileClear(x, y, strlen(st)*16, 16);
	Draw_String(x, y, st);
}
开发者ID:DrLabman,项目名称:QMB,代码行数:16,代码来源:gl_screen.cpp

示例12: SCR_DrawTurtle

void SCR_DrawTurtle(void) {
	static int count;

	if (!scr_showturtle.getBool())
		return;

	if (host_frametime < 0.1) {
		count = 0;
		return;
	}

	count++;
	if (count < 3)
		return;

	Draw_AlphaPic(scr_vrect.x, scr_vrect.y, scr_turtle, 1);
}
开发者ID:DrLabman,项目名称:QMB,代码行数:17,代码来源:gl_screen.cpp

示例13: 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();
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:46,代码来源:LoginForm.cpp

示例14: logIn

void MainApp::logIn(const char* user, const char* pass)
{
	gcTrace("User: {0}", user);

	std::lock_guard<std::mutex> a(m_UserLock);

	safe_delete(g_pUserHandle);

	gcString path = UTIL::OS::getAppDataPath();

	g_pUserHandle = (UserCore::UserI*)UserCore::FactoryBuilderUC(USERCORE);
	g_pUserHandle->init(path.c_str(), m_strServiceProvider.c_str());


	try
	{
		//need to do this here as news items will be passed onlogin
		g_pUserHandle->getNewsUpdateEvent() += delegate(this, &MainApp::onNewsUpdate);
		g_pUserHandle->getGiftUpdateEvent() += delegate((MainAppNoUI*)this, &MainAppNoUI::onGiftUpdate);
		g_pUserHandle->getNeedCvarEvent() += delegate(this, &MainApp::onNeedCvar);

		g_pUserHandle->lockDelete();
		g_pUserHandle->logIn(user, pass);
		g_pUserHandle->unlockDelete();

#ifndef DEBUG
		if (gc_enable_api_debugging.getBool())
			g_pUserHandle->getWebCore()->enableDebugging();
#endif
	}
	catch (gcException)
	{
		g_pUserHandle->logOut();

		g_pUserHandle->getNewsUpdateEvent() -= delegate(this, &MainApp::onNewsUpdate);
		g_pUserHandle->getGiftUpdateEvent() -= delegate((MainAppNoUI*)this, &MainAppNoUI::onGiftUpdate);
		g_pUserHandle->getNeedCvarEvent() -= delegate(this, &MainApp::onNeedCvar);

		g_pUserHandle->unlockDelete();

		g_pUserHandle->logOut(false, false);
		safe_delete(g_pUserHandle);
		throw;
	}
}
开发者ID:leayle2a,项目名称:desura-app,代码行数:45,代码来源:MainApp.cpp

示例15: showLogin

void MainApp::showLogin(bool skipAutoLogin, bool webLoggedOut)
{
#ifdef DEBUG
	showUnitTest();
#endif

	if (!m_wxLoginForm)
		m_wxLoginForm = new LoginForm(this);

	if (!skipAutoLogin && gc_savelogin.getBool())
		m_wxLoginForm->autoLogin();

	m_wxLoginForm->Show(!m_bQuiteMode);

	if (m_wxLoginForm->IsShown())
		m_wxLoginForm->Raise();

	if (webLoggedOut)
		m_wxLoginForm->showForcedLogoutPromt();
}
开发者ID:leayle2a,项目名称:desura-app,代码行数:20,代码来源:MainApp.cpp


注:本文中的CVar::getBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。