Beispiel #1
0
        /// <summary>
        /// Default constructor
        /// </summary>

        public FrmSkork()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            Point frmSize = new Point(750, 500);

            Width  = frmSize.X;
            Height = frmSize.Y;

            UserInterface.DrawMain(this, ref frmSize);
            OutlineBox o = new OutlineBox(ref this.picSyntax, null, 3);
        }
Beispiel #2
0
        private Drawable createProvider(Skin skin, Func <ISkin, Drawable> creationFunction, IBeatmap beatmap)
        {
            var created = creationFunction(skin);

            createdDrawables.Add(created);

            SkinProvidingContainer mainProvider;
            Container              childContainer;
            OutlineBox             outlineBox;
            SkinProvidingContainer skinProvider;

            var children = new Container
            {
                RelativeSizeAxes = Axes.Both,
                BorderColour     = Colour4.White,
                BorderThickness  = 5,
                Masking          = true,

                Children = new Drawable[]
                {
                    new Box
                    {
                        AlwaysPresent    = true,
                        Alpha            = 0,
                        RelativeSizeAxes = Axes.Both,
                    },
                    new OsuSpriteText
                    {
                        Text    = skin?.SkinInfo?.Name ?? "none",
                        Scale   = new Vector2(1.5f),
                        Padding = new MarginPadding(5),
                    },
                    childContainer = new Container
                    {
                        Anchor   = Anchor.Centre,
                        Origin   = Anchor.Centre,
                        Children = new Drawable[]
                        {
                            outlineBox = new OutlineBox(),
                            (mainProvider = new SkinProvidingContainer(skin)).WithChild(
                                skinProvider = new SkinProvidingContainer(Ruleset.Value.CreateInstance().CreateLegacySkinProvider(mainProvider, beatmap))
                            {
                                Child = created,
                            }
                                )
                        }
                    },
                }
            };

            // run this once initially to bring things into a sane state as early as possible.
            updateSizing();

            // run this once after construction to handle the case the changes are made in a BDL/LoadComplete call.
            Schedule(updateSizing);

            return(children);

            void updateSizing()
            {
                bool autoSize = created.RelativeSizeAxes == Axes.None;

                foreach (var c in new[] { mainProvider, childContainer, skinProvider })
                {
                    c.RelativeSizeAxes = Axes.None;
                    c.AutoSizeAxes     = Axes.None;

                    c.RelativeSizeAxes = !autoSize ? Axes.Both : Axes.None;
                    c.AutoSizeAxes     = autoSize ? Axes.Both : Axes.None;
                }

                outlineBox.Alpha = autoSize ? 1 : 0;
            }
        }
Beispiel #3
0
 private void btnCTXCompileDebug_Click(object sender, EventArgs e)
 {
     OutlineBox o = new OutlineBox(ref picSyntax, Color.Red, 3);
 }
Beispiel #4
0
 private void btnCTXSave_Click(object sender, EventArgs e)
 {
     OutlineBox o = new OutlineBox(ref picSyntax, null, 3);
 }
Beispiel #5
0
 private void btnCTXCompile_Click(object sender, EventArgs e)
 {
     OutlineBox o = new OutlineBox(ref picSyntax, Color.Green, 3);
     Util       u = new util.Util();
 }