예제 #1
0
        private void listMaterial_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            groupMaterialProperties.Visible = true;
            Material mat = materials[listMaterial.SelectedIndex];

            butAmbColorPicker.BackColor        = XF.NGNColToColor(mat.RGB);
            comboMaterialTexture.SelectedIndex = (mat.textureIndex != 65535 && mat.textureIndex <= listMaterial.Items.Count) ? mat.textureIndex : 0;
            if (mat.textureIndex > listMaterial.Items.Count)
            {
                SessionManager.Report("Material " + listMaterial.SelectedIndex + " in shape has an invalid textureindex (" + mat.textureIndex + ")", SessionManager.RType.WARN);
            }
            numericMaterialMetadata.Value = (mat.id == 129 ? -1 : mat.metadata);
        }
 private void comboMaterial_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboMaterial.SelectedIndex != -1)
     {
         groupMaterialProperties.Visible = true;
         Material mat = loadedShape.materials[comboMaterial.SelectedIndex];
         butAmbColorPicker.BackColor = XF.NGNColToColor(mat.RGB);
         t2Control_TextureSelector1.SelectedIndex = (mat.textureIndex != 65535 && mat.textureIndexRelative <= loadedNGN.textures.Count) ? mat.textureIndexRelative : -1;
         if (mat.textureIndex > loadedShape.textures.Count)
         {
             SessionManager.Report("Material " + comboMaterial.SelectedIndex + " in shape has an invalid textureindex (" + mat.textureIndex + ")", SessionManager.RType.WARN);
         }
         numericMaterialMetadata.Value = (mat.id == 129 ? -1 : mat.metadata);
     }
     else
     {
         groupMaterialProperties.Visible = false;
     }
 }