16 #define GETTEXT_DOMAIN "wesnoth-editor"
34 std::string addon_id =
"";
45 if(addon_id ==
"///newaddon///") {
46 static constexpr std::string_view ts_format =
"%Y-%m-%d_%H-%M-%S";
50 std::string addon_id_new = addon_id;
52 if(gui2::dialogs::prompt::execute(addon_id_new)) {
54 addon_id = addon_id_new;
59 if(addon_id ==
"mainline") {
98 *stream <<
"#textdomain wesnoth-" << addon_id <<
"\n"
99 <<
"[textdomain]" <<
"\n"
100 <<
" name=\"wesnoth-" << addon_id <<
"\"\n"
101 <<
" path=\"data/add-ons/" << addon_id <<
"/translations\"\n"
105 <<
" path=data/add-ons/" << addon_id <<
"\n"
106 <<
"[/binary_path]\n"
108 <<
"{~add-ons/" << addon_id <<
"/scenarios}\n"
109 <<
"{~add-ons/" << addon_id <<
"/utils}\n"
112 <<
" {~add-ons/" << addon_id <<
"/units}\n"
130 editor.context_manager_->load_map_dialog(
true);
142 editor.set_button_state();
145 if (take_screenshot) {
146 editor.do_screenshot(screenshot_filename);
151 if (!take_screenshot) {
155 ERR_ED <<
"Editor exception in editor::start: " <<
e.what();
Base class for editor actions.
static int get_instance_count()
Debugging aid.
The editor_controller class contains the mouse and keyboard event handling routines for the editor.
bool show(const unsigned auto_close_time=0)
Shows the window.
lg::log_domain log_editor("editor")
Declarations for File-IO.
auto format_local_timestamp(const std::chrono::system_clock::time_point &time, std::string_view format="%F %T")
Manage the empty-palette in the editor.
EXIT_STATUS start(bool clear_id, const std::string &filename, bool take_screenshot, const std::string &screenshot_filename)
Main interface for launching the editor from the title screen.
std::string initialize_addon()
static bool file_exists(const bfs::path &fpath)
bool is_directory(const std::string &fname)
Returns true if the given file is a directory.
filesystem::scoped_ostream ostream_file(const std::string &fname, std::ios_base::openmode mode, bool create_directory)
std::unique_ptr< std::ostream > scoped_ostream
static bool create_directory_if_missing(const bfs::path &dirpath)
std::string get_addons_dir()
constexpr uint32_t scope_editor
std::string filename
Filename.
bool addon_filename_legal(const std::string &name)
Checks whether an add-on file name is legal or not.