示例#1
0
LLColor4U lggBeamMaps::getCurrentColor(const LLColor4U& agentColor)
{
	static LLCachedControl<std::string> settingName(gSavedSettings, "FSBeamColorFile");
	std::string setName(settingName);

	if (setName.empty())
	{
		return agentColor;
	}

	if (setName != mLastColorFileName)
	{
		mLastColorFileName = settingName;
	
		std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "beamsColors", ""));
		std::string path_name2(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS , "beamsColors", ""));
		std::string filename = path_name + setName + ".xml";
		if (!gDirUtilp->fileExists(filename))
		{
			filename = path_name2 + setName + ".xml";
			if (!gDirUtilp->fileExists(filename))
			{
				return agentColor;
			}
		}

		mLastColorsData = lggBeamsColors::fromLLSD(getPic(filename));
	}
	
	return beamColorFromData(mLastColorsData);
}
LLColor4U lggBeamMaps::getCurrentColor(LLColor4U agentColor)
{

	static std::string* settingName = rebind_llcontrol<std::string >("EmeraldBeamColorFile", &gSavedSettings, true);

	if(*settingName == "===OFF===") return agentColor;

	if(*settingName != lastColorFileName)
	{
		lastColorFileName = *settingName;
	
		std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "beamsColors", ""));
		std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "beamsColors", ""));
		std::string filename = path_name + *settingName + ".xml";
		if(gDirUtilp->fileExists(filename))
		{
		}else
		{
			filename = path_name2 + *settingName + ".xml";
			if(!gDirUtilp->fileExists(filename))
			{
				return agentColor;
			}
		}

		lastColorsData = lggBeamsColors::fromLLSD(getPic(filename));
	}
	agentColor = beamColorFromData(lastColorsData);
	
	return agentColor;
}
示例#3
0
LLColor4U lggBeamMaps::getCurrentColor(LLColor4U agentColor)
{

    static LLCachedControl<std::string> ssettingName(gSavedSettings, "PhoenixBeamColorFile");
    std::string settingName = std::string(ssettingName);
    if(settingName == "===OFF===") return agentColor;

    if(settingName != lastColorFileName)
    {
        lastColorFileName = settingName;

        std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "beamsColors", ""));
        std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "beamsColors", ""));
        std::string filename = path_name + settingName + ".xml";
        if(gDirUtilp->fileExists(filename))
        {
        } else
        {
            filename = path_name2 + settingName + ".xml";
            if(!gDirUtilp->fileExists(filename))
            {
                return agentColor;
            }
        }

        lastColorsData = lggBeamsColors::fromLLSD(getPic(filename));
    }
    agentColor = beamColorFromData(lastColorsData);

    return agentColor;
}