Пример #1
0
 public Upgrade_Plant_Type()
     : base(Properties.Resources.UpgradePlantLayoutSettings)
 {
     Size sz = new Size(100, 100);
     Point p = TAB_REGION.Location;
     CONTROLS.Add("item↑", new MyButton("↑", this, new Rectangle(450, 275, 50, 50), Color.FromArgb(255, 0, 0)));
     CONTROLS.Add("item↓", new MyButton("↓", this, new Rectangle(500, 275, 50, 50), Color.FromArgb(255, 0, 0)));
     CONTROLS.Add("Purchase", new MyButton("Purchase", this, new Rectangle(550, 275, 125, 50), Color.FromArgb(255, 0, 0)));
     CONTROLS.Add("ProductPicture", new MyPicture("ProductPicture", this, new Rectangle(150, 25, 300, 300), null, new Rectangle(150, 25, 300, 300)));
     CONTROLS.Add("ProductName", new MyPicture("ProductName", this, new Rectangle(450, 25, 225, 50), null, new Rectangle(450, 25, 225, 50)));
     CONTROLS.Add("ProductDescription", new MyPicture("ProductDescription", this, new Rectangle(450, 75, 225, 200), null, new Rectangle(450, 75, 225, 200)));
     for (int i = 0; i < UpgradeInfo.UPGRADE_LIST.Length; i++)
     {
         TabButton tab = new TabButton(i, IMAGES, UpgradeInfo.UPGRADE_LIST[i], this, new Rectangle(p, sz), TAB_REGION);
         tab.Click += TAB_Click;
         CONTROLS["←"].Click += tab.ARROW_Click;
         CONTROLS["→"].Click += tab.ARROW_Click;
         TAB.Add(tab);
         p.Y += sz.Height;
     }
     CONTROLS["Exit"].Click += Button_Click;
     CONTROLS["↑"].Click += Button_Click;
     CONTROLS["↓"].Click += Button_Click;
     CONTROLS["item↑"].ENABLED = CONTROLS["item↓"].ENABLED = false;
     ITEM_PANEL_VISABLE = false;
     INSTRUCTION = new string[]
     {
         "Welcome to Upgrade Plant",
         "We found your equipments were out of date",
         "So we provide very convenient upgrade services here",
         "On the left you can browse the equipments you have",
         "Click the equipment you want to upgrade",
         "Then look for the upgrade you want",
         "Click it and press \"Purchase\"",
         "You'll find your Pod has been upgraded",
         "So easy, right?",
         "Remember to come here more often~~~"
     };
 }
Пример #2
0
 public ItemButton(TabButton tab_parent, int index, string text, Station parent, Rectangle rect, Bitmap image, Rectangle region = default(Rectangle))
     : base(index, text, parent, rect, image, region)
 {
     TAB_PARENT = tab_parent;
     PARENT.CONTROLS["item↑"].Click += Description_PageUp_Click;
     PARENT.CONTROLS["item↓"].Click += Description_PageDown_Click;
     PARENT.CONTROLS["Purchase"].Click += Purchase_Click;
     UPGRADE_INFO = UpgradeInfo.Get(text);
     UNLOCKED = UPGRADE_INFO.UnlockRequire;
     using (Font font = new Font("微軟正黑體", 1, FontStyle.Bold))
     {
         NAME_IMAGE = UPGRADE_INFO.Name.ToBitmap(PARENT.CONTROLS["ProductName"].Size, font, Color.FromArgb(255, 255, 255), StringAlign.Left, Color.FromArgb(255, 0, 0));
     }
     using (Font font2 = new Font("微軟正黑體", 15, FontStyle.Bold))
     {
         DESCRIPTION_IMAGE = ("$" + UPGRADE_INFO.Price.ToString() + "\r\n" + UPGRADE_INFO.Description).ToBitmap(PARENT.CONTROLS["ProductDescription"].Size.Width, font2, Color.FromArgb(0, 0, 0), StringAlign.Left, Color.FromArgb(128, 128, 255), new Size(225, 200));
     }
 }