diff --git a/data/help/texts.json b/data/core/help.json similarity index 98% rename from data/help/texts.json rename to data/core/help.json index e37101d4df6c8..10af37f5ceacf 100644 --- a/data/help/texts.json +++ b/data/core/help.json @@ -2,7 +2,7 @@ { "type": "help", "order": 0, - "name": ": Introduction", + "name": "Introduction", "messages": [ "Cataclysm: Dark Days Ahead is a turn-based survival game set in a post-apocalyptic world. You have survived the original onslaught, but the future looks pretty grim.", "You must prepare to face the many hardships to come, including dwindling supplies, hostile creatures, and harmful weather. Even among fellow survivors you must stay alert, since someone may be plotting behind your back to take your hard-earned loot.", @@ -13,7 +13,7 @@ { "type": "help", "order": 1, - "name": ": Movement", + "name": "Movement", "messages": [ "Movement is performed using the numpad, the arrow keys, or vikeys.", "", @@ -26,7 +26,7 @@ { "type": "help", "order": 2, - "name": ": Viewing", + "name": "Viewing", "messages": [ "The player can often see more than can be displayed on the screen at a time. Pressing enters \"Look around\" mode, which allows you to scroll around using the movement keys and view items on the map as well as monsters and their stance toward the character. Pressing provides a list of nearby visible items, though items shut away in crates, cupboards, refrigerators and the like won't be displayed until you are close enough. Pressing Shift+vikeys (h,j,k,l,y,u,b,n) will scroll the view persistently, allowing you to keep an eye on things as you move around.", "Places outside of your view but seen previously and still memorized can be visualized, but they will be covered by the \"fog of war.\"" @@ -35,7 +35,7 @@ { "type": "help", "order": 3, - "name": ": Hunger, thirst, and sleep", + "name": "Hunger, thirst, and sleep", "messages": [ "As time passes, you will begin to feel hunger and thirst, and your stomach will remind you of that. When this happens, status information will appear in the sidebar. Don't get confused - depending on your condition, it will display both how full your stomach is, as well as hunger intensity in relation to your nutrition status. Your body nutrition level is distinct from your current hunger: for example, you may feel full after a big meal while still being malnourished, and you will still get hungry while being overweight. With regular meals, you may even never get hungry and yet become malnourished, if your caloric intake is too low. In other words, you need to track both your immediate hunger/fullness and the overall nutrition of your whole body.", "Food takes some time to digest, and water travels faster through your digestive system than does solid food. Sudden overeating and overdrinking may make you feel excessively full, so split your meals. If you had been starved before, it will take some time to recover your body mass by building up stored calories through regular eating. Overeating for a prolonged period of time leads to obesity. Both sides of the spectrum are penalized. When hunger and thirst progress to severe levels, you will also suffer penalties. Thirst will kill you faster than hunger.", @@ -48,7 +48,7 @@ { "type": "help", "order": 4, - "name": ": Pain and stimulants", + "name": "Pain and stimulants", "messages": [ "When you take damage from almost any source, you'll start to feel pain. Pain slows you down and reduces your stats, and finding a way to manage pain is an early imperative. The most common is drugs: aspirin, codeine, tramadol, oxycodone, and more are all great options. Be aware that while under the influence of many painkillers, the physiological side effects may slow you down or reduce your stats.", "Note that most painkillers take a little while to kick in. If you take some oxycodone and don't notice the effects right away, don't start taking more - you may overdose and die!", @@ -61,7 +61,7 @@ { "type": "help", "order": 5, - "name": ": Healing and medication", + "name": "Healing and medication", "messages": [ "When you take damage, it will change the status of the affected body part, as shown in the sidebar. Its overall wellness is represented by a series of bars that will deplete and change color the more damage you take. If the accumulated damage is more than the body part can suffer, it will break. If that happens to a critical body part (i.e., your torso or head), you will die. For other body parts, it means broken bones, significant penalties, and a long process of healing - after placing the affected limb in a splint.", "Normal damage heals with time. You heal more during a good sleep, but wounds also heal a bit while you are awake.", @@ -74,7 +74,7 @@ { "type": "help", "order": 6, - "name": ": Addiction", + "name": "Addiction", "messages": [ "Many drugs (and some consumables) have a potential for addiction. Each time you consume such a substance, there is a chance that you will grow dependent on it. Consuming more of that drug will increase your dependence. Effects vary greatly between addictive substances, but no matter the substance, addiction has only one cure: going cold turkey. The process may last for days, and will leave you very weak, so try to do it in a safe area.", "If you are suffering from withdrawal effects, taking more of the addictive substance will cause the effects to cease immediately, but may deepen your dependence." @@ -83,7 +83,7 @@ { "type": "help", "order": 7, - "name": ": Morale and learning", + "name": "Morale and learning", "messages": [ "Your character has a morale level, which affects you in many ways. The depressing post-apocalypse world is tough to deal with, and your mood will naturally decrease very slowly.", "There are lots of options for increasing morale: reading an entertaining book, eating delicious food, listening to music, and taking recreational drugs are but a few options. However, most morale-boosting activities can only elevate your mood to a certain level before they grow boring.", @@ -98,7 +98,7 @@ { "type": "help", "order": 8, - "name": ": Radioactivity and mutation", + "name": "Radioactivity and mutation", "messages": [ "Though it is relatively rare, certain areas of the world may be contaminated with radiation. It will gradually accumulate in your body, weakening you more and more. While in radiation-free areas, your radiation level will slowly decrease; taking Prussian blue tablets will help speed this process. Get yourself a measuring device, as radiation is invisible, and you may not know that you are under its influence until it results in radiation sickness.", "If you become very irradiated, you may develop mutations. Most of the time, these mutations will be negative; however, many are beneficial, and others have both positive and negative effects. Your mutations may change your play style considerably. It is possible to find substances that will remove mutations, though these are extremely rare.", @@ -108,7 +108,7 @@ { "type": "help", "order": 9, - "name": ": Bionics", + "name": "Bionics", "messages": [ "Bionics are biomechanical upgrades to your body. While many are simply 'built-in' versions of items you would otherwise have to carry, some bionics have unique effects that are otherwise unobtainable. Some bionics are constantly working, whereas others need to be toggled on and off as needed.", "Most bionics require a source of power, and you will need an internal battery to store energy for them. Your current amount of energy is displayed in the sidebar right below your health. Replenishing energy can be done in a variety of ways, but all require the installation of a special bionic just for that purpose.", @@ -121,7 +121,7 @@ { "type": "help", "order": 10, - "name": ": Crafting", + "name": "Crafting", "messages": [ "Many important items can be very hard to find, or will cost a great deal of money to trade for. Fortunately, it is possible to craft a wide variety of goods (as best you can) with the proper tools, materials, and training.", "Some recipes require a set of tools. These are not used up when crafting, so you can keep your tool set. All recipes require one or more ingredients; these ARE used up in crafting.", @@ -141,7 +141,7 @@ { "type": "help", "order": 11, - "name": ": Traps", + "name": "Traps", "messages": [ "Before sleeping in dangerous territory, it may be wise to set traps to ward off unwanted intrusions - or at least warn you if one is in progress. There are a few traps to be found in the world, most notably bubble wrap (which will make a loud noise if stepped on, helping to wake you up) and bear traps (which make noise AND damage, and trap anything that steps on them). Others need to be crafted; this requires the Devices skill, and possibly Mechanics.", "To set a trap, simply use the item (press ) and choose a direction; the trap will be placed on the chosen tile. Some traps may require additional tools, like a shovel, to be set. Once set, a trap will remain in place until stepped on or disarmed.", @@ -153,7 +153,7 @@ { "type": "help", "order": 12, - "name": ": Items overview", + "name": "Items overview", "messages": [ "There is a wide variety of items available for your use. You may find them lying on the ground; if so, simply press to pick up items on the same tile. Some items are found inside a container, which may be drawn as a { with a blue background. Pressing , then a direction key, will allow you to examine these containers and loot their contents.", "Pressing opens a comparison menu, where you can see two items side-by-side with their attributes color-coded to indicate which is superior. You can also access the item comparison menu by pressing C after to open the \"List all items around the player\" menu and selecting an item.", @@ -171,7 +171,7 @@ { "type": "help", "order": 13, - "name": ": Combat", + "name": "Combat", "messages": [ "Zombies in cities will spawn at the start of the game, but may also wander around. All monsters are represented by letters (or sprites in the Tiles version) on your screen; a list of monster names, as well as their positions relative to you, is displayed on the right side of the screen. The 'compass' will display monsters that you see but are currently off the screen.", "To attack a monster with a melee weapon, simply move into them. The time it takes to attack depends on the size and weight of your weapon. Small, light weapons are the fastest; unarmed attacks increase in speed with your Unarmed Combat skill, and will eventually be VERY fast. A successful hit with a bashing weapon may stun the monster temporarily. A miss may make you stumble and lose movement points. If a monster hits you, your clothing may absorb some of the damage, but you will take what remains.", @@ -188,7 +188,7 @@ { "type": "help", "order": 14, - "name": ": Martial arts styles", + "name": "Martial arts styles", "messages": [ "A variety of fighting styles are available, particularly for the unarmed fighter. You can start with your choice of a single, commonly-taught style by starting with the Martial Arts Training trait. Many, many more can be found in their own traits, trained from manuals or by taking lessons from wandering masters.", "To select a fighting style, press . Some styles are relevant only when you are unarmed, others are compatible with (or require) certain weapons. If your current weapon is compatible with the chosen style, you will start using the selected style immediately. Otherwise, it will be locked in as your default style. To start using it, wield a relevant weapon, or empty your hands by pressing , then the key for the item you are currently wielding. If you wish to prevent yourself from accidentally wielding weapons taken from the ground, enable \"Keep hands free\" found in the styles menu.", @@ -200,7 +200,7 @@ { "type": "help", "order": 15, - "name": ": Survival tips", + "name": "Survival tips", "messages": [ "The hierarchy of needs for survival in most cases is as follows: shelter, fire, water, food. The rest is the process of trying to answer a question: What would you do in a survival situation?", "The first thing to do, when you are out of immediate danger, is to check your starting location for useful items. Your initial storage is limited, and a backpack, trenchcoat, or other storage medium will let you carry a lot more. Finding a weapon is important, but not a first priority; frying pans, butcher knives, and more are common in houses, and hardware stores may have others, as well as useful tools. Initially, save any guns you find as a last resort: ammo is scarce, while zombies are plenty, and unwanted attention may be more than you can handle.", @@ -218,7 +218,7 @@ { "type": "help", "order": 16, - "name": ": Vehicles and Driving", + "name": "Vehicles and Driving", "messages": [ "You control vehicles using the numpad, or vikeys. Note, however, that you control the vehicle's controls, rather than controlling the vehicle directly.", "", @@ -245,7 +245,7 @@ { "type": "help", "order": 17, - "name": ": Skills and proficiencies", + "name": "Skills and proficiencies", "messages": [ "SKILLS", "Each character has a collection of skills they may learn over time. These are grouped into four categories: Melee, Ranged, Crafting, and Interaction. Each skill begins at level 0 and increases with study and practice up to a maximum of level 10. Each level is harder to attain than the one before, but each level also increases the character's ability to do things using that skill, and may unlock crafting recipes or other actions gated by skill level. Reaching level 10 in any skill represents true mastery, near the limit of human capability.", @@ -261,7 +261,7 @@ { "type": "help", "order": 18, - "name": "<1>: List of item types and data", + "name": "List of item types and data", "messages": [ "~ Liquid\n%% Food\n! Medication\nThese are all consumed by using . They may provide a certain amount of nutrition, may quench your thirst, may be a stimulant or a depressant, and may provide (or reduce!) morale. There may also be more subtle effects.", "/ Large weapon\n; Small weapon or tool\n, Tiny item\nThese are all generic items, useful only to be wielded as a weapon. However, some have special uses; they will show up under the TOOLS section in your inventory. Press to use these.", @@ -276,7 +276,7 @@ { "type": "help", "order": 19, - "name": "<2>: Description of map symbols", + "name": "Description of map symbols", "messages": [ "MAP SYMBOLS:", ". Field - Empty grassland with occasional wild fruit.", @@ -304,7 +304,7 @@ { "type": "help", "order": 20, - "name": "<3>: Description of gun types", + "name": "Description of gun types", "messages": [ "( Handguns\nHandguns are small weapons held in one or both hands. They are much more difficult to aim and control than larger firearms, and this is reflected in their poor accuracy. However, their small size makes them appropriate for short-range combat. They are also relatively quick to reload and use a very wide variety of ammunition. Their small size and low weight make it possible to carry several loaded handguns, switching from one to the next as their ammo is spent.", "( Crossbows\nThe best feature of crossbows is low noise they produce. The bolts they fire are only rarely destroyed; if you pick up the bolts after firing them, your ammunition supply will last much longer. Crossbows suffer from a short range and a very long reload time (modified by your strength); plus, most only hold a single round.\nFor this reason, it is advisable to carry a few loaded crossbows. Crossbows can be very difficult to find; however, it is possible to craft one given a high enough Fabrication skill. Likewise, it is possible to make wooden bolts from any number of wooden objects, though these are much less effective than steel bolts. Crossbows use the Rifles skill.", @@ -320,7 +320,7 @@ { "type": "help", "order": 21, - "name": "<4>: Description of book colors", + "name": "Description of book colors", "messages": [ "BOOK COLORS:", "Red = You don't yet know what the book is about. You can skim it to find out.", @@ -337,7 +337,7 @@ { "type": "help", "order": 22, - "name": "<5>: FAQ (contains spoilers!)", + "name": "FAQ (contains spoilers!)", "messages": [ "Q: What is safe mode, and why does it prevent me from moving?\nA: Safe mode is a way to guarantee that you won't die by holding a movement key down. When a monster comes into view, your movement will be ignored until safe mode is turned off with the key. This ensures that the sudden appearance of a monster won't catch you off guard.", "Q: It seems like everything I eat makes me sick! What's wrong?\nA: Lots of the food found in towns is perishable and will only last a few days after the start of a new game. The electricity went out several days ago, so fruit, milk, and similar foods are the first to go bad. After the first couple of days, you should switch to canned food, jerky, and hunting. Also, you should make sure to cook any food and purify any water you come across, as it may contain parasites or otherwise be unsafe.", diff --git a/doc/HELP_MENU.md b/doc/HELP_MENU.md new file mode 100644 index 0000000000000..393dc45f777bf --- /dev/null +++ b/doc/HELP_MENU.md @@ -0,0 +1,36 @@ +# Help Menu + +The help menu consists of scrollable categorised help pages that would ideally explain everything a new survivor needs to know, as well as any information the game can't convey clearly in an immersive way. + +## Categories + +Each category is made up of a json object which for mods can be placed anywhere but for vanilla should be placed in `/data/core`. + +| Field | Description | +| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `"type"` | (required) must be `"help"` | +| `"order"` | (required) integer, where this category should appear in the list relative to others from the same source, with 0 being first. Must be unique per source (Every mod can start from 0). Each mods categories are appended to the end of the list per their load order. | +| `"name"` | (required) string, name of the category, can use [color tags](COLOR.md#Color tags) | +| `"messages"` | (required) array of strings, each string respresents a new line seperated paragraph containing information for this category, can use [color tags](COLOR.md#Color tags) and [keybind tags](#Keybind tags). Seperated mainly for ease of editing the json as `\n` lets you add newlines within strings | + +### Keybind tags + +The keybind tags here use a different syntax than elsewhere for now. +Keybind tags take the form where keybind corresponds to a keybind id, most of which are found in [keybindings.json](./data/raw/keybindings.json) and are automatically colored light blue. + +### Special tags + +`` and `` are special hardcoded tags that can be found in [help.cpp](./src/help.cpp) +`` displays a list of all the color abbreviations to be used with overmap notes. +`` displays the hjkl and numpad movement directions in a nicely rendered way. The movement directions have 3 binds by default with the above keybind tags not letting you specify which to use so unhardcoding it would result in a messier drawing. + +### Example + +```json + { + "type": "help", + "order": 0, + "name": "First Category Name", + "messages": [ "A useful tip.", "Some scary warning.", "A list of three keybinds.\n lets you pass one second.\n lets you wait for longer.\n lets you sleep." ] + }, +``` diff --git a/src/help.cpp b/src/help.cpp index 1f9fad0ba151b..3812e32f19de9 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -7,16 +7,15 @@ #include #include #include -#include #include #include "action.h" -#include "cata_utility.h" #include "catacharset.h" #include "color.h" #include "cursesdef.h" #include "debug.h" #include "input_context.h" +#include "json_error.h" #include "output.h" #include "path_info.h" #include "point.h" @@ -25,34 +24,49 @@ #include "translations.h" #include "ui_manager.h" +class JsonObject; + help &get_help() { static help single_instance; return single_instance; } -void help::load() +void help::load( const JsonObject &jo, const std::string &src ) { - read_from_file_optional_json( PATH_INFO::help(), [&]( const JsonValue & jsin ) { - deserialize( jsin ); - } ); + get_help().load_object( jo, src ); } -void help::deserialize( const JsonArray &ja ) +void help::reset() { - for( JsonObject jo : ja ) { - if( jo.get_string( "type" ) != "help" ) { - debugmsg( "object with type other than \"type\" found in help text file" ); - continue; - } - - std::vector messages; - jo.read( "messages", messages ); + get_help().reset_instance(); +} - translation name; - jo.read( "name", name ); +void help::reset_instance() +{ + current_order_start = 0; + current_src = ""; + help_texts.clear(); +} - help_texts[ jo.get_int( "order" ) ] = std::make_pair( name, messages ); +void help::load_object( const JsonObject &jo, const std::string &src ) +{ + if( src == "dda" ) { + jo.throw_error( string_format( "Vanilla help must be located in %s", + PATH_INFO::jsondir().generic_u8string() ) ); + } + if( src != current_src ) { + current_order_start = help_texts.empty() ? 0 : help_texts.crbegin()->first + 1; + current_src = src; + } + std::vector messages; + jo.read( "messages", messages ); + + translation name; + jo.read( "name", name ); + const int modified_order = jo.get_int( "order" ) + current_order_start; + if( !help_texts.try_emplace( modified_order, std::make_pair( name, messages ) ).second ) { + jo.throw_error_at( "order", "\"order\" must be unique (per src)" ); } } @@ -88,7 +102,7 @@ std::string help::get_dir_grid() } std::map> help::draw_menu( const catacurses::window &win, - int selected ) const + int selected, std::map &hotkeys ) const { std::map> opt_map; @@ -102,15 +116,22 @@ std::map> help::draw_menu( const catacurses::win int second_column = divide_round_up( getmaxx( win ), 2 ); size_t i = 0; for( const auto &text : help_texts ) { - const std::string cat_name = text.second.first.translated(); - const int cat_width = utf8_width( remove_color_tags( shortcut_text( c_white, cat_name ) ) ); + std::string cat_name; + auto hotkey_it = hotkeys.find( text.first ); + if( hotkey_it != hotkeys.end() ) { + cat_name = colorize( hotkey_it->second.short_description(), + selected == text.first ? hilite( c_light_blue ) : c_light_blue ); + cat_name += ": "; + } + cat_name += text.second.first.translated(); + const int cat_width = utf8_width( remove_color_tags( cat_name ) ); if( i < half_size ) { second_column = std::max( second_column, cat_width + 4 ); } const point sc_start( i < half_size ? 1 : second_column, y + i % half_size ); - shortcut_print( win, sc_start, selected == text.first ? hilite( c_white ) : c_white, - selected == text.first ? hilite( c_light_blue ) : c_light_blue, cat_name ); + fold_and_print( win, sc_start, getmaxx( win ) - 2, + selected == text.first ? hilite( c_white ) : c_white, cat_name ); ++i; opt_map.emplace( text.first, @@ -168,23 +189,26 @@ void help::display_help() const std::map> opt_map; int sel = -1; + const hotkey_queue &hkq = hotkey_queue::alphabets(); + input_event next_hotkey = ctxt.first_unassigned_hotkey( hkq ); + std::map hotkeys; + for( const auto &text : help_texts ) { + hotkeys.emplace( text.first, next_hotkey ); + next_hotkey = ctxt.next_unassigned_hotkey( hkq, next_hotkey ); + } + ui.on_redraw( [&]( const ui_adaptor & ) { draw_border( w_help_border, BORDER_COLOR, _( "Help" ) ); wnoutrefresh( w_help_border ); - opt_map = draw_menu( w_help, sel ); + opt_map = draw_menu( w_help, sel, hotkeys ); } ); - std::map> hotkeys; - for( const auto &text : help_texts ) { - hotkeys.emplace( text.first, get_hotkeys( text.second.first.translated() ) ); - } - do { ui_manager::redraw(); sel = -1; action = ctxt.handle_input(); - std::string sInput = ctxt.get_raw_input().text; + input_event input = ctxt.get_raw_input(); // Mouse selection if( action == "MOUSE_MOVE" || action == "SELECT" ) { @@ -196,8 +220,8 @@ void help::display_help() const } ); if( cnt > 0 && action == "SELECT" ) { auto iter = hotkeys.find( sel ); - if( iter != hotkeys.end() && !iter->second.empty() ) { - sInput = iter->second.front(); + if( iter != hotkeys.end() ) { + input = iter->second; action = "CONFIRM"; } } @@ -209,58 +233,57 @@ void help::display_help() const if( help_text_it == help_texts.end() ) { continue; } - for( const std::string &hotkey : hotkey_entry.second ) { - if( sInput == hotkey ) { - std::vector i18n_help_texts; - i18n_help_texts.reserve( help_text_it->second.second.size() ); - std::transform( help_text_it->second.second.begin(), help_text_it->second.second.end(), - std::back_inserter( i18n_help_texts ), [&]( const translation & line ) { - std::string line_proc = line.translated(); - if( line_proc == "" ) { - line_proc = get_note_colors(); - } else if( line_proc == "" ) { - line_proc = get_dir_grid(); - } - size_t pos = line_proc.find( "", pos, 1 ); - - std::string action = line_proc.substr( pos + 7, pos2 - pos - 7 ); - std::string replace = "" + - press_x( look_up_action( action ), "", "" ) + ""; - - if( replace.empty() ) { - debugmsg( "Help json: Unknown action: %s", action ); - } else { - line_proc = string_replace( - line_proc, "", replace ); - } - - pos = line_proc.find( " i18n_help_texts; + i18n_help_texts.reserve( help_text_it->second.second.size() ); + std::transform( help_text_it->second.second.begin(), help_text_it->second.second.end(), + std::back_inserter( i18n_help_texts ), [&]( const translation & line ) { + std::string line_proc = line.translated(); + if( line_proc == "" ) { + line_proc = get_note_colors(); + } else if( line_proc == "" ) { + line_proc = get_dir_grid(); + } + size_t pos = line_proc.find( "", pos, 1 ); + + std::string action = line_proc.substr( pos + 7, pos2 - pos - 7 ); + std::string replace = "" + + press_x( look_up_action( action ), "", "" ) + ""; + + if( replace.empty() ) { + debugmsg( "Help json: Unknown action: %s", action ); + } else { + line_proc = string_replace( + line_proc, "", replace ); } - return line_proc; - } ); - if( !i18n_help_texts.empty() ) { - ui.on_screen_resize( nullptr ); + pos = line_proc.find( " #include "cuboid_rectangle.h" +#include "input.h" class JsonArray; +class JsonObject; class translation; namespace catacurses { @@ -20,16 +22,19 @@ class window; class help { public: - void load(); + static void load( const JsonObject &jo, const std::string &src ); + static void reset(); void display_help() const; - private: - void deserialize( const JsonArray &ja ); + void load_object( const JsonObject &jo, const std::string &src ); + void reset_instance(); std::map> draw_menu( const catacurses::window &win, - int selected ) const; + int selected, std::map &hotkeys ) const; static std::string get_note_colors(); static std::string get_dir_grid(); - + // Modifier for each mods order + int current_order_start = 0; + std::string current_src; std::map>> help_texts; }; diff --git a/src/init.cpp b/src/init.cpp index 726bb4ffeeb6c..9b0007ac6ea48 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -47,6 +47,7 @@ #include "game.h" #include "gates.h" #include "harvest.h" +#include "help.h" #include "input.h" #include "item_action.h" #include "item_category.h" @@ -274,6 +275,7 @@ void DynamicDataLoader::initialize() add( "weather_type", &weather_types::load ); add( "ammo_effect", &ammo_effects::load ); add( "emit", &emit::load_emit ); + add( "help", &help::load ); add( "activity_type", &activity_type::load ); add( "addiction_type", &add_type::load_add_types ); add( "movement_mode", &move_mode::load_move_mode ); @@ -665,6 +667,7 @@ void DynamicDataLoader::unload_data() disease_type::reset(); dreams.clear(); emit::reset(); + help::reset(); enchantment::reset(); event_statistic::reset(); effect_on_conditions::reset(); diff --git a/src/input_context.cpp b/src/input_context.cpp index ca46cf9f47f71..f6088703e91bb 100644 --- a/src/input_context.cpp +++ b/src/input_context.cpp @@ -1125,7 +1125,6 @@ action_id input_context::display_menu( bool permit_execute_action ) if( changed && query_yn( _( "Save changes?" ) ) ) { try { inp_mngr.save(); - get_help().load(); } catch( std::exception &err ) { popup( _( "saving keybindings failed: %s" ), err.what() ); } diff --git a/src/main.cpp b/src/main.cpp index 9695ae140e91c..fb9dce428c37a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -851,8 +851,6 @@ int main( int argc, const char *argv[] ) main_menu::queued_world_to_load = std::move( cli.world ); - get_help().load(); - while( true ) { main_menu menu; try { diff --git a/src/path_info.cpp b/src/path_info.cpp index 40ffdbebef139..c327b5fc269b0 100644 --- a/src/path_info.cpp +++ b/src/path_info.cpp @@ -303,10 +303,6 @@ std::string PATH_INFO::graveyarddir() { return user_dir_value + "graveyard/"; } -cata_path PATH_INFO::help() -{ - return datadir_path_value / "help" / "texts.json"; -} cata_path PATH_INFO::keybindings() { return datadir_path_value / "raw" / "keybindings.json"; diff --git a/src/path_info.h b/src/path_info.h index e74bfbd0376f8..5a5b9d5e7ff29 100644 --- a/src/path_info.h +++ b/src/path_info.h @@ -69,7 +69,6 @@ cata_path datadir_path(); cata_path defaultsounddir(); cata_path fontdata(); cata_path gfxdir(); -cata_path help(); cata_path jsondir(); cata_path keybindings(); cata_path keybindings_vehicle(); diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 107195f3e6f74..870a3b3b212ef 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -35,7 +35,6 @@ #include "debug.h" #include "filesystem.h" #include "game.h" -#include "help.h" #include "json.h" #include "map.h" #include "messages.h" @@ -128,8 +127,6 @@ static void init_global_game_state( const std::vector &mods, g->new_game = true; g->load_static_data(); - get_help().load(); - world_generator->set_active_world( nullptr ); world_generator->init(); // Using unicode characters in the world name to test path encoding