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 &Model::addSub()
{
    Record *sub = new Record;

    sub->addText  ("filename", "");
    sub->addText  ("skinFilename", "");
    sub->addText  ("frame", "");
    sub->addNumber("frameRange", 0);
    sub->addNumber("flags", 0);
    sub->addNumber("skin", 0);
    sub->addNumber("skinRange", 0);
    sub->addArray ("offset", new ArrayValue(Vector3f()));
    sub->addNumber("alpha", 0);
    sub->addNumber("parm", 0);
    sub->addNumber("selSkinMask", 0);
    sub->addNumber("selSkinShift", 0);

    ArrayValue *skins = new ArrayValue;
    for(int i = 0; i < 8; ++i) *skins << NumberValue(0);
    sub->addArray ("selSkins", skins);

    sub->addText  ("shinySkin", "");
    sub->addNumber("shiny", 0);
    sub->addArray ("shinyColor", new ArrayValue(Vector3f(1, 1, 1)));
    sub->addNumber("shinyReact", 1);
    sub->addNumber("blendMode", BM_NORMAL);

    def()["sub"].value<ArrayValue>()
            .add(new RecordValue(sub, RecordValue::OwnsRecord));

    return *sub;
}
示例#3
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;
}
示例#4
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;
}