void LLFloaterAvatarPicker::populateNearMe()
{
	BOOL all_loaded = TRUE;
	BOOL empty = TRUE;
	LLScrollListCtrl* near_me_scroller = getChild<LLScrollListCtrl>("NearMe");
	near_me_scroller->deleteAllItems();

	uuid_vec_t avatar_ids;
	LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
	for(U32 i=0; i<avatar_ids.size(); i++)
	{
		LLUUID& av = avatar_ids[i];
		if(av == gAgent.getID()) continue;
		LLSD element;
		element["id"] = av; // value
		LLAvatarName av_name;

		if (!LLAvatarNameCache::get(av, &av_name))
		{
			element["columns"][0]["column"] = "name";
			element["columns"][0]["value"] = LLCacheName::getDefaultName();
			all_loaded = FALSE;
		}			
		else
		{
			element["columns"][0]["column"] = "name";
			element["columns"][0]["value"] = av_name.mDisplayName;
			element["columns"][1]["column"] = "username";
			element["columns"][1]["value"] = av_name.mUsername;

			sAvatarNameMap[av] = av_name;
		}
		near_me_scroller->addElement(element);
		empty = FALSE;
	}

	if (empty)
	{
		getChildView("NearMe")->setEnabled(FALSE);
		getChildView("ok_btn")->setEnabled(FALSE);
		near_me_scroller->setCommentText(getString("no_one_near"));
	}
	else 
	{
		getChildView("NearMe")->setEnabled(TRUE);
		getChildView("ok_btn")->setEnabled(TRUE);
		near_me_scroller->selectFirstItem();
		onList();
		near_me_scroller->setFocus(TRUE);
	}

	if (all_loaded)
	{
		mNearMeListComplete = TRUE;
	}
}
void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& content)
{
	// Check for out-of-date query
	if (query_id != mQueryID) return;

	LLScrollListCtrl* search_results = getChild<LLScrollListCtrl>("SearchResults");

	LLSD agents = content["agents"];
	if (agents.size() == 0)
	{
		LLStringUtil::format_map_t map;
		map["[TEXT]"] = childGetText("Edit");
		LLSD item;
		item["id"] = LLUUID::null;
		item["columns"][0]["column"] = "name";
		item["columns"][0]["value"] = getString("not_found", map);
		search_results->addElement(item);
		search_results->setEnabled(false);
		getChildView("ok_btn")->setEnabled(false);
		return;
	}

	// clear "Searching" label on first results
	search_results->deleteAllItems();

	LLSD item;
	LLSD::array_const_iterator it = agents.beginArray();
	for ( ; it != agents.endArray(); ++it)
	{
		const LLSD& row = *it;
		item["id"] = row["id"];
		LLSD& columns = item["columns"];
		columns[0]["column"] = "name";
		columns[0]["value"] = row["display_name"];
		columns[1]["column"] = "username";
		columns[1]["value"] = row["username"];
		search_results->addElement(item);

		// add the avatar name to our list
		LLAvatarName avatar_name;
		avatar_name.fromLLSD(row);
		sAvatarNameMap[row["id"].asUUID()] = avatar_name;
	}

	getChildView("ok_btn")->setEnabled(true);
	search_results->setEnabled(true);
	search_results->selectFirstItem();
	onList();
	search_results->setFocus(TRUE);
}
void LLFloaterAvatarPicker::populateNearMe()
{
	BOOL all_loaded = TRUE;
	BOOL empty = TRUE;
	LLScrollListCtrl* near_me_scroller = getChild<LLScrollListCtrl>("NearMe");
	near_me_scroller->deleteAllItems();

	std::vector<LLUUID> avatar_ids;
	LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
	for(U32 i=0; i<avatar_ids.size(); i++)
	{
		LLUUID& av = avatar_ids[i];
		if(av == gAgent.getID()) continue;
		LLSD element;
		element["id"] = av; // value
		std::string fullname;
		if(!gCacheName->getFullName(av, fullname))
		{
			element["columns"][0]["value"] = LLCacheName::getDefaultName();
			all_loaded = FALSE;
		}			
		else
		{
			element["columns"][0]["value"] = fullname;
		}
		near_me_scroller->addElement(element);
		empty = FALSE;
	}

	if (empty)
	{
		childDisable("NearMe");
		childDisable("Select");
		near_me_scroller->addCommentText(getString("no_one_near"));
	}
	else 
	{
		childEnable("NearMe");
		childEnable("Select");
		near_me_scroller->selectFirstItem();
		onList(near_me_scroller, this);
		near_me_scroller->setFocus(TRUE);
	}

	if (all_loaded)
	{
		mNearMeListComplete = TRUE;
	}
}
void LLFloaterAvatarPicker::draw()
{
	// sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars).
	// lets check this via mOkButtonValidateSignal callback periodically.
	static LLFrameTimer timer;
	if (timer.hasExpired())
	{
		timer.setTimerExpirySec(0.33f); // three times per second should be enough.

		// simulate list changes.
		onList();
		timer.start();
	}

	LLFloater::draw();

// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-1.0.0e
	// TODO-RLVa: this code needs revisiting
	if (rlv_handler_t::isEnabled())
	{
		LLPanel* pNearMePanel = getChild<LLPanel>("NearMePanel");
		if ( (pNearMePanel) && (childGetVisibleTab("ResidentChooserTabs") == pNearMePanel) )
		{
			if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
			{
				if (mNearMeListComplete)
				{
					getChild<LLScrollListCtrl>("NearMe")->deleteAllItems();
					childSetEnabled("Select", false);
				}
				mNearMeListComplete = FALSE;
				pNearMePanel->setCtrlsEnabled(FALSE);
				return;
			}
			pNearMePanel->setCtrlsEnabled(TRUE);
		}
	}
// [/RLVa:KB]

	if (!mNearMeListComplete &&  getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel() == getChild<LLPanel>("NearMePanel"))
	{
		populateNearMe();
	}
}
void LLFloaterAvatarPicker::draw()
{
	// sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars).
	// lets check this via mOkButtonValidateSignal callback periodically.
	static LLFrameTimer timer;
	if (timer.hasExpired())
	{
		timer.setTimerExpirySec(0.33f); // three times per second should be enough.

		// simulate list changes.
		onList();
		timer.start();
	}

	LLFloater::draw();
	if (!mNearMeListComplete && getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel() == getChild<LLPanel>("NearMePanel"))
	{
		populateNearMe();
	}
}
Beispiel #6
0
BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, PVOID pvReserved) {	
	if(dwReason == DLL_PROCESS_ATTACH) {
		OutputDebugString("GeDoSaTo: startup");

		// read install location from registry
		getInstallDirectory();
		OutputDebugString("GeDoSaTo: Got install dir");

		// don't attach to processes on the blacklist / not on the whitelist
		if(getUseBlacklist() ? onList(getExeFileName(), "blacklist.txt") : !onList(getExeFileName(), "whitelist.txt")) {
			OutputDebugString("GeDoSaTo: blacklisted / not whitelisted");
			if(getExeFileName() == "GeDoSaToTool") return true;
			return true;
		}
		g_active = true;
		OutputDebugString("GeDoSaTo: Active");
		
		// initialize log
		string logFn = format("logs\\%s_%s.log", getExeFileName().c_str(), getTimeString().c_str());
		std::replace(logFn.begin(), logFn.end(), ':', '-');
		std::replace(logFn.begin(), logFn.end(), ' ', '_');
		logFn = getInstalledFileName(logFn);
		fopen_s(&g_oFile, logFn.c_str(), "w");
		if(!g_oFile) OutputDebugString(format("GeDoSaTo: Error opening log fn %s", logFn.c_str()).c_str());
		else OutputDebugString(format("GeDoSaTo: Opening log fn %s, handle: %p", logFn.c_str(), g_oFile).c_str());
		OutputDebugString("GeDoSaTo: Log file initialized, let that take over");

		// startup
		sdlogtime(-1);
		SDLOG(-1, "===== start "INTERCEPTOR_NAME" %s = fn: %s\n", GeDoSaToVersion(), getExeFileName().c_str());
		SDLOG(-1, "===== installation directory: %s\n", getInstallDirectory().c_str());

		// load settings
		Settings::get().load();
		Settings::get().report();
		 
		KeyActions::get().load();
		KeyActions::get().report();

		if(!Settings::get().getPreventSteamOverlay() && Settings::get().getLoadSteamOverlayEarly()) {
			SDLOG(2, "Attempting to pre-load Steam overlay dll.\n");
			LoadLibrary("gameoverlayrenderer.dll");
		}

		if(Settings::get().getLoadD3DEarly()) {
			SDLOG(2, "Early d3d loading.\n");
			auto dllname = getSystemDllName("d3d9.dll");
			LoadLibrary(dllname.c_str());
		}

		// detour
		startDetour();
		return true;
	}
	if(dwReason == DLL_PROCESS_DETACH && g_active) {
		Settings::get().shutdown();
		endDetour();
		SDLOG(-1, "===== end =\n");
		fclose(g_oFile);
	}
    return false;
}