void UpdaterSettings::initialize()
{
    Config &config = App::config();

    if(!config.names().has(SUBREC_NAME))
    {
        /**
         * @todo These defaults can be moved to Config.de when libdeng2 has
         * knowledge of the release type.
         */

        // Looks like we don't have existing values stored. Let's set up a
        // Record with the defaults.
        Record *s = new Record;

        s->addNumber(VAR_FREQUENCY, Weekly);
        s->addNumber(VAR_CHANNEL, QString(DOOMSDAY_RELEASE_TYPE) == "Stable"? Stable : Unstable);
        s->addTime(VAR_LAST_CHECKED, Time::invalidTime());

        bool checkByDefault = false;
#if defined(UNIX) && !defined(MACOSX)
        // On Unix platforms don't do automatic checks by default.
        checkByDefault = true;
#endif
        s->addBoolean(VAR_ONLY_MANUAL, checkByDefault);

        s->addBoolean(VAR_DELETE, true);
        s->addText(VAR_DELETE_PATH, "");
        s->addText(VAR_DOWNLOAD_PATH, SYMBOL_DEFAULT_DOWNLOAD);

        config.names().add(SUBREC_NAME, s);
    }
}
示例#2
0
Record *GameRuleset::toRecord() const
{
    Record *rec = new Record;

    rec->addNumber ("skill",           skill);
#if !__JHEXEN__
    rec->addBoolean("fast",            CPP_BOOL(fast));
#endif
    rec->addNumber ("deathmatch",      deathmatch);
    rec->addBoolean("noMonsters",      CPP_BOOL(noMonsters));
#if __JHEXEN__
    rec->addBoolean("randomClasses",   CPP_BOOL(randomClasses));
#else
    rec->addBoolean("respawnMonsters", CPP_BOOL(respawnMonsters));
#endif

    return rec;
}
示例#3
0
Record &Sky::addLayer()
{
    Record *layer = new Record;

    layer->addBoolean("custom", false);

    layer->addNumber("flags", 0);
    layer->addText  ("material", "");
    layer->addNumber("offset", DEFAULT_SKY_SPHERE_XOFFSET);
    layer->addNumber("offsetSpeed", 0);
    layer->addNumber("colorLimit", DEFAULT_SKY_SPHERE_FADEOUT_LIMIT);

    def()["layer"].array().add(new RecordValue(layer, RecordValue::OwnsRecord));

    return *layer;
}
示例#4
0
Record &Sky::addModel()
{
    Record *model = new Record;

    model->addBoolean("custom", false);

    model->addText  (VAR_ID, "");
    model->addNumber("layer", -1);
    model->addNumber("frameInterval", 1);
    model->addNumber("yaw", 0);
    model->addNumber("yawSpeed", 0);
    model->addArray ("originOffset", new ArrayValue(Vector3f()));
    model->addArray ("rotate", new ArrayValue(Vector2f()));
    model->addText  ("execute", "");
    model->addArray ("color", new ArrayValue(Vector4f(1, 1, 1, 1)));

    def()["model"].array().add(new RecordValue(model, RecordValue::OwnsRecord));

    return *model;
}