Exemple #1
0
            public LayoutSelectionItem(LyricLayout layout)
            {
                this.layout = layout;

                AutoSizeAxes = Axes.Both;
                Spacing      = new Vector2(5);
                Direction    = FillDirection.Vertical;

                InternalChildren = new Drawable[]
                {
                    cornerContainer = new Container
                    {
                        AutoSizeAxes = Axes.Both,
                        Masking      = true,
                        CornerRadius = 5f,
                        Child        = drawableLayoutPreview = new DrawableLayoutPreview
                        {
                            Size   = new Vector2(selection_size),
                            Layout = layout,
                        }
                    },
                    new OsuSpriteText
                    {
                        Text = layout.Name
                    }
                };

                selectedLayoutIndex.BindValueChanged(e =>
                {
                    var selected = layout.ID == e.NewValue;
                    cornerContainer.BorderThickness = selected ? 3 : 0;
                }, true);
            }
Exemple #2
0
        protected virtual void ApplyLayout(LyricLayout layout)
        {
            // Layout relative to parent
            Anchor = layout.Alignment;
            Origin = layout.Alignment;
            Margin = new MarginPadding
            {
                Left   = layout.Alignment.HasFlag(Anchor.x0) ? layout.HorizontalMargin : 0,
                Right  = layout.Alignment.HasFlag(Anchor.x2) ? layout.HorizontalMargin : 0,
                Top    = layout.Alignment.HasFlag(Anchor.y0) ? layout.VerticalMargin : 0,
                Bottom = layout.Alignment.HasFlag(Anchor.y2) ? layout.VerticalMargin : 0
            };
            Padding = new MarginPadding(30);

            foreach (var lyricPiece in lyricPieces)
            {
                // Layout to text
                lyricPiece.Continuous = layout.Continuous;
                lyricPiece.KaraokeTextSmartHorizon = layout.SmartHorizon;
                lyricPiece.Spacing = new Vector2(layout.LyricsInterval, lyricPiece.Spacing.Y);

                // Ruby
                lyricPiece.RubySpacing   = new Vector2(layout.RubyInterval, lyricPiece.RubySpacing.Y);
                lyricPiece.RubyAlignment = layout.RubyAlignment;
                lyricPiece.RubyMargin    = layout.RubyMargin;

                // Romaji
                lyricPiece.RomajiSpacing   = new Vector2(layout.RomajiInterval, lyricPiece.RomajiSpacing.Y);
                lyricPiece.RomajiAlignment = layout.RomajiAlignment;
                lyricPiece.RomajiMargin    = layout.RomajiMargin;
            }
        }
Exemple #3
0
                public DeleteButton(LyricLayout layout)
                {
                    this.layout      = layout;
                    RelativeSizeAxes = Axes.Y;

                    Width = button_width + item_height / 2; // add corner radius to cover with fill
                }
Exemple #4
0
            public ItemContent(LyricLayout layout)
            {
                this.layout = layout;

                RelativeSizeAxes = Axes.X;
                Height           = item_height;
                Masking          = true;
            }
Exemple #5
0
 protected override void ApplyLayout(LyricLayout layout)
 {
     // use my own layout
     base.ApplyLayout(new LyricLayout
     {
         Name      = "Skin layout",
         Alignment = Anchor.Centre
     });
 }
        public DeleteLayoutDialog(LyricLayout layout, Action deleteAction)
        {
            HeaderText = "Confirm deletion of";
            BodyText   = $"Are you sure you want to delete layout {layout.Name}?";

            Icon = FontAwesome.Regular.TrashAlt;

            Buttons = new PopupDialogButton[]
            {
                new PopupDialogOkButton
                {
                    Text   = @"Yes. Go for it.",
                    Action = deleteAction
                },
                new PopupDialogCancelButton
                {
                    Text = @"No! Abort mission!",
                },
            };
        }
Exemple #7
0
 protected override void ApplyLayout(LyricLayout layout)
 {
     base.ApplyLayout(layout);
     Padding = new MarginPadding(0);
 }
Exemple #8
0
 public bool IsLayoutModified(LyricLayout layout)
 {
     throw new NotImplementedException();
 }
Exemple #9
0
 public void AddLayout(LyricLayout layout)
 {
     throw new NotImplementedException();
 }
Exemple #10
0
 public void UpdateLayoutName(LyricLayout layout, string newValue)
 {
     throw new NotImplementedException();
 }
Exemple #11
0
 public void ChangeCurrentLayout(LyricLayout layout)
 {
     LoadedLayout.Value = layout;
     EditLayout.Value   = layout;
 }