Exemple #1
0
        public SidebarWidget(IngameUiWidget ingameUi)
        {
            IngameUi = ingameUi;
            Id       = "KKND_SIDEBAR";

            Buttons = new Animation(IngameUi.World, "icon-" + IngameUi.World.LocalPlayer.Faction.InternalName);
            Font    = new Animation(IngameUi.World, "font");

            ChromeMetrics.TryGet("ButtonArea-" + IngameUi.World.LocalPlayer.Faction.InternalName, out ButtonArea);

            AddChild(new ProductionCategoryButtonWidget(this, 0, new[] { "infantry" }, "Infantry"));
            AddChild(new ProductionCategoryButtonWidget(this, 1, new[] { "vehicle", "beast" }, "Vehicles"));
            AddChild(new ProductionCategoryButtonWidget(this, 2, new[] { "building" }, "Buildings"));
            AddChild(new ProductionCategoryButtonWidget(this, 3, new[] { "tower" }, "Towers"));
            AddChild(new ProductionCategoryButtonWidget(this, 4, new[] { "wall" }, "Walls"));

            AddChild(bomber = new BomberButtonWidget(this));

            AddChild(sell     = new SellButtonWidget(this));
            AddChild(research = new ResearchButtonWidget(this));
            AddChild(repair   = new RepairButtonWidget(this));

            AddChild(radar   = new RadarButtonWidget(this));
            AddChild(options = new OptionsButtonWidget(this));

            Resize();
        }
Exemple #2
0
        public SidebarWidget(IngameUiWidget ingameUi)
        {
            this.IngameUi = ingameUi;
            this.Id       = SidebarWidget.Identifier;

            this.Buttons = new(this.IngameUi.World, $"sidebar-{this.IngameUi.World.LocalPlayer.Faction.InternalName}");
            this.Font    = new(this.IngameUi.World, "font");

            ChromeMetrics.TryGet($"ButtonArea-{this.IngameUi.World.LocalPlayer.Faction.InternalName}", out this.ButtonArea);

            this.AddChild(new ProductionCategoryButtonWidget(this, 0, new[] { "infantry" }, "Infantry"));
            this.AddChild(new ProductionCategoryButtonWidget(this, 1, new[] { "vehicle", "beast" }, "Vehicles"));
            this.AddChild(new ProductionCategoryButtonWidget(this, 2, new[] { "building" }, "Buildings"));
            this.AddChild(new ProductionCategoryButtonWidget(this, 3, new[] { "tower" }, "Towers"));
            this.AddChild(new ProductionCategoryButtonWidget(this, 4, new[] { "wall" }, "Walls"));

            this.AddChild(this.bomber = new(this));

            this.AddChild(this.sell     = new(this));
            this.AddChild(this.research = new(this));
            this.AddChild(this.repair   = new(this));

            this.AddChild(this.radar   = new(this));
            this.AddChild(this.options = new(this));

            this.Resize();
        }