Beispiel #1
0
        static void OnAddNewButtonClicked()
        {
            ItemDataEntry newEntry = ItemDataEntry.Create("New Item");

            AddSubAsset(newEntry, itemDatabaseCache);
            itemDatabaseCache.ItemList.Add(newEntry);
            if (itemDataEditorDebugging)
            {
                Debug.Log("ItemDataEditor:: OnAddNewButtonClicked():: New entry added to itemDatabaseCache.ItemList.");
            }
            CacheItemNames();

            ForceChangeFilterValue("");
            //itemNamesCache.Add("New Item");
            //if (itemDataEditorDebugging) Debug.Log("ItemDataEditor:: OnAddNewButtonClicked():: \"New Item\" added to itemNamesCache to be optimistic.");
            //filteredItemNamesCache = new List<string>(itemNamesCache);

            selected = itemDatabaseCache.ItemList.Count - 1;
            LoadEntry(itemDatabaseCache.ItemList[selected]);

            dDrawEditorContent  = EditorContent_DrawEditor;
            dDrawSidebarContent = Sidebar_DrawSelections;

            SaveDatabase();
        }
Beispiel #2
0
 ///Load entry content into Editor block, does not thing to do with (int) selected.
 static void LoadEntry(ItemDataEntry entry)
 {
     if (itemDataEditorDebugging)
     {
         Debug.Log("ItemDataEditor:: LoadEntry():: Loading " + entry.itemID);
     }
     entryCache = entry;
 }
Beispiel #3
0
        public static bool GetItemByName(string name, out ItemDataEntry entry)
        {
            if (nameMap.Count == 0)
            {
                FillNameMap();
            }

            entry = new ItemDataEntry();
            foreach (var kv in nameMap)
            {
                if (kv.Key.Trim() == name.Trim())
                {
                    entry = nameMap[kv.Key];
                    return(true);
                }
            }

            return(false);
        }