Exemplo n.º 1
0
        private void onOption_Click(object sender, EventArgs e)
        {
            var itemView = sender as ConstructableItemView;

            if (controller.CanPick(itemView.Data))
            {
                controller.Enqueue(itemView.Data);

                var queueItemView = new QueuedConstructionView();
                queueList.Controls.Add(queueItemView);
            }

            updateOptions();
            updateQueue();
        }
Exemplo n.º 2
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();
        }