public CharacterAnimation()
        {
            _settings = DependencyInjection.Resolve<IReadOnlySettings>();
            _animationPosition = new Vector2(500, 100);

            _animationButton = new FlipTextButton<bool>(550, 3);
            _animationButton.AddOption(false, "play");
            _animationButton.AddOption(true, "stop");
            _animationButton.Value = false;
        }
Example #2
0
        public CharacterAnimation()
        {
            _settings          = DependencyInjection.Resolve <IReadOnlySettings>();
            _animationPosition = new Vector2(500, 100);

            _animationButton = new FlipTextButton <bool>(550, 3);
            _animationButton.AddOption(false, "play");
            _animationButton.AddOption(true, "stop");
            _animationButton.Value = false;
        }
        public LedgePallete(int x, int y)
        {
            _x = x;
            _y = y;
            _mapData = DependencyInjection.Resolve<IReadonlyMapData>();
            _text = DependencyInjection.Resolve<IText>();
            _settings = DependencyInjection.Resolve<IReadOnlySettings>();
            _ledgeSelector = new LedgeSelector(x, y, YIncrement);
            _ledgeFlagsButtons = new FlipTextButton<int>[_mapData.Ledges.Length];
            CreateLedgeFlagsButtons();

            var ledgesLoader = DependencyInjection.Resolve<ILedgesLoader>();
            ledgesLoader.LedgesLoaded += UpdateLedgeFlagsButtonValues;
        }
        private void CreateLedgeFlagsButtons()
        {
            for (var i = 0; i < _mapData.Ledges.Length; i++)
            {
                var button = new FlipTextButton<int>(_x + 160, _y + i * YIncrement);
                button.AddOption(0, "soft");
                button.AddOption(1, "hard");

                var ledge = _mapData.Ledges[i];
                button.Value = ledge.Flags;
                button.Change = v => ledge.Flags = v;

                _ledgeFlagsButtons[i] = button;
            }
        }
        private void CreateLedgeFlagsButtons()
        {
            for (var i = 0; i < _mapData.Ledges.Length; i++)
            {
                var button = new FlipTextButton <int>(_x + 160, _y + i * YIncrement);
                button.AddOption(0, "soft");
                button.AddOption(1, "hard");

                var ledge = _mapData.Ledges[i];
                button.Value  = ledge.Flags;
                button.Change = v => ledge.Flags = v;

                _ledgeFlagsButtons[i] = button;
            }
        }