15 #ifndef CONTEXT_MANAGER_HPP_INCLUDED
16 #define CONTEXT_MANAGER_HPP_INCLUDED
237 bool write_map(
bool display_confirmation =
false);
map_labels * get_current_labels()
bool write_scenario(bool display_confirmation=false)
int current_context_index_
void expand_areas_menu(std::vector< std::string > &items)
Menu expanding for the map's defined areas.
void apply_mask_dialog()
Display an apply mask dialog and process user input.
A map fragment – a collection of locations and information abut them.
bool check_switch_open_map(const std::string &fn)
Check if a map is already open.
int auto_update_transitions_
Flag to rebuild terrain on every terrain change.
int current_context_index()
Index into the map_contexts_ array.
void edit_scenario_dialog()
Display a scenario edit dialog and process user input.
int add_map_context(map_context *mc)
Add a map context.
const config & game_config_
void replace_map_context(map_context *new_mc)
Replace the current map context and refresh accordingly.
void new_map(int width, int height, const t_translation::t_terrain &fill, bool new_context)
Create a new map.
void reload_map()
Reload the map after it has significantly changed (when e.g.
void resize_map_dialog()
Display a load map dialog and process user input.
void save_scenario_as_dialog()
Display a save map as dialog and process user input.
map_fragment clipboard_
Clipboard map_fragment – used for copy-paste.
void rename_area_dialog()
Display an dialog to querry a new id for an [time_area].
void refresh_after_action(bool drag_part=false)
Refresh the display after an action has been performed.
void expand_time_menu(std::vector< std::string > &items)
Menu expanding for the map's defined areas.
context_manager(editor_display &gui, const config &game_config)
void save_map()
Save the map, open dialog if not named yet.
std::string default_dir_
Default directory for map load/save as dialogs.
void perform_refresh(const editor_action &action, bool drag_part=false)
Perform an action on the current map_context, then refresh the display.
size_t check_open_map(const std::string &fn) const
Check if a map is already open.
const std::vector< std::string > items
editor_map & get_map()
Get the map from the current map context object.
bool confirm_discard()
Shows an are-you-sure dialog if the map was modified.
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) ...
map_context & get_map_context()
Get the current map context object.
void refresh_all()
Refresh everything, i.e.
void revert_map()
Revert the map by reloading it from disk.
void edit_side_dialog(int side)
TODO.
const editor_map & get_map() const
Get the map from the current map context object - const version.
void close_current_context()
Closes the active map context.
std::vector< map_generator * > map_generators_
Available random map generators.
void expand_sides_menu(std::vector< std::string > &items)
Menu expanding for the map's player sides.
void load_map_dialog(bool force_same_context=false)
Display a load map dialog and process user input.
editor_map & get_map()
Map accessor.
void set_auto_update_transitions(int value)
void new_scenario_dialog()
Display a new map dialog and process user input.
void expand_open_maps_menu(std::vector< std::string > &items)
Menu expanding for open maps list.
void expand_local_time_menu(std::vector< std::string > &items)
Menu expanding for the map's defined areas.
Manage the empty-palette in the editor.
map_fragment & get_clipboard()
bool is_active_transitions_hotkey(const std::string &item)
void switch_context(const int index, const bool force=false)
Switches the context to the one under the specified index.
void expand_load_mru_menu(std::vector< std::string > &items)
Menu expanding for most recent loaded list.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
void load_map(const std::string &filename, bool new_context)
Load a map given the filename.
std::vector< map_context * > map_contexts_
The currently opened map context object.
This class adds extra editor-specific functionality to a normal gamemap.
void fill_selection()
Fill the selection with the foreground terrain.
void save_map_as_dialog()
Display a save map as dialog and process user input.
bool write_map(bool display_confirmation=false)
Save the map under a given filename.
Game configuration data as global variables.
bool save_scenario_as(const std::string &filename)
Base class for all editor actions.
void save_all_maps(bool auto_save_windows=false)
Save all maps, open dialog if not named yet, except when using auto_save_windows which will name unna...
size_t modified_maps(std::string &modified)
void create_mask_to_dialog()
Display an apply mask dialog and process user input.
This class wraps around a map to provide a concise interface for the editor to work with...
GLint GLint GLint GLint GLint GLint GLsizei GLsizei height
map_generator * last_map_generator_
bool toggle_update_transitions()
void new_scenario(int width, int height, const t_translation::t_terrain &fill, bool new_context)
Create a new scenario.
void generate_map_dialog()
Display a generate random map dialog and process user input.
GLint GLint GLint GLint GLint GLint GLsizei width
void set_window_title()
Displays the specified map name in the window titlebar.
void create_default_context()
Creates a default map context object, used to ensure there is always at least one.
bool save_map_as(const std::string &filename)
Save the map under a given filename.
A config object defines a single node in a WML file, with access to child nodes.
void init_map_generators(const config &game_config)
init available random map generators
void load_mru_item(unsigned index, bool force_same_context=false)
Open the specified entry from the recent files list.
GLsizei const GLcharARB ** string
void set_update_trasitions_mode(int mode)
const map_context & get_map_context() const
Get the current map context object - const version.
void new_map_dialog()
Display a new map dialog and process user input.