Beispiel #1
0
        private void title_TextChanged(object sender, EventArgs e)
        {
            string ascii   = GeneralHelper.AsciiOnly(title.Text);
            bool   isRoman = ascii == title.Text;

            if (isRoman)
            {
                titleRomanised.Text = title.Text;
            }
            panelRomanisedTitle.Enabled = !isRoman;

            titleRomanised.Text = GeneralHelper.AsciiOnly(titleRomanised.Text);

            changesMade = true;
        }
Beispiel #2
0
        private void artist_TextChanged(object sender, EventArgs e)
        {
            string ascii   = GeneralHelper.AsciiOnly(artist.Text);
            bool   isRoman = ascii == artist.Text;

            if (isRoman)
            {
                artistRomanised.Text = artist.Text;
            }
            panelRomanisedArtist.Enabled = !isRoman;

            artistRomanised.Text = GeneralHelper.AsciiOnly(artistRomanised.Text);

            changesMade = true;
        }
Beispiel #3
0
        private void SongSetup_Load(object sender, EventArgs e)
        {
            combos = new[] { combo1, combo2, combo3, combo4,
                             combo5, combo6, combo7, combo8 };

            List <String> files = (BeatmapManager.Current.InOszContainer) ?
                                  new List <string>(BeatmapManager.Current.Package.MapFiles) : null;

            //Restrict anything that can alter the filename of the difficulty when we are in the editor with a overridden difficulty
            //unless we are using the save as dialog.
            bool fRestrict = files != null && !newDifficulty &&
                             files.Exists((f) => f.EndsWith(Path.GetFileName(BeatmapManager.Current.Filename)));

            version.Enabled = !fRestrict;

            title.Text          = !string.IsNullOrEmpty(BeatmapManager.Current.TitleUnicode) ? BeatmapManager.Current.TitleUnicode : BeatmapManager.Current.Title;
            titleRomanised.Text = string.IsNullOrEmpty(BeatmapManager.Current.Title) ? GeneralHelper.AsciiOnly(BeatmapManager.Current.TitleUnicode) : BeatmapManager.Current.Title;

            artist.Text          = !string.IsNullOrEmpty(BeatmapManager.Current.ArtistUnicode) ? BeatmapManager.Current.ArtistUnicode : BeatmapManager.Current.Artist;
            artistRomanised.Text = string.IsNullOrEmpty(BeatmapManager.Current.Artist) ? GeneralHelper.AsciiOnly(BeatmapManager.Current.ArtistUnicode) : BeatmapManager.Current.Artist;

            creator.Text = (BeatmapManager.Current.Creator.Length > 0
                                ? BeatmapManager.Current.Creator
                                : ConfigManager.sUsername.Value);
            source.Text = BeatmapManager.Current.Source;
            if (creator.Text == ConfigManager.sUsername || fRestrict)
            {
                creator.Enabled = false;
            }
            version.Text = BeatmapManager.Current.Version;

            coopmode.Checked = BeatmapManager.Current.PlayMode == PlayModes.OsuMania && BeatmapManager.Current.DifficultyCircleSize >= 10;

            // extend the trackbar a little to avoid resetting .osuhaxed values
            setDifficulty(hpDrainRate, BeatmapManager.Current.DifficultyHpDrainRate, DRAIN_MIN, DRAIN_MAX, 10.0);

            if (allowedModes.SelectedIndex == 3)
            {
                setDifficulty(circleSize, BeatmapManager.Current.DifficultyCircleSize / (coopmode.Checked ? 2 : 1), CS_MIN_MANIA, CS_MAX_MANIA, 1.0); // Mania doesn't support any decimal circle size
            }
            else
            {
                setDifficulty(circleSize, BeatmapManager.Current.DifficultyCircleSize, CS_MIN, CS_MAX, 10.0);
            }

            setDifficulty(approachRate, BeatmapManager.Current.DifficultyApproachRate, AR_MIN, AR_MAX, 10.0);
            setDifficulty(overallDifficulty, BeatmapManager.Current.DifficultyOverall, OD_MIN, OD_MAX, 10.0);

            // in the case where there's only one sampleset, this works.
            // when there isn't, the control is hidden anyway.
            listSampleset.SelectedItem = AudioEngine.CurrentSampleSet.ToString();
            tags.Text               = BeatmapManager.Current.Tags;
            source.Text             = BeatmapManager.Current.Source;
            sampleCustom.Checked    = AudioEngine.CustomSamples == CustomSampleSet.Custom1;
            checkEpilepsy.Checked   = BeatmapManager.Current.EpilepsyWarning;
            udCountdownOffset.Value = BeatmapManager.Current.CountdownOffset;

            stackLeniency.Value = (int)Math.Max(2, Math.Round(BeatmapManager.Current.StackLeniency * 10));

            allowedModes.SelectedIndex = (int)BeatmapManager.Current.PlayMode;
            originMode = BeatmapManager.Current.PlayMode;

            volume1.Value = BeatmapManager.Current.SampleVolume;

            if (BeatmapManager.Current.AudioPresent)
            {
                checkSamplesMatchPlaybackRate.Checked = BeatmapManager.Current.SamplesMatchPlaybackRate;
            }
            else
            {
                checkSamplesMatchPlaybackRate.Checked = true;
                checkSamplesMatchPlaybackRate.Enabled = false;
            }

            checkCountdown.Checked     = BeatmapManager.Current.Countdown != Countdown.Disabled;
            checkLetterbox.Checked     = BeatmapManager.Current.LetterboxInBreaks;
            checkWidescreen.Checked    = BeatmapManager.Current.WidescreenStoryboard || newDifficulty;
            checkStoryOverFire.Checked = !BeatmapManager.Current.StoryFireInFront;

            if (BeatmapManager.Current.Countdown == Countdown.Disabled)
            {
                countdownNormal.Checked = true;
            }
            else
            {
                countdownDouble.Checked = BeatmapManager.Current.Countdown == Countdown.DoubleSpeed;
                countdownHalf.Checked   = BeatmapManager.Current.Countdown == Countdown.HalfSpeed;
                countdownNormal.Checked = BeatmapManager.Current.Countdown == Countdown.Normal;
            }

            SkinManager.InitializeSkinList();
            foreach (string s in SkinManager.Skins)
            {
                skinPreference.Items.Add(s);
            }

            if (!string.IsNullOrEmpty(BeatmapManager.Current.SkinPreference))
            {
                skinPreference.Text = BeatmapManager.Current.SkinPreference;
            }
            else
            {
                skinPreference.SelectedIndex = 0;
            }



            panelCountdownRate.Enabled = checkCountdown.Checked;

            if (AudioEngine.ControlPoints.Count > 0)
            {
                SampleSet       def    = AudioEngine.ControlPoints[0].SampleSet;
                CustomSampleSet cus    = AudioEngine.ControlPoints[0].CustomSamples;
                int             volume = AudioEngine.ControlPoints[0].Volume;


                foreach (ControlPoint p in AudioEngine.ControlPoints)
                {
                    if (p.SampleSet != def || p.CustomSamples != cus || p.CustomSamples >= CustomSampleSet.Custom2)
                    {
                        hideSampleSettings.Visible = true;
                        resetSampleSettings        = false;
                    }
                    if (p.Volume != volume)
                    {
                        hideSampleVolume.Visible = true;
                        resetVolumeSettings      = false;
                    }
                }

                volume1.Value = volume;
            }

            List <System.Drawing.Color> colours = new List <System.Drawing.Color>(4);

            for (int x = 0; x < SkinManager.MAX_COLOUR_COUNT; x++)
            {
                System.Drawing.Color c = OsuMathHelper.CConvert(SkinManager.LoadColour("Combo" + (x + 1).ToString()));
                if (x < 2 || c.A > 0)
                {
                    colours.Add(c);
                }
            }

            while (colours.Count < 2)
            {
                colours.Add(System.Drawing.Color.FromArgb(240, 240, 240));
            }

            colours.Add(colours[0]);
            colours.RemoveAt(0);

            int y;

            for (y = 0; y < colours.Count; y++)
            {
                combos[y].SwatchColor = colours[y];
                combos[y].Visible     = true;
                combos[y].Visible2    = true;
            }

            for (; y < 8; y++)
            {
                combos[y].Visible  = false;
                combos[y].Visible2 = false;
            }

            backgroundColour.SwatchColor = OsuMathHelper.CConvert(EventManager.backgroundColour);

            updateCheckedColours();
            customColour.Checked    = BeatmapManager.Current.CustomColours;
            cb_maniaSpecial.Checked = BeatmapManager.Current.SpecialStyle;

            if (newDifficulty || fRestrict)
            {
                version.Text = string.Empty;
                version.Select();

                artist.Enabled = false;
                title.Enabled  = false;
            }
            else
            {
                artist.Select();
            }

            changesMade = false;
        }