you've inspired something controversial
| 61 | |
| 62 | // you've inspired something controversial |
| 63 | void ScenarioExt::ExtData::SaveVariablesToFile(bool isGlobal) |
| 64 | { |
| 65 | CCINIClass fINI {}; |
| 66 | CCFileClass file { isGlobal ? "globals.ini" : "locals.ini" }; |
| 67 | |
| 68 | if (file.Exists()) |
| 69 | fINI.ReadCCFile(&file); |
| 70 | else |
| 71 | file.CreateFileA(); |
| 72 | |
| 73 | for (const auto& [_,varext] : Global()->Variables[isGlobal]) |
| 74 | fINI.WriteInteger(ScenarioClass::Instance->FileName, varext.Name, varext.Value, false); |
| 75 | |
| 76 | fINI.WriteCCFile(&file); |
| 77 | file.Close(); |
| 78 | } |
| 79 | |
| 80 | void ScenarioExt::Allocate(ScenarioClass* pThis) |
| 81 | { |