Working multiple window support, including editor
This commit is contained in:
committed by
Juan Linietsky
parent
f51fdc6eef
commit
4758057f20
@@ -82,11 +82,11 @@ void ExportTemplateManager::_update_template_list() {
|
||||
String(VERSION_STATUS) != String("rc");
|
||||
|
||||
Label *current = memnew(Label);
|
||||
current->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
current->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
current_hb->add_child(current);
|
||||
|
||||
if (templates.has(current_version)) {
|
||||
current->add_color_override("font_color", get_color("success_color", "Editor"));
|
||||
current->add_color_override("font_color", current->get_color("success_color", "Editor"));
|
||||
|
||||
// Only display a redownload button if it can be downloaded in the first place
|
||||
if (downloads_available) {
|
||||
@@ -103,7 +103,7 @@ void ExportTemplateManager::_update_template_list() {
|
||||
uninstall->connect("pressed", callable_mp(this, &ExportTemplateManager::_uninstall_template), varray(current_version));
|
||||
|
||||
} else {
|
||||
current->add_color_override("font_color", get_color("error_color", "Editor"));
|
||||
current->add_color_override("font_color", current->get_color("error_color", "Editor"));
|
||||
Button *redownload = memnew(Button);
|
||||
redownload->set_text(TTR("Download"));
|
||||
|
||||
@@ -121,13 +121,13 @@ void ExportTemplateManager::_update_template_list() {
|
||||
|
||||
HBoxContainer *hbc = memnew(HBoxContainer);
|
||||
Label *version = memnew(Label);
|
||||
version->set_modulate(get_color("disabled_font_color", "Editor"));
|
||||
version->set_modulate(current->get_color("disabled_font_color", "Editor"));
|
||||
String text = E->get();
|
||||
if (text == current_version) {
|
||||
text += " " + TTR("(Current)");
|
||||
}
|
||||
version->set_text(text);
|
||||
version->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
version->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
hbc->add_child(version);
|
||||
|
||||
Button *uninstall = memnew(Button);
|
||||
@@ -145,7 +145,7 @@ void ExportTemplateManager::_download_template(const String &p_version) {
|
||||
while (template_list->get_child_count()) {
|
||||
memdelete(template_list->get_child(0));
|
||||
}
|
||||
template_downloader->popup_centered_minsize();
|
||||
template_downloader->popup_centered();
|
||||
template_list_state->set_text(TTR("Retrieving mirrors, please wait..."));
|
||||
template_download_progress->set_max(100);
|
||||
template_download_progress->set_value(0);
|
||||
@@ -157,7 +157,7 @@ void ExportTemplateManager::_download_template(const String &p_version) {
|
||||
void ExportTemplateManager::_uninstall_template(const String &p_version) {
|
||||
|
||||
remove_confirm->set_text(vformat(TTR("Remove template version '%s'?"), p_version));
|
||||
remove_confirm->popup_centered_minsize();
|
||||
remove_confirm->popup_centered();
|
||||
to_remove = p_version;
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||
void ExportTemplateManager::popup_manager() {
|
||||
|
||||
_update_template_list();
|
||||
popup_centered_minsize(Size2(400, 400) * EDSCALE);
|
||||
popup_centered(Size2(400, 400) * EDSCALE);
|
||||
}
|
||||
|
||||
void ExportTemplateManager::ok_pressed() {
|
||||
@@ -483,6 +483,11 @@ void ExportTemplateManager::_window_template_downloader_closed() {
|
||||
|
||||
void ExportTemplateManager::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
if (!is_visible()) {
|
||||
set_process(false);
|
||||
}
|
||||
}
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
||||
update_countdown -= get_process_delta_time();
|
||||
@@ -536,12 +541,6 @@ void ExportTemplateManager::_notification(int p_what) {
|
||||
set_process(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
if (!is_visible_in_tree()) {
|
||||
set_process(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ExportTemplateManager::can_install_android_template() {
|
||||
@@ -674,7 +673,7 @@ ExportTemplateManager::ExportTemplateManager() {
|
||||
installed_scroll->add_child(installed_vb);
|
||||
installed_scroll->set_enable_v_scroll(true);
|
||||
installed_scroll->set_enable_h_scroll(false);
|
||||
installed_vb->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
installed_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
|
||||
get_cancel()->set_text(TTR("Close"));
|
||||
get_ok()->set_text(TTR("Install From File"));
|
||||
@@ -688,7 +687,7 @@ ExportTemplateManager::ExportTemplateManager() {
|
||||
template_open->set_title(TTR("Select Template File"));
|
||||
template_open->add_filter("*.tpz ; " + TTR("Godot Export Templates"));
|
||||
template_open->set_access(FileDialog::ACCESS_FILESYSTEM);
|
||||
template_open->set_mode(FileDialog::MODE_OPEN_FILE);
|
||||
template_open->set_file_mode(FileDialog::FILE_MODE_OPEN_FILE);
|
||||
template_open->connect("file_selected", callable_mp(this, &ExportTemplateManager::_install_from_file), varray(true));
|
||||
add_child(template_open);
|
||||
|
||||
@@ -708,7 +707,7 @@ ExportTemplateManager::ExportTemplateManager() {
|
||||
template_downloader->get_ok()->set_text(TTR("Close"));
|
||||
template_downloader->set_exclusive(true);
|
||||
add_child(template_downloader);
|
||||
template_downloader->connect("popup_hide", callable_mp(this, &ExportTemplateManager::_window_template_downloader_closed));
|
||||
template_downloader->connect("cancelled", callable_mp(this, &ExportTemplateManager::_window_template_downloader_closed));
|
||||
|
||||
VBoxContainer *vbc = memnew(VBoxContainer);
|
||||
template_downloader->add_child(vbc);
|
||||
|
||||
Reference in New Issue
Block a user