Esempio n. 1
0
void initOptions() {
    int iNum = 0;

    mPage.clear();
    mPage["general"] = iNum++;
    mPage["interface"] = iNum++;
    mPage["debug"] = iNum++;

    vPages.clear();
    vPages.push_back(_("General"));
    vPages.push_back(_("Interface"));
    vPages.push_back(_("Debug"));

    OPTIONS.clear();

    OPTIONS["USE_CELSIUS"] =            cOpt(mPage["interface"], _("Use Celsius"),
                                             _("Switch between Celsius and Fahrenheit."),
                                             "Fahrenheit,Celsius", "Fahrenheit"
                                            );

    OPTIONS["USE_METRIC_SPEEDS"] =      cOpt(mPage["interface"], _("Use Metric Speeds"),
                                             _("Switch between Km/h and mph."),
                                             "mph,km/h", "mph"
                                            );

    OPTIONS["USE_METRIC_WEIGHTS"] =     cOpt(mPage["interface"], _("Use Metric Weights"),
                                             _("Switch between kg and lbs."),
                                             "lbs,kg", "lbs"
                                            );

    OPTIONS["FORCE_CAPITAL_YN"] =       cOpt(mPage["interface"], _("Force Y/N in prompts"),
                                             _("If true, Y/N prompts are case- sensitive and y and n are not accepted."),
                                             true
                                            );

    OPTIONS["NO_BRIGHT_BACKGROUNDS"] =  cOpt(mPage["interface"], _("No Bright Backgrounds"),
                                            _("If true, bright backgrounds are not used--some consoles are not compatible."),
                                             false
                                            );

    OPTIONS["24_HOUR"] =                cOpt(mPage["interface"], _("24 Hour Time"),
                                             _("12h: AM/PM, eg: 7:31 AM - Military: 24h Military, eg: 0731 - 24h: Normal 24h, eg: 7:31"),
                                             "12h,Military,24h", "12h"
                                            );

    OPTIONS["SNAP_TO_TARGET"] =         cOpt(mPage["interface"], _("Snap to Target"),
                                             _("If true, automatically follow the crosshair when firing/throwing."),
                                             false
                                            );

    OPTIONS["SAFEMODE"] =               cOpt(mPage["general"], _("Safemode on by default"),
                                             _("If true, safemode will be on after starting a new game or loading."),
                                             true
                                            );

    OPTIONS["SAFEMODEPROXIMITY"] =      cOpt(mPage["general"], _("Safemode proximity distance"),
                                             _("If safemode is enabled, distance to hostiles when safemode should show a warning. 0 = Max player viewdistance."),
                                             0, 50, 0
                                            );

    OPTIONS["AUTOSAFEMODE"] =           cOpt(mPage["general"], _("Auto-Safemode on by default"),
                                             _("If true, auto-safemode will be on after starting a new game or loading."),
                                             false
                                            );

    OPTIONS["AUTOSAFEMODETURNS"] =      cOpt(mPage["general"], _("Turns to reenable safemode"),
                                             _("Number of turns after safemode is reenabled if no hostiles are in safemodeproximity distance."),
                                             1, 100, 50
                                            );

    OPTIONS["AUTOSAVE"] =               cOpt(mPage["general"], _("Periodically Autosave"),
                                             _("If true, game will periodically save the map."),
                                             false
                                            );

    OPTIONS["AUTOSAVE_TURNS"] =         cOpt(mPage["general"], _("Game turns between autosaves"),
                                             _("Number of game turns between autosaves"),
                                             1, 30, 5
                                            );

    OPTIONS["AUTOSAVE_MINUTES"] =       cOpt(mPage["general"], _("Real minutes between autosaves"),
                                             _("Number of real time minutes between autosaves"),
                                             0, 127, 5
                                            );

    OPTIONS["RAIN_ANIMATION"] =         cOpt(mPage["interface"], _("Rain animation"),
                                             _("If true, will display weather animations."),
                                             true
                                            );

    OPTIONS["CIRCLEDIST"] =             cOpt(mPage["general"], _("Circular distances"),
                                             _("If true, the game will calculate range in a realistic way: light sources will be circles diagonal movement will cover more ground and take longer. If disabled, everything is square: moving to the northwest corner of a building takes as long as moving to the north wall."),
                                             false
                                            );

    OPTIONS["QUERY_DISASSEMBLE"] =      cOpt(mPage["interface"], _("Query on disassembly"),
                                             _("If true, will query before disassembling items."),
                                             true
                                            );

    OPTIONS["DROP_EMPTY"] =             cOpt(mPage["general"], _("Drop empty containers"),
                                             _("Set to drop empty containers after use. No: Don't drop any. - Watertight: All except watertight containers. - All: Drop all containers."),
                                             "No,Watertight,All", "No"
                                            );

    OPTIONS["SKILL_RUST"] =             cOpt(mPage["debug"], _("Skill Rust"),
                                             _("Set the level of skill rust. Vanilla: Vanilla Cataclysm - Capped: Capped at skill levels 2 - Int: Intelligence dependent - IntCap: Intelligence dependent, capped - Off: None at all."),
                                             "Vanilla,Capped,Int,IntCap,Off", "Vanilla"
                                            );

    OPTIONS["DELETE_WORLD"] =           cOpt(mPage["general"], _("Delete World"),
                                             _("Delete world upon player death."),
                                             "No,Yes,Query", "No"
                                            );

    OPTIONS["INITIAL_POINTS"] =         cOpt(mPage["debug"], _("Initial points"),
                                             _("Initial points available on character generation."),
                                             0, 25, 6
                                            );

    OPTIONS["MAX_TRAIT_POINTS"] =       cOpt(mPage["debug"], _("Maximum trait points"),
                                             _("Maximum trait points available for character generation."),
                                             0, 25, 12
                                            );

    OPTIONS["INITIAL_TIME"] =           cOpt(mPage["debug"], _("Initial time"),
                                             _("Initial starting time of day on character generation."),
                                             0, 23, 8
                                            );

    OPTIONS["VIEWPORT_X"] =             cOpt(mPage["interface"], _("Viewport width"),
                                             _("SDL ONLY: Set the expansion of the viewport along the X axis. Requires restart. POSIX systems will use terminal size at startup."),
                                             12, 93, 12
                                            );

    OPTIONS["VIEWPORT_Y"] =             cOpt(mPage["interface"], _("Viewport height"),
                                             _("SDL ONLY: Set the expansion of the viewport along the Y axis. Requires restart. POSIX systems will use terminal size at startup."),
                                             12, 93, 12
                                            );

    OPTIONS["SIDEBAR_STYLE"] =          cOpt(mPage["interface"], _("Sidebar style"),
                                             _("Switch between the standard or a narrower and taller sidebar. Requires restart."),
                                             "Standard,Narrow", "Standard"
                                            );

    OPTIONS["MOVE_VIEW_OFFSET"] =       cOpt(mPage["interface"], _("Move view offset"),
                                             _("Move view by how many squares per keypress."),
                                             1, 50, 1
                                            );

    OPTIONS["STATIC_SPAWN"] =           cOpt(mPage["debug"], _("Static spawn"),
                                             _("Spawn zombies at game start instead of during game. Must reset world directory after changing for it to take effect."),
                                             true
                                            );

    OPTIONS["CLASSIC_ZOMBIES"] =        cOpt(mPage["debug"], _("Classic zombies"),
                                             _("Only spawn classic zombies and natural wildlife. Requires a reset of save folder to take effect. This disables certain buildings."),
                                             false
                                            );

    OPTIONS["REVIVE_ZOMBIES"] =         cOpt(mPage["debug"], _("Revive zombies"),
                                             _("Allow zombies to revive after a certain amount of time."),
                                             true
                                            );

    OPTIONS["SEASON_LENGTH"] =          cOpt(mPage["debug"], _("Season length"),
                                             _("Season length, in days."),
                                             14, 127, 14
                                            );

    OPTIONS["STATIC_NPC"] =             cOpt(mPage["debug"], _("Static npcs"),
                                             _("If true, the game will spawn static NPC at the start of the game, requires world reset."),
                                             false
                                            );

    OPTIONS["RANDOM_NPC"] =             cOpt(mPage["debug"], _("Random npcs"),
                                             _("If true, the game will randomly spawn NPC during gameplay."),
                                             false
                                            );

    OPTIONS["RAD_MUTATION"] =           cOpt(mPage["general"], _("Mutations by radiation"),
                                             _("If true, radiation causes the player to mutate."),
                                             true
                                            );

    OPTIONS["SAVE_SLEEP"] =             cOpt(mPage["interface"], _("Ask to save before sleeping"),
                                             _("If true, game will ask to save the map before sleeping."),
                                             false
                                            );

    OPTIONS["HIDE_CURSOR"] =            cOpt(mPage["interface"], _("Hide Mouse Cursor"),
                                             _("Always: Cursor is always shown. Hidden: Cursor is hidden. HiddenKB: Cursor is hidden on keyboard input and unhidden on mouse movement."),
                                             "Always,Hidden,HiddenKB", "Always"
                                            );

    OPTIONS["AUTO_PICKUP"] =            cOpt(mPage["general"], _("Enable item Auto Pickup"),
                                             _("Enable item auto pickup. Change pickup rules with the Auto Pickup Manager in the Help Menu ?3"),
                                             false
                                            );

    OPTIONS["AUTO_PICKUP_ZERO"] =       cOpt(mPage["general"], _("Auto Pickup 0 Vol light items"),
                                             _("Auto pickup items with 0 Volume, and weight less than or equal to [option] * 50 grams. '0' disables this option"),
                                             0, 20, 0
                                            );

    OPTIONS["AUTO_PICKUP_SAFEMODE"] =   cOpt(mPage["general"], _("Auto Pickup Safemode"),
                                             _("Auto pickup is disabled as long as you can see monsters nearby. This is affected by Safemode proximity distance."),
                                             false
                                            );

    OPTIONS["DANGEROUS_PICKUPS"] =      cOpt(mPage["general"], _("Dangerous pickups"),
                                             _("If false will cause player to drop new items that cause them to exceed the weight limit."),
                                             false
                                            );

    OPTIONS["SORT_CRAFTING"] =          cOpt(mPage["interface"], _("Sort Crafting menu"),
                                             _("If true, the crafting menus will display recipes that you can craft before other recipes"),
                                             true
                                            );

    for (std::map<std::string, cOpt>::iterator iter = OPTIONS.begin(); iter != OPTIONS.end(); ++iter) {
        mPageItems[(iter->second).getPage()].push_back(iter->first);
    }
}
Esempio n. 2
0
void initOptions() {
    vPages.clear();
    vPages.push_back(std::make_pair("general", _("General")));
    vPages.push_back(std::make_pair("interface", _("Interface")));
    vPages.push_back(std::make_pair("debug", _("Debug")));

    OPTIONS.clear();

    optionNames["fahrenheit"] = _("Fahrenheit");
    optionNames["celsius"] = _("Celsius");
    OPTIONS["USE_CELSIUS"] =            cOpt("interface", _("Temperature units"),
                                             _("Switch between Celsius and Fahrenheit."),
                                             "fahrenheit,celsius", "fahrenheit"
                                            );

    optionNames["mph"] = _("mph");
    optionNames["km/h"] = _("km/h");
    OPTIONS["USE_METRIC_SPEEDS"] =      cOpt("interface", _("Speed units"),
                                             _("Switch between km/h and mph."),
                                             "mph,km/h", "mph"
                                            );

    optionNames["lbs"] = _("lbs");
    optionNames["kg"] = _("kg");
    OPTIONS["USE_METRIC_WEIGHTS"] =     cOpt("interface", _("Mass units"),
                                             _("Switch between kg and lbs."),
                                             "lbs,kg", "lbs"
                                            );

    OPTIONS["FORCE_CAPITAL_YN"] =       cOpt("interface", _("Force Y/N in prompts"),
                                             _("If true, Y/N prompts are case- sensitive and y and n are not accepted."),
                                             true
                                            );

    OPTIONS["NO_BRIGHT_BACKGROUNDS"] =  cOpt("interface", _("No bright backgrounds"),
                                            _("If true, bright backgrounds are not used--some consoles are not compatible."),
                                             false
                                            );

    //~ 12h time, e.g. 11:59pm
    optionNames["12h"] = _("12h");
    //~ Military time, e.g. 2359
    optionNames["military"] = _("Military");
    //~ 24h time, e.g. 23:59
    optionNames["24h"] = _("24h");
    OPTIONS["24_HOUR"] =                cOpt("interface", _("24 hour time"),
                                             _("12h: AM/PM, eg: 7:31 AM - Military: 24h Military, eg: 0731 - 24h: Normal 24h, eg: 7:31"),
                                             "12h,military,24h", "12h"
                                            );

    OPTIONS["SNAP_TO_TARGET"] =         cOpt("interface", _("Snap to target"),
                                             _("If true, automatically follow the crosshair when firing/throwing."),
                                             false
                                            );

    OPTIONS["SAFEMODE"] =               cOpt("general", _("Safemode on by default"),
                                             _("If true, safemode will be on after starting a new game or loading."),
                                             true
                                            );

    OPTIONS["SAFEMODEPROXIMITY"] =      cOpt("general", _("Safemode proximity distance"),
                                             _("If safemode is enabled, distance to hostiles when safemode should show a warning. 0 = Max player viewdistance."),
                                             0, 50, 0
                                            );

    OPTIONS["AUTOSAFEMODE"] =           cOpt("general", _("Auto-safemode on by default"),
                                             _("If true, auto-safemode will be on after starting a new game or loading."),
                                             false
                                            );

    OPTIONS["AUTOSAFEMODETURNS"] =      cOpt("general", _("Turns to reenable safemode"),
                                             _("Number of turns after safemode is reenabled if no hostiles are in safemodeproximity distance."),
                                             1, 100, 50
                                            );

    OPTIONS["AUTOSAVE"] =               cOpt("general", _("Periodically autosave"),
                                             _("If true, game will periodically save the map."),
                                             false
                                            );

    OPTIONS["AUTOSAVE_TURNS"] =         cOpt("general", _("Game turns between autosaves"),
                                             _("Number of game turns between autosaves"),
                                             1, 30, 5
                                            );

    OPTIONS["AUTOSAVE_MINUTES"] =       cOpt("general", _("Real minutes between autosaves"),
                                             _("Number of real time minutes between autosaves"),
                                             0, 127, 5
                                            );

    OPTIONS["RAIN_ANIMATION"] =         cOpt("interface", _("Rain animation"),
                                             _("If true, will display weather animations."),
                                             true
                                            );

    OPTIONS["CIRCLEDIST"] =             cOpt("general", _("Circular distances"),
                                             _("If true, the game will calculate range in a realistic way: light sources will be circles diagonal movement will cover more ground and take longer. If disabled, everything is square: moving to the northwest corner of a building takes as long as moving to the north wall."),
                                             false
                                            );

    OPTIONS["QUERY_DISASSEMBLE"] =      cOpt("interface", _("Query on disassembly"),
                                             _("If true, will query before disassembling items."),
                                             true
                                            );

    optionNames["no"] = _("No");
    //~ containers
    optionNames["watertight"] = _("Watertight");
    optionNames["all"] = _("All");
    OPTIONS["DROP_EMPTY"] =             cOpt("general", _("Drop empty containers"),
                                             _("Set to drop empty containers after use. No: Don't drop any. - Watertight: All except watertight containers. - All: Drop all containers."),
                                             "no,watertight,all", "no"
                                            );

    //~ plain, default, normal
    optionNames["vanilla"] = _("Vanilla");
    //~ capped at a value
    optionNames["capped"] = _("Capped");
    //~ based on intelligence
    optionNames["int"] = _("Int");
    //~ based on intelligence and capped
    optionNames["intcap"] = _("IntCap");
    optionNames["off"] = _("Off");
    OPTIONS["SKILL_RUST"] =             cOpt("debug", _("Skill rust"),
                                             _("Set the level of skill rust. Vanilla: Vanilla Cataclysm - Capped: Capped at skill levels 2 - Int: Intelligence dependent - IntCap: Intelligence dependent, capped - Off: None at all."),
                                             "vanilla,capped,int,intcap,off", "vanilla"
                                            );

    optionNames["no"] = _("No");
    optionNames["yes"] = _("Yes");
    optionNames["query"] = _("Query");
    OPTIONS["DELETE_WORLD"] =           cOpt("general", _("Delete world"),
                                             _("Delete world upon player death."),
                                             "no,yes,query", "no"
                                            );

    OPTIONS["INITIAL_POINTS"] =         cOpt("debug", _("Initial points"),
                                             _("Initial points available on character generation."),
                                             0, 25, 6
                                            );

    OPTIONS["MAX_TRAIT_POINTS"] =       cOpt("debug", _("Maximum trait points"),
                                             _("Maximum trait points available for character generation."),
                                             0, 25, 12
                                            );

    OPTIONS["SPAWN_DENSITY"] =          cOpt("general", _("Spawn rate scaling factor"),
                                             _("A scaling factor that determines density of monster spawns."),
                                             0.0, 50.0, 1.0, 0.1
                                            );

    OPTIONS["CITY_SIZE"] =              cOpt("general", _("Size of cities"),
                                             _("A number determining how large cities are. Warning, large numbers lead to very slow mapgen."),
                                             4, 16, 4
                                            );

    OPTIONS["INITIAL_TIME"] =           cOpt("debug", _("Initial time"),
                                             _("Initial starting time of day on character generation."),
                                             0, 23, 8
                                            );

    OPTIONS["VIEWPORT_X"] =             cOpt("interface", _("Viewport width"),
                                             _("SDL ONLY: Set the expansion of the viewport along the X axis. Requires restart. POSIX systems will use terminal size at startup."),
                                             12, 93, 12
                                            );

    OPTIONS["VIEWPORT_Y"] =             cOpt("interface", _("Viewport height"),
                                             _("SDL ONLY: Set the expansion of the viewport along the Y axis. Requires restart. POSIX systems will use terminal size at startup."),
                                             12, 93, 12
                                            );

    optionNames["standard"] = _("Standard");
    //~ sidebar style
    optionNames["narrow"] = _("Narrow");
    OPTIONS["SIDEBAR_STYLE"] =          cOpt("interface", _("Sidebar style"),
                                             _("Switch between the standard or a narrower and taller sidebar. Requires restart."),
                                             "standard,narrow", "standard"
                                            );

    OPTIONS["MOVE_VIEW_OFFSET"] =       cOpt("interface", _("Move view offset"),
                                             _("Move view by how many squares per keypress."),
                                             1, 50, 1
                                            );

    OPTIONS["STATIC_SPAWN"] =           cOpt("debug", _("Static spawn"),
                                             _("Spawn zombies at game start instead of during game. Must reset world directory after changing for it to take effect."),
                                             true
                                            );

    OPTIONS["CLASSIC_ZOMBIES"] =        cOpt("debug", _("Classic zombies"),
                                             _("Only spawn classic zombies and natural wildlife. Requires a reset of save folder to take effect. This disables certain buildings."),
                                             false
                                            );

    OPTIONS["SEASON_LENGTH"] =          cOpt("debug", _("Season length"),
                                             _("Season length, in days."),
                                             14, 127, 14
                                            );

    OPTIONS["STATIC_NPC"] =             cOpt("debug", _("Static npcs"),
                                             _("If true, the game will spawn static NPC at the start of the game, requires world reset."),
                                             false
                                            );

    OPTIONS["RANDOM_NPC"] =             cOpt("debug", _("Random npcs"),
                                             _("If true, the game will randomly spawn NPC during gameplay."),
                                             false
                                            );

    OPTIONS["RAD_MUTATION"] =           cOpt("general", _("Mutations by radiation"),
                                             _("If true, radiation causes the player to mutate."),
                                             true
                                            );

    OPTIONS["SAVE_SLEEP"] =             cOpt("interface", _("Ask to save before sleeping"),
                                             _("If true, game will ask to save the map before sleeping."),
                                             false
                                            );

    //~ show mouse cursor
    optionNames["show"] = _("Show");
    //~ hide mouse cursor
    optionNames["hide"] = _("Hide");
    //~ hide mouse cursor when keyboard is used
    optionNames["hidekb"] = _("HideKB");
    OPTIONS["HIDE_CURSOR"] =            cOpt("interface", _("Hide mouse cursor"),
                                             _("Always: Cursor is always shown. Hidden: Cursor is hidden. HiddenKB: Cursor is hidden on keyboard input and unhidden on mouse movement."),
                                             "show,hide,hidekb", "show"
                                            );

    OPTIONS["MENU_SCROLL"] =            cOpt("interface", _("Centered menu scrolling"),
                                             _("If true, menus will start scrolling in the center of the list, and keep the list centered."),
                                             true
                                            );

    OPTIONS["AUTO_PICKUP"] =            cOpt("general", _("Enable item auto pickup"),
                                             _("Enable item auto pickup. Change pickup rules with the Auto Pickup Manager in the Help Menu ?3"),
                                             false
                                            );

    OPTIONS["AUTO_PICKUP_ZERO"] =       cOpt("general", _("Auto pickup 0 vol light items"),
                                             _("Auto pickup items with 0 Volume, and weight less than or equal to [option] * 50 grams. '0' disables this option"),
                                             0, 20, 0
                                            );

    OPTIONS["AUTO_PICKUP_SAFEMODE"] =   cOpt("general", _("Auto pickup safemode"),
                                             _("Auto pickup is disabled as long as you can see monsters nearby. This is affected by Safemode proximity distance."),
                                             false
                                            );

    OPTIONS["DANGEROUS_PICKUPS"] =      cOpt("general", _("Dangerous pickups"),
                                             _("If false will cause player to drop new items that cause them to exceed the weight limit."),
                                             false
                                            );

    OPTIONS["SHIFT_LIST_ITEM_VIEW"] =   cOpt("interface", _("Shift list item view"),
                                             _("If true, shift the view toward the selected item if it is outside of your current viewport."),
                                             true
                                            );

    OPTIONS["USE_TILES"] =              cOpt("interface", _("Use tiles"),
                                             _("If true, replaces some TTF rendered text with Tiles. Only applicable on SDL builds. Requires restart."),
                                             true
                                             );

    for (std::map<std::string, cOpt>::iterator iter = OPTIONS.begin(); iter != OPTIONS.end(); ++iter) {
        for (int i=0; i < vPages.size(); ++i) {
            if (vPages[i].first == (iter->second).getPage()) {
                mPageItems[i].push_back(iter->first);
                break;
            }
        }
    }
}