protected override void OnStartup(StartupEventArgs e) { #if DEBUG LogManager.AddDebugListener(true); #endif var languageService = ServiceLocator.Default.ResolveType <ILanguageService>(); // Note: it's best to use .CurrentUICulture in actual apps since it will use the preferred language // of the user. But in order to demo multilingual features for devs (who mostly have en-US as .CurrentUICulture), // we use .CurrentCulture for the sake of the demo languageService.PreferredCulture = CultureInfo.CurrentCulture; languageService.FallbackCulture = new CultureInfo("en-US"); FontMaterial.Initialize(false); FontAwesome.Initialize(); var serviceLocator = ServiceLocator.Default; var shellService = serviceLocator.ResolveType <IShellService>(); shellService.CreateAsync <ShellWindow>(); _stopwatch.Stop(); Log.Info("Elapsed startup stopwatch time: {0}", _stopwatch.Elapsed); }
/// <inheritdoc /> /// <summary> /// Ctor - /// </summary> /// <param name="type"></param> /// <param name="size"></param> public HitErrorBar(ScalableVector2 size) { Size = size; MiddleLine = new Sprite() { Size = new ScalableVector2(2, 0, 0, 1), Alignment = Alignment.MidCenter, Parent = this }; // Create the object pool and initialize all of the sprites. LineObjectPool = new List <Sprite>(); for (var i = 0; i < PoolSize; i++) { LineObjectPool.Add(new Sprite() { Parent = this, Size = new ScalableVector2(4, 0, 0, 1), Alignment = Alignment.MidCenter, Alpha = 0 }); } // Create the hit chevron. LastHitCheveron = new Sprite() { Parent = this, Alignment = Alignment.MidCenter, Alpha = 1, Image = FontAwesome.Get(FontAwesomeIcon.fa_caret_down), Y = -Height - 3, Size = new ScalableVector2(8, 8) }; }
/// <summary> /// </summary> private void CreateReturnButton() => ReturnButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_long_arrow_pointing_to_the_right), (sender, args) => { if (string.IsNullOrWhiteSpace(NameTextbox.RawText)) { NotificationManager.Show(NotificationLevel.Error, "Your layer name must not be empty "); return; } var selectedLayer = View.LayerCompositor.ScrollContainer.AvailableItems[View.LayerCompositor.SelectedLayerIndex.Value]; var colorString = $"{SelectedColor.Tint.R},{SelectedColor.Tint.G},{SelectedColor.Tint.B}"; // Only change/add add an action if it was actually changed. if (NameTextbox.RawText != selectedLayer.Name || selectedLayer.ColorRgb != colorString && selectedLayer.ColorRgb != null) { Screen.Ruleset.ActionManager.EditLayer(View.LayerCompositor, selectedLayer, NameTextbox.RawText, colorString); } Screen.ActiveLayerInterface.Value = EditorLayerInterface.Composition; }) { Parent = HeaderBackground, Alignment = Alignment.MidRight, Size = new ScalableVector2(20, 20), Tint = Color.White, X = -8 };
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="dialog"></param> /// <param name="name"></param> /// <param name="bindable"></param> public SettingsBool(SettingsDialog dialog, string name, Bindable <bool> bindable) : base(dialog, name) { Bindable = bindable; Selector = new HorizontalSelector(new List <string> { "No", "Yes", }, new ScalableVector2(200, 26), Fonts.Exo2Medium, 13, FontAwesome.Get(FontAwesomeIcon.fa_chevron_pointing_to_the_left), FontAwesome.Get(FontAwesomeIcon.fa_right_chevron), new ScalableVector2(30, 22), 5, OnSelectorChanged, Convert.ToInt32(Bindable.Value)) { Parent = this, Alignment = Alignment.MidRight, Tint = Color.Transparent, SelectedItemText = { Tint = Color.White, UsePreviousSpriteBatchOptions = true }, ButtonSelectLeft = { UsePreviousSpriteBatchOptions = true }, ButtonSelectRight = { UsePreviousSpriteBatchOptions = true } }; Selector.X -= 68; Bindable.ValueChanged += OnBindableValueChanged; }
/// <summary> /// Gets a chat badge icon based on user groups. /// </summary> /// <param name="groups"></param> /// <returns></returns> public static Texture2D GetIcon(UserGroups groups) { if (groups.HasFlag(UserGroups.Developer)) { return(FontAwesome.Get(FontAwesomeIcon.fa_code)); } // Bot if (groups.HasFlag(UserGroups.Bot)) { return(FontAwesome.Get(FontAwesomeIcon.fa_open_wrench_tool_silhouette)); } // Admin if (groups.HasFlag(UserGroups.Admin)) { return(FontAwesome.Get(FontAwesomeIcon.fa_legal_hammer)); } if (groups.HasFlag(UserGroups.Moderator)) { return(FontAwesome.Get(FontAwesomeIcon.fa_ban_circle_symbol)); } return(null); }
private void menuXList1_DownClick(TPlayerList.TopItem Item) { thisPage = 1; isdownok = true; menuXList1.SelectItemIndex = Item.Index; menuXList1.Tom(Item); webVideoList1.Items.Clear(); webVideoList1.chatVScroll.MoveSliderToLocation(0); string typeUrl = $"?ac=detail&t={Item.Tag}&pg={thisPage}"; timer1.Enabled = true; Action _action = () => { LoadingCover(typeUrl); }; _task.ContinueWhenAll(new Task[] { _task.StartNew(_action) }, (action => { this.Invoke(new Action(() => { webVideoList1.chatVScroll.OnScrollChange(100); timer1.Enabled = false; if (isgo != -1) { isgo = -1; //isgo = true; pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, Color.Black); } })); })); }
/// <summary> /// 创建路径 /// </summary> /// <param name="display"></param> /// <param name="path"></param> /// <param name="icon"></param> /// <param name="behave"></param> /// <returns></returns> public static ILocation Create(string display, string path, FontAwesome icon, LinkBehave behave) { return(new Location(path) { Display = display, Icon = icon, Behave = behave }); }
/// <summary> /// åˆ›å»ºå…ƒç´ /// </summary> /// <param name="source"></param> /// <returns></returns> public static HtmlElement CreateElement(this FontAwesome source) { var result = new HtmlElement(HtmlTag.I); result.AddClass(string.Format("fa fa-{0}", source.ToString().ToLower().Replace("_", "-"))); return(result); }
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="view"></param> /// <param name="container"></param> public CurrentlySearchingInterface(DownloadScreenView view, DownloadScrollContainer container) { View = view; Size = new ScalableVector2(container.Width - 4, 100); Tint = Color.Black; Alpha = 0.85f; SetChildrenAlpha = false; Icon = new Sprite { Parent = this, Alignment = Alignment.TopLeft, Image = FontAwesome.Get(FontAwesomeIcon.fa_magnifying_glass), Size = new ScalableVector2(18, 18), Y = 18, }; Header = new SpriteText(Fonts.Exo2SemiBold, "Searching For Mapsets...", 14) { Parent = Icon, Alignment = Alignment.MidLeft, X = Icon.Width + 10 }; Icon.X = Width / 2f - Header.Width / 2f - 10 - Icon.Width / 2f; CreateLoadingWheel(); View.SearchBox.IsSearching.ValueChanged += OnIsSearchingValueChanged; }
public Statistic(FontAwesome icon) { AutoSizeAxes = Axes.Both; Direction = FillDirection.Horizontal; Spacing = new Vector2(2f); Children = new Drawable[] { new SpriteIcon { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Icon = icon, Shadow = true, Size = new Vector2(13), }, text = new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = @"Exo2.0-SemiBoldItalic", TextSize = 14, }, }; }
/// <summary> /// Creates tool buttons to the bottom right of the screen. /// </summary> private void CreateToolButtons() { const int targetY = -5; const int animationTime = 1100; PowerButton = new ToolButton(FontAwesome.Get(FontAwesomeIcon.fa_power_button_off), (o, e) => DialogManager.Show(new QuitDialog())) { Alignment = Alignment.BotRight, }; PowerButton.Y = PowerButton.Height; // Add Animation to move it up. PowerButton.Animations.Add(new Animation(AnimationProperty.Y, Easing.OutQuint, PowerButton.Y, targetY, animationTime)); MiddleContainer.AddContainedDrawable(PowerButton); // Create settings button SettingsButton = new ToolButton(FontAwesome.Get(FontAwesomeIcon.fa_settings), (o, e) => DialogManager.Show(new SettingsDialog())) { Parent = MiddleContainer, Alignment = Alignment.BotRight, Y = PowerButton.Y, X = PowerButton.X - PowerButton.Width - 5, Animations = { new Animation(AnimationProperty.Y, Easing.OutQuint, PowerButton.Y, targetY, animationTime) } }; MiddleContainer.AddContainedDrawable(SettingsButton); }
/// <summary> /// Creates the restart button /// </summary> private void CreateRestartButton() { RestartButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_undo_arrow)) { Parent = this, Alignment = Alignment.MidRight, Size = new ScalableVector2(Height * 0.50f, Height * 0.50f), X = PauseResumeButton.X - PauseResumeButton.Width - 10, }; RestartButton.Clicked += (o, e) => { SkinManager.Skin.SoundClick.CreateChannel().Play(); try { AudioEngine.LoadCurrentTrack(); if (AudioEngine.Track != null) { lock (AudioEngine.Track) AudioEngine.Track?.Play(); } PauseResumeButton.Image = FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol); } catch (Exception) { Logger.Error($"Failed to load track", LogType.Runtime); } }; }
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="dialog"></param> /// <param name="name"></param> /// <param name="bindable"></param> public SettingsSlider(SettingsDialog dialog, string name, BindableInt bindable) : base(dialog, name) { Bindable = bindable; bindable.ValueChanged += OnValueChanged; Value = new SpriteText(Fonts.Exo2Medium, $"{bindable.Value.ToString()}", 13) { Parent = this, Alignment = Alignment.MidRight, X = -30, UsePreviousSpriteBatchOptions = true }; var slider = new Slider(bindable, Vector2.One, FontAwesome.Get(FontAwesomeIcon.fa_circle)) { Parent = this, Alignment = Alignment.MidRight, X = -90, UsePreviousSpriteBatchOptions = true, Width = 350, Height = 2, ProgressBall = { UsePreviousSpriteBatchOptions = true } }; }
/// <summary> /// Creates the pause/resume control button. /// </summary> private void CreatePauseResumeButton() { PauseResumeButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol)) { Parent = this, Alignment = Alignment.MidRight, Size = new ScalableVector2(Height * 0.50f, Height * 0.50f), X = NextButton.X - NextButton.Width - 10 }; PauseResumeButton.Clicked += (o, e) => { SkinManager.Skin.SoundClick.CreateChannel().Play(); if (AudioEngine.Track == null || AudioEngine.Track.IsDisposed) { return; } if (AudioEngine.Track.IsStopped || AudioEngine.Track.IsPaused) { AudioEngine.Track.Play(); PauseResumeButton.Image = FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol); ChangeDiscordPresenceToSongTitle(); } else { AudioEngine.Track.Pause(); PauseResumeButton.Image = FontAwesome.Get(FontAwesomeIcon.fa_play_button); ChangeDiscordPresenceToIdle(); } }; }
/// <summary> /// </summary> private void CreateDeleteButton() => DeleteButton = new JukeboxButton(FontAwesome.Get(FontAwesomeIcon.fa_times), (sender, args) => { if (SelectedLayerIndex.Value == 0) { NotificationManager.Show(NotificationLevel.Error, "You cannot delete the default layer!"); return; } // Show them a confirmation dialog if objects are contained inside of the layer. if (Screen.WorkingMap.HitObjects.Any(x => x.EditorLayer == SelectedLayerIndex.Value)) { DialogManager.Show(new EditorLayerDeleteConfirmationDialog(Screen.Ruleset as EditorRulesetKeys, ScrollContainer.AvailableItems[SelectedLayerIndex.Value])); return; } Screen.Ruleset.ActionManager.RemoveLayer(Screen.WorkingMap, this, ScrollContainer.AvailableItems[SelectedLayerIndex.Value]); }) { Parent = HeaderBackground, Alignment = Alignment.MidRight, Size = new ScalableVector2(20, 20), Tint = Color.Crimson, X = -8 };
private void ChangeMenuHighlight(FontAwesome menuIcon, TextView menuText) { ResetMenuIcons(); menuIcon.SetTextColor(Color.ParseColor("#FFFFFF")); menuText.SetTextColor(Color.ParseColor("#FFFFFF")); }
private void cmbFontAwesomeType_SelectedIndexChanged(object sender, EventArgs e) { if (this.cmbFontAwesomeType.SelectedIndex < 0) { return; } FontAwesome.IconSize = (int)this.nudIconSize.Value; if (this.cmbBackColor.SelectedIndex > -1) { FontAwesome.BackColer = Color.FromName(this.cmbBackColor.Text); } if (this.cmbBorderColor.SelectedIndex > -1) { FontAwesome.BorderColer = Color.FromName(this.cmbBorderColor.Text); } if (this.cmbForeColor.SelectedIndex > -1) { FontAwesome.ForeColer = Color.FromName(this.cmbForeColor.Text); } FontAwesome.BorderVisible = this.cbShowBorder.Checked == true; int val = FontAwesome.TypeDict[this.cmbFontAwesomeType.Text]; Bitmap bmp = FontAwesome.GetImage(val);//f188 this.panel1.BackgroundImage = bmp; this.Icon = FontAwesome.GetIcon(val);//f188; }
public MultiplayerEndGameWaitTime() { Image = UserInterface.WaitingPanel; Size = new ScalableVector2(450, 134); Alpha = 0; SetChildrenAlpha = true; Icon = new Sprite { Parent = this, Alignment = Alignment.TopCenter, Image = FontAwesome.Get(FontAwesomeIcon.fa_information_button), Y = 18, Size = new ScalableVector2(24, 24) }; // ReSharper disable once ObjectCreationAsStatement var text = new SpriteTextBitmap(FontsBitmap.AllerRegular, "Waiting for other players to finish!") { Parent = this, FontSize = 20, Y = Icon.Y + Icon.Height + 10, Alignment = Alignment.TopCenter }; LoadingWheel = new Sprite() { Parent = this, Size = new ScalableVector2(40, 40), Image = UserInterface.LoadingWheel, Alignment = Alignment.TopCenter, Y = text.Y + text.Height + 10 }; }
/// <summary> /// Creates dots for the individual hit differences. /// </summary> private void CreateDots() { // Exit if we don't have any dots to draw. if (FilteredStats.Count == 0) { return; } // Return if the graph isn't wide enough. if (Width < DotSize) { return; } // Create a sprite for every dot. foreach (var breakdown in FilteredStats) { // ReSharper disable once ObjectCreationAsStatement new Sprite { Parent = this, Tint = SkinManager.Skin.Keys[GameMode.Keys4].JudgeColors[breakdown.Judgement], Size = new ScalableVector2(DotSize, DotSize), Image = FontAwesome.Get(FontAwesomeIcon.fa_circle), X = (int)TimeToX(breakdown.SongPosition) - (int)(DotSize / 2), Y = (int)HitDifferenceToY(breakdown.HitDifference), Alignment = Alignment.MidLeft, }; } }
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="gameTime"></param> public override void Update(GameTime gameTime) { if (AudioEngine.Track != null) { if (AudioEngine.Track.IsPlaying) { var pause = FontAwesome.Get(FontAwesomeIcon.fa_pause_symbol); if (Image != pause) { Image = pause; } } else if (AudioEngine.Track.IsStopped || AudioEngine.Track.IsPaused) { var play = FontAwesome.Get(FontAwesomeIcon.fa_play_button); if (Image != play) { Image = play; } } } base.Update(gameTime); }
public ScoreModIcon(FontAwesome icon, Color4 colour) { AutoSizeAxes = Axes.Both; Children = new[] { new SpriteIcon { Origin = Anchor.Centre, Anchor = Anchor.Centre, Icon = FontAwesome.fa_osu_mod_bg, Colour = colour, Shadow = true, Size = new Vector2(30), }, new SpriteIcon { Origin = Anchor.Centre, Anchor = Anchor.Centre, Icon = icon, Colour = OsuColour.Gray(84), Size = new Vector2(18), Position = new Vector2(0f, 2f), }, }; }
public Statistic(FontAwesome icon, int value = 0) { Anchor = Anchor.TopRight; Origin = Anchor.TopRight; AutoSizeAxes = Axes.Both; Direction = FillDirection.Horizontal; Spacing = new Vector2(5f, 0f); Children = new Drawable[] { text = new OsuSpriteText { Font = @"Exo2.0-SemiBoldItalic", }, new SpriteIcon { Icon = icon, Shadow = true, Size = new Vector2(14), Margin = new MarginPadding { Top = 1 }, }, }; Value = value; }
public ScoreComponentLabel(FontAwesome icon, string value) { Anchor = Anchor.CentreLeft; Origin = Anchor.CentreLeft; Size = new Vector2(60f, 20f); Padding = new MarginPadding { Top = 10f, }; Children = new Drawable[] { new TextAwesome { Origin = Anchor.Centre, Icon = FontAwesome.fa_square, Colour = OsuColour.FromHex(@"3087ac"), Rotation = 45, Shadow = true, }, new TextAwesome { Origin = Anchor.Centre, Icon = icon, Colour = OsuColour.FromHex(@"a4edff"), Scale = new Vector2(0.8f), }, new GlowingSpriteText(value, @"Exo2.0-Bold", 17, Color4.White, OsuColour.FromHex(@"83ccfa")) { Origin = Anchor.CentreLeft, Margin = new MarginPadding { Left = 15, }, }, }; }
/// <summary> /// </summary> private void CreateHeader() { HeaderContainer = new Sprite { Parent = ContentContainer, Size = new ScalableVector2(ContentContainer.Width, 45), Tint = ColorHelper.HexToColor($"#212121") }; var headerFlag = new Sprite() { Parent = HeaderContainer, Size = new ScalableVector2(5, HeaderContainer.Height), Tint = Color.LightGray, Alpha = 0 }; var headerText = new SpriteText(Fonts.Exo2Medium, "Options Menu", 16) { Parent = HeaderContainer, Alignment = Alignment.MidLeft, X = headerFlag.X + 15 }; var exitButton = new ImageButton(FontAwesome.Get(FontAwesomeIcon.fa_times), (sender, args) => DialogManager.Dismiss()) { Parent = HeaderContainer, Alignment = Alignment.MidRight, Size = new ScalableVector2(25, 25) }; exitButton.X -= exitButton.Width / 2f + 5; }
private void cmbFontAwesomeType_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.CmbFontAwesomeType.SelectedIndex < 0) { return; } FontAwesome.IconSize = (int)this.Slider1.Value; if (this.CmbBackColor.SelectedIndex > -1) { FontAwesome.BackColer = System.Drawing.Color.FromName(this.CmbBackColor.SelectedItem.ToString()); } if (this.CmbBorderColor.SelectedIndex > -1) { FontAwesome.BorderColer = System.Drawing.Color.FromName(this.CmbBorderColor.SelectedItem.ToString()); } if (this.CmbForeColor.SelectedIndex > -1) { FontAwesome.ForeColer = System.Drawing.Color.FromName(this.CmbForeColor.SelectedItem.ToString()); } FontAwesome.BorderVisible = this.CbShowBorder.IsChecked == true; int val = FontAwesome.TypeDict[this.CmbFontAwesomeType.SelectedItem.ToString()]; Bitmap bmp = FontAwesome.GetImage(val);//f188 ImageSource imgs = ToImageSource(bmp); this.Image.Background = new ImageBrush() { ImageSource = imgs, Stretch = Stretch.None }; }
public ScoreModIcon(FontAwesome icon, Color4 colour) { AutoSizeAxes = Axes.Both; Children = new[] { new TextAwesome { Origin = Anchor.Centre, Anchor = Anchor.Centre, Icon = FontAwesome.fa_osu_mod_bg, Colour = colour, Shadow = true, TextSize = 30, UseFullGlyphHeight = false, }, new TextAwesome { Origin = Anchor.Centre, Anchor = Anchor.Centre, Icon = icon, Colour = OsuColour.Gray(84), TextSize = 18, Position = new Vector2(0f, 2f), UseFullGlyphHeight = false, }, }; }
public IconPill(FontAwesome icon) { AutoSizeAxes = Axes.Both; Masking = true; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.5f, }, new Container { AutoSizeAxes = Axes.Both, Margin = new MarginPadding(5), Child = new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, Icon = icon, Size = new Vector2(12), }, }, }; }
public SpectatorCount() { SetChildrenVisibility = true; Eye = new Sprite { Parent = this, Size = new ScalableVector2(20, 20), Image = FontAwesome.Get(FontAwesomeIcon.fa_eye_open), SetChildrenVisibility = true }; SpectatorsText = new SpriteTextBitmap(FontsBitmap.GothamRegular, $" ") { Parent = Eye, Alignment = Alignment.MidLeft, FontSize = 14, X = Eye.X + Eye.Width + 10 }; UpdateSpectatorText(); Size = new ScalableVector2(Eye.X + Eye.Width + 10 + SpectatorsText.Width, SpectatorsText.Height); OnlineManager.Client.OnSpectatorJoined += OnSpectatorJoined; OnlineManager.Client.OnSpectatorLeft += OnSpectatorLeft; }
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="dialog"></param> /// <param name="name"></param> /// <param name="bindable"></param> public SettingsSlider(SettingsDialog dialog, string name, BindableInt bindable, Func <int, string> display = null) : base(dialog, name) { Display = display ?? (x => x.ToString()); Bindable = bindable; bindable.ValueChanged += OnValueChanged; Value = new SpriteText(Fonts.Exo2Medium, Display(bindable.Value), 13) { Parent = this, Alignment = Alignment.MidRight, X = -30, UsePreviousSpriteBatchOptions = true }; var slider = new Slider(bindable, Vector2.One, FontAwesome.Get(FontAwesomeIcon.fa_circle)) { Parent = this, Alignment = Alignment.MidRight, X = -110, UsePreviousSpriteBatchOptions = true, Width = 330, Height = 2, ProgressBall = { UsePreviousSpriteBatchOptions = true } }; }
/// <summary> /// </summary> private void CreateMenuHeader() { MenuHeader = new MenuHeader(FontAwesome.Get(FontAwesomeIcon.fa_gamepad_console), "score", "results", "View in-depth results of a play", ColorHelper.HexToColor("#69acc5")) { Parent = Container }; }
public DifficultyIcon(FontAwesome icon, Color4 color) { const float size = 20; Size = new Vector2(size); Children = new[] { new TextAwesome { Anchor = Anchor.Centre, TextSize = size, Colour = color, Icon = icon } }; }
// Token: 0x0600245A RID: 9306 // RVA: 0x000DC4A0 File Offset: 0x000DA6A0 internal Class534(FontAwesome fontAwesome_0, float float_8, Vector2 vector2_11) : base(((char)fontAwesome_0).ToString(), float_8, vector2_11, 1f, true, Color.get_White()) { base.method_62("FontAwesome"); this.origins_0 = Origins.Centre; }