using UnityEngine.UI; using UnityEngine; using TMPro; using System.Collections.Generic; using System; using System.Collections; [System.Serializable] public class SaveToList : MonoBehaviour { string category; //public TMP_InputField Libname; public TMP_Dropdown Library; public TMP_InputField Cabname; //public TMP_InputField UniqueName; public TMP_Dropdown CabCat; public TMP_Dropdown SubCabCat; public TMP_InputField D1; public TMP_InputField D2; public TMP_InputField D3; public TMP_InputField Amin; public TMP_InputField Amax; public TMP_InputField Aval; public TMP_Dropdown Adrop; public TMP_InputField Bmin; public TMP_InputField Bmax; public TMP_InputField Bval; public TMP_Dropdown Bdrop; public TMP_InputField Cmin; public TMP_InputField Cmax; public TMP_InputField Cval; public TMP_Dropdown Cdrop; public TMP_InputField Dmin; public TMP_InputField Dmax; public TMP_InputField Dval; public TMP_Dropdown Ddrop; public TMP_InputField Emin; public TMP_InputField Emax; public TMP_InputField Eval; public TMP_Dropdown Edrop; public TMP_InputField Fmin; public TMP_InputField Fmax; public TMP_InputField Fval; public TMP_Dropdown Fdrop; public TMP_InputField Kmin; public TMP_InputField Kmax; public TMP_InputField Kval; public TMP_Dropdown Kdrop; // public void openPNL() // used by Canvas/Panel_SCENE/PNL/CabinetPNL/ROWHEIGHTPNL/ADDTOLIST // { // Get.o2("PNL/CABINETpnl", "ADDINPUTS").SetActive(true); // //Add name cabinet to input // Cabname.text = _G.SC[0]; // var c = Get.CabCode(_G.SC[0], "Ukichenit"); // //C1.text=c[2]; // //C2.text=c[2]; // //C2.text=c[2]; // D1.text = c.Description_Language_1; // D2.text = c.Description_Language_2; // D3.text = c.Description_Language_3; // Get.o2("ADDINPUTS/DIMS", "A").SetActive(false); // Get.o2("ADDINPUTS/DIMS", "B").SetActive(false); // Get.o2("ADDINPUTS/DIMS", "C").SetActive(false); // Get.o2("ADDINPUTS/DIMS", "D").SetActive(false); // Get.o2("ADDINPUTS/DIMS", "E").SetActive(false); // Get.o2("ADDINPUTS/DIMS", "F").SetActive(false); // if (c.A_Value.IndexOf('_') != -1) { }//A add dropdown value // else { AddDIM("A", c, Amin, Amax, Aval, CsvHeaders.A_Value); }//Show A // if (c.B_Value.IndexOf('_') != -1 || c.D_Value.IndexOf('_') != -1) // { // if (c.K_Value != "0") { }//show D setDIMFIX(DD,13, c); // if (c.K_Value == "0") { }//Show B setDIMFIX(BD,7, c); // } // else // { // addDIM("B", c, Bmin, Bmax, Bval, CsvHeaders.B_Value);//ShowB 7 // addDIM("D", c, Dmin, Dmax, Dval, CsvHeaders.D_Value);//ShowD 13 // } // if (c.C_Value.IndexOf('_') != -1) { } //C & D add dropdown value setDIMFIX(CD,10, c); // else { addDIM("C", c, Cmin, Cmax, Cval, CsvHeaders.C_Value); } //Show C // /* // addDIM(E.gameObject,16,c,FixE.gameObject);//ShowE // addDIM(F.gameObject,19,c,FixF.gameObject);//ShowF*/ // } public void AddtolistNewCabinet() // used by Canvas/Panel_SCENE/PNL/CABINETpnl/ADDINPUTS/ADDTOSERVER { //CREATE LINE CODE[] print("_G.UIT_LibraryCabinets[0]===="+_G.UIT_LibraryCabinets[0]); string[] LINE=_G.UIT_LibraryCabinets[0].Split(","); LINE[UIT.Ind("Cabinet","Unique_Name")]=Cabname.text; LINE[UIT.Ind("Cabinet","Box_finish")]="All"; LINE[UIT.Ind("Cabinet","Cab_Image")]=Get.o2("CABINETpnl/ADDINPUTS/SIZES","MODEL").GetComponent().sprite.name; LINE[UIT.Ind("Cabinet","Library_Name")]=GetLibrairyName(Library.value);//Kitchen or Bathroom string Cabcat=CabCat.options[CabCat.value].text; LINE[UIT.Ind("Cabinet","Category")]=Cabcat; LINE[UIT.Ind("Cabinet","Category_L1")]=_SC.GetCat()[Cabcat+"1"][SubCabCat.value]; LINE[UIT.Ind("Cabinet","Category_L2")]=_SC.GetCat()[Cabcat+"2"][SubCabCat.value]; LINE[UIT.Ind("Cabinet","Category_L3")]=_SC.GetCat()[Cabcat+"3"][SubCabCat.value]; LINE[UIT.Ind("Cabinet","Des_L1")]=D1.text.Replace(Cabname.text,""); LINE[UIT.Ind("Cabinet","Des_L2")]=D2.text.Replace(Cabname.text,""); LINE[UIT.Ind("Cabinet","Des_L3")]=D3.text.Replace(Cabname.text,""); LINE[UIT.Ind("Cabinet","A")]=GetSizeLetter(Amin,Aval,Amax, Adrop); LINE[UIT.Ind("Cabinet","B")]=GetSizeLetter(Bmin,Bval,Bmax, Bdrop); LINE[UIT.Ind("Cabinet","C")]=GetSizeLetter(Cmin,Cval,Cmax, Cdrop); LINE[UIT.Ind("Cabinet","D")]=GetSizeLetter(Dmin,Dval,Dmax, Ddrop); LINE[UIT.Ind("Cabinet","E")]=GetSizeLetter(Emin,Eval,Emax, Edrop); LINE[UIT.Ind("Cabinet","F")]=GetSizeLetter(Fmin,Fval,Fmax, Fdrop); LINE[UIT.Ind("Cabinet","K")]=GetSizeLetter(Kmin,Kval,Kmax, Kdrop); LINE[UIT.Ind("Cabinet","Pattern_Door_1")]=_G.CODEPATERN; LINE[UIT.Ind("Cabinet","Pattern_Door_2")]=_G.CODEPATERN2; LINE[UIT.Ind("Cabinet","Flip")]="F";//F,L,R LINE[UIT.Ind("Cabinet","Model")]=_G.SC[1];//B1,B2,W1,W4....----------------------------------------------------------- LINE[UIT.Ind("Cabinet","Category")]=_G.SC[2];//BASE,WALL, CBASE....--------------------------------------------------- LINE[UIT.Ind("Cabinet","FF")]="0";//0,54 LINE[UIT.Ind("Cabinet","Sink")]="y"; LINE[UIT.Ind("Cabinet","Finish")]=GetFINISH_Code(_G.SC[1]);//Finish recipe LINE[UIT.Ind("Cabinet","FV1")]=_G.VF; LINE[UIT.Ind("Cabinet","FV2")]=_G.VF2; LINE[UIT.Ind("Cabinet","Cutout")]="0_0_0_0";//Cutout LINE[UIT.Ind("Cabinet","Tambour")]="0_0_0_0";//Tambour LINE[UIT.Ind("Cabinet","Glass")]="0_0_0_0";//Glass LINE[UIT.Ind("Cabinet","K_Model")]=GetKick_Model();//Kick model Sus,Over,Knotch,Std LINE[UIT.Ind("Cabinet","Side_Model")]=GetSide_Model();//Kick model Sus,Over,Knotch,Std LINE[UIT.Ind("Cabinet","R_Code")]="0_0_0_0_0_0";//Retraction Recipe code LINE[UIT.Ind("Cabinet","K_Code")]= GetK_Code(_G.SC[1]);//Kick Recipe code on or off //print("KickGlobalPNL====="+LINE[UIT.Ind("Cabinet","K_Code")]); LINE[UIT.Ind("Cabinet","C_Code")]=GetC_Code(_G.SC[1]);//Counter projection Recipe code LINE[UIT.Ind("Cabinet","TopFull")]="n"; LINE[UIT.Ind("Cabinet","Option1")]=""; LINE[UIT.Ind("Cabinet","Option2")]=""; LINE[UIT.Ind("Cabinet","Option3")]=""; //MAKE NEW LINE STRING string NewLine=""; for(int i=0; i().onClick.AddListener(() => OK_Rewrite(NewLine,Cabname.text)); } StartCoroutine( EmptySpace() ); } public IEnumerator EmptySpace(){ yield return new WaitForSeconds(0.5f); ListNoEmpty=new(); for(int i=0; i<_G.UIT_LibraryCabinets.Count; i++) { print("line "+i+" ======"+_G.UIT_LibraryCabinets[i].Split(',')[0]); if(!string.IsNullOrEmpty(_G.UIT_LibraryCabinets[i].Split(',')[0])) { if(_G.UIT_LibraryCabinets[i].Split(',')[0]!=","){ NoEmpty.Add(_G.UIT_LibraryCabinets[i]); } } } _G.UIT_LibraryCabinets=NoEmpty; } private static object WaitForSeconds(float v) { throw new NotImplementedException(); } public void OK_Rewrite(string NewLine,string unique){ UIT.ReplaceLineOnLibrary("Cabinet", unique, NewLine); _M.PH(15, 0, "ffffff", 1, 1); Invoke(nameof(CloseMessage), 2f); Get.o2("HIDER/MESSAGE", "btnOK").GetComponent