60 void try_era(
const std::string&
id,
bool force =
false);
68 void try_scenario(
const std::string&
id,
bool force =
false);
171 elem(
const std::string& _id,
const std::string& _type)
180 {
return id ==
e.id &&
type ==
e.type; }
309 const std::string& requester =
_(
"A component"));
321 const std::string& requester =
_(
"A component"));
342 (
const std::vector<std::string>& scenarios);
A config object defines a single node in a WML file, with access to child nodes.
A class grating read only view to a vector of config objects, viewed as one config with all children ...
Note to all triers: It's not guaranteed that the specified component will be selected (if the user de...
bool change_scenario(const std::string &id)
Attempts to change the selected scenario.
void try_era_by_index(int index, bool force=false)
Tries to set the selected era.
bool change_modifications(const std::vector< std::string > &modifications)
Attempts to change the selected modifications.
void revert()
restores the lastly saved values of era_, scenarios_ and mods_
void try_modifications(const std::vector< std::string > &ids, bool force=false)
Tries to set the enabled modifications.
bool disable_mods_dialog(const std::vector< std::string > &mods, const std::string &requester=_("A component"))
Display a dialog requesting confirmation for disabling some modifications.
bool exists(const elem &e) const
Decides whether a certain component is installed or not.
void insert_element(component_type type, const config &data, int index=0)
Adds a new element to the manager's database.
std::string change_era_dialog(const std::vector< std::string > &eras)
Display a dialog requesting the user to select a new era.
void try_era(const std::string &id, bool force=false)
Tries to set the selected era.
bool enable_mods_dialog(const std::vector< std::string > &mods, const std::string &requester=_("A component"))
Display a dialog requesting confirmation for enabling some modifications.
bool does_conflict(const elem &elem1, const elem &elem2, bool directonly=false) const
Decides if two components are conflicting or not.
config depinfo_
holds all required info about the components and their dependencies
std::vector< std::string > get_required(const elem &e) const
Get the list of modifications required by a certain component.
std::string prev_era_
used by save_state() and revert() to backup/restore era_
std::vector< std::string > get_conflicting_enabled(const elem &e) const
Get the list of modifications which are conflicting a certain component and are currently enabled.
const std::string & get_era() const
Returns the selected era.
std::string find_name_for(const elem &e) const
Look up the name of a given component.
const std::string & get_scenario() const
Returns the selected scenario.
bool does_require(const elem &elem1, const elem &elem2) const
Decides whether e1 requires e2.
std::vector< std::string > mods_
the ids of the currently selected modifications
int get_era_index() const
Returns the selected era.
std::string scenario_
the id of the currently selected scenario
std::vector< std::string > get_required_not_installed(const elem &e) const
Get the list of modifications which are required by a certain component, but currently unavailable on...
std::string change_scenario_dialog(const std::vector< std::string > &scenarios)
Display a dialog requesting the user to select a new scenario.
bool is_modification_active(int index) const
Tells whether a certain mod is activated.
std::string era_
the id of the currently selected era
void try_scenario(const std::string &id, bool force=false)
Tries to set the selected scenario.
const std::vector< std::string > & get_modifications() const
Returns the enabled modifications.
void try_scenario_by_index(int index, bool force=false)
Tries to set the selected scenario.
manager(const game_config_view &gamecfg, bool mp)
void failure_dialog(const std::string &msg)
Shows an error message.
bool change_era(const std::string &id)
Attempts to change the selected era.
void save_state()
saves the current values of era_, scenarios_ and mods_
std::string prev_scenario_
used by save_state() and revert() to backup/restore scenario_
int get_scenario_index() const
Returns the selected scenario.
std::vector< std::string > get_required_not_enabled(const elem &e) const
Get the list of modifications which are required by a certain component, but aren't currently enabled...
void try_modification_by_id(const std::string &id, bool activate, bool force=false)
Tries to enable/disable a specific modification.
std::vector< std::string > prev_mods_
used by save_state() and revert() to backup/restore mods_
Definitions for the interface to Wesnoth Markup Language (WML).
static std::string _(const char *str)
Main entry points of multiplayer mode.
std::size_t index(std::string_view str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
represents a component (era, modification or scenario)
elem(const std::string &_id, const std::string &_type)
bool operator!=(const elem &e) const
bool operator==(const elem &e) const