void LoadConfig()
{
char szTemp[MAX_STRING] = {0};
char szTempF[MAX_STRING] = {0};
bool bRewriteIni = false; // re-save if bad values were read
// default settings
GetPrivateProfileString("Defaults", "AllowMove", ftoa(SET->AllowMove, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 10.0f)
{
SET->AllowMove = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Defaults", "AutoPause", SET->AutoPause ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->AutoPause = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "AutoSave", SET->AutoSave ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->AutoSave = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "AutoUW", SET->AutoUW ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->AutoUW = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "BreakKeyboard", SET->BreakKB ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->BreakKB = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "BreakMouse", SET->BreakMouse ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->BreakMouse = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "BreakOnGM", SET->BreakGM ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->BreakGM = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "BreakOnSummon", SET->BreakSummon ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->BreakSummon = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "DistSummon", ftoa(SET->DistSummon, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 2.0f)
{
SET->DistSummon = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Defaults", "FeignSupport", SET->Feign ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->Feign = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "Heading", (SET->Head == H_TRUE) ? "true" : (SET->Head == H_LOOSE ? "loose" : "fast"), szTemp, MAX_STRING, INIFileName);
SET->Head = H_FAST;
if (!strnicmp(szTemp, "true", 5))
{
SET->Head = H_TRUE;
}
else if (!strnicmp(szTemp, "loose", 6))
{
SET->Head = H_LOOSE;
}
GetPrivateProfileString("Defaults", "KeyboardPause", SET->PauseKB ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->PauseKB = (!strnicmp(szTemp, "on", 3));
if (SET->PauseKB) SET->BreakKB = false;
GetPrivateProfileString("Defaults", "MousePause", SET->PauseMouse ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->PauseMouse = (!strnicmp(szTemp, "on", 3));
if (SET->PauseMouse) SET->BreakMouse = false;
GetPrivateProfileString("Defaults", "LockPause", SET->LockPause ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->LockPause = (!strnicmp(szTemp, "on", 3));
PAUSE->MaxDelay(GetPrivateProfileInt("Defaults", "PauseMaxDelay", PAUSE->Max, INIFileName));
PAUSE->MinDelay(GetPrivateProfileInt("Defaults", "PauseMinDelay", PAUSE->Min, INIFileName));
GetPrivateProfileString("Defaults", "SaveByChar", SET->SaveByChar ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->SaveByChar = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Defaults", "TurnRate", ftoa(SET->TurnRate, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f && (float)atof(szTemp) <= 100.0f)
{
SET->TurnRate = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Defaults", "UseWindow", SET->Window ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->Window = (!strnicmp(szTemp, "on", 3));
// verbosity flag handling
GetPrivateProfileString("Defaults", "Verbosity", (uiVerbLevel & V_VERBOSITY) == V_VERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
if (!strnicmp(szTemp, "on", 3))
{
uiVerbLevel |= V_VERBOSITY;
}
else
{
uiVerbLevel &= ~V_VERBOSITY;
}
// FullVerbosity is more frequent, detailed output, and differs from Verbosity
// Setting one does not include the text of the other.
GetPrivateProfileString("Defaults", "FullVerbosity", (uiVerbLevel & V_FULLVERBOSITY) == V_FULLVERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
if (!strnicmp(szTemp, "on", 3))
{
uiVerbLevel |= V_FULLVERBOSITY;
}
else
{
uiVerbLevel &= ~V_FULLVERBOSITY;
}
// Total Silence disables all output except extreme error messages and BreakOnSummon
GetPrivateProfileString("Defaults", "TotalSilence", (uiVerbLevel == V_SILENCE) ? "on" : "off", szTemp, MAX_STRING, INIFileName);
if (!strnicmp(szTemp, "on", 3))
{
uiVerbLevel = V_SILENCE;
}
// do not need an else, just leaves flags alone if we arent silencing
// if totalsilence is not set to 'on', set flags directly. if ini entry doesnt exist, default will have been set by verb/full reads above
if (uiVerbLevel != V_SILENCE)
{
uiVerbLevel = GetPrivateProfileInt("Defaults", "VerbosityFlags", uiVerbLevel, INIFileName);
GetPrivateProfileString("Defaults", "AutoPauseMsg", (uiVerbLevel & V_AUTOPAUSE) == V_AUTOPAUSE ? "on" : "off", szTemp, MAX_STRING, INIFileName);
if (!strnicmp(szTemp, "on", 3))
{
uiVerbLevel |= V_AUTOPAUSE;
}
else
{
uiVerbLevel &= ~V_AUTOPAUSE;
}
GetPrivateProfileString("Defaults", "HideHelp", (uiVerbLevel & V_HIDEHELP) == V_HIDEHELP ? "on" : "off", szTemp, MAX_STRING, INIFileName);
if (!strnicmp(szTemp, "on", 3))
{
uiVerbLevel |= V_HIDEHELP;
}
else
{
uiVerbLevel &= ~V_HIDEHELP;
}
}
GetPrivateProfileString("Defaults", "WinEQ", SET->WinEQ ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->WinEQ = (!strnicmp(szTemp, "on", 3));
// stick settings
GetPrivateProfileString("Stick", "AlwaysUW", SET_S->UW ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->UW = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "ArcBehind", ftoa(SET_S->ArcBehind, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
{
SET_S->ArcBehind = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Stick", "ArcNotFront", ftoa(SET_S->ArcNotFront, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
{
SET_S->ArcNotFront = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Stick", "AwareNotAggro", SET->Spin ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->Spin = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "BreakOnGate", SET_S->BreakGate ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->BreakGate = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "BreakOnHit", SET_S->BreakHit ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->BreakHit = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "BreakOnTarget", SET_S->BreakTarget ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->BreakTarget = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "BreakOnWarp", SET_S->BreakWarp ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->BreakWarp = (!strnicmp(szTemp, "on", 3));
if (SET_S->BreakWarp) SET_S->PauseWarp = false;
GetPrivateProfileString("Stick", "PauseOnWarp", SET_S->PauseWarp ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->PauseWarp = (!strnicmp(szTemp, "on", 3));
if (SET_S->PauseWarp) SET_S->BreakWarp = false;
GetPrivateProfileString("Stick", "DelayStrafe", SET_S->DelayStrafe ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->DelayStrafe = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "DistBackup", ftoa(SET_S->DistBack, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_S->DistBack = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Stick", "DistBreak", ftoa(SET_S->DistBreak, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_S->DistBreak = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Stick", "DistFlex", ftoa(SET_S->DistFlex, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 2.0f && (float)atof(szTemp) <= 20.0f)
{
SET_S->DistFlex = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Stick", "DistMod", ftoa(SET_S->DistMod, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 0.0f)
{
SET_S->DistMod = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Stick", "DistMod%", ftoa(SET_S->DistModP, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 0.0f)
{
SET_S->DistModP = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("Stick", "DistSnaproll", ftoa(SET_S->DistSnap, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_S->DistSnap = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
SET_S->MaxDelay(GetPrivateProfileInt("Stick", "StrafeMaxDelay", SET_S->Max, INIFileName));
SET_S->MinDelay(GetPrivateProfileInt("Stick", "StrafeMinDelay", SET_S->Min, INIFileName));
// end stick delays
GetPrivateProfileString("Stick", "RandomArc", SET_S->Randomize ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->Randomize = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "UseBackward", SET_S->UseBack ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->UseBack = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "UseFleeing", SET_S->UseFleeing ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->UseFleeing = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "UseFlex", SET_S->Flex ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->Flex = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Stick", "UseWalk", SET_S->Walk ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->Walk = (!strnicmp(szTemp, "on", 3));
// makecamp settings
GetPrivateProfileString("MakeCamp", "CampRadius", ftoa(SET_CAMP->Radius, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 5.0f)
{
SET_CAMP->SetRadius((float)atof(szTemp));
}
else
{
bRewriteIni = true;
}
SET_CAMP->MaxDelay(GetPrivateProfileInt("MakeCamp", "MaxDelay", SET_CAMP->Max, INIFileName));
SET_CAMP->MinDelay(GetPrivateProfileInt("MakeCamp", "MinDelay", SET_CAMP->Min, INIFileName));
GetPrivateProfileString("MakeCamp", "RealtimePlayer", SET_CAMP->Realtime ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->Realtime = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MakeCamp", "ReturnHaveTarget", SET_CAMP->HaveTarget ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->HaveTarget = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MakeCamp", "ReturnNoAggro", SET_CAMP->NoAggro ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->NoAggro = (!strnicmp(szTemp, "on", 3));;
GetPrivateProfileString("MakeCamp", "ReturnNotLooting", SET_CAMP->NotLoot ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->NotLoot = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MakeCamp", "UseLeash", SET_CAMP->Leash ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->Leash = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MakeCamp", "LeashLength", ftoa(SET_CAMP->Length, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= SET_CAMP->Radius)
{
SET_CAMP->SetLeash((float)atof(szTemp));
}
else
{
bRewriteIni = true;
}
// scatter configuration (makecamp)
GetPrivateProfileString("MakeCamp", "UseScatter", SET_CAMP->Scatter ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->Scatter = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MakeCamp", "Bearing", ftoa(SET_CAMP->Bearing, szTempF), szTemp, MAX_STRING, INIFileName);
SET_CAMP->Bearing = (float)atof(szTemp);
GetPrivateProfileString("MakeCamp", "ScatDist", ftoa(SET_CAMP->ScatDist, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_CAMP->ScatDist = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("MakeCamp", "ScatSize", ftoa(SET_CAMP->ScatSize, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_CAMP->ScatSize = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
// moveto settings
GetPrivateProfileString("MoveTo", "AlwaysUW", SET_M->UW ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_M->UW = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MoveTo", "ArrivalDist", ftoa(SET_M->Dist, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_M->Dist = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("MoveTo", "ArrivalDistX", ftoa(SET_M->DistX, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_M->DistX = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("MoveTo", "ArrivalDistY", ftoa(MOVETO->DistY, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_M->DistY = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("MoveTo", "BreakOnAggro", SET_M->BreakAggro ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_M->BreakAggro = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MoveTo", "BreakOnHit", SET_M->BreakHit ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_M->BreakHit = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MoveTo", "DistBackup", ftoa(SET_M->DistBack, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_M->DistBack = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("MoveTo", "MoveToMod", ftoa(SET_M->Mod, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 0.0f)
{
SET_M->Mod = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("MoveTo", "UseBackward", SET_M->UseBack ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_M->UseBack = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("MoveTo", "UseWalk", SET_M->Walk ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_M->Walk = (!strnicmp(szTemp, "on", 3));
// circle settings
GetPrivateProfileString("Circle", "Backward", SET_C->Backward ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_C->Backward = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Circle", "CCW", SET_C->CCW ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_C->CCW = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Circle", "Drunken", SET_C->Drunk ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_C->Drunk = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("Circle", "RadiusSize", ftoa(SET_C->Radius, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 5.0f)
{
SET_C->SetRadius((float)atof(szTemp));
}
else
{
bRewriteIni = true;
}
// stuck logic related
GetPrivateProfileString("StuckLogic", "StuckLogic", STUCK->On ? "on" : "off", szTemp, MAX_STRING, INIFileName);
STUCK->On = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("StuckLogic", "DistStuck", ftoa(STUCK->Dist, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) > 0.0f)
{
STUCK->Dist = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
sprintf(szTempF, "%uh", STUCK->Check);
GetPrivateProfileString("StuckLogic", "PulseCheck", szTempF, szTemp, MAX_STRING, INIFileName);
if ((unsigned int)atoi(szTemp) > 1)
{
STUCK->Check = (unsigned int)atoi(szTemp);
}
else
{
bRewriteIni = true;
}
sprintf(szTempF, "%uh", STUCK->Unstuck);
GetPrivateProfileString("StuckLogic", "PulseUnstuck", szTempF, szTemp, MAX_STRING, INIFileName);
if ((unsigned int)atoi(szTemp) > 1)
{
STUCK->Unstuck = (unsigned int)atoi(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString("StuckLogic", "TryToJump", STUCK->Jump ? "on" : "off", szTemp, MAX_STRING, INIFileName);
STUCK->Jump = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString("StuckLogic", "TurnHalf", STUCK->TurnHalf ? "on" : "off", szTemp, MAX_STRING, INIFileName);
STUCK->TurnHalf = (!strnicmp(szTemp, "on", 3));
// check if we want to explicitly ignore this char's custom ini
GetPrivateProfileString(szCharName, "DisregardMe", "false", szTemp, MAX_STRING, INIFileName);
if (SET->SaveByChar && strnicmp(szTemp, "true", 5))
{
// Character specific
GetPrivateProfileString(szCharName, "AllowMove", ftoa(SET->AllowMove, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) > 10.0f)
{
SET->AllowMove = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "ArcBehind", ftoa(SET_S->ArcBehind, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
{
SET_S->ArcBehind = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "ArcNotFront", ftoa(SET_S->ArcNotFront, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
{
SET_S->ArcNotFront = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "AutoSave", SET->AutoSave ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->AutoSave = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString(szCharName, "AutoUW", SET->AutoUW ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->AutoUW = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString(szCharName, "BreakOnGate", SET_S->BreakGate ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->BreakGate = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString(szCharName, "BreakOnWarp", SET_S->BreakWarp ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->BreakWarp = (!strnicmp(szTemp, "on", 3));
if (SET_S->BreakWarp) SET_S->PauseWarp = false;
GetPrivateProfileString(szCharName, "PauseOnWarp", SET_S->PauseWarp ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_S->PauseWarp = (!strnicmp(szTemp, "on", 3));
if (SET_S->PauseWarp) SET_S->BreakWarp = false;
GetPrivateProfileString(szCharName, "LockPause", SET->LockPause ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->LockPause = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString(szCharName, "DistBreak", ftoa(STICK->DistBreak, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
STICK->DistBreak = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "DistSnaproll", ftoa(SET_S->DistSnap, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_S->DistSnap = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "FeignSupport", SET->Feign ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->Feign = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString(szCharName, "Heading", (SET->Head == H_TRUE ? "true" : (SET->Head == H_LOOSE ? "loose" : "fast")), szTemp, MAX_STRING, INIFileName);
SET->Head = H_FAST;
if (!strnicmp(szTemp, "true", 5))
{
SET->Head = H_TRUE;
}
else if (!strnicmp(szTemp, "loose", 6))
{
SET->Head = H_LOOSE;
}
GetPrivateProfileString(szCharName, "LeashLength", ftoa(SET_CAMP->Length, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= SET_CAMP->Radius)
{
SET_CAMP->SetLeash((float)atof(szTemp));
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "UseLeash", SET_CAMP->Leash ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->Leash = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString(szCharName, "UseWindow", SET->Window ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET->Window = (!strnicmp(szTemp, "on", 3));
// verbosity flag handling
GetPrivateProfileString(szCharName, "Verbosity", (uiVerbLevel & V_VERBOSITY) == V_VERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
if (!strnicmp(szTemp, "on", 3))
{
uiVerbLevel |= V_VERBOSITY;
}
else
{
uiVerbLevel &= ~V_VERBOSITY;
}
// FullVerbosity is more frequent, detailed output, and differs from Verbosity
// Setting one does not include the text of the other.
GetPrivateProfileString(szCharName, "FullVerbosity", (uiVerbLevel & V_FULLVERBOSITY) == V_FULLVERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
if (!strnicmp(szTemp, "on", 3))
{
uiVerbLevel |= V_FULLVERBOSITY;
}
else
{
uiVerbLevel &= ~V_FULLVERBOSITY;
}
// set flags directly, if no entry present use results of above reads
uiVerbLevel = GetPrivateProfileInt(szCharName, "VerbosityFlags", uiVerbLevel, INIFileName);
GetPrivateProfileString(szCharName, "CampRadius", ftoa(SET_CAMP->Radius, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 5.0f)
{
SET_CAMP->SetRadius((float)atof(szTemp));
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "RealtimePlayer", SET_CAMP->Realtime ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->Realtime = (!strnicmp(szTemp, "on", 3));
// scatter configuration (makecamp)
GetPrivateProfileString(szCharName, "UseScatter", SET_CAMP->Scatter ? "on" : "off", szTemp, MAX_STRING, INIFileName);
SET_CAMP->Scatter = (!strnicmp(szTemp, "on", 3));
GetPrivateProfileString(szCharName, "Bearing", ftoa(SET_CAMP->Bearing, szTempF), szTemp, MAX_STRING, INIFileName);
SET_CAMP->Bearing = (float)atof(szTemp);
GetPrivateProfileString(szCharName, "ScatDist", ftoa(SET_CAMP->ScatDist, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_CAMP->ScatDist = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
GetPrivateProfileString(szCharName, "ScatSize", ftoa(SET_CAMP->ScatSize, szTempF), szTemp, MAX_STRING, INIFileName);
if ((float)atof(szTemp) >= 1.0f)
{
SET_CAMP->ScatSize = (float)atof(szTemp);
}
else
{
bRewriteIni = true;
}
}
if (bRewriteIni) SaveConfig();
// copy new setting defaults to active
pMU->NewDefaults();
// create window if needed
if (SET->Window)
{
WINDOW->Create();
}
else
{
WINDOW->Destroy(true);
}
}