private void initializeChannels() { SpriteText loading; Add(loading = new OsuSpriteText { Text = @"initialising chat...", Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = 40, }); messageRequest?.Cancel(); ListChannelsRequest req = new ListChannelsRequest(); req.Success += delegate(List <Channel> channels) { Scheduler.Add(delegate { loading.FadeOut(100); loading.Expire(); addChannel(channels.Find(c => c.Name == @"#lazer")); addChannel(channels.Find(c => c.Name == @"#osu")); addChannel(channels.Find(c => c.Name == @"#lobby")); }); messageRequest = Scheduler.AddDelayed(fetchNewMessages, 1000, true); }; api.Queue(req); }
private void load(OsuColour colours) { SelectedColour = colours.Green; DeselectedColour = SelectedColour.Opacity(0.5f); Text = @"random"; Action = () => { if (rewindSearch) { const double fade_time = 500; OsuSpriteText rewindSpriteText; TextContainer.Add(rewindSpriteText = new OsuSpriteText { Alpha = 0, Text = @"rewind", AlwaysPresent = true, // make sure the button is sized large enough to always show this Anchor = Anchor.Centre, Origin = Anchor.Centre, }); rewindSpriteText.FadeOutFromOne(fade_time, Easing.In); rewindSpriteText.MoveTo(Vector2.Zero).MoveTo(new Vector2(0, 10), fade_time, Easing.In); rewindSpriteText.Expire(); SpriteText.FadeInFromZero(fade_time, Easing.In); PreviousRandom.Invoke(); } else { NextRandom.Invoke(); } }; }
private void load(OsuColour colours) { SelectedColour = colours.Green; DeselectedColour = SelectedColour.Opacity(0.5f); TextContainer.Add(persistentText = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AlwaysPresent = true, AutoSizeAxes = Axes.Both, Children = new[] { randomSpriteText = new OsuSpriteText { AlwaysPresent = true, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "random", }, rewindSpriteText = new OsuSpriteText { AlwaysPresent = true, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "rewind", Alpha = 0f, } } }); Action = () => { if (rewindSearch) { const double fade_time = 500; OsuSpriteText fallingRewind; TextContainer.Add(fallingRewind = new OsuSpriteText { Alpha = 0, Text = rewindSpriteText.Text, AlwaysPresent = true, // make sure the button is sized large enough to always show this Anchor = Anchor.Centre, Origin = Anchor.Centre, }); fallingRewind.FadeOutFromOne(fade_time, Easing.In); fallingRewind.MoveTo(Vector2.Zero).MoveTo(new Vector2(0, 10), fade_time, Easing.In); fallingRewind.Expire(); persistentText.FadeInFromZero(fade_time, Easing.In); PreviousRandom.Invoke(); } else { NextRandom.Invoke(); } }; }