validate addon name when first entered as well
This commit is contained in:
parent
b4f988a220
commit
07100d0759
1 changed files with 2 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "editor/controller/editor_controller.hpp"
|
||||
|
||||
#include "addon/validation.hpp"
|
||||
#include "gettext.hpp"
|
||||
#include "gui/dialogs/editor/choose_addon.hpp"
|
||||
#include "gui/dialogs/prompt.hpp"
|
||||
|
@ -45,8 +46,7 @@ std::string initialize_addon()
|
|||
std::int64_t current_millis = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
|
||||
addon_id = "MyAwesomeAddon-"+std::to_string(current_millis);
|
||||
if (gui2::dialogs::prompt::execute(addon_id_new)) {
|
||||
/* In case somebody enters a blank id and presses OK */
|
||||
addon_id = addon_id_new.empty() ? "MyAwesomeAddon-"+std::to_string(current_millis) : addon_id_new;
|
||||
addon_id = !addon_filename_legal(addon_id_new) ? "MyAwesomeAddon-"+std::to_string(current_millis) : addon_id_new;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue