Esempio n. 1
0
        void add_Click(object sender, EventArgs e)
        {
            WeaponButton btn = (WeaponButton)sender;

            totalMyWpn += btn.Checked ? 1 : -1;
            formatTotalWeapon();
        }
Esempio n. 2
0
 private void wpnBteAnim(WeaponButton btn, bool check)
 {
     if (btn.Checked != check)
     {
         btn.Checked = check;
     }
 }
Esempio n. 3
0
        private void intoAdd(string name)
        {
            //iniClass.curFile = @"cstrike\weapons.ini";

            var  canBuyStr = weaponIni[name.ToUpper()]["CanBuy"].ToLower();
            bool canBuy    = bool.Parse(canBuyStr);

            if (!canBuy)
            {
                return;
            }

            WeaponButton add = new WeaponButton();

            add.Location = new Point(24 + 255 * (totalWeapons % 3), 24 + 126 * (totalWeapons / 3));
            add.Name     = "btnAdd";
            add.Text     = "";
            //add.FontWeightMedium = true;
            add.Size           = new Size(235, 102);
            add.AutoSize       = false;
            add.Depth          = 0;
            add.WeaponRealName = name;
            add.MouseState     = MaterialSkin.MouseState.HOVER;

            //iniClass.curFile = localizedLauncherIniPath;
            var weaponLabel = launcherIni["Weapons"][name.ToUpper()]; weaponLabel = weaponLabel == null ? name : weaponLabel;

            add.WeaponText = weaponLabel;

            add.Click += add_Click;

            foreach (string mywpn in myWpn)
            {
                if (mywpn == name)
                {
                    add.Checked = true;
                }
            }

            string img = @"wpnpic\" + name + ".png";

            if (File.Exists(img))
            {
                add.Image = Image.FromFile(img);
            }

            panel1.Controls.Add(add);
            buttonWpn.Add(add);

            totalWeapons++;
        }