Logo Search packages:      
Sourcecode: wesnoth version File versions

map_editor::map_editor Class Reference

#include <editor.hpp>

Inheritance diagram for map_editor::map_editor:

List of all members.


Detailed Description

A map editor. Receives SDL events and can execute hotkey commands.

Definition at line 33 of file editor.hpp.


Public Types

enum  ABORT_MODE { DONT_ABORT, ABORT_NORMALLY, ABORT_HARD }

Public Member Functions

virtual bool can_execute_command (hotkey::HOTKEY_COMMAND command) const
virtual void change_unit_side ()
bool changed_since_save () const
virtual void continue_move ()
virtual void create_unit ()
virtual void cycle_units ()
virtual void draw ()
virtual void edit_copy ()
virtual void edit_cut ()
virtual void edit_draw ()
virtual void edit_fill_selection ()
virtual void edit_flip ()
virtual void edit_flood_fill ()
virtual void edit_load_map ()
virtual void edit_new_map ()
virtual void edit_paste ()
virtual void edit_quit ()
virtual void edit_refresh ()
virtual void edit_resize ()
virtual void edit_revert ()
virtual void edit_save_as ()
virtual void edit_save_map ()
virtual void edit_select_all ()
virtual void edit_set_start_pos ()
virtual void edit_set_terrain ()
virtual void end_turn ()
virtual void end_unit_turn ()
virtual std::string get_action_image (hotkey::HOTKEY_COMMAND command) const
virtual ACTION_STATE get_action_state (hotkey::HOTKEY_COMMAND command) const
std::string get_menu_image (hotkey::HOTKEY_COMMAND command) const
virtual void goto_leader ()
virtual void handle_event (const SDL_Event &event)
void handle_keyboard_event (const SDL_KeyboardEvent &event, const int mousex, const int mousey)
void handle_mouse_button_event (const SDL_MouseButtonEvent &event, const int mousex, const int mousey)
virtual void label_terrain ()
virtual void load_game ()
std::string load_map (const std::string filename)
void main_loop ()
 map_editor (display &gui, gamemap &map, config &theme, config &game_config)
virtual void objectives ()
void perform_flood_fill ()
void perform_paste ()
void perform_set_starting_pos ()
virtual void preferences ()
virtual void process_event ()
virtual void process_help_string (int mousex, int mousey)
virtual void recall ()
virtual void recruit ()
virtual void redo ()
void redraw_everything ()
 Recalculate layout and redraw everything.
virtual void rename_unit ()
virtual void repeat_recruit ()
virtual bool requires_event_focus () const
virtual void save_game ()
bool save_map (const std::string filename="", const bool display_confirmation=true)
virtual void search ()
void set_abort (const ABORT_MODE abort=ABORT_NORMALLY)
void set_file_to_save_as (const std::string)
 Set the filename that map should be saved as.
virtual void show_chat_log ()
virtual void show_enemy_moves (bool)
virtual void show_help ()
virtual void show_statistics ()
virtual void speak ()
virtual void status_table ()
virtual void toggle_grid ()
virtual void toggle_shroud_updates ()
virtual void undo ()
virtual void unit_description ()
virtual void unit_list ()
virtual void update_shroud_now ()
virtual void user_command ()
virtual void volatile_draw ()
virtual void volatile_undraw ()

Private Types

enum  LEFT_BUTTON_FUNC {
  DRAW, SELECT_HEXES, FLOOD_FILL, SET_STARTING_POSITION,
  PASTE, NUM_L_BUTTON_FUNC
}
 What to perform on a left button click.
enum  LEFT_BUTTON_HELD_FUNC {
  DRAW_TERRAIN, ADD_SELECTION, REMOVE_SELECTION, MOVE_SELECTION,
  NONE
}
 What to perform while the left button is held down.

Private Member Functions

void clear_highlighted_hexes_in_gui ()
bool confirm_exit_and_save ()
void draw_on_mouseover_hexes (const gamemap::TERRAIN t)
void draw_terrain (const gamemap::TERRAIN terrain, const gamemap::location hex)
void execute_command (const hotkey::HOTKEY_COMMAND command)
std::string get_action_name (const LEFT_BUTTON_FUNC func) const
gamemap::location get_hex_with_offset (const gamemap::location loc, const int x_offset, const int y_offset)
void highlight_selected_hexes (const bool clear_old=true)
void insert_selection_in_clipboard ()
 Insert the currently selected locations in the clipboard.
void invalidate_adjacent (const gamemap::location hex)
void invalidate_all_and_adjacent (const std::set< gamemap::location > &hexes)
void invalidate_all_and_adjacent (const std::vector< gamemap::location > &hexes)
bool is_left_button_func_menu (const theme::menu &menu) const
void left_button_down (const int mousex, const int mousey)
void left_button_func_changed (const LEFT_BUTTON_FUNC func)
void left_click (const gamemap::location loc)
 Handle a left click on the location.
void middle_button_down (const int mousex, const int mousey)
void perform_selection_move ()
 Commit the movement of a selection.
void recalculate_starting_pos_labels ()
void right_button_down (const int mousex, const int mousey)
void right_click (const gamemap::location loc)
 Handle a right click on the location.
void save_undo_action (const map_undo_action &action)
void set_starting_position (const int player, const gamemap::location loc)
void show_menu (const std::vector< std::string > &items_arg, const int xloc, const int yloc, const bool context_menu=false)
 Display a menu with given items and at the given location.
void terrain_changed (const std::set< gamemap::location > &hexes, map_undo_action &undo_action)
void terrain_changed (const std::vector< gamemap::location > &hexes, map_undo_action &undo_action)
void terrain_changed (const gamemap::location &hex, map_undo_action &undo_action)
void update_l_button_palette ()
void update_mouse_over_hexes (const gamemap::location mouse_over_hex)

Private Attributes

ABORT_MODE abort_
bool all_hexes_selected_
brush_bar brush_
std::vector< clipboard_itemclipboard_
gamemap::location clipboard_offset_loc_
bool everything_dirty_
std::string filename_
config & game_config_
display & gui_
bool highlighted_locs_cleared_
const hotkey::manager hotkey_manager_
CKey key_
LEFT_BUTTON_HELD_FUNC l_button_held_func_
bool l_button_palette_dirty_
gamemap & map_
bool map_dirty_
bool mouse_moved_
std::set< gamemap::location > mouse_over_hexes_
terrain_palette palette_
const preferences::display_manager prefs_disp_manager_
gamemap::location selected_hex_
std::set< gamemap::location > selected_hexes_
gamemap::location selection_move_start_
size_specs size_specs_
std::vector< gamemap::location > starting_positions_
config & theme_

Static Private Attributes

static bool first_time_created_ = true
static config hotkeys_
static LEFT_BUTTON_FUNC l_button_func_ = PASTE
static int num_operations_since_save_ = 0
static gamemap::TERRAIN old_bg_terrain_
static int old_brush_size_
static gamemap::TERRAIN old_fg_terrain_
static config prefs_

Classes

struct  clipboard_item
struct  load_map_exception
 Exception thrown when the loading of a map failed. More...
struct  new_map_exception
 Exception thrown when new map is to be loaded. More...

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index