93 bool select_area(
int index);
101 ++actions_since_save_;
105 tod_manager_->replace_area_locations(active_area_, area);
108 void new_area(
const std::set<map_location>& area) {
109 tod_manager_->add_time_area(
"", area,
config());
110 active_area_ = tod_manager_->get_area_ids().size() -1;
111 ++actions_since_save_;
114 void remove_area(
int index);
120 void replace_schedule(
const std::vector<time_of_day>& schedule);
140 virtual const std::vector<team>&
teams()
const override 165 return lbl_categories_;
170 return lbl_categories_;
176 void replace_local_schedule(
const std::vector<time_of_day>& schedule);
181 void set_starting_time(
int time);
187 tod_manager_->set_current_time(time, active_area_);
188 ++actions_since_save_;
192 return tod_manager_.get();
196 return tod_manager_.get();
203 return game_classification_;
215 active_area_ =
index;
219 return music_tracks_.find(track_id) != music_tracks_.end();
224 if (music_tracks_.find(track.
id()) == music_tracks_.end())
225 music_tracks_.emplace(track.
id(), track);
226 else music_tracks_.erase(track.
id());
234 bool one_layer_only =
false);
240 bool one_layer_only =
false);
247 bool one_layer_only =
false);
273 void set_scenario_setup(
const std::string&
id,
const std::string&
name,
const std::string& description,
274 int turns,
int xp_mod,
bool victory_defeated,
bool random_time);
292 void clear_changed_locations();
294 void add_changed_location(
const std::set<map_location>& locs);
295 void set_everything_changed();
296 bool everything_changed()
const;
298 void set_labels(
display& disp);
300 void clear_starting_position_labels(
display& disp);
302 void set_starting_position_labels(
display& disp);
304 void reset_starting_position_labels(
display& disp);
312 const std::string&
get_id()
const {
return scenario_id_; }
314 const std::string&
get_name()
const {
return scenario_name_; }
316 const t_string get_default_context_name()
const;
339 bool save_scenario();
341 void load_scenario();
362 bool modified()
const;
365 void clear_modified();
368 void add_to_recent_files();
371 bool can_undo()
const;
374 bool can_redo()
const;
405 void clear_undo_redo();
513 typedef std::map<std::string, sound::music_track>
music_map;
int actions_since_save_
Number of actions performed since the map was saved.
action_stack undo_stack_
The undo stack.
std::string map_data_key_
When a scenario file is loaded, the referenced map is loaded instead.
const std::string & get_name() const
editor_map map_
The map object of this map_context.
game_classification game_classification_
std::set< map_location > starting_position_label_locs_
Cache of set starting position labels.
void add_to_playlist(const sound::music_track &track)
const std::string & id() const
bool needs_terrain_rebuild_
Refresh flag indicating the terrain in the map has changed and requires a rebuild.
void save_area(const std::set< map_location > &area)
const std::string & get_filename() const
void new_area(const std::set< map_location > &area)
void set_active_area(int index)
map_labels & get_labels()
bool needs_reload_
Refresh flag indicating the map in this context should be completely reloaded by the display...
virtual const std::vector< std::string > & hidden_label_categories() const override
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
bool needs_reload() const
Getter for the reload flag.
mp_game_settings & get_mp_settings()
std::string scenario_name_
virtual const gamemap & map() const =0
void set_needs_reload(bool value=true)
Setter for the reload flag.
std::deque< std::unique_ptr< editor_action > > action_stack
Action stack typedef.
std::optional< int > xp_mod_
bool embedded_
Whether the map context refers to a map embedded in a scenario file.
bool needs_labels_reset() const
Getter for the labels reset flag.
const std::string & get_id() const
overlay_map & get_overlays()
game_classification & get_classification()
bool pure_map_
Whether the map context refers to a file containing only the pure map data.
This class stores all the data for a single 'side' (in game nomenclature).
tod_manager * get_time_manager()
std::map< std::string, sound::music_track > music_map
void set_local_starting_time(int time)
TODO.
std::unique_ptr< tod_manager > tod_manager_
std::vector< team > teams_
editor_team_info(const team &t)
void remove_side()
removes the last side from the scenario
side_controller::type controller
void set_embedded(bool v)
const std::set< map_location > changed_locations() const
bool random_start_time() const
virtual std::vector< std::string > & hidden_label_categories() override
std::optional< bool > victory_defeated_
virtual const unit_map & units() const =0
Manage the empty-palette in the editor.
void set_needs_terrain_rebuild(bool value=true)
Setter for the terrain rebuild flag.
bool needs_labels_reset_
Refresh flag indicating the labels in the map have changed.
Encapsulates the map of the game.
const std::string & get_description() const
This class adds extra editor-specific functionality to a normal gamemap.
virtual const std::vector< team > & teams() const =0
Game configuration data as global variables.
const tod_manager * get_time_manager() const
editor_map & map()
Local non-const overload of map.
Base class for all editor actions.
Internal representation of music tracks.
const std::string & get_map_data_key() const
This class wraps around a map to provide a concise interface for the editor to work with...
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.
action_stack redo_stack_
The redo stack.
std::vector< std::string > lbl_categories_
bool victory_defeated() const
virtual const unit_map & units() const override
Const units accessor.
unit_map & units()
Local non-const overload of units.
team_shared_vision::type share_vision
virtual const editor_map & map() const override
Const map accessor.
int get_active_area() const
void set_needs_labels_reset(bool value=true)
Setter for the labels reset flag.
bool is_in_playlist(std::string track_id)
std::optional< int > get_xp_mod() const
bool needs_terrain_rebuild() const
Getter for the terrain rebuild flag.
static const std::size_t max_action_stack_size_
Action stack (i.e.
void set_filename(const std::string &fn)
Container associating units to locations.
std::string filename_
The actual filename of this map.
std::map< map_location, std::vector< overlay > > overlay_map
std::vector< team > & teams()
Local non-const overload of teams.
std::set< map_location > changed_locations_
A config object defines a single node in a WML file, with access to child nodes.
virtual const std::vector< team > & teams() const override
Const teams accessor.
mp_game_settings mp_settings_