Пример #1
0
        /// <summary>
        /// Handles the TextureReferenceChanged event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.TextureReferenceChangedEventArgs"/> instance containing the event data.</param>
        private void Interface_TextureReferenceChanged(object sender, TextureReferenceChangedEventArgs e)
        {
            try
            {
                e.Emitter.ParticleTexture = e.TextureReference.Texture;

                e.Emitter.ParticleTextureAssetName = e.TextureReference.GetAssetName();

                e.Result = CoreOperationResult.OK;
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }
Пример #2
0
        /// <summary>
        /// Handles the Click event of the uxSelectTexture control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void uxSelectTexture_Click(object sender, EventArgs e)
        {
            using (TextureReferenceBrowser browser = new TextureReferenceBrowser(this.TextureReferences, this.TextureReferenceAdded))
            {
                if (browser.ShowDialog() == DialogResult.OK)
                {
                    EmitterTreeNode node = this.uxEffectTree.SelectedNode as EmitterTreeNode;

                    var args = new TextureReferenceChangedEventArgs(node.Emitter, browser.SelectedReference);

                    this.OnTextureReferenceChanged(args);

                    this.uxPropertyBrowser.Refresh();
                }
            }
        }
Пример #3
0
        protected virtual void OnTextureReferenceChanged(TextureReferenceChangedEventArgs e)
        {
            Trace.WriteLine("User requires assigning texture reference to emitter...", "UI");

            using (new TraceIndenter())
            {
                Trace.WriteLine("Emitter: " + e.Emitter.Name);
                Trace.WriteLine("Texture: " + e.TextureReference.FilePath);
            }

            using (new HourglassCursor())
            {
                var handler = Interlocked.CompareExchange(ref this.TextureReferenceChanged, null, null);

                if (handler != null)
                {
                    handler.Invoke(this, e);
                }
            }

            this.AssertOperationOK(e.Result);
        }
Пример #4
0
        protected virtual void OnTextureReferenceChanged(TextureReferenceChangedEventArgs e)
        {
            Trace.WriteLine("User requires assigning texture reference to emitter...", "UI");

            using (new TraceIndenter())
            {
                Trace.WriteLine("Emitter: " + e.Emitter.Name);
                Trace.WriteLine("Texture: " + e.TextureReference.FilePath);
            }

            using (new HourglassCursor())
            {
                var handler = Interlocked.CompareExchange(ref this.TextureReferenceChanged, null, null);

                if (handler != null)
                    handler.Invoke(this, e);
            }

            this.AssertOperationOK(e.Result);
        }
Пример #5
0
        /// <summary>
        /// Handles the Click event of the uxSelectTexture control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void uxSelectTexture_Click(object sender, EventArgs e)
        {
            using (TextureReferenceBrowser browser = new TextureReferenceBrowser(this.TextureReferences, this.TextureReferenceAdded))
            {
                if (browser.ShowDialog() == DialogResult.OK)
                {
                    EmitterTreeNode node = this.uxEffectTree.SelectedNode as EmitterTreeNode;

                    var args = new TextureReferenceChangedEventArgs(node.Emitter, browser.SelectedReference);

                    this.OnTextureReferenceChanged(args);

                    this.uxPropertyBrowser.Refresh();
                }
            }
        }
Пример #6
0
        /// <summary>
        /// Handles the TextureReferenceChanged event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.TextureReferenceChangedEventArgs"/> instance containing the event data.</param>
        private void Interface_TextureReferenceChanged(Object sender, TextureReferenceChangedEventArgs e)
        {
            try
            {
                e.Emitter.ParticleTexture = e.TextureReference.Texture;

                //e.Emitter.ParticleTextureAssetName = e.TextureReference.GetAssetName();

                e.Result = CoreOperationResult.OK;
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }
Пример #7
0
 protected virtual void OnTextureReferenceChanged(TextureReferenceChangedEventArgs e)
 {
     if (this.TextureReferenceChanged != null)
         this.TextureReferenceChanged(this, e);
 }
Пример #8
0
        /// <summary>
        /// Handles the TextureReferenceChanged event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.TextureReferenceChangedEventArgs"/> instance containing the event data.</param>
        private void Interface_TextureReferenceChanged(object sender, TextureReferenceChangedEventArgs e)
        {
            e.Emitter.ParticleTexture = e.TextureReference.Texture;

            e.Emitter.ParticleTextureAssetName = e.TextureReference.GetAssetName();
        }