Пример #1
0
 private void buttonSelectTexture_Click(object sender, EventArgs e)
 {
     MaterialSelectorDialog materialSelectorDialog = new MaterialSelectorDialog();
     materialSelectorDialog.SelectedMaterial = this.TileSheet.Material;
     materialSelectorDialog.ShowLocalTextures = ItemIsLocal;
     if (materialSelectorDialog.ShowDialog() == DialogResult.OK)
     {
         this.TileSheet.Material = materialSelectorDialog.SelectedMaterial;                                
         labelTextureName.Text = materialSelectorDialog.SelectedMaterial.ToString();
     }
 }
Пример #2
0
 private void buttonSelectTexture_Click(object sender, EventArgs e)
 {
     MaterialSelectorDialog materialSelectorDialog = new MaterialSelectorDialog();
     materialSelectorDialog.SelectedMaterial = spriteEditorControl.Sprite.Material;
     materialSelectorDialog.ShowLocalTextures = ItemIsLocal;
     if (materialSelectorDialog.ShowDialog() == DialogResult.OK
         && spriteEditorControl.Sprite.Material != materialSelectorDialog.SelectedMaterial)
     {
         this.Sprite.Material = materialSelectorDialog.SelectedMaterial;
         this.Sprite.SourceRectangle = null;
         this.Sprite.MaterialArea = "";
         LoadMaterialAreas();
         spriteEditorControl.SelectionMode = SpriteEditorSelectionMode.Normal;
         UpdateSourceRectangleControls();
         labelTextureName.Text = materialSelectorDialog.SelectedMaterial.ToString();
     }
 }
Пример #3
0
 private void buttonSelectTexture_Click(object sender, EventArgs e)
 {
     MaterialSelectorDialog materialSelectorDialog = new MaterialSelectorDialog();
     materialSelectorDialog.SelectedMaterial = this.AnimatedSprite.Material;
     materialSelectorDialog.ShowLocalTextures = ItemIsLocal;
     if (materialSelectorDialog.ShowDialog() == DialogResult.OK
         && this.AnimatedSprite.Material != materialSelectorDialog.SelectedMaterial)
     {
         if (materialSelectorDialog.SelectedMaterial.Areas.Keys.Count == 0)
         {
             MilkshakeForm.ShowErrorMessage("The selected Material \"" + 
                 materialSelectorDialog.SelectedMaterial.ToString() + "\" does contain any defined Areas.\n" +
                 "To use the animations you need to load an area definition file with this Material");
         }
         else
         {
             this.AnimatedSprite.Material = materialSelectorDialog.SelectedMaterial;
             this.AnimatedSprite.SourceRectangle = null;
             this.AnimatedSprite.MaterialArea = "";
             labelTextureName.Text = materialSelectorDialog.SelectedMaterial.ToString();
             RefreshAreaComboList();
         }              
     }
 }
Пример #4
0
 private void OpenTextureSelectionDialog()
 {
     ParticleType pType = null;
     // check each particle types
     for (int i = 0; i < particleEffectControl.ParticleEffect.Emitter.ParticleTypes.Count; i++)
     {
         // check the index + 1 (index 0 is Global Settings)
         if (particleEffectProperties.SelectedNode == particleEffectProperties.Nodes[0].Nodes[0].Nodes[i + 1])
         {
             pType = particleEffectControl.ParticleEffect.Emitter.ParticleTypes[i];
         }
     }
     // if the selected node was a particle type
     if (pType != null)
     {
         MaterialSelectorDialog materialSelectorDialog = new MaterialSelectorDialog();
         materialSelectorDialog.SelectedMaterial = pType.Material;
         materialSelectorDialog.ShowLocalTextures = ItemIsLocal;
         if (materialSelectorDialog.ShowDialog() == DialogResult.OK)
         {
             pType.Material = materialSelectorDialog.SelectedMaterial;                    
         }  
     }      
 }