532{
533
534 bool open_host_gametable = false;
535 bool open_manage_gametable = false;
536 bool connect_to_gametable = false;
537 bool close_current_gametable = false;
538
539 bool open_network_center = false;
540 bool open_username_change = false;
541
542 bool open_create_board = false;
543 bool close_current_board = false;
544 bool load_active_board = false;
545
546 bool open_remove_assets = false;
547
548 bool about = false;
549 bool guide = false;
550
551 ImGui::BeginMainMenuBar();
552
553
554 if (ImGui::BeginMenu("Game Table"))
555 {
556 if (ImGui::MenuItem("Host..."))
557 {
558 open_host_gametable = true;
559 }
560 if (ImGui::MenuItem("Connect..."))
561 {
562 connect_to_gametable = true;
563 }
564 if (ImGui::MenuItem("Manage..."))
565 {
566 open_manage_gametable = true;
567 }
568
570 {
571 if (ImGui::MenuItem("Save"))
572 {
574 }
575 if (ImGui::MenuItem("Close"))
576 {
577 close_current_gametable = true;
578 }
579 }
580 ImGui::EndMenu();
581 }
583
584 if (showNetwork)
585 {
586 if (ImGui::BeginMenu("Network"))
587 {
588 if (ImGui::MenuItem("Network Center"))
589 {
590 open_network_center = true;
591 }
592
593 if (ImGui::MenuItem("Change Username"))
594 {
595 open_username_change = true;
596 }
597 ImGui::EndMenu();
598 }
599 }
600
601
603 {
604 if (ImGui::BeginMenu("Board"))
605 {
606 if (ImGui::MenuItem("Create"))
607 {
608 open_create_board = true;
609 }
610 if (ImGui::MenuItem("Open"))
611 {
612 load_active_board = true;
613 }
615 {
616 if (ImGui::MenuItem("Save"))
617 {
620 }
621 if (ImGui::MenuItem("Close"))
622 {
623 close_current_board = true;
624 }
625 }
626
627 ImGui::EndMenu();
628 }
629 }
630 if (ImGui::BeginMenu("Notes"))
631 {
633 if (ImGui::MenuItem("Note Editor", nullptr, vis))
634 {
636 }
637 ImGui::EndMenu();
638 }
639 if (ImGui::BeginMenu("Assets"))
640 {
641 if (ImGui::MenuItem("Add Marker (from file)"))
642 {
643 std::vector<std::filesystem::path> dst;
644 std::string err;
646 {
647
648 std::cerr << "Import marker failed: " << err << "\n";
650 }
651 else
652 {
654 }
655 }
656 if (ImGui::MenuItem("Add Map (from file)"))
657 {
658 std::vector<std::filesystem::path> dst;
659 std::string err;
661 {
662
663 std::cerr << "Import map failed: " << err << "\n";
665 }
666 else
667 {
669 }
670 }
671 if (ImGui::MenuItem("Remove Assets..."))
672 {
673 open_remove_assets = true;
674 }
675 ImGui::EndMenu();
676 }
677
678 if (ImGui::BeginMenu("Help"))
679 {
680 if (ImGui::MenuItem("Guide"))
681 {
682 guide = true;
683 }
684
685 if (ImGui::MenuItem("About"))
686 {
687 about = true;
688 }
689
691 if (ImGui::MenuItem("Console", nullptr, vis))
692 {
694 }
695
696 ImGui::EndMenu();
697 }
698
699 ImGui::EndMainMenuBar();
700
701
702
703 if (open_remove_assets)
704 ImGui::OpenPopup("DeleteAssets");
705 if (ImGui::IsPopupOpen("DeleteAssets"))
707
708 if (open_host_gametable)
709 ImGui::OpenPopup("Host GameTable");
710 if (ImGui::IsPopupOpen("Host GameTable"))
712
713 if (open_manage_gametable)
714 ImGui::OpenPopup("Manage GameTables");
715 if (ImGui::IsPopupOpen("Manage GameTables"))
717
718 if (connect_to_gametable)
719 ImGui::OpenPopup("ConnectToGameTable");
720 if (ImGui::IsPopupOpen("ConnectToGameTable"))
722
723 if (close_current_gametable)
724 ImGui::OpenPopup("CloseGameTable");
725 if (ImGui::IsPopupOpen("CloseGameTable"))
727
728 if (open_network_center)
729 ImGui::OpenPopup("Network Center");
730 if (ImGui::IsPopupOpen("Network Center"))
732
733 if (open_username_change)
734 ImGui::OpenPopup("Change Username");
735 if (ImGui::IsPopupOpen("Change Username"))
737
738 if (open_create_board)
739 ImGui::OpenPopup("CreateBoard");
740 if (ImGui::IsPopupOpen("CreateBoard"))
742
743 if (load_active_board)
744 ImGui::OpenPopup("LoadBoard");
745 if (ImGui::IsPopupOpen("LoadBoard"))
747
748 if (close_current_board)
749 ImGui::OpenPopup("CloseBoard");
750 if (ImGui::IsPopupOpen("CloseBoard"))
752
753 if (guide)
754 ImGui::OpenPopup("Guide");
755 if (ImGui::IsPopupOpen("Guide"))
757
758 if (about)
759 ImGui::OpenPopup("About");
760 if (ImGui::IsPopupOpen("About"))
762}
static void setVisible(bool v)
void openDeleteAssetPopUp(std::weak_ptr< ImGuiToaster > toaster_)
bool importManyFromPicker(AssetKind kind, std::vector< std::filesystem::path > *outDsts=nullptr, std::string *outError=nullptr)