public IconsPalette()
        {
            _items = new List<IconPaletteItem>();
            _characterDefinition = DependencyInjection.Resolve<CharacterDefinition>();
            _mouseInput = DependencyInjection.Resolve<IMouseInput>();
            _settings = DependencyInjection.Resolve<IReadOnlySettings>();

            for (var l = 0; l < 4; l++)
            {
                for (var i = 0; i < 25; i++)
                {
                    var source = new Rectangle((i % 5) * 64, (i / 5) * 64, 64, 64);
                    var destination = new Rectangle(i * 23, 467 + l * 32, 23, 32);

                    if (l == 3)
                    {
                        source.X = (i % 4) * 80;
                        source.Y = (i / 4) * 64;
                        source.Width = 80;

                        if (i < 15)
                        {
                            destination.X = i * 30;
                            destination.Width = 30;
                        }
                    }

                    _items.Add(new IconPaletteItem(i + 64 * l, l, source, destination));
                }
            }
        }
 public KeyFrameSelectorItem(TextButtonOption option, int keyFrameIndex)
 {
     _settings = DependencyInjection.Resolve<IReadOnlySettings>();
     _characterDefinition = DependencyInjection.Resolve<CharacterDefinition>();
     Option = option;
     SetKeyFrame(keyFrameIndex);
 }
        public SwapDownButton(int x, int y)
            : base(2, x, y, 0.5f)
        {
            _settings = DependencyInjection.Resolve<ISettings>();
            _characterDefinition = DependencyInjection.Resolve<CharacterDefinition>();

            Click = Swap;
        }
Esempio n. 4
0
 public Settings()
 {
     FileName = "char";
     _characterDefinition = DependencyInjection.Resolve<CharacterDefinition>();
     SelectedAnimation = _characterDefinition.Animations[SelectedAnimationIndex];
     SelectedKeyFrame = SelectedAnimation.KeyFrames[SelectedKeyFrameIndex];
     SelectedFrame = _characterDefinition.Frames[SelectedFrameIndex];
     SelectedPart = SelectedFrame.Parts[SelectedPartIndex];
 }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            this.IsMouseVisible = true;

            characterDefinition = new CharacterDefinition();

            base.Initialize();
        }
Esempio n. 6
0
 public SaveButton()
     : base(200, 5)
 {
     _settings = DependencyInjection.Resolve<IReadOnlySettings>();
     _characterDefinition = DependencyInjection.Resolve<CharacterDefinition>();
 }
 public static void Initialize()
 {
     _settings = DependencyInjection.Resolve<IReadOnlySettings>();
     _characterDefinition = DependencyInjection.Resolve<CharacterDefinition>();
 }
 public DefinitionsLoader()
 {
     _characterDefinition = DependencyInjection.Resolve<CharacterDefinition>();
 }