MCPcopy Create free account
hub / github.com/Illation/ETEngine / QueryStartScene

Method QueryStartScene

Engine/source/EtEditor/Util/EditorConfig.cpp:53–76  ·  view source on GitHub ↗

--------------------------------- EditorConfig::QueryStartScene Let the user decide what scene to boot into

Source from the content-addressed store, hash-verified

51// Let the user decide what scene to boot into
52//
53void EditorConfig::QueryStartScene()
54{
55 ResourceChooserDialog* resourceDialog = ResourceChooserDialog::create(std::vector<rttr::type>({rttr::type::get<fw::SceneDescriptorAsset>()}));
56 resourceDialog->set_title("Please select a Scene...");
57
58 resourceDialog->signal_hide().connect([resourceDialog]() -> void { delete resourceDialog; });
59
60 int32 const response = resourceDialog->run();
61 if (response == Gtk::ResponseType::RESPONSE_ACCEPT)
62 {
63 ET_ASSERT(!(resourceDialog->GetSelectedAssets().empty()));
64
65 core::I_Asset* const selectedAsset = resourceDialog->GetSelectedAssets()[0];
66 ET_ASSERT(selectedAsset->GetType() == rttr::type::get<fw::SceneDescriptor>());
67
68 m_StartScene = selectedAsset->GetId();
69 }
70 else
71 {
72 m_StartScene.Reset();
73 }
74
75 resourceDialog->hide();
76}
77
78
79} // namespace edit

Callers 1

InitializeUtilitiesMethod · 0.80

Calls 3

GetTypeMethod · 0.45
GetIdMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected