示例#1
0
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;
}
示例#2
0
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());
}
示例#3
0
bool CBotVarArray::Save1State(FILE* pf)
{
    if ( !WriteType(pf, m_type) ) return false;
    return SaveVars(pf, m_pInstance);                        // saves the instance that manages the table
}
示例#4
0
void SetVar(const String& var, const String& val, bool save) {
	MainNest().Set(var, val);
	if(save)
		SaveVars(GetVarsName());
}