private ArrayList getCurrentData(string matName) { System.Collections.ArrayList data = new System.Collections.ArrayList(); data.Clear(); bool writeFallback = true; data.Add("Texture " + matName); foreach (object obj in mats) { if (obj.GetType() == typeof(aeCommon.MatBlock)) { aeCommon.MatBlock mb = (aeCommon.MatBlock)obj; if (mb.isFallBack) { if (writeFallback) { writeFallback = false; data.Add("\tFallback"); int useFallbackVal = this.useFallback ? 1 : 0; data.Add(string.Format("\t\tUseFallback {0}", useFallbackVal)); } mb.getData(ref data); } else { mb.getData(ref data); data.Add(""); } } else if (obj.GetType() == typeof(FB_GlobalOptionsPnl)) { FB_GlobalOptionsPnl fbg = (FB_GlobalOptionsPnl)obj; fbg.getData(ref data); } else if (obj.GetType() == typeof(aeCommon.MatSpecLitCubeMapTintFlags)) { aeCommon.MatSpecLitCubeMapTintFlags mslcmtf = (aeCommon.MatSpecLitCubeMapTintFlags)obj; mslcmtf.getData(ref data); } } data.Add("\tEnd"); data.Add("End"); return(data); }
private void populateMatPanel(string[] fieldsList, aeCommon.CollapsablePanel cp, int matBlckHeight, Size gSize, bool isFallbackSec) { aeCommon.MatBlock matBlck = null; int i = 0; foreach (string mat in fieldsList) { matBlck = buildMatBlock(ref i, matBlckHeight, mat, gSize, isFallbackSec); cp.Add(matBlck); mats.Add(matBlck); if (mat.Equals("BumpMap2")) { bumpMap2Indx = this.mats.Count; } } cp.fixHeight(); }
private aeCommon.MatBlock buildMatBlock(ref int i, int mHeight, string mat, Size gSize, bool isFallbackSec) { int firstMatBlcLocation = isFallbackSec ? 15 : 12;//isFallbackSec ? 135 : 12; int vLoc = firstMatBlcLocation + (mHeight * (i++)); Point matBLocation = new System.Drawing.Point(10, vLoc); string[] split = mat.Split(",".ToCharArray()); string matName = split[0] + "Gbx"; string matText = split[0]; string extraOpName = split.Length > 1 ? split[1] : "noExtra"; bool useExtraChBx = split.Length > 1 ? true : false; aeCommon.MatBlock matBlck = new aeCommon.MatBlock(matName, matText, matBLocation, openFileDialog1, useExtraChBx, extraOpName, isFallbackSec); matBlck.Size = gSize; return(matBlck); }
private void setMatProperties(Button matTrickBtn) { finishedLoading = false; //Addison Delany requested to set multiply 1 defaulr to "c:\game\src\_texture_library\World\Filler\white.tga" // and to if fallback base and bump is empty fill them automatically with base1 and bump1 values without activating fall back checkbox this.SuspendLayout(); matTrickPropertiesPanel.SuspendLayout(); MatTrick mt = (MatTrick)matTrickBtn.Tag; ArrayList data = (ArrayList)mt.data; string base1Texture = ""; string bump1Texture = ""; string tPath = ""; string name = ""; bool isFallb = false; string multiply1DefaultPath = getRoot() + @"src\_texture_library\World\Filler\white.tga"; string [] tgafileNames = tgaFilesDictionary.Values.ToArray(); string [] tgafilePaths = tgaFilesDictionary.Keys.ToArray(); foreach (object obj in this.mats) { switch (obj.GetType().ToString()) { case "COH_CostumeUpdater.assetEditor.aeCommon.MatBlock": aeCommon.MatBlock mb = ((aeCommon.MatBlock)obj); isFallb = mb.isFallBack; mb.setData(ref data, tgafilePaths, tgafileNames); tPath = mb.getTexturePath(); name = mb.getName(); if (name.ToLower().Equals("base1")) { base1Texture = tPath; } else if (name.ToLower().Equals("bumpmap1")) { bump1Texture = tPath; } else if (name.ToLower().Equals("multiply1") && !(tPath.Length > 0)) { mb.setTexturePath(multiply1DefaultPath); } else if (name.ToLower().Equals("base") && isFallb && !(tPath.Length > 0)) { mb.setTexturePath(base1Texture); } else if (name.ToLower().Equals("bumpmap") && isFallb && !(tPath.Length > 0)) { mb.setTexturePath(bump1Texture); } break; case "COH_CostumeUpdater.assetEditor.aeCommon.MatSpecLitCubeMapTintFlags": ((aeCommon.MatSpecLitCubeMapTintFlags)obj).setData(data, tgafilePaths, tgafileNames); break; case "COH_CostumeUpdater.assetEditor.materialTrick.FB_GlobalOptionsPnl": ((FB_GlobalOptionsPnl)obj).setData(data, tgaFilesDictionary); break; } } string k = base1Texture; string m = bump1Texture; setUseFallbackCkBx(data); if (this.matTrickPropertiesPanel.Controls.Count > 0) { this.matTrickPropertiesPanel.ScrollControlIntoView(this.matTrickPropertiesPanel.Controls[0]); } matTrickPropertiesPanel.ResumeLayout(false); this.ResumeLayout(false); finishedLoading = true; }