Esempio n. 1
0
        public FormBuildingQueue(AConstructionSiteController controller) : this()
        {
            this.controller = controller;

            if (controller.IsReadOnly)
            {
                moveDownButton.Enabled = false;
                moveUpButton.Enabled   = false;
                removeButton.Enabled   = false;
            }

            foreach (var data in controller.ConstructableItems)
            {
                var itemView = new ConstructableItemView();
                itemView.Data    = data;
                itemView.Enabled = controller.CanPick(data);

                if (!controller.IsReadOnly)
                {
                    itemView.Click += onOption_Click;
                }
                itemView.MouseEnter += onOption_MouseEnter;

                optionList.Controls.Add(itemView);
            }

            foreach (var data in controller.ConstructionQueue)
            {
                var queueItemView = new QueuedConstructionView();
                queueItemView.Data = data;
                queueList.Controls.Add(queueItemView);
            }

            var context = LocalizationManifest.Get.CurrentLanguage["FormBuilding"];

            this.Text         = context["FormTitle"].Text();
            this.Font         = SettingsWinforms.Get.FormFont;
            optionsLabel.Text = context["optionsTitle"].Text();
            queueLabel.Text   = context["queueTitle"].Text();
        }
Esempio n. 2
0
 private void updateDescription(ConstructableItemView itemView)
 {
     thumbnailImage.Image  = ImageCache.Get[itemView.Data.ImagePath];
     descriptionLabel.Text = itemView.Data.Description;
 }