Пример #1
0
        private static Image GetBackgroundImage()
        {
            if (_background != null)
            {
                return(_background);
            }

            _background = ImageFromResource.Get("open3mod.Images.TextureTransparentBackground.png");
            return(_background);
        }
Пример #2
0
        private static Image GetLoadingImage()
        {
            if (_loadAnimImage != null)
            {
                return(_loadAnimImage);
            }

            _loadAnimImage = ImageFromResource.Get("open3mod.Images.TextureLoading.gif");
            return(_loadAnimImage);
        }
Пример #3
0
        // hack: we make that public because it gets also used by the Renderer
        // to draw tabs which failed to load their scenes.
        public static Image GetLoadErrorImage()
        {
            if (_loadError != null)
            {
                return(_loadError);
            }

            _loadError = ImageFromResource.Get("open3mod.Images.FailedToLoad.png");
            return(_loadError);
        }
Пример #4
0
        private void SetTip(int nextTip)
        {
            while (nextTip < 0)
            {
                nextTip += _tips.Length;
            }
            _cursor = nextTip % _tips.Length;

            pictureBoxTipPic.Image = ImageFromResource.Get("open3mod.Images.TipOfTheDay.Tip" + _cursor + ".png");
            labelTipText.Text      = _tips[_cursor];
        }
Пример #5
0
        public AnimationInspectionView(Scene scene, TabPage tabPageAnimations)
        {
            _scene = scene;

            Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            Dock   = DockStyle.Fill;
            InitializeComponent();

            tabPageAnimations.Controls.Add(this);

            listBoxAnimations.Items.Add("None (Bind Pose)");

            if (scene.Raw.Animations != null)
            {
                foreach (var anim in scene.Raw.Animations)
                {
                    var dur = anim.DurationInTicks;
                    if (anim.TicksPerSecond > 1e-10)
                    {
                        dur /= anim.TicksPerSecond;
                    }
                    else
                    {
                        dur /= SceneAnimator.DefaultTicksPerSecond;
                    }
                    listBoxAnimations.Items.Add(string.Format("{0} ({1}s)", anim.Name, dur.ToString("0.000")));
                }
            }
            listBoxAnimations.SelectedIndex = 0;

            checkBoxLoop.Checked = _scene.SceneAnimator.Loop;
            _imagePlay           = ImageFromResource.Get("open3mod.Images.PlayAnim.png");
            _imageStop           = ImageFromResource.Get("open3mod.Images.StopAnim.png");
            buttonPlay.Image     = _imagePlay;

            // initially, animations are disabled.
            _scene.SceneAnimator.AnimationPlaybackSpeed = 0.0;
            labelSpeedValue.Text = "1.0x";

            timeSlideControl.Rewind += (o, args) =>
            {
                if (_scene.SceneAnimator.ActiveAnimation >= 0)
                {
                    _scene.SceneAnimator.AnimationCursor = args.NewPosition;
                }
            };
        }
Пример #6
0
        /// <summary>
        /// Populate _hudImages
        /// </summary>
        private void LoadHudImages()
        {
            if (_hudImages != null)
            {
                return;
            }

            _hudImages = new Image[PrefixTable.Length, 3];
            for (var i = 0; i < _hudImages.GetLength(0); ++i)
            {
                for (var j = 0; j < _hudImages.GetLength(1); ++j)
                {
                    _hudImages[i, j] = ImageFromResource.Get(PrefixTable[i] + PostFixTable[j] + ".png");
                }
            }

            _hudBar = ImageFromResource.Get("open3mod.Images.HUDBar.png");
        }
        public AnimationInspectionView(Scene scene, TabPage tabPageAnimations)
        {
            _scene = scene;

            Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            Dock   = DockStyle.Fill;
            InitializeComponent();

            tabPageAnimations.Controls.Add(this);
            listBoxAnimations.Items.Add("None (Bind Pose)");
            listBoxAnimations.SelectedIndex = 0;
            if (scene.Raw.Animations != null)
            {
                foreach (var anim in scene.Raw.Animations)
                {
                    listBoxAnimations.Items.Add(FormatAnimationName(anim));
                    listBoxAnimations.SelectedIndex = 1;
                }
            }

            checkBoxLoop.Checked = _scene.SceneAnimator.Loop;
            _imagePlay           = ImageFromResource.Get("open3mod.Images.PlayAnim.png");
            _imageStop           = ImageFromResource.Get("open3mod.Images.StopAnim.png");
            buttonPlay.Image     = _imagePlay;

            // initially, animations are disabled.
            _scene.SceneAnimator.AnimationPlaybackSpeed = 0.0;
            labelSpeedValue.Text = "1.0x";

            timeSlideControl.Rewind += (o, args) =>
            {
                if (_scene.SceneAnimator.ActiveAnimation >= 0)
                {
                    _scene.SceneAnimator.AnimationCursor = args.NewPosition;
                }
            };
        }