internal void SaveAs()
        {
            HideDifficultySwitch();

            GameBase.MenuActive = true;

            SongSetup m = new SongSetup(true, false);

            if (m.ShowDialog(GameBase.Form) == DialogResult.OK)
            {
                BeatmapManager.Beatmaps.Sort(); //sorting by filename as it just changed.

                //ensure we reset the beatmap IDs.
                hitObjectManager.Beatmap.BeatmapId = 0;

                BeatmapManager.ProcessFolder(hitObjectManager.Beatmap.InOszContainer ?
                                             hitObjectManager.Beatmap.ExtractionFolder : hitObjectManager.Beatmap.ContainingFolderAbsolute);

                if (hitObjectManager.hitObjectsCount > 0)
                {
                    DialogResult r = MessageBox.Show(LocalisationManager.GetString(OsuString.Editor_FileOperations_SaveAsDialog), @"osu!",
                                                     MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation,
                                                     MessageBoxDefaultButton.Button1);
                    if (r == DialogResult.Yes)
                    {
                        hitObjectManager.Clear();
                        hitObjectManager.Save(false, false, false);
                    }
                }
            }

            GameBase.MenuActive = false;
        }
Exemplo n.º 2
0
        public OptionSlider(OsuString title, BindableDouble value, string unit = null, bool immediatelyAdjust = true)
        {
            this.value = value;
            localValue = value.Value;

            this.unit = unit;

            this.immediatelyAdjust = immediatelyAdjust;

            value.ValueChanged += value_ValueChanged;

            string text = LocalisationManager.GetString(title);

            header = new pText(text, 12, Vector2.Zero, 1, true, Color.White);
            spriteManager.Add(header);

            Size = header.MeasureText();

            Slider = new pSliderBar(spriteManager, value.MinValue, value.MaxValue, value.Value, new Vector2(Size.X + 5, Size.Y / 2), (int)(ELEMENT_SIZE - Size.X - 5));
            Slider.OnValueChanged += Slider_ValueChanged;

            Slider.KeyboardControl          = true;
            Slider.KeyboardControlIncrement = value is BindableInt ? 1 : 0.01;

            addKeyword(text);
            addKeyword(title.ToString());
            updateUnit();
        }
Exemplo n.º 3
0
        protected override void runDifficultyCheck()
        {
            //HP
            if (Math.Round(map.DifficultyHpDrainRate) < 4 && Difficulty < BeatmapDifficulty.Hard)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_EasyHpBelow4)));
            }
            else if (Math.Round(map.DifficultyHpDrainRate) < 7 && Difficulty >= BeatmapDifficulty.Hard)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_HardHpBelow7)));
            }

            //OD
            double holdRate = map.countSlider * 1.0 / map.ObjectCount;

            if (holdRate < 0.05 && Math.Round(map.DifficultyOverall) < 8)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_VeryLowSliderOdBelow8)));
            }
            else if (holdRate < 0.25 && Math.Round(map.DifficultyOverall) < 7)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_LowSliderOdBelow7)));
            }
            else if (Math.Round(map.DifficultyOverall) < 5)
            {
                Reports.Add(new AiReport(Severity.Info, LocalisationManager.GetString(OsuString.AIMetaMania_OdBelow5)));
            }
        }
Exemplo n.º 4
0
        internal static bool Initialize()
        {
            if (!ConfigManager.sShaders)
            {
                return(true);
            }

            try
            {
                if (renderTarget != null)
                {
                    renderTarget.Dispose();
                }
                renderTarget = new RenderTarget2D(GameBase.WindowManager.Width, GameBase.WindowManager.Height);

                if (bloomShader != null)
                {
                    bloomShader.Dispose();
                }
                bloomShader = ShaderManager.Load(OsuVertexShader.Texture2D, OsuFragmentShader.Bloom);

                GameBase.OnResolutionChange -= GameBase_OnResolutionChange;
                GameBase.OnResolutionChange += GameBase_OnResolutionChange;
            }
            catch
            {
                ConfigManager.sBloomSoftening.Value = false;
                //Todo: Localize
                NotificationManager.ShowMessage(LocalisationManager.GetString(OsuString.BloomRenderer_InitializationFailed));
            }

            return(true);
        }
Exemplo n.º 5
0
        private void OnCreateGame(object sender, EventArgs e)
        {
            if (!BanchoClient.Connected)
            {
                NotificationManager.ShowMessage(LocalisationManager.GetString(OsuString.Lobby_LoginFirst));
                return;
            }

            if (Status == LobbyStatus.PendingCreate)
            {
                return;
            }


            if (BeatmapManager.Beatmaps.Count == 0)
            {
                NotificationManager.ShowMessage(LocalisationManager.GetString(OsuString.Lobby_NoBeatmapsAvailable));
                return;
            }

            if (BeatmapManager.Current == null)
            {
                BeatmapManager.Current = BeatmapManager.Beatmaps[0];
            }

            CreateGameDialog cgd = new CreateGameDialog();

            GameBase.ShowDialog(cgd);
        }
Exemplo n.º 6
0
        private void toggleFilters(object sender, EventArgs e)
        {
            pButton but = sender as pButton;

            filtersVisible = !filtersVisible;


            const int ADJUSTMENT_HEADER = FILTER_ADJUSTMENT + 12;

            if (filtersVisible)
            {
                but.SetColour(Color.Red);
                but.Text.Text = LocalisationManager.GetString(OsuString.Lobby_Hide);

                but.SpriteCollection.ForEach(s => s.MoveToRelative(new Vector2(0, FILTER_ADJUSTMENT), 200, EasingTypes.Out));

                //headerText2.MoveToRelative(new Vector2(0, ADJUSTMENT_HEADER), 200, EasingTypes.In);
            }
            else
            {
                but.SetColour(Color.YellowGreen);
                but.Text.Text = LocalisationManager.GetString(OsuString.Lobby_Filters);

                but.SpriteCollection.ForEach(s => s.MoveToRelative(new Vector2(0, -FILTER_ADJUSTMENT), 200, EasingTypes.Out));


                //headerText2.MoveToRelative(new Vector2(0, -ADJUSTMENT_HEADER), 200, EasingTypes.In);
            }
        }
Exemplo n.º 7
0
        public static void JoinMatch(bMatch info, string password = null)
        {
            if (Status == LobbyStatus.PendingJoin)
            {
                return;
            }

            if (info.slotOpenCount <= info.slotUsedCount || Status != LobbyStatus.Idle)
            {
                NotificationManager.ShowMessage(LocalisationManager.GetString(OsuString.Lobby_MatchFull));
                AudioEngine.PlaySample(@"match-leave");
            }
            else if (info.passwordRequired && string.IsNullOrEmpty(password))
            {
                JoinGameDialog jgd = new JoinGameDialog(info);
                GameBase.ShowDialog(jgd);
                return;
            }

            MatchSetup.Match = new ClientSideMatch(info);
            if (password != null)
            {
                MatchSetup.Match.gamePassword = password;
            }

            JoinMatch(info.matchId, password);
        }
        internal static void CheckAndProcess(bool ForceRefresh, bool UserForced = false)
        {
            bool newFiles = ChangedFolders.Count > 0 || ChangedPackages.Count > 0;

            Logger.LogPrint($"ChangedFolders: {ChangedFolders.Count}\nChangedPackages: {ChangedPackages.Count}");

            if (newFiles)
            {
                InvokeOnStatusUpdate(LocalisationManager.GetString(OsuString.BeatmapManager_LoadingNewFilesOnly));

                ProcessBeatmaps(true);

                if (pulledOnlineStatsOnce) //save some bandwidth when adding a single new song if possible.
                {
                    GetOnlineBeatmapInfo(NewFilesList);
                }
            }

            if ((!newFiles && ForceRefresh) || Beatmaps.Count == 0)
            {
                InvokeOnStatusUpdate(LocalisationManager.GetString(OsuString.BeatmapManager_ReloadingDatabase));
                ProcessBeatmaps(false, !UserForced);
            }

            if (!pulledOnlineStatsOnce)
            {
                GetOnlineBeatmapInfo();
                pulledOnlineStatsOnce = true;
            }

            ChangedFolders.Clear();
            ChangedPackages.Clear();
            NewFilesList.Clear();
        }
Exemplo n.º 9
0
        internal override void Draw()
        {
            bool activePointSet = currentActivePoint != null;
            bool beatSyncing    = (!activePointSet && AudioEngine.BeatSyncing) || (activePointSet && currentActivePoint.BeatLength > 0);

            if (beatSyncing)
            {
                beatBpmDisplay.Text = String.Format(KeyboardHandler.ControlPressed ? @"{0:0.000}" : @"{0:0.00}",
                                                    60000 / (activePointSet ? currentActivePoint.BeatLength : AudioEngine.BeatLength));
                beatOffsetDisplay.Text     = String.Format(@"{0:#,0}", (activePointSet ? currentActivePoint.Offset : AudioEngine.CurrentOffset));
                sliderVelocityDisplay.Text =
                    String.Format(@"{0:N2}", BeatmapManager.Current.DifficultySliderMultiplier);
                sliderTickDisplay.Text = String.Format(@"{0}", BeatmapManager.Current.DifficultySliderTickRate);
                beatDisplay.Text       = String.Format(@"{0}:{1}", Metronome.CurrentStanza, Metronome.CurrentBeat);
            }
            else
            {
                beatDisplay.Text       = LocalisationManager.GetString(OsuString.EditorModeTiming_TimingSectionNotTimed);
                beatBpmDisplay.Text    = @"-";
                beatOffsetDisplay.Text = @"-";
            }

            spriteManagerCentre.Draw();

            base.Draw();

            Metronome.Draw();
        }
Exemplo n.º 10
0
        internal TournamentLobby(Tournament tournament, SpriteManager spriteManager, float depth)
        {
            this.tournament = tournament;

            Vector2 pos = tournament.ControlPanelLocation;

            pText tmp;

            spriteManager.Add(tmp = new pText(LocalisationManager.GetString(OsuString.Tournament_MakeAMultiplayerRoomWithFormat), 10, new Vector2(0, pos.Y), depth, true, Color.White));
            pos.Y += (int)tmp.MeasureText().Y;
            spriteManager.Add(tmp = new pText(acronym + @": (team 1 name) vs (team 2 name)", 10, new Vector2(0, pos.Y), depth, true, Color.White)
            {
                TextBold = true
            });

            // Splitter between text and matches
            pos.Y += (int)tmp.MeasureText().Y;
            spriteManager.Add(new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Game, new Vector2(0, pos.Y), depth, true, new Color(255, 255, 255, 127))
            {
                VectorScale = new Vector2(300 * 1.6f, 1)
            });
            pos.Y += 3;

            matchesArea = new pScrollableArea(new Rectangle(0, (int)pos.Y, 300, (int)(480 - pos.Y)), Vector2.Zero, true);
            matchesArea.SetContentDimensions(new Vector2(300, 0));

            requestMatchInfo();

            updateMatches();
        }
Exemplo n.º 11
0
        internal override bool DoSkip()
        {
            if (OutroSkippable)
            {
                base.DoSkip();
                return(true);
            }

            if (queueSkipCount > 0)
            {
                NotificationManager.ClearMessageMassive();
                MultiSkipRequested = false;

                clearSkippedStatus();

                base.DoSkip();
                return(true);
            }

            if (!MultiSkipRequested && (AudioEngine.Time < SkipBoundary) && Status == PlayerStatus.Intro)
            {
                MultiSkipRequested = true;
                NotificationManager.ShowMessageMassive(LocalisationManager.GetString(OsuString.PlayerVs_SkipRequest), 2000);
                BanchoClient.SendRequest(RequestType.Osu_MatchSkipRequest, null);
            }

            return(false);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Runs all current rulesets and stores them in AiReports.
        /// </summary>
        internal void RunAllRules(HitObjectManager hitObjectManager)
        {
            if (Rulesets.Count == 0)
            {
                initializeRulesets();
            }
            Reports.Clear();

            //hitobjects could have stacking effects that might change their position
            hitObjectManager.ClearPositionOffsets();

            List <AiReport> reportsAll = Reports[AiModType.All] = new List <AiReport>();

            foreach (AiModRuleset r in Rulesets)
            {
                List <AiReport> reports = r.Run(hitObjectManager);

                Report(r.Type, reports);
            }

            if (reportsAll.Count == 0)
            {
                reportsAll.Add(new AiReport(-1, Severity.Info, LocalisationManager.GetString(OsuString.AIModWindow_NoProblemsFound), 0, null));
            }
        }
Exemplo n.º 13
0
        protected override void OnLoadStart()
        {
            base.OnLoadStart();

            multiplayerRankingText = new pText(string.Empty, 80, new Vector2(10, 10), Vector2.Zero, 0, true,
                                               new Color(255, 255, 255, 100), false);
            multiplayerRankingText.Field  = Fields.BottomRight;
            multiplayerRankingText.Origin = Origins.BottomRight;
            spriteManagerBelowHitObjectsWidescreen.Add(multiplayerRankingText);

            if (!AllPlayersLoaded)
            {
                NotificationManager.ShowMessageMassive(LocalisationManager.GetString(OsuString.PlayerVs_WaitingForPlayers), 300000);
            }

            if (Match.beatmapChecksum != BeatmapManager.Current.BeatmapChecksum)
            {
                //getting here when hitting mp invites in spectate mode.
                GameBase.ChangeMode(OsuModes.Lobby);
                return;
            }

            MultiRuleset.Initialize();

            for (int i = 0; i < bMatch.MAX_PLAYERS; i++)
            {
                //initialize HpGraph
                HpGraphCollection[i] = new List <Vector2>();

                if (Match.slotStatus[i] == SlotStatus.Quit)
                {
                    MultiRuleset.HandlePlayerLeft(i);
                }
            }
        }
Exemplo n.º 14
0
        internal override void GotoRanking(bool force = false)
        {
            if (AllPlayersCompleted || force)
            {
                //force a reorder before going to ranking screen.
                ScoreBoard.Reorder(false);

                if (TeamOverlay != null)
                {
                    GameBase.ChangeMode(OsuModes.RankingTeam);
                    NotificationManager.ClearMessageMassive();
                }
                else
                {
                    MultiRuleset.LoadRanking();
                }
            }
            else
            {
                //gotoranking will never be called twice, so when we get here it gets stuck.
                if (!MultiPass)
                {
                    MultiPass = true;
                    SendMapComplete();
                    NotificationManager.ShowMessageMassive(LocalisationManager.GetString(OsuString.PlayerVs_WaitingForFinish), 300000);
                }
            }
        }
Exemplo n.º 15
0
        internal static bool Initialize()
        {
            if (!ConfigManager.sShaders)
            {
                return(true);
            }

            try
            {
                if (vShader != null)
                {
                    vShader.Dispose();
                }
                vShader = ShaderManager.Load(OsuVertexShader.Texture2D, OsuFragmentShader.BlurVertical);

                if (hShader != null)
                {
                    hShader.Dispose();
                }
                hShader = ShaderManager.Load(OsuVertexShader.Texture2D, OsuFragmentShader.BlurHorizontal);
            }
            catch
            {
                ConfigManager.sShaders = false;
                //Todo: Localize
                NotificationManager.ShowMessage(LocalisationManager.GetString(OsuString.BlurRenderer_InitializationFailed));
            }

            return(true);
        }
Exemplo n.º 16
0
        public ChangelogOverlay(Game game, bool fullscreen = false)
            : base(game)
        {
            if (fullscreen)
            {
                Width       = GameBase.WindowManager.WidthScaled;
                Height      = 226;
                startHeight = 0;
            }

            area = new pScrollableArea(new Rectangle(0, GameBase.WindowManager.HeightScaled - Height, Width, Height), Vector2.Zero, true);
            area.HeaderHeight = startHeight;

            int year  = General.VERSION / 10000;
            int month = General.VERSION / 100 - year * 100;
            int day   = General.VERSION - year * 10000 - month * 100;

            int version_dated   = Int32.Parse(new DateTime(year, month, day).AddDays(-14).ToString("yyyyMMdd"));
            int version_current = Int32.Parse(new DateTime(year, month, day).ToString("yyyyMMdd"));

            pWebRequest snr = new pWebRequest(General.WEB_ROOT + "/p/changelog?updater=3" + (!string.IsNullOrEmpty(General.SUBVERSION) ? "&test=1" : "&current=" + version_current + "&from=" + version_dated));

            snr.Finished += snr_onFinish;
            snr.Perform();

            pSprite bg = new pSprite(GameBase.WhitePixel, Vector2.Zero, 0.5f, true, Color.Black);

            bg.Scale            = 1.6f;
            bg.ViewOffsetImmune = true;
            bg.VectorScale      = new Vector2(Width, Height);
            bg.Alpha            = 0.5f;

            area.ContentSpriteManager.Add(bg);

            if (!fullscreen)
            {
                pText t = new pText(LocalisationManager.GetString(OsuString.Update_RecentChanges), 10, new Vector2(3, 3), Vector2.Zero, 0.9992f, true, Color.White, false);
                t.ViewOffsetImmune = true;
                t.TextBold         = true;

                area.ContentSpriteManager.Add(t);

                bg                  = new pSprite(GameBase.WhitePixel, Vector2.Zero, 0.9991f, true, SkinManager.NEW_SKIN_COLOUR_SECONDARY);
                bg.Scale            = 1.6f;
                bg.ViewOffsetImmune = true;
                bg.VectorScale      = new Vector2(Width, startHeight);
                bg.Alpha            = 0.8f;
                bg.HandleInput      = true;

                bg.HoverEffect = new Transformation(Color.DarkBlue, Color.LightBlue, 0, 50);

                bg.OnClick += delegate
                {
                    area.ContentSpriteManager.SpriteList.ForEach(s => s.FadeOut(100));
                    GameBase.Scheduler.AddDelayed(delegate { area.Hide(); }, 100);
                };

                area.ContentSpriteManager.Add(bg);
            }
        }
Exemplo n.º 17
0
        internal static void AdjustSpeed(int delta)
        {
            int speed = Speed + delta;

            SetSpeed(speed, true);
            NotificationManager.ShowMessageMassive(string.Format(LocalisationManager.GetString(OsuString.ConfigMania_OsuManiaSpeedSet), GetSpeedString()), 1750);
        }
Exemplo n.º 18
0
        public static void Initialize()
        {
            if (isInitialized)
            {
                return;
            }

#if MONO
            return;
#endif

            if (File.Exists(LogFileFullPath))
            {
                string contents = File.ReadAllText(LogFileFullPath);
                File.Delete(LogFileFullPath);

                GameBase.Scheduler.Add(delegate
                {
                    Notification notification = new Notification(
                        "Oops...",
                        LocalisationManager.GetString(OsuString.Crashed) ?? "A serious crash happened and has been reported",
                        NotificationStyle.Okay);
                    GameBase.Notify(notification);
                }, true);

                Report(contents);
            }

            AppDomain.CurrentDomain.UnhandledException += HandleException;

            isInitialized = true;
        }
Exemplo n.º 19
0
 internal ChannelListDialog()
     : base(LocalisationManager.GetString(OsuString.ChannelListDialog_SelectAnyChannelYouWishToJoin), true)
 {
     channelButtonList    = new pScrollableArea(new Rectangle(0, 60, 550, 321), Vector2.Zero, false, 0, defaultTargetType);
     currentVerticalSpace = 400;
     AddOption(LocalisationManager.GetString(OsuString.General_Close), SkinManager.NEW_SKIN_COLOUR_MAIN, null, true);
 }
Exemplo n.º 20
0
        private void WithBeatmapReload(VoidDelegate action)
        {
            DialogResult r;

            if (editor.changeManager.Dirty)
            {
                r = MessageBox.Show(LocalisationManager.GetString(OsuString.EditorControl_BeatmapMustBeSavedDialog), @"osu!",
                                    MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation,
                                    MessageBoxDefaultButton.Button1);

                if (r == DialogResult.Yes)
                {
                    editor.SaveFile();
                }
                else if (r == DialogResult.Cancel)
                {
                    return;
                }
            }
            else
            {
                r = DialogResult.Yes;
            }

            action();

            editor.LoadFile(editor.hitObjectManager.Beatmap, r == DialogResult.No, true);
        }
Exemplo n.º 21
0
        internal override void CopySelection()
        {
            copiedPoints.Clear();

            StringBuilder timingInfo = new StringBuilder();

            for (int i = 0; i < AudioEngine.ControlPoints.Count; i++)
            {
                ControlPoint p = AudioEngine.ControlPoints[i];
                if (p.TimingChange)
                {
                    timingInfo.AppendFormat("{2}. Offset: {0:#,0}ms\tBPM: {1:#.00#}\n", p.Offset, p.Bpm, i + 1);
                }
                else
                {
                    timingInfo.AppendFormat("{2}. Offset: {0:#,0}ms\tBPM: Inherited ({1}x)\n", p.Offset, Math.Round(-100f / p.BeatLength, 1), i + 1);
                }
            }

            try
            {
                System.Windows.Forms.Clipboard.SetText(timingInfo.ToString());
            }
            catch (Exception)
            {
                NotificationManager.ShowMessage(LocalisationManager.GetString(OsuString.General_Editor_ClipboardNotAvailable));
            }
        }
Exemplo n.º 22
0
        private void checkFiles()
        {
            DirectoryInfo di = new DirectoryInfo(BeatmapManager.Current.ContainingFolderAbsolute);

            FileInfo[] files     = di.GetFiles(@"*", SearchOption.AllDirectories);
            long       totalSize = 0;
            bool       hasVideo  = false;

            foreach (FileInfo fi in files)
            {
                totalSize += fi.Length;
                if (!hasVideo)
                {
                    hasVideo = GeneralHelper.GetFileType(fi.Name) == FileType.Video;
                }
            }
            totalSize /= 1024; //Kb
            if (!hasVideo && totalSize > 10 * 1024)
            {
                Reports.Add(new AiReport(Severity.Warning, LocalisationManager.GetString(OsuString.AIMapset_LargeFilesize)));
            }
            else if (hasVideo && totalSize > 24 * 1024)
            {
                Reports.Add(new AiReport(Severity.Warning, LocalisationManager.GetString(OsuString.AIMapset_LargeFilesizeVideo)));
            }
        }
Exemplo n.º 23
0
        public static void OnJoinFail()
        {
            MatchSetup.Match = null;

            NotificationManager.ShowMessageMassive(LocalisationManager.GetString(OsuString.Lobby_Join_Fail), 2000);
            AudioEngine.PlaySample(@"match-leave");
            Status = GameBase.Mode == OsuModes.Lobby ? LobbyStatus.Idle : LobbyStatus.NotJoined;
        }
Exemplo n.º 24
0
        private OptionSection getLoginSection()
        {
            loginUserTB = null;
            loginPassTB = null;

            if (!BanchoClient.AllowUserSwitching)
            {
                return(new OptionSection(OsuString.General_Login)
                {
                    Children = new[] { new OptionText(LocalisationManager.GetString(OsuString.Options_ClientLocked)) }
                });
            }

            if (BanchoClient.Authenticated)
            {
                return(new OptionSection(OsuString.General_Login)
                {
                    Children = new[]
                    {
                        new OptionText(string.Format(LocalisationManager.GetString(OsuString.Options_LoggedIn), ConfigManager.sUsername), delegate
                        {
                            UserProfile.DisplayProfileFor(GameBase.User);
                        })
                    }
                });
            }

            if (GameBase.HasLogin)
            {
                return(new OptionSection(OsuString.General_Login)
                {
                    Children = new OptionElement[] { new OptionSpinner() }
                });
            }

            ;
            BanchoClient.DisableBancho = true;
            OptionSection loginSection = new OptionSection(OsuString.General_Login)
            {
                Children = new OptionElement[]
                {
                    (loginUserTB = new OptionTextbox(OsuString.Options_Username, ConfigManager.sUsername)),
                    (loginPassTB = new OptionTextbox(OsuString.Options_Password, true)),
                    new OptionCheckbox(LocalisationManager.GetString(OsuString.Options_RememberUsername), string.Empty, ConfigManager.sSaveUsername),
                    new OptionCheckbox(LocalisationManager.GetString(OsuString.Options_RememberPassword), string.Empty, ConfigManager.sSavePassword),
                    new OptionButton(OsuString.General_Login, SkinManager.NEW_SKIN_COLOUR_SECONDARY, delegate { performLogin(); }),
                    new OptionButton(LocalisationManager.GetString(OsuString.Options_CreateAnAccount), SkinManager.NEW_SKIN_COLOUR_SECONDARY, delegate
                    {
                        GameBase.ProcessStart(General.WEB_ROOT + @"/p/register");
                    })
                }
            };

            loginUserTB.Textbox.InputControl.OnKey += handleLoginTextBoxInput;
            loginPassTB.Textbox.InputControl.OnKey += handleLoginTextBoxInput;

            return(loginSection);
        }
Exemplo n.º 25
0
 private void resnapAllNotesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (DialogResult.Yes ==
         MessageBox.Show(LocalisationManager.GetString(OsuString.EditorControl_SnapAllNotesWarning), @"osu!",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation))
     {
         editor.Timing.BeatSnapSong();
     }
 }
Exemplo n.º 26
0
 private void retimeCurrentPointToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (DialogResult.Yes ==
         MessageBox.Show(LocalisationManager.GetString(OsuString.EditorControl_ResetCurrentTimingWarning), @"osu!",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation))
     {
         GameBase.Scheduler.Add(editor.Timing.TimingReset);
     }
 }
Exemplo n.º 27
0
    public void UpdateText()
    {
        var textMeshPro = GetComponentInChildren <TextMeshProUGUI>();

        if (textMeshPro != null)
        {
            textMeshPro.text = LocalisationManager.GetString(stringKey.ToString());
        }
    }
Exemplo n.º 28
0
        private void performAddDel(bool isDel, bool addCompleteSet = false)
        {
            bool hasChange = false;

            if (addCompleteSet)
            {
                List <Beatmap> maps = BeatmapManager.Beatmaps.FindAll(b => b.ContainingFolder == BeatmapManager.Current.ContainingFolder);
                foreach (Beatmap map in maps)
                {
                    if (isDel)
                    {
                        if (CollectionManager.RemoveFromCollection(Name, map.BeatmapChecksum))
                        {
                            Count--;
                            hasChange = true;
                        }
                    }
                    else
                    {
                        if (CollectionManager.AddToCollection(Name, map.BeatmapChecksum))
                        {
                            Count++;
                            hasChange = true;
                        }
                    }
                }
            }
            else
            {
                if (isDel)
                {
                    if (CollectionManager.RemoveFromCollection(Name, BeatmapManager.Current.BeatmapChecksum))
                    {
                        Count--;
                        hasChange = true;
                    }
                }
                else
                {
                    if (CollectionManager.AddToCollection(Name, BeatmapManager.Current.BeatmapChecksum))
                    {
                        Count++;
                        hasChange = true;
                    }
                }
            }

            if (!hasChange)
            {
                return;
            }

            NotificationManager.ShowMessageMassive(string.Format(isDel ? LocalisationManager.GetString(OsuString.CollectionSprites_Removed) : LocalisationManager.GetString(OsuString.CollectionSprites_Added),
                                                                 addCompleteSet ? BeatmapManager.Current.SortTitle : BeatmapManager.Current.DisplayTitleFull, Name), 1500);

            UpdateState();
        }
Exemplo n.º 29
0
        private void UpdateTextFields()
        {
            if (!StatsLoaded)
            {
                InfoText = string.Empty;
            }
            else
            {
                if (PerformancePoints > 0)
                {
                    InfoText = string.Format(GameBase.nfi, "Performance:{0}pp\nAccuracy:{1:0.00}%\n" + (extended ? @"Play Count: {2} (Lv{3:0})" : @"Lv{3}"), PerformancePoints.ToString(@"#,0", GameBase.nfi), Accuracy, PlayCount, (int)Level, PerformancePoints);
                }
                else if (RankedScore > 0)
                {
                    float  score  = RankedScore;
                    string suffix = string.Empty;
                    if (score > 1000000000)
                    {
                        suffix = @"b";
                        score /= 1000000000f;
                    }
                    else if (score > 1000000)
                    {
                        suffix = @"m";
                        score /= 1000000f;
                    }
                    else if (score > 0)
                    {
                        suffix = @"k";
                        score /= 1000f;
                    }

                    string scoreString = (score % 1 != 0 ? score.ToString(@"#,0.0", GameBase.nfi) : score.ToString(@"#,0", GameBase.nfi)) + suffix;

                    InfoText = string.Format(GameBase.nfi, "Score:{0}\nAccuracy:{1:0.00}%\n" + (extended ? @"Play Count: {2} (Lv{3:0})" : @"Lv{3}"), scoreString, Accuracy, PlayCount, (int)Level);
                }
                else
                {
                    InfoText = LocalisationManager.GetString(OsuString.User_Neverplayed);
                }

                RankText = Rank == 0 ? string.Empty : @"#" + Rank;
            }

            if (Sprites != null)
            {
                spriteInfo.Text = InfoText;
                spriteName.Text = Name;
                if (spriteStatus != null)
                {
                    spriteStatus.Text = StatusText;
                }
                updateLevelBar();
                spriteRank.Text = RankText;
            }
        }
Exemplo n.º 30
0
 private void recalculateSlidersToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (DialogResult.OK ==
         MessageBox.Show(
             LocalisationManager.GetString(OsuString.EditorControl_RecalculateSlidersMessage),
             @"osu!", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
     {
         editor.Timing.RecalculateSliderLengths();
     }
 }