示例#1
0
        //constructs the toolbar with the given buttons
        private ToolBarUI()
        {
            _flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.AlwaysAutoResize;



            ToolbuttonData btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["DesComp"],
                TooltipText = "Design a new component or facility",
                OnClick     = new Action(ComponentDesignUI.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(ComponentDesignUI.GetInstance().GetActive)
                              //Opens up the component design menu
            };

            ToolButtons.Add(btn);

            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["DesShip"],
                TooltipText = "Design a new Ship",
                OnClick     = new Action(ShipDesignUI.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(ShipDesignUI.GetInstance().GetActive)
                              //Opens up the ship design menu
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Research"],
                TooltipText = "Research",
                OnClick     = new Action(ResearchWindow.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(ResearchWindow.GetInstance().GetActive)
                              //Opens up the research menu
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["GalMap"],
                TooltipText = "Galaxy Browser",
                OnClick     = new Action(GalaxyWindow.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(GalaxyWindow.GetInstance().GetActive)
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Ruler"],
                TooltipText = "Measure distance",
                OnClick     = new Action(DistanceRuler.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(DistanceRuler.GetInstance().GetActive)
                              //Opens the ruler menu
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Tree"],
                TooltipText = "View objects in the system",
                OnClick     = new Action(SystemTreeViewer.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(SystemTreeViewer.GetInstance().GetActive)
                              //Display a tree with all objects in the system
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Tree"],
                TooltipText = "Spawn ships and planets",
                OnClick     = new Action(EntitySpawnWindow.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(EntitySpawnWindow.GetInstance().GetActive),
                //Display a tree with all objects in the system
            };
            SMToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Tree"],
                TooltipText = "View SM debug info about a body",
                OnClick     = new Action(SMPannel.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(SMPannel.GetInstance().GetActive),
                //Display a list of bodies with some info about them.
            };
            SMToolButtons.Add(btn);
        }
示例#2
0
        //constructs the toolbar with the given buttons
        private ToolBarUI()
        {
            _flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoTitleBar;


            ToolbuttonData btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["DesComp"],
                TooltipText = "Design a new component or facility",
                OnClick     = new Action(ComponentDesignUI.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(ComponentDesignUI.GetInstance().GetActive)
                              //Opens up the component design menu
            };

            ToolButtons.Add(btn);

            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["DesShip"],
                TooltipText = "Design a new Ship",
                OnClick     = new Action(ShipDesignUI.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(ShipDesignUI.GetInstance().GetActive)
                              //Opens up the ship design menu
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["DesOrd"],
                TooltipText = "Design a Missile",
                OnClick     = new Action(OrdinanceDesignUI.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(OrdinanceDesignUI.GetInstance().GetActive)
                              //Opens up the ship design menu
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Research"],
                TooltipText = "Research",
                OnClick     = new Action(ResearchWindow.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(ResearchWindow.GetInstance().GetActive)
                              //Opens up the research menu
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["GalMap"],
                TooltipText = "Galaxy Browser",
                OnClick     = new Action(GalaxyWindow.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(GalaxyWindow.GetInstance().GetActive)
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Ruler"],
                TooltipText = "Measure distance",
                OnClick     = new Action(DistanceRuler.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(DistanceRuler.GetInstance().GetActive)
                              //Opens the ruler menu
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Tree"],
                TooltipText = "View objects in the system",
                OnClick     = new Action(SystemTreeViewer.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(SystemTreeViewer.GetInstance().GetActive)
                              //Display a tree with all objects in the system
            };
            ToolButtons.Add(btn);
            btn = new ToolbuttonData()
            {
                Picture     = _uiState.SDLImageDictionary["Tree"],
                TooltipText = "View objects in the system",
                OnClick     = new Action(EntitySpawnWindow.GetInstance().ToggleActive),
                GetActive   = new Func <bool>(EntitySpawnWindow.GetInstance().GetActive)
                              //Display a tree with all objects in the system
            };
            ToolButtons.Add(btn);
        }