@@ -276,6 +276,7 @@ void App::renderImGui() {
276
276
renderImGuiTabBar ();
277
277
renderImGuiLeftPanel ();
278
278
renderImGuiDepthSelector ();
279
+ renderImGuiInstructions ();
279
280
ImGui::Render ();
280
281
281
282
ImGui_ImplOpenGL3_RenderDrawData (ImGui::GetDrawData ());
@@ -519,9 +520,10 @@ void App::renderImGuiDepthSelector() {
519
520
auto & world = *active_project.rendered_world ;
520
521
if (world.levels .size () > 1 ) {
521
522
auto line_height = ImGui::GetTextLineHeightWithSpacing ();
523
+ ImGui::PushStyleVar (ImGuiStyleVar_WindowPadding, {10 .f , 10 .f });
524
+ ImGui::PushStyleVar (ImGuiStyleVar_WindowRounding, 10 .f );
522
525
ImGui::SetNextWindowSize ({45 , 20 .f + static_cast <float >(world.levels .size ()) * line_height});
523
526
ImGui::SetNextWindowPos ({PANEL_WIDTH + 15 , BAR_HEIGHT + 15 });
524
- ImGui::PushStyleVar (ImGuiStyleVar_WindowPadding, {10 .f , 10 .f });
525
527
ImGui::Begin (" DepthSelector" , nullptr , imgui_window_flags);
526
528
527
529
for (auto it = world.levels .rbegin (); it != world.levels .rend (); it++) {
@@ -539,6 +541,28 @@ void App::renderImGuiDepthSelector() {
539
541
}
540
542
ImGui::End ();
541
543
ImGui::PopStyleVar ();
544
+ ImGui::PopStyleVar ();
542
545
}
543
546
}
544
547
}
548
+
549
+ void App::renderImGuiInstructions () {
550
+ if (!projectOpened ()) {
551
+ ImGui::PushStyleVar (ImGuiStyleVar_WindowRounding, 10 .f );
552
+ ImGui::SetNextWindowSize ({400 , 200 });
553
+ ImGui::SetNextWindowPos ({PANEL_WIDTH + (static_cast <float >(m_window.getSize ().x ) - PANEL_WIDTH - 400 ) / 2 ,
554
+ BAR_HEIGHT + (static_cast <float >(m_window.getSize ().y ) - BAR_HEIGHT - 200 ) / 2 });
555
+ ImGui::Begin (" Instructions" , nullptr , imgui_window_flags);
556
+ #if defined(EMSCRIPTEN)
557
+ ImGui::Pad (0 , 80 );
558
+ ImGui::TextCentered (" Drag and drop your LDtk projects" );
559
+ ImGui::TextCentered (" and all the needed assets here" );
560
+ ImGui::TextCentered (" (you can drop an entire folder)" );
561
+ #else
562
+ ImGui::Pad (0 , 90 );
563
+ ImGui::TextCentered (" Drag and drop your LDtk projects here" );
564
+ #endif
565
+ ImGui::End ();
566
+ ImGui::PopStyleVar ();
567
+ }
568
+ }
0 commit comments