void UGameUserSettings::ValidateSettings()
{
	// Should we wipe all user settings?
	if ( !IsVersionValid() )
	{
		// First try loading the settings, if they haven't been loaded before.
		LoadSettings(true);

		// If it still an old version, delete the user settings file and reload defaults.
		if ( !IsVersionValid() )
		{
			// Force reset if there aren't any default .ini settings.
			SetToDefaults();
			static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.VSync"));
			SetVSyncEnabled( CVar->GetValueOnGameThread() != 0 );

			IFileManager::Get().Delete( *GGameUserSettingsIni );
			LoadSettings(true);
		}
	}

	if ( ResolutionSizeX <= 0 || ResolutionSizeY <= 0 )
	{
		SetScreenResolution(FIntPoint(GSystemResolution.ResX, GSystemResolution.ResY));

		// Set last confirmed video settings
		LastConfirmedFullscreenMode = FullscreenMode;
		LastUserConfirmedResolutionSizeX = ResolutionSizeX;
		LastUserConfirmedResolutionSizeY = ResolutionSizeY;
	}

	// The user settings have now been validated for the current version.
	UpdateVersion();
}
Exemple #2
0
CCurve::CCurve(COLORREF color) :
	Pen(color),
	Brush(color)
{
	SetToDefaults();
	SetColor(color);
}
Exemple #3
0
CCurve::CCurve(const POINT* Points, int numPoints, COLORREF color) :
	Pen(color),
	Brush(color)
{
	SetToDefaults();
	SetColor(color);
	SetPoints(Points, numPoints);
}
Exemple #4
0
CCurve::CCurve(const CCurve& from) :
	Pen(from.Pen),
	Brush(from.Brush)
{
	SetToDefaults();
	SetColor(from.Color);
	SetPoints(from.Points, from.NumPoints);
}
Exemple #5
0
void CC_Data::Initialize(void) {
    filename="client.ini";
    ClearFavoriteServers();
    Profile = NULL;
    FirstProfile=NULL;
    Profile = new C_Profile;
    FirstProfile=Profile;
    ClearProfiles();
    memset(szAccessName,0,255);
    strcpy(szServerVersion,"Unknown");
    SetToDefaults();
}
UShooterGameUserSettings::UShooterGameUserSettings(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	SetToDefaults();
}
Exemple #7
0
bool CC_Data::bLoad(void) {
    SetToDefaults();
    pLog->_Add("LOADING CONFIG FROM %s",filename.c_str());
    FILE *fp;
    char In[256];
    char temp[1024];
    float f;
    vector <string> lin;
    fp=fopen(filename.c_str(),"rt");
    if(!fp) return false;
    while(fgets(In,255,fp)) {
        In[strlen(In)-1]=0;
        lin = dlcs_explode("=",In);
        if(lin.size()>1) {
            strcpy(temp,lin[1].c_str());
            if(dlcs_strcasecmp(lin[0].c_str(),"name")) {
                Name.assign(lin[1].c_str());
                pLog->_Add(" Name [%s]",Name.c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"password")) {
                Password.assign(lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"save password")) {
                bSavePassword=dlcs_istrue(lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"last server")) {
                strcpy(ServerName,lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"last server ip")) {
                strcpy(IPAddress,lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"port")) {
                strcpy(Port,lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"log")) {
                bLog=dlcs_istrue(temp);
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"download")) {
                bDownload=dlcs_istrue(lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"sound volume")) {
                f=atof(lin[1].c_str());
                if(f>100) f=100;
                if(f<0)   f=0;
                fSoundVolume=f;
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"music volume")) {
                f=atof(lin[1].c_str());
                if(f>100) f=100;
                if(f<0)   f=0;
                fMusicVolume=f;
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"sound")) {
                bSound=dlcs_istrue(lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"music")) {
                bMusic=dlcs_istrue(lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"master server")) {
                strcpy(MasterIPAddress,lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"master server port")) {
                strcpy(MasterPort,lin[1].c_str());
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"fullscreen")) {
                bFullScreen=dlcs_istrue(temp);
                pLog->_Add(" bFullScreen [%d]",bFullScreen);
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"screen width")) {
                ScreenWidth=atoi(lin[1].c_str());
                pLog->_Add(" ScreenWidth [%d]",ScreenWidth);
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"screen height")) {
                ScreenHeight=atoi(lin[1].c_str());
                pLog->_Add(" ScreenHeight [%d]",ScreenHeight);
                continue;
            }
            if(dlcs_strcasecmp(lin[0].c_str(),"screen colors")) {
                ScreenColors=atoi(lin[1].c_str());
                pLog->_Add(" ScreenColors [%d]",ScreenColors);
                continue;
            }
        }
    }
    fclose(fp);
    if(bSavePassword==false) {
        Password.clear();
        bSave();
    }
    return true;
}
UGameUserSettings::UGameUserSettings(const FObjectInitializer& ObjectInitializer)
:	Super(ObjectInitializer)
{
	SetToDefaults();
}
UShooterPersistentUser::UShooterPersistentUser(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	SetToDefaults();
}
UAmethystPersistentUser::UAmethystPersistentUser(const class FObjectInitializer& PCIP)
: Super(PCIP)
{
    SetToDefaults();
}