Beispiel #1
0
        private bool updateWidgetInput(Player player)
        {
            bool             flag = false;
            IAttributeWidget selectedAttribute = SelectedAttribute;

            if (uiDelay == 0)
            {
                if (parentUI.IsDownButtonDown() && selectedAttribute.SelectDown())
                {
                    flag = true;
                }
                if (parentUI.IsUpButtonDown() && selectedAttribute.SelectUp())
                {
                    flag = true;
                }
                if (parentUI.IsLeftButtonDown() && selectedAttribute.SelectLeft())
                {
                    flag = true;
                }
                if (parentUI.IsRightButtonDown() && selectedAttribute.SelectRight())
                {
                    flag = true;
                }
            }
            if (flag)
            {
                selectedAttribute.Apply(player);
            }
            return(flag);
        }
Beispiel #2
0
        public void Update()
        {
            if (uiDelay > 0)
            {
                uiDelay--;
                return;
            }
            bool flag = false;

            if (parentUI.IsRightButtonDown())
            {
                selected.Progress += stepSize;
                flag = true;
            }
            if (parentUI.IsLeftButtonDown())
            {
                selected.Progress -= stepSize;
                flag = true;
            }
            if (parentUI.IsUpButtonDown() || parentUI.IsDownButtonDown())
            {
                if (selected == soundSlider)
                {
                    SelectMusicSlider();
                }
                else
                {
                    SelectSoundSlider();
                }
                flag = true;
            }
            if (flag)
            {
                uiDelay                = 12;
                Main.soundVolume       = (parentUI.soundVolume = soundSlider.Progress);
                Main.musicVolume       = (parentUI.musicVolume = musicSlider.Progress);
                parentUI.settingsDirty = true;
                Main.PlaySound(12);
            }
        }