The Battle for Wesnoth  1.19.1+dev
Classes | Typedefs | Enumerations | Functions
editor Namespace Reference

Manage the empty-palette in the editor. More...


class  editor_action_whole_map
 Replace contents of the entire map, Useful as a fallback undo method when something else would be impractical. More...
class  editor_action_extendable
 Base class for actions that: 1) operate on an area 2) can be used as undo for a click-drag operation 3) can be extended so one undo action undos several actual drag actions. More...
class  editor_action_chain
 Container action wrapping several actions into one. More...
class  editor_action_location
 Base class for actions which act on a specified location (and possibly on other locations that can be derived from the staring hex) More...
class  editor_action_location_terrain
 Base class for actions which in addition to acting on a hex, act with one terrain type, i.e. More...
class  editor_action_area
 Base class for area-affecting actions. More...
class  editor_action_paste
 Paste a map fragment into the map. More...
class  editor_action_paint_area
 Paint the same terrain on a number of locations on the map. More...
class  editor_action_fill
 Flood fill. More...
class  editor_action_starting_position
 Set starting position action, sets location ids (both for starting locations and for non-starting locations). More...
class  editor_action_resize_map
 Resize the map. More...
class  editor_action_apply_mask
class  editor_action_create_mask
class  editor_action_shuffle_area
 Randomize terrain in an area. More...
class  editor_action
 Base class for all editor actions. More...
struct  editor_action_exception
class  editor_action_item
 place a new item on the map More...
class  editor_action_item_delete
 Remove a item from the map. More...
class  editor_action_item_replace
class  editor_action_item_facing
class  editor_action_label
 Set label action. More...
class  editor_action_label_delete
class  editor_action_select
 Select the given locations. More...
class  editor_action_deselect
 Deselect the given locations. More...
class  editor_action_select_all
 Select the entire map. More...
class  editor_action_select_none
 Clear selection. More...
class  editor_action_select_inverse
 Invert the selection. More...
class  editor_action_unit
 place a new unit on the map More...
class  editor_action_unit_delete
 Remove a unit from the map. More...
class  editor_action_unit_replace
class  editor_action_unit_facing
class  editor_action_village
 Sets the ownership of a village to the current side. More...
class  editor_action_village_delete
 Clears the ownership of a village. More...
class  mouse_action
 A mouse action receives events from the controller, and responds to them by creating an appropriate editor_action object. More...
class  brush_drag_mouse_action
 A brush-drag mouse action base class which adds brush and drag processing to a basic mouse action. More...
class  mouse_action_paint
 Brush paint mouse action. More...
class  mouse_action_paste
 Paste action. More...
class  mouse_action_fill
 Fill action. More...
class  mouse_action_starting_position
 Set starting position action. More...
class  mouse_action_item
 item placement action class More...
class  mouse_action_map_label
 Set map label action. More...
class  mouse_action_select
 Select (and deselect) action, by brush or "magic wand" (via keyboard modifier) More...
class  mouse_action_unit
 Unit placement action class. More...
class  mouse_action_village
 Editor mouse action class. More...
class  editor_controller
 The editor_controller class contains the mouse and keyboard event handling routines for the editor. More...
struct  editor_exception
struct  editor_logic_exception
class  editor_display
class  context_manager
struct  editor_map_operation_exception
struct  editor_map_integrity_error
struct  editor_map_load_exception
struct  editor_map_save_exception
class  editor_map
 This class adds extra editor-specific functionality to a normal gamemap. More...
struct  editor_team_info
class  map_context
 This class wraps around a map to provide a concise interface for the editor to work with. More...
struct  tile_info
 This represents a tile along with information about it, namely the terrain, possibly other information. More...
class  map_fragment
 A map fragment – a collection of locations and information abut them. More...
struct  item_group
 Stores the info about the groups in a nice format. More...
class  common_palette
class  tristate_palette
class  editor_palette
class  empty_palette
 Empty palette. More...
class  item_palette
 Palette where the terrain to be drawn can be selected. More...
class  location_palette
 List of starting locations and location ids. More...
class  palette_manager
 Empty palette. More...
class  terrain_palette
 Palette where the terrain to be drawn can be selected. More...
class  unit_palette
 Palette where the terrain to be drawn can be selected. More...
class  brush
 The brush class represents a single brush – a set of relative locations around a "hotspot", and related info such as the icon image. More...
class  editor_toolkit


using action_stack = std::deque< std::unique_ptr< editor_action > >
 Action stack typedef. More...


enum  menu_type {


std::string initialize_addon ()
EXIT_STATUS start (bool clear_id, const std::string &filename="", bool take_screenshot=false, const std::string &screenshot_filename="map_screenshot.png")
 Main interface for launching the editor from the title screen. More...
editor_map_load_exception wrap_exc (const char *type, const std::string &e_msg, const std::string &filename)
 Exception wrapping utility. More...
static std::string get_map_location (const std::string &file_contents, const std::string &attr)
static bool loc_id_comp (const std::string &lhs, const std::string &rhs)
const t_translation::terrain_codeget_selected_bg_terrain ()
const t_translation::terrain_codeget_selected_fg_terrain ()
static bool is_valid_terrain (const t_translation::terrain_code &c)

Detailed Description

Manage the empty-palette in the editor.

Manage the unit-palette in the editor.

Manage the terrain-palette in the editor.

Manages all the palettes in the editor.

Note: this is a near-straight rip from the old editor.

Typedef Documentation

◆ action_stack

using editor::action_stack = typedef std::deque<std::unique_ptr<editor_action> >

Action stack typedef.

Definition at line 69 of file editor_common.hpp.

Enumeration Type Documentation



Definition at line 23 of file editor_main.hpp.

◆ menu_type


Definition at line 38 of file editor_controller.hpp.

Function Documentation

◆ get_map_location()

static std::string editor::get_map_location ( const std::string &  file_contents,
const std::string &  attr 

Definition at line 94 of file map_context.cpp.

References utils::trim().

Referenced by editor::map_context::map_context().

◆ get_selected_bg_terrain()

const t_translation::terrain_code & editor::get_selected_bg_terrain ( )

◆ get_selected_fg_terrain()

const t_translation::terrain_code & editor::get_selected_fg_terrain ( )

Definition at line 39 of file terrain_palettes.cpp.

◆ initialize_addon()

std::string editor::initialize_addon ( )

◆ is_valid_terrain()

static bool editor::is_valid_terrain ( const t_translation::terrain_code c)

◆ loc_id_comp()

static bool editor::loc_id_comp ( const std::string &  lhs,
const std::string &  rhs 

Definition at line 412 of file location_palette.cpp.

References is_positive_integer().

Referenced by editor::location_palette::add_item().

◆ start()

EXIT_STATUS editor::start ( bool  clear_id,
const std::string &  filename = "",
bool  take_screenshot = false,
const std::string &  screenshot_filename = "map_screenshot.png" 

Main interface for launching the editor from the title screen.

How the editor was exited (whether the intent was to go back to the titlescreen or quit to desktop altogether)

Definition at line 113 of file editor_main.cpp.

References e, game_config::editor, ERR_ED, EXIT_ERROR, EXIT_NORMAL, filesystem::file_exists(), editor::editor_action::get_instance_count(), h, filesystem::is_directory(), and hotkey::scope_editor.

Referenced by add_prefixes(), gui2::rich_label::add_text_with_attribute(), gui2::rich_label::add_text_with_attributes(), gui2::text_box_base::copy_selection(), wfl::builtins::DEFINE_WFL_FUNCTION(), gui2::combobox::delete_selection(), gui2::multiline_text::delete_selection(), gui2::password_box::delete_selection(), gui2::text_box::delete_selection(), events::menu_handler::do_search(), gui::textbox::draw_contents(), utf8::erase(), display::fade_to(), display::fade_tod_mask(), config::find_total_first_of(), gui2::event::dispatcher::fire(), flood_name(), variable_info_implementation::get_child_range(), editor::editor_map::get_contiguous_terrain_tiles(), display::get_fog_shroud_images(), gui2::text_box_base::handle_editing(), editor::map_context::map_context(), help::unit_topic_generator::operator()(), map_location::parse_direction(), game_launcher::play_screenshot_mode(), help::print_behavior_description(), gui2::dialogs::gamestate_inspector::model::repaginate(), savegame::savegame::save_game(), gui2::text_box_base::set_selection(), gui2::event::distributor::signal_handler_sdl_text_editing(), gui2::event::distributor::signal_handler_sdl_text_input(), game_launcher::start_editor(), gui2::event::sdl_event_handler::text_editing(), gui2::combobox::update_canvas(), gui2::multiline_text::update_canvas(), gui2::text_box::update_canvas(), and arrow::update_symbols().

◆ wrap_exc()

editor_map_load_exception editor::wrap_exc ( const char *  type,
const std::string &  e_msg,
const std::string &  filename 

Exception wrapping utility.

Definition at line 30 of file editor_map.cpp.

References wfl::msg(), VGETTEXT, and WRN_ED.

Referenced by editor::editor_map::from_string().