bool BaseSetupDlg::Run(String& vars) { upp <<= GetVar("UPP"); output <<= GetVar("OUTPUT"); base <<= vars; new_base = IsNull(vars); while(TopWindow::Run() == IDOK) { String varname = ~base; String varfile = VarFilePath(varname); if(varname != vars) { if(FileExists(varfile) && !PromptOKCancel(NFormat("Overwrite existing assembly [* \1%s\1]?", varfile))) continue; if(!SaveVars(varname)) { Exclamation(NFormat("Error writing assmbly [* \1%s\1].", VarFilePath(varname))); continue; } } SetVar("UPP", ~upp); SetVar("OUTPUT", ~output); Vector<String> paths = SplitDirs(upp.GetText().ToString()); for(int i = 0; i < paths.GetCount(); i++) RealizeDirectory(paths[i]); RealizeDirectory(output); vars = varname; return true; } return false; }
bool CBotVarPointer::Save1State(FILE* pf) { if ( m_pClass ) { if (!WriteString(pf, m_pClass->GetName())) return false; // name of the class } else { if (!WriteString(pf, "")) return false; } if (!WriteLong(pf, GetIdent())) return false; // the unique reference // also saves the proceedings copies return SaveVars(pf, GetPointer()); }
bool CBotVarArray::Save1State(FILE* pf) { if ( !WriteType(pf, m_type) ) return false; return SaveVars(pf, m_pInstance); // saves the instance that manages the table }
void SetVar(const String& var, const String& val, bool save) { MainNest().Set(var, val); if(save) SaveVars(GetVarsName()); }