Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Embedded Game over expanded bottom panel, by resetting expanded bottom panel on Play #102978

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions editor/gui/editor_bottom_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ void EditorBottomPanel::toggle_last_opened_bottom_panel() {
}
}

void EditorBottomPanel::set_expanded(bool p_expanded) {
expand_button->set_pressed(p_expanded);
}

EditorBottomPanel::EditorBottomPanel() {
item_vbox = memnew(VBoxContainer);
add_child(item_vbox);
Expand Down
1 change: 1 addition & 0 deletions editor/gui/editor_bottom_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class EditorBottomPanel : public PanelContainer {
void move_item_to_end(Control *p_item);
void hide_bottom_panel();
void toggle_last_opened_bottom_panel();
void set_expanded(bool p_expanded);

EditorBottomPanel();
};
Expand Down
3 changes: 3 additions & 0 deletions editor/plugins/game_view_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/gui/editor_bottom_panel.h"
#include "editor/gui/editor_run_bar.h"
#include "editor/plugins/embedded_process.h"
#include "editor/themes/editor_scale.h"
Expand Down Expand Up @@ -300,6 +301,8 @@ void GameView::_play_pressed() {
_update_embed_window_size();
if (!window_wrapper->get_window_enabled()) {
EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_GAME);
// Reset the normal size of the bottom panel when fully expanded.
EditorNode::get_singleton()->get_bottom_panel()->set_expanded(false);
embedded_process->grab_focus();
}
embedded_process->embed_process(current_process_id);
Expand Down