示例#1
0
        protected override void OnGotContext(RenderContext context)
        {
            base.OnGotContext(context);

            var settings     = Program.Settings;
            var theaterDays  = Game.AsTheaterDays();
            var debugOverlay = theaterDays.FindSingleElement <DebugOverlay>();

            var gamingArea = theaterDays.FindSingleElement <GamingArea>();

            if (gamingArea == null)
            {
                throw new InvalidOperationException();
            }

            if (settings.Images.Notes == null || settings.Images.Notes.Length == 0)
            {
                if (debugOverlay != null)
                {
                    debugOverlay.AddLine("WARNING: default notes image strip is not specified.");
                }
            }
            else
            {
                _noteImages = new D2DImageStrip[settings.Images.Notes.Length];

                for (var i = 0; i < settings.Images.Notes.Length; ++i)
                {
                    var notesImageEntry = settings.Images.Notes[i];
                    if (notesImageEntry == null)
                    {
                        continue;
                    }

                    if (notesImageEntry.File == null || !File.Exists(notesImageEntry.File))
                    {
                        if (i == 0)
                        {
                            if (debugOverlay != null)
                            {
                                debugOverlay.AddLine($"WARNING: default notes image strip <{notesImageEntry.File ?? string.Empty}> is not found.");
                            }
                        }
                        else
                        {
                            if (debugOverlay != null)
                            {
                                debugOverlay.AddLine($"WARNING: notes image strip <{notesImageEntry.File ?? string.Empty}> is not found, falling back to default.");
                            }
                        }
                        continue;
                    }

                    var imageStrip = Direct2DHelper.LoadImageStrip(context, notesImageEntry.File, notesImageEntry.Count, notesImageEntry.Orientation);
                    _noteImages[i] = imageStrip;
                }
            }

            _tapPointImage = Direct2DHelper.LoadBitmap(context, settings.Images.TapPoint.FileName);
        }
示例#2
0
        protected override void OnGotContext(RenderContext context)
        {
            base.OnGotContext(context);

            var settings = Program.Settings;

            _hitRankImages = Direct2DHelper.LoadImageStrip(context, settings.Images.HitRank.File, settings.Images.HitRank.Count, settings.Images.HitRank.Orientation);
        }
示例#3
0
        protected override void OnGotContext(RenderContext context)
        {
            base.OnGotContext(context);

            var settings = Program.Settings;

            var numbersSettings = settings.Images.Combo.Numbers;

            _numberImages = Direct2DHelper.LoadImageStrip(context, numbersSettings.File, numbersSettings.Count, numbersSettings.Orientation);

            var clientSize = context.ClientSize;
            var layout     = settings.UI.Combo.Numbers.Layout;

            var x = layout.X.IsPercentage ? layout.X.Value * clientSize.Width : layout.X.Value;
            var y = layout.Y.IsPercentage ? layout.Y.Value * clientSize.Height : layout.Y.Value;

            Location = new Point((int)x, (int)y);
        }