16 #define GETTEXT_DOMAIN "wesnoth-editor"
35 std::string addon_id =
"";
46 if(addon_id ==
"///newaddon///") {
47 std::int64_t current_millis = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
48 addon_id =
"MyAwesomeAddon-"+std::to_string(current_millis);
51 if(addon_id ==
"mainline") {
90 *stream <<
"#textdomain wesnoth-" << addon_id <<
"\n"
91 <<
"[textdomain]" <<
"\n"
92 <<
" name=\"wesnoth-" << addon_id <<
"\"\n"
93 <<
" path=\"data/add-ons/" << addon_id <<
"/translations\"\n"
96 <<
"#ifdef MULTIPLAYER\n"
98 <<
" path=data/add-ons/" << addon_id <<
"\n"
101 <<
"{~add-ons/" << addon_id <<
"/scenarios}\n"
102 <<
"{~add-ons/" << addon_id <<
"/utils}\n"
105 <<
" {~add-ons/" << addon_id <<
"/units}\n"
113 EXIT_STATUS start(
bool clear_id,
const std::string& filename,
bool take_screenshot,
const std::string& screenshot_filename)
123 editor.context_manager_->set_default_dir(filename);
124 editor.context_manager_->load_map_dialog(
true);
126 editor.context_manager_->load_map(filename,
false);
137 editor.set_button_state();
140 if (take_screenshot) {
141 editor.do_screenshot(screenshot_filename);
146 if (!take_screenshot) {
150 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.
Dialog for adding a translation while editing an add-on's _server.pbl.
bool show(const unsigned auto_close_time=0)
Shows the window.
lg::log_domain log_editor("editor")
Declarations for File-IO.
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