Esempio n. 1
0
CLaptopUtil::CLaptopUtil()
{
	IConsole * pConsole = gEnv->pConsole;

	pConsole->Register(	"g_show_laptop_status", &CLaptopUtil::g_show_laptop_status, 0, 0,
											"Show laptop status");

	pConsole->Register(	"g_show_laptop_status_test", &CLaptopUtil::g_show_laptop_status_test, 0, 0,
											"Show fake laptop status for testing");

	m_isLaptop = false;
	m_percentBatLife = 0;
	m_secBatLife = 0;
	m_isWLan = false;
	m_isBattery = false;
	m_signalStrength = false;

	Init();

	if(m_isLaptop)
	{
		Update();
		//gEnv->pGame->GetIGameFramework()->RegisterListener(this, "laptoputil", FRAMEWORKLISTENERPRIORITY_MENU);
	}
}
Esempio n. 2
0
	void Init()
	{
		m_pConsole = Kernel()->RequestInterface<IConsole>();
		m_pStorage = Kernel()->RequestInterface<IStorage>();

		if(!m_pConsole || !m_pStorage)
			return;

		m_pConsole->Register("dbg_dumpmem", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, Con_DbgDumpmem, this, "Dump the memory", IConsole::CONSOLELEVEL_ADMIN);
		m_pConsole->Register("dbg_lognetwork", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, Con_DbgLognetwork, this, "Log the network", IConsole::CONSOLELEVEL_ADMIN);
	}
Esempio n. 3
0
void CFriends::Init()
{
	IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
	if(pConfig)
		pConfig->RegisterCallback(ConfigSaveCallback, this);

	IConsole *pConsole = Kernel()->RequestInterface<IConsole>();
	if(pConsole)
	{
		pConsole->Register("add_friend", "ss", CFGFLAG_CLIENT, ConAddFriend, this, "Add a friend");
		pConsole->Register("remove_Friend", "ss", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a friend");
	}
}
Esempio n. 4
0
	virtual void Init(int FlagMask)
	{
		m_pStorage = Kernel()->RequestInterface<IStorage>();
		m_pConsole = Kernel()->RequestInterface<IConsole>();
		m_FlagMask = FlagMask;
		Reset();

		if(m_pConsole)
			m_pConsole->Register("save_config", "?s", CFGFLAG_SERVER|CFGFLAG_CLIENT|CFGFLAG_STORE, Con_SaveConfig, this, "Save config to file");
	}
Esempio n. 5
0
void CLua::Init()
{
	IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
	if(pConfig)
		pConfig->RegisterCallback(ConfigSaveCallback, this);
	IConsole *pConsole = Kernel()->RequestInterface<IConsole>();
	if(pConsole)
	{
		pConsole->Register("add_lua_file", "s", CFGFLAG_CLIENT, ConAddLuaFile, this, "Add a Lua file");
	}
}
Esempio n. 6
0
void CFriends::Init(bool Foes)
{
	CALLSTACK_ADD();

	m_Foes = Foes;

	IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
	if(pConfig)
		pConfig->RegisterCallback(ConfigSaveCallback, this);

	IConsole *pConsole = Kernel()->RequestInterface<IConsole>();
	if(pConsole)
	{
		if(Foes)
		{
			pConsole->Register("add_foe", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConAddFriend, this, "Add a foe");
			pConsole->Register("remove_foe", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a foe");
			pConsole->Register("foes", "", CFGFLAG_CLIENT, ConFriends, this, "List foes");
		}
		else
		{
			pConsole->Register("add_friend", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConAddFriend, this, "Add a friend");
			pConsole->Register("remove_friend", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a friend");
			pConsole->Register("friends", "", CFGFLAG_CLIENT, ConFriends, this, "List friends");
		}
	}
}