Example #1
0
    public void ShowAbilities()
    {
        currentPanel = Panels.Abilities;

        MenuPanel.SetActive(false);
        WeaponsPanel.SetActive(false);
        //ItemsPanel.SetActive(false);
        AbilitiesPanel.SetActive(true);

        MenuButton.GetComponent <Image>().color    = new Color(0.4117647f, 0.3882353f, 0.6196079f);
        WeaponsButton.GetComponent <Image>().color = new Color(0.4117647f, 0.3882353f, 0.6196079f);
        //ItemsButton.GetComponent<Image>().color = new Color(0.4117647f, 0.3882353f, 0.6196079f);
        AbilitiesButton.GetComponent <Image>().color = new Color(0.2638712f, 0.2509804f, 0.3882353f);
    }
Example #2
0
    public void ShowItems()
    {
        currentPanel = Panels.Items;

        MenuPanel.SetActive(false);
        WeaponsPanel.SetActive(false);
        ItemsPanel.SetActive(true);
        AbilitiesPanel.SetActive(false);

        MenuButton.GetComponent <Image>().color      = new Color(0.4117647f, 0.3882353f, 0.6196079f);
        WeaponsButton.GetComponent <Image>().color   = new Color(0.4117647f, 0.3882353f, 0.6196079f);
        ItemsButton.GetComponent <Image>().color     = new Color(0.2638712f, 0.2509804f, 0.3882353f);
        AbilitiesButton.GetComponent <Image>().color = new Color(0.4117647f, 0.3882353f, 0.6196079f);

        playerStats.SetupItemUIs(ItemsList);
    }
Example #3
0
        public WeaponsController(Car car, Vcf vcf, Transform firstPersonTransform)
        {
            _car = car;
            int weaponCount = vcf.Weapons.Count;

            _weapons            = new Weapon[weaponCount];
            _weaponAudio        = car.gameObject.AddComponent <AudioSource>();
            _weaponAudio.volume = 0.5f;
            _weaponEmptySound   = CacheManager.Instance.GetAudioClip("cammo.gpw");
            _weaponBrokenSound  = CacheManager.Instance.GetAudioClip("cwstat.gpw");
            _firingWeapons      = new List <Weapon>(5);
            _weaponGroups       = new List <int>();

            List <VcfWeapon> weaponsList = vcf.Weapons;

            weaponsList.Sort((x, y) =>
            {
                int compare = x.RearFacing.CompareTo(y.RearFacing);
                if (compare != 0)
                {
                    return(compare);
                }

                return(x.Gdf.WeaponGroup.CompareTo(y.Gdf.WeaponGroup));
            });


            int seperatorIndex = -1;

            for (int i = 0; i < weaponCount; ++i)
            {
                AudioClip fireSound = CacheManager.Instance.GetAudioClip(weaponsList[i].Gdf.SoundName);
                _weapons[i] = new Weapon(weaponsList[i].Gdf, weaponsList[i].Transform)
                {
                    FireSound  = fireSound,
                    RearFacing = weaponsList[i].RearFacing,
                    Index      = i
                };

                if (_weapons[i].RearFacing)
                {
                    if (seperatorIndex == -1)
                    {
                        seperatorIndex = i;
                    }

                    _weapons[i].WeaponGroupOffset += 100;
                }

                if (!_weaponGroups.Contains(_weapons[i].WeaponGroupOffset))
                {
                    _weaponGroups.Add(_weapons[i].WeaponGroupOffset);
                }
            }

            if (firstPersonTransform != null)
            {
                _panel = new WeaponsPanel(firstPersonTransform);
                _panel.SetWeaponCount(weaponCount);
                for (int i = 0; i < weaponCount; ++i)
                {
                    _panel.SetWeaponHealthGroup(i, 0);
                    _panel.SetWeaponAmmoCount(i, _weapons[i].Ammo);
                    _panel.TryGetWeaponSprites(weaponsList[i].Gdf, out _weapons[i].OnSprite, out _weapons[i].OffSprite);
                }

                if (seperatorIndex != -1)
                {
                    _panel.SeparatorIndex = seperatorIndex;
                }

                if (_weaponGroups.Count > 0)
                {
                    _panel.UpdateActiveWeaponGroup(_weaponGroups[_activeGroup], _weapons);
                }
            }
        }
Example #4
0
        private void InitializeComponent()
        {
            SuspendLayout();
            ClientSize = new Size(resolution.Width, resolution.Height);

            Int32 valueBoxWidthPosition  = (Int32)(0.75 * monitor.Resolution.Width);
            Int32 valueBoxHeightPosition = (Int32)(0.85 * EventsAndGlobalsController.CurrentMonitor.Resolution.Height);

            #region Power Angle Wind valueBox defines

            angleValueBox = new ValueBox("Angle")
            {
                BackColor    = Color.FromArgb(0, 75, 0),
                Location     = new Point(valueBoxWidthPosition, valueBoxHeightPosition),
                Size         = new Size(ValueBoxWidth, ValueBoxHeight),
                EndString    = @"°",
                DefaultValue = EventsAndGlobalsController.Angle,
                MaxValue     = 359,
            };
            angleValueBox.Text = angleValueBox.DefaultValue.ToString();
            //angleValueBox.TextChanged += (sender, e) => ValueBoxOnTextChanged(ref angleValueBox);

            windValueBox = new ValueBox("Wind")
            {
                BackColor    = Color.FromArgb(0, 0, 75),
                Location     = new Point(ValueBoxWidth + valueBoxWidthPosition + DistanceBetweenValueBox, valueBoxHeightPosition),
                Size         = new Size(ValueBoxWidth, ValueBoxHeight),
                EndString    = $@"{_localization.Meters}",
                DefaultValue = EventsAndGlobalsController.Wind,
                MaxValue     = 100,
                MinValue     = -100
            };
            windValueBox.Text = windValueBox.DefaultValue.ToString();
            //windValueBox.TextChanged += (sender, e) => ValueBoxOnTextChanged(ref windValueBox);

            powerValueBox = new ValueBox("Power")
            {
                BackColor    = Color.FromArgb(75, 0, 0),
                Location     = new Point(valueBoxWidthPosition, ValueBoxHeight + valueBoxHeightPosition),
                Size         = new Size(2 * ValueBoxWidth + DistanceBetweenValueBox, ValueBoxHeight),
                EndString    = @"%",
                DefaultValue = EventsAndGlobalsController.Power,
                MaxValue     = 100,
            };
            powerValueBox.Text = powerValueBox.DefaultValue.ToString();
            //powerValueBox.TextChanged += (sender, e) => ValueBoxOnTextChanged(ref powerValueBox);

            #endregion

            weaponsPanel = new WeaponsPanel();

            MainForm    thisForm = this;
            RulerRender ruler    = new RulerRender(ref thisForm);

            TopMost         = true;
            ControlBox      = false;
            AutoScaleMode   = AutoScaleMode.Font;
            Text            = !isDisguise ? _localization.RulerVersion : _localization.MaskName;
            BackColor       = Color.Black;
            TransparencyKey = Color.Black;
            FormBorderStyle = FormBorderStyle.None;
            WindowState     = FormWindowState.Maximized;
            Icon            = !isDisguise ? Resources.icon : Resources.notepad;
            ShowInTaskbar   = !isDisguise;
            Location        = new Point(resolution.X, resolution.Y);
            Size            = new Size(resolution.Width, resolution.Height);
            Controls.Add(powerValueBox);
            Controls.Add(angleValueBox);
            Controls.Add(windValueBox);
            Controls.Add(weaponsPanel);
            ResumeLayout(false);
            PerformLayout();
            ruler.Start();
        }