16 #define GETTEXT_DOMAIN "wesnoth-editor"
62 static std::vector<std::string> saved_windows_;
71 , mouse_handler_base()
80 , floating_label_manager_(nullptr)
81 , help_manager_(nullptr)
123 const std::string& schedule_id = schedule[
"id"];
125 const std::string& schedule_name = schedule[
"name"].empty() ? schedule[
"id"] : schedule[
"name"];
126 if (schedule_id.empty()) {
127 ERR_ED <<
"Missing ID attribute in a TOD Schedule.";
132 if (times ==
tods_.end()) {
133 std::pair<tods_map::iterator, bool> new_times =
134 tods_.emplace(schedule_id, std::pair(schedule_name, std::vector<time_of_day>()));
135 times = new_times.first;
137 ERR_ED <<
"Duplicate TOD Schedule identifiers.";
142 times->second.second.emplace_back(time);
148 ERR_ED <<
"No editor time-of-day defined";
154 const std::string tag_name =
"editor_music";
155 if (
game_config.child_range(tag_name).size() == 0) {
156 ERR_ED <<
"No editor music defined";
163 WRN_ED <<
"Music track " << track.
id() <<
" not found.";
202 ERR_ED <<
"Screenshot creation failed!";
211 std::string modified;
216 message =
_(
"Do you really want to quit?");
218 message =
_(
"Do you really want to quit? Changes to this map since the last save will be lost.");
220 message =
_(
"Do you really want to quit? The following maps were modified and all changes since the last save will be lost:");
221 message +=
"\n" + modified;
229 if (unit_dlg.
show()) {
242 std::vector<time_of_day> prev_schedule = manager.
times();
249 std::function<void(std::vector<time_of_day>)> update_func(
253 std::placeholders::_1));
257 static constexpr std::string_view ts_format =
"%Y-%m-%d_%H-%M-%S";
267 std::vector<time_of_day> schedule = tod_dlg.
get_schedule();
268 if(!gui2::dialogs::tod_new_schedule::execute(sch_id, sch_name)) {
275 if (sch_id.empty()) {
281 for (
auto map_elem :
tods_) {
282 if (sch_id == map_elem.first) {
288 tods_.emplace(sch_id, std::pair(sch_name, schedule));
313 unsigned i =
static_cast<unsigned>(
index);
317 if (i < context_manager_->open_maps()) {
339 return toolkit_->get_palette_manager()->can_scroll_up();
341 return toolkit_->get_palette_manager()->can_scroll_down();
343 return !
gui_->zoom_at_max();
345 return !
gui_->zoom_at_min();
445 return toolkit_->get_palette_manager()->active_palette().supports_swap();
570 return context_manager_->is_active_transitions_hotkey(
"editor-auto-update-transitions")
573 return context_manager_->is_active_transitions_hotkey(
"editor-partial-update-transitions")
576 return context_manager_->is_active_transitions_hotkey(
"editor-no-update-transitions")
643 return static_cast<std::size_t
>(
index) ==
gui_->playing_team_index()
657 tods_map::const_iterator it =
tods_.begin();
658 std::advance(it,
index);
659 const std::vector<time_of_day>& times1 = it->second.second;
665 tods_map::const_iterator it =
tods_.begin();
666 std::advance(it,
index);
667 const std::vector<time_of_day>& times1 = it->second.second;
681 return command_executor::get_action_state(cmd);
694 return command_executor::do_execute_command(cmd, press, release);
702 unsigned i =
static_cast<unsigned>(
index);
703 if (i < context_manager_->
size()) {
719 gui_->set_viewing_team_index(
index,
true);
721 toolkit_->get_palette_manager()->draw_contents();
726 const std::set<map_location>& area =
729 gui_->scroll_to_tiles({ area.begin(), area.end() });
750 std::vector<config> items;
751 items.emplace_back(
"id",
"editor-playlist");
752 std::shared_ptr<gui::button>
b =
gui_->find_menu_button(
"menu-playlist");
753 show_menu(items,
b->location().x +1,
b->location().y +
b->height() +1,
false, *
gui_);
759 std::advance(iter,
index);
768 std::advance(iter,
index);
777 un->anim_comp().set_standing();
786 gui_->set_zoom(
true);
791 gui_->set_zoom(
false);
796 gui_->toggle_default_zoom();
810 toolkit_->get_palette_manager()->scroll_up();
813 toolkit_->get_palette_manager()->scroll_down();
837 toolkit_->get_palette_manager()->active_palette().swap();
857 toolkit_->hotkey_set_mouse_action(command);
889 std::string filepath = dlg.
path();
919 bool unrenamable = un->unrenamable();
920 un->set_unrenamable(!unrenamable);
927 bool canrecruit = un->can_recruit();
928 un->set_can_recruit(!canrecruit);
929 un->anim_comp().set_standing();
936 bool loyal = un->loyal();
937 un->set_loyal(!loyal);
947 toolkit_->hotkey_set_mouse_action(command);
953 toolkit_->update_mouse_action_highlights();
957 toolkit_->update_mouse_action_highlights();
961 toolkit_->update_mouse_action_highlights();
965 toolkit_->update_mouse_action_highlights();
1090 toolkit_->get_palette_manager()->location_palette_->add_item(std::to_string(new_side_num));
1096 gui_->set_viewing_team_index(0,
true);
1097 gui_->set_playing_team_index(0);
1147 prefs::get().set_editor_help_text_shown(
gui().help_string_enabled());
1186 std::vector<config> items;
1187 for(
const auto&
c : items_arg) {
1188 const std::string&
id =
c[
"id"];
1195 items.emplace_back(
"id",
id);
1205 const std::string& first_id = items.front()[
"id"];
1207 if(first_id ==
"EDITOR-LOAD-MRU-PLACEHOLDER") {
1212 if(first_id ==
"editor-switch-map") {
1217 if(first_id ==
"editor-palette-groups") {
1219 toolkit_->get_palette_manager()->active_palette().expand_palette_groups_menu(items, 0);
1222 if(first_id ==
"editor-switch-side") {
1227 if(first_id ==
"editor-switch-area") {
1232 if(first_id ==
"editor-pbl") {
1236 if(!items.empty() && items.front()[
"id"] ==
"editor-switch-time") {
1241 if(first_id ==
"editor-assign-local-time") {
1246 if(first_id ==
"menu-unit-facings") {
1248 auto pos = items.erase(items.begin());
1255 if(first_id ==
"editor-playlist") {
1257 auto pos = items.erase(items.begin());
1259 return config {
"label", track.title().empty() ? track.id() : track.title()};
1263 if(first_id ==
"editor-assign-schedule") {
1265 auto pos = items.erase(items.begin());
1267 return config {
"label", tod.second.first};
1271 if(first_id ==
"editor-assign-local-schedule") {
1273 auto pos = items.erase(items.begin());
1275 return config {
"label", tod.second.first};
1284 gui_->clear_help_string();
1285 gui2::dialogs::preferences_dialog::display();
1287 gui_->queue_rerender();
1293 gui_->invalidate_all();
1301 if(un != units.
end()) {
1323 const std::string title(
N_(
"Change Unit ID"));
1324 const std::string
label(
N_(
"ID:"));
1326 if(un != units.
end()) {
1327 std::string
id = un->id();
1328 if (gui2::dialogs::edit_text::execute(title,
label,
id)) {
1340 const std::string title(
N_(
"Rename Unit"));
1341 const std::string
label(
N_(
"Name:"));
1343 if(un != units.
end()) {
1344 std::string name = un->name();
1345 if(gui2::dialogs::edit_text::execute(title,
label, name)) {
1358 if(
i->side() !=
gui().viewing_team().side()) {
1366 if (unit_dlg->show() && unit_dlg->is_selected()) {
1393 std::stringstream ssx, ssy;
1396 ssx <<
"x = " <<
i->wml_x();
1397 ssy <<
"y = " <<
i->wml_y();
1400 ssx <<
", " <<
i->wml_x();
1401 ssy <<
", " <<
i->wml_y();
1404 ssx <<
"\n" << ssy.str() <<
"\n";
1451 if (mouse_handler_base::mouse_motion_default(x, y,
update))
return;
1454 std::unique_ptr<editor_action> a;
1500 toolkit_->clear_mouseover_overlay();
1501 if (mouse_handler_base::left_click(x, y, browse))
1504 LOG_ED <<
"Left click, after generic handling";
1509 LOG_ED <<
"Left click action " << hex_clicked;
1538 toolkit_->clear_mouseover_overlay();
1539 if (mouse_handler_base::right_click(x, y, browse))
return true;
1540 LOG_ED <<
"Right click, after generic handling";
1543 LOG_ED <<
"Right click action " << hex_clicked;
1561 mouse_handler_base::right_mouse_up(x, y, browse);
1615 return toolkit_->get_palette_manager()->active_palette().action_pressed();
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(config_key_type key)
void set_scroll_up(bool on)
void set_scroll_left(bool on)
virtual bool in_context_menu(const hotkey::ui_command &cmd) const
void set_scroll_right(bool on)
const game_config_view & game_config_
void set_scroll_down(bool on)
virtual void play_slice()
virtual const unit_map & units() const =0
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
void toggle_debug_flag(DEBUG_FLAG flag)
void change_display_context(const display_context *dc)
virtual void highlight_hex(map_location hex)
void add_redraw_observer(const std::function< void(display &)> &f)
Adds a redraw observer, a function object to be called when a full rerender is queued.
@ DEBUG_COORDINATES
Overlays x,y coords on tiles.
@ DEBUG_NUM_BITMAPS
Overlays number of bitmaps on tiles.
@ DEBUG_TERRAIN_CODES
Overlays terrain codes on tiles.
void scroll_to_tile(const map_location &loc, SCROLL_TYPE scroll_type=ONSCREEN, bool check_fogged=true, bool force=true)
Scroll such that location loc is on-screen.
void invalidate_all()
Function to invalidate all tiles.
surface screenshot(bool map_screenshot=false)
Capture a (map-)screenshot into a surface.
const display_context & context() const
void queue_rerender()
Marks everything for rendering including all tiles and sidebar.
void set_debug_flag(DEBUG_FLAG flag, bool value)
const map_location & mouseover_hex() const
map_location hex_clicked_on(int x, int y) const
given x,y co-ordinates of an onscreen pixel, will return the location of the hex that this pixel corr...
virtual void select_hex(map_location hex)
Container action wrapping several actions into one.
Paint the same terrain on a number of locations on the map.
Randomize terrain in an area.
The editor_controller class contains the mouse and keyboard event handling routines for the editor.
const std::unique_ptr< context_manager > context_manager_
void preferences() override
Show the preferences dialog.
void refresh_image_cache()
Reload images.
void rename_unit() override
void right_drag_end(int x, int y, const bool browse) override
Called whenever the right mouse drag has "ended".
void unit_editor_dialog()
Show Unit Editor dialog.
bool can_execute_command(const hotkey::ui_command &command) const override
command_executor override
bool quit_confirm()
Show a quit confirmation dialog and returns true if the user pressed 'yes'.
void unit_list() override
void update_map_schedule(const std::vector< time_of_day > &schedule)
Updates schedule and the map display.
void scroll_up(bool on) override
Handle hotkeys to scroll map.
void cut_selection()
Cut the selection from the current map to the clipboard.
void display_redraw_callback(display &)
Callback function passed to display to be called on queue_rerender.
std::unique_ptr< font::floating_label_context > floating_label_manager_
void show_menu(const std::vector< config > &items_arg, int xloc, int yloc, bool context_menu, display &disp) override
controller_base override
void undo() override
Undos an action in the current map context.
void left_mouse_up(int x, int y, const bool browse) override
Called when the left mouse button is up.
bool left_click(int x, int y, const bool browse) override
Overridden in derived classes, called on a left click (mousedown).
bool allow_mouse_wheel_scroll(int x, int y) override
Derived classes can override this to disable mousewheel scrolling under some circumstances,...
void touch_motion(int x, int y, const bool browse, bool update=false, map_location new_loc=map_location::null_location()) override
void unit_description() override
virtual std::vector< std::string > additional_actions_pressed() override
void perform_refresh_delete(std::unique_ptr< editor_action > action, bool drag_part=false)
Peform an action on the current map_context, then refresh the display and delete the pointer.
void init_tods(const game_config_view &game_config)
init the available time-of-day settings
bool initialize_addon()
Initialize an addon if the addon id is empty.
const mouse_action & get_mouse_action() const
Get the current mouse action.
void status_table() override
map_context & get_current_map_context() const
std::unique_ptr< editor_toolkit > toolkit_
void scroll_right(bool on) override
void init_music(const game_config_view &game_config)
init background music for the editor
const std::unique_ptr< editor_display > gui_
The display object used and owned by the editor.
bool do_execute_command(const hotkey::ui_command &command, bool press=true, bool release=false) override
command_executor override
void export_selection_coords()
Export the WML-compatible list of selected tiles to the system clipboard.
void redo() override
Redos an action in the current map context.
editor_display & gui() override
Reference to the used display objects.
hotkey::ACTION_STATE get_action_state(const hotkey::ui_command &command) const override
command_executor override
void perform_delete(std::unique_ptr< editor_action > action)
Perform an action, then delete the action object.
void right_mouse_up(int x, int y, const bool browse) override
Called when the right mouse button is up.
virtual hotkey::command_executor * get_hotkey_command_executor() override
Optionally get a command executor to handle context menu events.
void mouse_motion(int x, int y, const bool browse, bool update, map_location new_loc=map_location::null_location()) override
Called when a mouse motion event takes place.
EXIT_STATUS main_loop()
Editor main loop.
editor_controller(const editor_controller &)=delete
void custom_tods_dialog()
Display the settings dialog, used to control e.g.
void do_screenshot(const std::string &screenshot_filename="map_screenshot.png")
Takes a screenshot.
void toggle_grid() override
Grid toggle.
void scroll_left(bool on) override
bool right_click(int x, int y, const bool browse) override
Overridden in derived classes, called on a right click (mousedown).
void save_area()
Save the current selection to the active area.
void process_keyup_event(const SDL_Event &event) override
Process keyup (always).
void copy_selection()
Copy the selection on the current map to the clipboard.
void show_help() override
void init_gui()
init the display object and general set-up
std::unique_ptr< help::help_manager > help_manager_
std::vector< sound::music_track > music_tracks_
bool right_click_show_menu(int x, int y, const bool browse) override
Called in the default right_click when the context menu is about to be shown, can be used for preproc...
editor::menu_type active_menu_
static std::string current_addon_id_
void add_area()
Add a new area to the current context, filled with the selection if any.
void terrain_description() override
void scroll_down(bool on) override
void left_drag_end(int x, int y, const bool browse) override
Called whenever the left mouse drag has "ended".
bool do_quit_
Quit main loop flag.
void save_map() override
Save the map, open dialog if not named yet.
void set_help_string_enabled(bool value)
Sets whether the help text should be shown.
bool everything_selected() const
const std::set< map_location > & selection() const
Return the selection set.
List of starting locations and location ids.
const std::string & selected_item() const
Return the currently selected item.
void save_area(const std::set< map_location > &area)
void new_area(const std::set< map_location > &area)
void perform_partial_action(const editor_action &action)
Performs a partial action, assumes that the top undo action has been modified to maintain coherent st...
void remove_side()
removes the last side from the scenario
void set_active_area(int index)
virtual const unit_map & units() const override
Const units accessor.
void set_local_starting_time(int time)
int get_active_area() const
void new_side()
Adds a new side to the map.
editor_action * last_undo_action()
void redo()
Re-does a previously undid action, and puts it back in the undo stack.
void set_starting_time(int time)
bool select_area(int index)
Select the nth tod area.
void perform_action(const editor_action &action)
Performs an action (thus modifying the map).
void undo()
Un-does the last action, and puts it in the redo stack for a possible redo.
void replace_schedule(const std::vector< time_of_day > &schedule)
bool is_in_playlist(std::string track_id)
void remove_area(int index)
void replace_local_schedule(const std::vector< time_of_day > &schedule)
Replace the [time]s of the currently active area.
const tod_manager * get_time_manager() const
void partial_undo()
Un-does a single step from a undo action chain.
virtual const editor_map & map() const override
Const map accessor.
void add_to_playlist(const sound::music_track &track)
const std::string & get_filename() const
void set_starting_position_labels(display &disp)
map_labels & get_labels()
virtual const std::vector< team > & teams() const override
Const teams accessor.
void save_schedule(const std::string &schedule_id, const std::string &schedule_name)
Save custom time of day schedule in the utils directory.
A map fragment – a collection of locations and information abut them.
virtual std::unique_ptr< editor_action > click_left(editor_display &disp, int x, int y)=0
A click, possibly the beginning of a drag.
virtual std::unique_ptr< editor_action > click_right(editor_display &disp, int x, int y)=0
A click, possibly the beginning of a drag.
virtual std::unique_ptr< editor_action > drag_end_right(editor_display &disp, int x, int y)
virtual bool has_context_menu() const
virtual std::unique_ptr< editor_action > up_left(editor_display &disp, int x, int y)
virtual void move(editor_display &disp, const map_location &hex)
Mouse move (not a drag).
virtual std::unique_ptr< editor_action > up_right(editor_display &disp, int x, int y)
virtual std::unique_ptr< editor_action > key_event(editor_display &disp, const SDL_Event &e)
Function called by the controller on a key event for the current mouse action.
virtual std::unique_ptr< editor_action > drag_left(editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
Drag operation.
virtual std::unique_ptr< editor_action > drag_right(editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
Drag operation.
virtual bool supports_brushes() const
Whether we need the brush bar, is used to grey it out.
virtual std::unique_ptr< editor_action > drag_end_left(editor_display &disp, int x, int y)
The end of dragging.
bool dragging_right_
RMB drag init flag.
bool dragging_left_
LMB drag init flag.
map_location drag_from_hex_
Drag start or mouse-down map location.
A class grating read only view to a vector of config objects, viewed as one config with all children ...
bool on_board_with_border(const map_location &loc) const
const terrain_type & get_terrain_info(const t_translation::terrain_code &terrain) const
const std::vector< time_of_day > get_schedule()
Return current schedule.
void register_callback(std::function< void(std::vector< time_of_day >)>)
Register callback for update.
Dialog that allows user to create custom unit types.
void write()
Write the cfg file.
file_dialog & set_path(const std::string &value)
Sets the initial file selection.
file_dialog & set_title(const std::string &value)
Sets the current dialog title text.
std::string path() const
Gets the current file selection.
@ auto_close
Enables auto close.
bool show(const unsigned auto_close_time=0)
Shows the window.
static std::unique_ptr< units_dialog > build_unit_list_dialog(std::vector< unit_const_ptr > &units_list)
virtual bool do_execute_command(const hotkey::ui_command &command, bool press=true, bool release=false)
void recalculate_labels()
Implements a quit confirmation dialog.
static bool show_prompt(const std::string &message)
static bool quit()
Shows the quit confirmation if needed.
static void quit_to_desktop()
Internal representation of music tracks.
const std::string & file_path() const
const std::string & id() const
const std::vector< time_of_day > & times(const map_location &loc=map_location::null_location()) const
std::vector< std::string > get_area_ids() const
const std::set< map_location > & get_area_by_index(int index) const
int get_current_time(const map_location &loc=map_location::null_location()) const
int get_current_area_time(int index) const
Container associating units to locations.
unit_iterator find(std::size_t id)
static std::string _(const char *str)
std::string label
What to show in the filter's drop-down list.
auto format_local_timestamp(const std::chrono::system_clock::time_point &time, std::string_view format="%F %T")
void set(CURSOR_TYPE type)
Use the default parameter to reset cursors.
void copy_to_clipboard(const std::string &text)
Copies text to the clipboard.
bool open_object([[maybe_unused]] const std::string &path_or_url)
constexpr bool open_object_is_supported()
Returns whether open_object() is supported/implemented for the current platform.
Manage the empty-palette in the editor.
const t_translation::terrain_code & get_selected_bg_terrain()
std::string initialize_addon()
bool is_cfg(const std::string &filename)
Returns true if the file ends with the wmlfile extension.
bool is_map(const std::string &filename)
Returns true if the file ends with the mapfile extension.
std::string get_current_editor_dir(const std::string &addon_id)
Game configuration data as global variables.
void show_transient_message(const std::string &title, const std::string &message, const std::string &image, const bool message_use_markup, const bool title_use_markup)
Shows a transient message to the user.
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
void show_message(const std::string &title, const std::string &msg, const std::string &button_caption, const bool auto_close, const bool message_use_markup, const bool title_use_markup)
Shows a message to the user.
void show_help(const std::string &show_topic)
Open the help browser, show topic with id show_topic.
void show_terrain_description(const terrain_type &t)
void show_unit_description(const unit &u)
Keyboard shortcuts for game actions.
const hotkey_command & get_hotkey_command(const std::string &command)
returns the hotkey_command with the given name
@ HOTKEY_EDITOR_TOOL_VILLAGE
@ HOTKEY_MINIMAP_DRAW_VILLAGES
@ HOTKEY_EDITOR_BRUSH_NW_SE
@ HOTKEY_EDITOR_SELECT_NONE
@ HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW
@ HOTKEY_EDITOR_PALETTE_GROUPS
@ HOTKEY_TERRAIN_DESCRIPTION
@ HOTKEY_EDITOR_PALETTE_UPSCROLL
@ HOTKEY_EDITOR_SIDE_REMOVE
@ HOTKEY_EDITOR_BRUSH_NEXT
@ HOTKEY_EDITOR_TOOL_LABEL
@ HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW
@ HOTKEY_EDITOR_CLIPBOARD_PASTE
@ HOTKEY_EDITOR_PARTIAL_UNDO
@ HOTKEY_EDITOR_UNIT_TOGGLE_CANRECRUIT
@ HOTKEY_EDITOR_PALETTE_ITEM_SWAP
@ HOTKEY_EDITOR_TOOL_PAINT
@ HOTKEY_EDITOR_MAP_CLOSE
@ HOTKEY_EDITOR_MAP_GENERATE
@ HOTKEY_EDITOR_SELECTION_FLIP
@ HOTKEY_EDITOR_TOOL_FILL
@ HOTKEY_EDITOR_SCENARIO_SAVE_AS
@ HOTKEY_EDITOR_MAP_SAVE_AS
@ HOTKEY_UNIT_DESCRIPTION
@ HOTKEY_EDITOR_SELECT_ALL
@ HOTKEY_EDITOR_DRAW_COORDINATES
@ HOTKEY_EDITOR_TOOL_NEXT
@ HOTKEY_EDITOR_SELECTION_EXPORT
@ HOTKEY_EDITOR_PARTIAL_UPDATE_TRANSITIONS
@ HOTKEY_EDITOR_MAP_CREATE_MASK_TO
@ HOTKEY_EDITOR_SELECTION_CUT
@ HOTKEY_EDITOR_UNIT_CHANGE_ID
@ HOTKEY_MINIMAP_DRAW_TERRAIN
@ HOTKEY_EDITOR_DRAW_NUM_OF_BITMAPS
@ HOTKEY_EDITOR_BRUSH_SW_NE
@ HOTKEY_EDITOR_TOOL_UNIT
@ HOTKEY_EDITOR_HELP_TEXT_SHOWN
@ HOTKEY_EDITOR_CHANGE_ADDON_ID
@ HOTKEY_EDITOR_CUSTOM_TODS
@ HOTKEY_EDITOR_REFRESH_IMAGE_CACHE
@ HOTKEY_EDITOR_SELECTION_FILL
@ HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL
@ HOTKEY_EDITOR_MAP_SAVE_ALL
@ HOTKEY_EDITOR_SELECTION_ROTATE
@ HOTKEY_EDITOR_TOOL_STARTING_POSITION
@ HOTKEY_MINIMAP_CODING_TERRAIN
@ HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS
@ HOTKEY_EDITOR_SELECTION_COPY
@ HOTKEY_MINIMAP_DRAW_UNITS
@ HOTKEY_EDITOR_PALETTE_DOWNSCROLL
@ HOTKEY_EDITOR_UNIT_TOGGLE_LOYAL
@ HOTKEY_EDITOR_MAP_APPLY_MASK
@ HOTKEY_EDITOR_LOCAL_TIME
@ HOTKEY_EDITOR_UNIT_FACING
@ HOTKEY_EDITOR_EDIT_UNIT
@ HOTKEY_EDITOR_SELECTION_RANDOMIZE
@ HOTKEY_EDITOR_SCENARIO_NEW
@ HOTKEY_EDITOR_MAP_SWITCH
@ HOTKEY_EDITOR_SELECT_INVERSE
@ HOTKEY_EDITOR_TOGGLE_TRANSITIONS
@ HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS
@ HOTKEY_EDITOR_AREA_RENAME
@ HOTKEY_EDITOR_MAP_RESIZE
@ HOTKEY_EDITOR_DRAW_TERRAIN_CODES
@ HOTKEY_EDITOR_MAP_TO_SCENARIO
@ HOTKEY_EDITOR_AREA_REMOVE
@ HOTKEY_EDITOR_UPDATE_TRANSITIONS
@ HOTKEY_EDITOR_TOOL_SELECT
@ HOTKEY_EDITOR_AREA_SAVE
@ HOTKEY_EDITOR_REMOVE_LOCATION
@ HOTKEY_EDITOR_SIDE_EDIT
@ HOTKEY_EDITOR_SELECT_ADDON
@ HOTKEY_EDITOR_TOOL_ITEM
@ TITLE_SCREEN__RELOAD_WML
@ HOTKEY_EDITOR_UNIT_TOGGLE_RENAMEABLE
@ HOTKEY_EDITOR_SCENARIO_EDIT
@ HOTKEY_EDITOR_OPEN_ADDON
@ HOTKEY_EDITOR_MAP_REVERT
@ HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL
@ HOTKEY_MINIMAP_CODING_UNIT
void flush_cache()
Purges all image caches.
save_result save_image(const locator &i_locator, const std::string &filename)
int show_menu(lua_State *L)
Displays a popup menu at the current mouse position Best used from a [set_menu_item],...
Unit and team statistics.
::tod_manager * tod_manager
game_classification * classification
filter_context * filter_con
uint32_t get_mouse_button_mask()
Returns the current mouse button mask.
void play_music_once(const std::string &file)
std::size_t size(std::string_view str)
Length in characters of a UTF-8 string.
std::size_t index(std::string_view str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
std::string::const_iterator iterator
Desktop environment interaction functions.
@ partial
There are still moves and/or attacks possible, but the unit doesn't fit in the "unmoved" status.
structure which will hide all current floating labels, and cause floating labels instantiated after i...
The help implementation caches data parsed from the game_config.
Used as the main paramneter for can_execute_command/do_execute_command These functions are used to ex...
hotkey::HOTKEY_COMMAND hotkey_command
The hotkey::HOTKEY_COMMAND associated with this action, HOTKEY_NULL for actions that don't allow hotk...
int index
When this action was the result of a menu click, this is the index of the clicked item in the menu.
Encapsulates the map of the game.
direction
Valid directions which can be moved in our hexagonal world.
static std::string write_translated_direction(direction dir)
Helper class, don't construct this directly.
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...