Exemplo n.º 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);
            }
        }
Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 7
0
 protected virtual void OnTextureReferenceChanged(TextureReferenceChangedEventArgs e)
 {
     if (this.TextureReferenceChanged != null)
         this.TextureReferenceChanged(this, e);
 }
Exemplo n.º 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();
        }