Exemplo n.º 1
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.º 2
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.º 3
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);
        }
Exemplo n.º 4
0
        private void load(FrameworkConfigManager config)
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));

            Textures = new TextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            dependencies.Cache(Textures);

            var tracks = new ResourceStore <byte[]>();

            tracks.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Tracks"));
            tracks.AddStore(new OnlineStore());

            var samples = new ResourceStore <byte[]>();

            samples.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Samples"));
            samples.AddStore(new OnlineStore());

            Audio = new AudioManager(Host.AudioThread, tracks, samples)
            {
                EventScheduler = Scheduler
            };
            dependencies.Cache(Audio);

            dependencies.CacheAs(Audio.Tracks);
            dependencies.CacheAs(Audio.Samples);

            // attach our bindables to the audio subsystem.
            config.BindWith(FrameworkSetting.AudioDevice, Audio.AudioDevice);
            config.BindWith(FrameworkSetting.VolumeUniversal, Audio.Volume);
            config.BindWith(FrameworkSetting.VolumeEffect, Audio.VolumeSample);
            config.BindWith(FrameworkSetting.VolumeMusic, Audio.VolumeTrack);

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            dependencies.Cache(Shaders);

            var cacheStorage = Host.Storage.GetStorageForDirectory(Path.Combine("cache", "fonts"));

            // base store is for user fonts
            Fonts = new FontStore(useAtlas: true, cacheStorage: cacheStorage);

            // nested store for framework provided fonts.
            // note that currently this means there could be two async font load operations.
            Fonts.AddStore(localFonts = new FontStore(useAtlas: false));

            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-Bold"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-Italic"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-BoldItalic"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Solid"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Brands"));

            dependencies.Cache(Fonts);

            Localisation = new LocalisationManager(config);
            dependencies.Cache(Localisation);
        }
Exemplo n.º 5
0
 void UpdateDisplay()
 {
     DayText.text               = string.Format(DAY_STRING_FORMAT, LocalisationManager.GetValue(DAY_LOCALISATION_KEY), 1);
     PopulationText.text        = string.Format(POPULATION_STRING_FORMAT, SurvivorModel.AllModels.Count, "TODO");
     FoodText.text              = PlayerResources.Singleton.Food.ToString();
     BuildingMaterialsText.text = PlayerResources.Singleton.BuildingMaterials.ToString();
 }
Exemplo n.º 6
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.º 7
0
        public BibTeXControl()
        {
            InitializeComponent();

            ButtonBibTexEditor.Caption = "Popup";
            ButtonBibTexEditor.ToolTip = "Edit this BibTeX in a larger popup window.";
            ButtonBibTexEditor.Click  += ButtonBibTexEditor_Click;

            ButtonBibTexClear.Caption = "Clear";
            ButtonBibTexClear.ToolTip = "Clear this BibTeX.";
            ButtonBibTexClear.Click  += ButtonBibTexClear_Click;

            ButtonBibTexAutoFind.Caption  = "Find";
            ButtonBibTexAutoFind.ToolTip  = LocalisationManager.Get("LIBRARY/TIP/BIBTEX_AUTOFIND");
            ButtonBibTexAutoFind.Click   += ButtonBibTexAutoFind_Click;
            ButtonBibTexAutoFind.MinWidth = 0;

            ButtonBibTexSniffer.Caption  = "Sniffer";
            ButtonBibTexSniffer.ToolTip  = LocalisationManager.Get("LIBRARY/TIP/BIBTEX_SNIFFER");
            ButtonBibTexSniffer.Click   += ButtonBibTexSniffer_Click;
            ButtonBibTexSniffer.MinWidth = 0;

            ButtonUseSummary.Caption  = "Summary";
            ButtonUseSummary.ToolTip  = "Use your Reference Summary information to create a BibTeX record.";
            ButtonUseSummary.Click   += ButtonUseSummary_Click;
            ButtonUseSummary.MinWidth = 0;
        }
Exemplo n.º 8
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.º 9
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);
        }
        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.º 11
0
        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.º 12
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.º 13
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.º 14
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);
        }
        void OnConfirmAssignment(ConfirmAssignmentEvent e)
        {
            bool scavengerTeamsUnassigned = false;
            bool survivorsUnassigned      = false;

            foreach (SurvivorModel model in SurvivorModel.AllModels)
            {
                if (model.AssignedBuilding == null)
                {
                    survivorsUnassigned = true;
                    break;
                }
            }

            if (!survivorsUnassigned && !scavengerTeamsUnassigned)
            {
                OnModalOk();
                return;
            }

            string confirmText   = LocalisationManager.GetValue(ANYTHING_UNASSIGNED_KEY);
            string survivorText  = survivorsUnassigned ? LocalisationManager.GetValue(SURVIVORS_UNASSIGNED_KEY) : string.Empty;
            string scavengerText = scavengerTeamsUnassigned ? LocalisationManager.GetValue(SCAVENGERS_UNASSIGNED_KEY) : string.Empty;

            string cancelText = LocalisationManager.GetValue(CANCEL_KEY);
            string okText     = LocalisationManager.GetValue(OK_KEY);

            confirmText = string.Format(confirmText, survivorText, scavengerText);
            EventSystem.Publish(new ShowModalEvent(confirmText, okText, OnModalOk, cancelText, null));
        }
Exemplo n.º 16
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.º 17
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.º 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 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.º 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
 public TerramonMod()
 {
     Instance     = this;
     Localisation = new LocalisationManager(locale);
     Store        = new ResourceStore <byte[]>(new EmbeddedStore());
     Localisation.AddLanguage(GameCulture.English.Name, new LocalisationStore(Store, GameCulture.English));
 }
Exemplo n.º 22
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.º 23
0
        private void load(OsuColour colours, LocalisationManager localisation)
        {
            hoverColour  = colours.Yellow;
            artistColour = colours.Gray9;

            var metadata = BeatmapSetInfo.Metadata;

            FilterTerms = metadata.SearchableTerms;

            Children = new Drawable[]
            {
                handle = new PlaylistItemHandle
                {
                    Colour = colours.Gray5
                },
                text = new OsuTextFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Left = 20
                    },
                    ContentIndent = 10f,
                },
            };

            titleBind  = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title)));
            artistBind = localisation.GetLocalisedString(new LocalisedString((metadata.ArtistUnicode, metadata.Artist)));

            artistBind.BindValueChanged(newText => recreateText(), true);
        }
Exemplo n.º 24
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.º 25
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.º 26
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.º 27
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.º 28
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.º 29
0
        public ExtentionUIPopup(APIManager api, LocalisationManager localisationManager, string genericPopupID, object popupHeaderLocalisationID, object popupMessageLocalisationID) : base(api)
        {
            _localisation   = localisationManager;
            _genericPopupID = genericPopupID;

            CreateLocalisationKey(POPUP_HEADER, popupHeaderLocalisationID);
            CreateLocalisationKey(POPUP_MESSAGE, popupMessageLocalisationID);
        }
Exemplo n.º 30
0
    // Need a data structure for this to parse and fill out texts accordingly.
    // This needs to be thought through.
    // Main level, sublevel1, sublevel2


    // Use this for initialization
    void Start()
    {
        camera = GameObject.Find("Main Camera");
        lm     = this.GetComponent <LocalisationManager>();
        lm.LoadLocalisedText("localizedText_en.json");
        Debug.Log(lm);
        Debug.Log(lm.GetLocalisedValue("game_title"));
    }