示例#1
0
 public Tab(string name, TabSelector selector, GUIComponent parent) :
     base(selector.GUI, parent)
 {
     Name       = name;
     Selector   = selector;
     OnSelected = () => { };
 }
示例#2
0
 public MagicMenu(DwarfGUI gui, GUIComponent parent, GameMaster master, WindowButtons buttons = WindowButtons.CloseButton)
     : base(gui, parent, buttons)
 {
     Master    = master;
     MinWidth  = 512;
     MinHeight = 256;
     Selector  = new TabSelector(GUI, this, 2)
     {
         WidthSizeMode  = SizeMode.Fit,
         HeightSizeMode = SizeMode.Fit,
         LocalBounds    = new Rectangle(0, 0, MinWidth, MinHeight)
     };
     SpellTriggered = spell => { };
     CreateSpellsTab();
     CreateResearchTab();
     Selector.SetTab("Known Spells");
 }
示例#3
0
        public BuildMenu(DwarfGUI gui, GUIComponent parent, GameMaster faction) :
            base(gui, parent, WindowButtons.CloseButton)
        {
            GridLayout layout = new GridLayout(GUI, this, 1, 1);

            Master   = faction;
            Selector = new TabSelector(GUI, layout, 3);
            layout.SetComponentPosition(Selector, 0, 0, 1, 1);

            SetupBuildRoomTab();
            SetupBuildItemTab();
            SetupBuildWallTab();


            Selector.SetTab("Rooms");
            MinWidth  = 512;
            MinHeight = 256;
        }
示例#4
0
        public GoodsPanel(DwarfGUI gui, GUIComponent parent, Faction faction)
            : base(gui, parent)
        {
            LocalBounds = parent.GlobalBounds;
            Faction     = faction;
            GridLayout layout = new GridLayout(GUI, this, 8, 4);

            Tabs = new TabSelector(GUI, layout, 4)
            {
                WidthSizeMode = SizeMode.Fit
            };


            layout.SetComponentPosition(Tabs, 0, 0, 4, 8);

            TotalMoney = new Label(GUI, layout, "Total Money: " + Faction.Economy.CurrentMoney.ToString("C"), GUI.DefaultFont)
            {
                ToolTip  = "Total amount of money in our treasury",
                WordWrap = true
            };

            TotalMoney.OnUpdate += TotalMoney_OnUpdate;

            layout.SetComponentPosition(TotalMoney, 3, 0, 1, 1);

            SpaceLabel = new Label(GUI, layout, "Space: " + Faction.ComputeStockpileSpace() + "/" + Faction.ComputeStockpileCapacity(), GUI.DefaultFont)
            {
                ToolTip  = "Space left in our stockpiles",
                WordWrap = true
            };

            layout.SetComponentPosition(SpaceLabel, 2, 0, 1, 1);

            SpaceLabel.OnUpdate += SpaceLabel_OnUpdate;

            layout.UpdateSizes();

            CreateBuyTab();
            CreateSellTab();
            Tabs.SetTab("Buy");
        }
示例#5
0
        public BuildMenu(DwarfGUI gui, GUIComponent parent, GameMaster faction, BuildType type) :
            base(gui, parent, WindowButtons.CloseButton)
        {
            GridLayout layout = new GridLayout(GUI, this, 1, 1);

            Master   = faction;
            Selector = new TabSelector(GUI, layout, 4);
            layout.SetComponentPosition(Selector, 0, 0, 1, 1);
            Build = type;

            if (type.HasFlag(BuildType.Room))
            {
                SetupBuildRoomTab();
            }

            if (type.HasFlag(BuildType.Item))
            {
                SetupBuildItemTab();
            }

            if (type.HasFlag(BuildType.Craft) || type.HasFlag(BuildType.Cook))
            {
                SetupBuildResourceTab();
            }

            if (type.HasFlag(BuildType.Wall))
            {
                SetupBuildWallTab();
            }


            if (Selector.Tabs.Count > 0)
            {
                Selector.SetTab(Selector.Tabs.First().Key);
            }

            MinWidth  = 512;
            MinHeight = 256;
        }