42 prefs::get().set_editor_auto_update_transitions(mode);
84 void save_map(
bool show_confirmation =
true);
168 map->set_addon_id(
id);
227 template<
typename... T>
235 template<
typename... T>
269 bool write_map(
bool display_confirmation =
true);
Abstract class for exposing game data that doesn't depend on the GUI, however which for historical re...
const game_config_view & game_config_
std::vector< std::unique_ptr< map_context > > map_contexts_
The currently opened map context object.
bool write_scenario(bool display_confirmation=true)
context_manager(editor_display &gui, const game_config_view &game_config, const std::string &addon_id)
bool is_active_transitions_hotkey(const std::string &item)
void new_scenario(int width, int height, const t_translation::terrain_code &fill, bool new_context)
Create a new scenario.
void set_update_transitions_mode(int mode)
void new_map(int width, int height, const t_translation::terrain_code &fill, bool new_context)
Create a new map.
virtual const game_data * get_game_data() const override
Inherited from filter_context.
void fill_selection()
Fill the selection with the foreground terrain.
void new_map_dialog()
Display a new map dialog and process user input.
void expand_time_menu(std::vector< config > &items, int i)
Menu expanding for the map's defined areas.
bool confirm_discard()
Shows an are-you-sure dialog if the map was modified.
void expand_sides_menu(std::vector< config > &items, int i)
Menu expanding for the map's player sides.
void generate_map_dialog()
Display a generate random map dialog and process user input.
int auto_update_transitions_
Flag to rebuild terrain on every terrain change.
void rename_area_dialog()
Display an dialog to querry a new id for an [time_area].
void revert_map()
Revert the map by reloading it from disk.
map_fragment clipboard_
Clipboard map_fragment – used for copy-paste.
void load_map_dialog(bool force_same_context=false)
Display a load map dialog and process user input.
bool check_switch_open_map(const std::string &fn)
Check if a map is already open.
std::vector< std::unique_ptr< map_generator > > map_generators_
Available random map generators.
void set_window_title()
Displays the specified map name in the window titlebar.
std::size_t open_maps(void)
virtual game_lua_kernel * get_lua_kernel() const override
Inherited from filter_context.
void set_default_dir(const std::string &str)
Set the default dir (where the filebrowser is pointing at when there is no map file opened)
void switch_context(const int index, const bool force=false)
Switches the context to the one under the specified index.
map_generator * last_map_generator_
std::size_t check_open_map(const std::string &fn) const
Check if a map is already open.
void save_scenario_as_dialog()
Display a save map as dialog and process user input.
int current_context_index()
Index into the map_contexts_ array.
void refresh_all()
Refresh everything, i.e.
void init_map_generators(const game_config_view &game_config)
init available random map generators
void save_all_maps()
Save all maps, show save dialogs for unsaved ones.
int add_map_context_of(std::unique_ptr< map_context > &&mc)
virtual const display_context & get_disp_context() const override
Inherited from filter_context.
bool toggle_update_transitions()
void save_map_as_dialog()
Display a save map as dialog and process user input.
void create_default_context()
Creates a default map context object, used to ensure there is always at least one.
void new_scenario_dialog()
Display a new map dialog and process user input.
void replace_map_context(const T &... args)
Replace the current map context and refresh accordingly.
void apply_mask_dialog()
Display an apply mask dialog and process user input.
void load_map(const std::string &filename, bool new_context)
Load a map given the filename.
void reload_map()
Reload the map after it has significantly changed (when e.g.
void save_contexts()
Save all open map_contexts to memory.
void set_addon_id(const std::string &id)
void create_mask_to_dialog()
Display an apply mask dialog and process user input.
void close_current_context()
Closes the active map context.
void resize_map_dialog()
Display a load map dialog and process user input.
void edit_scenario_dialog()
Display a scenario edit dialog and process user input.
std::string current_addon_
The currently selected add-on.
void replace_map_context_with(std::unique_ptr< map_context > &&mc)
void perform_refresh(const editor_action &action, bool drag_part=false)
Perform an action on the current map_context, then refresh the display.
int add_map_context(const T &... args)
Add a map context.
const map_context & get_map_context() const
Get the current map context object - const version.
std::string default_dir_
Default directory for map load/save as dialogs.
void expand_areas_menu(std::vector< config > &items, int i)
Menu expanding for the map's defined areas.
void save_map(bool show_confirmation=true)
Save the map, open dialog if not named yet.
void edit_side_dialog(const team &t)
Display a side edit dialog and process user input.
void create_blank_context()
void expand_local_time_menu(std::vector< config > &items, int i)
Menu expanding for the map's defined areas.
bool write_map(bool display_confirmation=true)
Save the map under a given filename.
void load_mru_item(unsigned index, bool force_same_context=false)
Open the specified entry from the recent files list.
map_context & get_map_context()
Get the current map context object.
int current_context_index_
map_fragment & get_clipboard()
virtual const tod_manager & get_tod_man() const override
Inherited from filter_context.
class location_palette * locs_
void expand_load_mru_menu(std::vector< config > &items, int i)
Menu expanding for most recent loaded list.
void expand_open_maps_menu(std::vector< config > &items, int i)
Menu expanding for open maps list.
void refresh_after_action(bool drag_part=false)
Refresh the display after an action has been performed.
void refresh_on_context_change()
Performs the necessary housekeeping necessary when switching contexts.
std::size_t modified_maps(std::string &modified)
Base class for all editor actions.
List of starting locations and location ids.
This class wraps around a map to provide a concise interface for the editor to work with.
const tod_manager * get_time_manager() const
A map fragment – a collection of locations and information abut them.
A class grating read only view to a vector of config objects, viewed as one config with all children ...
This class stores all the data for a single 'side' (in game nomenclature).
std::string id
Text to match against addon_info.tags()
void fill(const SDL_Rect &rect, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Fill an area with the given colour.
Manage the empty-palette in the editor.
Game configuration data as global variables.
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
std::string filename
Filename.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...