Esempio n. 1
0
        public void DisplayItem(SW_DataController.dataType type, string name, string subtitle, List <StringString> values)
        {
            dataType  = type;
            Type.text = type.ToString();
            SetName(name);

            for (int i = 0; i < values.Count; i++)
            {
                if (values[i].String1 != "Index" && values[i].String1 != "GeneratedId")
                {
                    if (values[i].String1.ToLower().Contains("category"))
                    {
                        subtitle = values[i].String2;
                    }
                    else if (values[i].String2 != name && values[i].String2 != subtitle)
                    {
                        TitlesAndValues[i].Set(values[i].String1, values[i].String2);
                    }
                }
                else if (values[i].String1 == "Index")
                {
                    if (!dataController)
                    {
                        dataController = FindObjectOfType <SW_DataController>();
                    }
                    TitlesAndValues[i].Set(values[i].String1, dataController.BookFromIndex(values[i].String2));
                }
            }
            if (subtitle != null)
            {
                Subtitle.gameObject.SetActive(true);
                Subtitle.text = subtitle;
            }
            else
            {
                Subtitle.gameObject.SetActive(false);
            }
            rTransform.ForceUpdateRectTransforms();
            Canvas.ForceUpdateCanvases();
            if (type == SW_DataController.dataType.Book)
            {
                overlord.OpenAllTablesFromBook(name);
            }
        }
        public void OpenTable(SW_DataController.dataType type)
        {
            if (tempTable)
            {
                tempTable.gameObject.SetActive(false);
                //tempTable.transform.SetParent(null);
            }
            tempTable = Tables.Find(x => x.TableType == type);
            //tempTable.transform.SetParent(AllTableContent);

            tempTable.gameObject.SetActive(true);
            tempTable.OpenTable();
            //tempTable.ResizeAllRows();
            if (uIAnimation.HomePanelOpen)
            {
                uIAnimation.ToggleHomePanel();
            }
            if (!uIAnimation.LeftPanelClosed)
            {
                uIAnimation.ToggleLeftBar();
            }
        }
 public void PopulateAllTables()
 {
     firstPopulation = true;
     for (int i = 0; i < Enum.GetValues(typeof(SW_DataController.dataType)).Length; i++)
     {
         tempTable    = null;
         tempDataType = (SW_DataController.dataType)Enum.GetValues(typeof(SW_DataController.dataType)).GetValue(i);
         object tempObj = dControl.GetDataClass(tempDataType);
         tempTable = Tables.Find(x => x.TableType == tempDataType);
         if (tempTable == null)
         {
             Debug.Log("Couldn't find table for " + tempDataType);
         }
         else
         {
             Debug.Log("Populating " + tempObj.GetType().Name);
             tempTable.PopulateTable(tempObj);
             //tempTable.transform.SetParent(null);
             tempTable.CloseTable();
             tempTable.gameObject.SetActive(false);
         }
     }
 }
Esempio n. 4
0
 public SW_Search_Result(object searchObj, string name, string subtitle, SW_DataController.dataType type)
 {
     SearchObject = searchObj;
     Name         = name;
     Type         = type;
 }
 public void OpenItemDisplay(SW_DataController.dataType type, string name, string subtitle, object Item)
 {
     ItemDisplay.gameObject.SetActive(true);
     ItemDisplay.DisplayItem(type, name, subtitle, StringString.MakeFromType(Item));
 }