VOID HandleINI() { CHAR szBuffer[MAX_STRING] = {0}; WritePrivateProfileString(HUDSection,"Last",HUDNames,INIFileName); SkipParse = GetPrivateProfileInt(HUDSection,"SkipParse",1,INIFileName); SkipParse = SkipParse < 1 ? 1 : SkipParse; CheckINI = GetPrivateProfileInt(HUDSection,"CheckINI",10,INIFileName); CheckINI = CheckINI < 10 ? 10 : CheckINI; GetPrivateProfileString(HUDSection,"UpdateInBackground","on",szBuffer,MAX_STRING,INIFileName); bBGUpdate = _strnicmp(szBuffer,"on",2)?false:true; GetPrivateProfileString(HUDSection,"ClassHUD","on",szBuffer,MAX_STRING,INIFileName); bClassHUD = _strnicmp(szBuffer,"on",2)?false:true; GetPrivateProfileString(HUDSection,"ZoneHUD","on",szBuffer,MAX_STRING,INIFileName); bZoneHUD = _strnicmp(szBuffer,"on",2)?false:true; GetPrivateProfileString("MQ2HUD","UseFontSize","off",szBuffer,MAX_STRING,INIFileName); bUseFontSize = _strnicmp(szBuffer,"on",2)?false:true; // Write the SkipParse and CheckINI section, in case they didn't have one WritePrivateProfileString(HUDSection,"SkipParse",SafeItoa(SkipParse,szBuffer,10),INIFileName); WritePrivateProfileString(HUDSection,"CheckINI",SafeItoa(CheckINI,szBuffer,10),INIFileName); WritePrivateProfileString(HUDSection,"UpdateInBackground",bBGUpdate?"on":"off",INIFileName); WritePrivateProfileString(HUDSection,"ClassHUD",bClassHUD?"on":"off",INIFileName); WritePrivateProfileString(HUDSection,"ZoneHUD",bZoneHUD?"on":"off",INIFileName); WritePrivateProfileString("MQ2HUD","UseFontSize",bUseFontSize?"on":"off",INIFileName); LoadElements(); }
VOID SaveChatToINI(PCSIDLWND pWindow) { CHAR szTemp[MAX_STRING]={0}; WritePrivateProfileString("Settings","AutoScroll", bAutoScroll?"on":"off",INIFileName); WritePrivateProfileString("Settings","NoCharSelect", bNoCharSelect?"on":"off",INIFileName); WritePrivateProfileString("Settings","SaveByChar", bSaveByChar?"on":"off",INIFileName); if (pWindow->Minimized) { WritePrivateProfileString(szChatINISection,"ChatTop", SafeItoa(pWindow->OldLocation.top, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatBottom", SafeItoa(pWindow->OldLocation.bottom, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatLeft", SafeItoa(pWindow->OldLocation.left, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatRight", SafeItoa(pWindow->OldLocation.right, szTemp,10),INIFileName); } else { WritePrivateProfileString(szChatINISection,"ChatTop", SafeItoa(pWindow->Location.top, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatBottom", SafeItoa(pWindow->Location.bottom, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatLeft", SafeItoa(pWindow->Location.left, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatRight", SafeItoa(pWindow->Location.right, szTemp,10),INIFileName); } WritePrivateProfileString(szChatINISection,"Locked", SafeItoa(pWindow->Locked, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Fades", SafeItoa(pWindow->Fades, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Delay", SafeItoa(pWindow->FadeDelay, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Duration", SafeItoa(pWindow->FadeDuration, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Alpha", SafeItoa(pWindow->Alpha, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"FadeToAlpha", SafeItoa(pWindow->FadeToAlpha, szTemp,10),INIFileName); ARGBCOLOR col = { 0 }; col.ARGB = pWindow->BGColor; WritePrivateProfileString(szChatINISection,"BGType", SafeItoa(pWindow->BGType, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.alpha", SafeItoa(col.A, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.red", SafeItoa(col.R, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.green", SafeItoa(col.G, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.blue", SafeItoa(col.B, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"FontSize", SafeItoa(MQChatWnd->FontSize, szTemp,10),INIFileName); GetCXStr(pWindow->WindowText,szTemp, MAX_STRING); WritePrivateProfileString(szChatINISection,"WindowTitle",szTemp,INIFileName); }