Example #1
0
 void OnTableModified(LocalizedTableCollection col, LocalizedTable tbl)
 {
     if (col == m_Collection)
     {
         RefreshTables();
     }
 }
Example #2
0
 void EditorEvents_CollectionModifiedWithSender(object sender, LocalizedTableCollection collection)
 {
     if (sender != this)
     {
         EditorEvents_CollectionModified(collection);
     }
 }
Example #3
0
        void ResolveTableCollection()
        {
            m_PossibleTableCollection.Clear();
            m_Collection = LocalizationEditorSettings.GetCollectionFromTable(m_TargetTable);

            if (m_TargetTable.SharedData == null)
            {
                return;
            }

            m_SharedTableDataSerializedObject = new SerializedObject(m_TargetTable.SharedData);
            m_TableCollectionName             = m_SharedTableDataSerializedObject.FindProperty("m_TableCollectionName");

            if (m_Collection != null)
            {
                m_CollectionButton = new GUIContent("Select Collection", EditorGUIUtility.ObjectContent(m_Collection, m_Collection.GetType()).image);
                return;
            }

            m_SharedTableDataCollection = LocalizationEditorSettings.GetCollectionForSharedTableData(m_TargetTable.SharedData);
            if (m_SharedTableDataCollection != null)
            {
                return;
            }

            LocalizationEditorSettings.FindLooseStringTablesUsingSharedTableData(m_TargetTable.SharedData, m_PossibleTableCollection);
        }
Example #4
0
        void TableCollectionSelected(LocalizedTableCollection ltc)
        {
            m_TableContents.Clear();

            if (m_CurrentEditor != null)
            {
                m_CurrentEditor.OnDisable();
            }

            if (ltc == null || ltc.TableType == null)
            {
                return;
            }

            var editorType = GetEditorTypeForCollection(ltc.GetType());

            if (editorType == null)
            {
                return;
            }

            m_CurrentEditor = (TableEditor)Activator.CreateInstance(editorType);
            m_CurrentEditor.TableCollection = ltc;
            m_TableContents.Add(m_CurrentEditor);
            m_CurrentEditor.StretchToParentSize();
            m_CurrentEditor.OnEnable();
        }
Example #5
0
 public TableEntryTreeViewItem(LocalizedTableCollection collection, SharedTableData.SharedTableEntry sharedEntry, int id, int depth) :
     base(id, depth)
 {
     TableCollection = collection;
     if (sharedEntry != null)
     {
         SharedEntry = sharedEntry;
         displayName = SharedEntry.Key;
     }
 }
        public GenericAssetTableListViewMultiColumnHeader(MultiColumnHeaderState state, GenericAssetTableListView <T1, T2> parent, LocalizedTableCollection collection)
            : base(state)
        {
            height         += k_MetadataLabelHeight;
            m_Parent        = parent;
            TableCollection = collection;

            var visibleColumns = new List <int>();

            for (int i = 0; i < state.columns.Length; ++i)
            {
                if (state.columns[i] is VisibleColumn col && col.Visible)
                {
                    visibleColumns.Add(i);
                }
Example #7
0
        void OnEnable()
        {
            m_Collection      = target as LocalizedTableCollection;
            m_Tables          = serializedObject.FindProperty("m_Tables");
            m_SharedTableData = serializedObject.FindProperty("m_SharedTableData");
            m_Extensions      = serializedObject.FindProperty("m_Extensions");

            m_ExtensionsList                   = new ReorderableListExtended(serializedObject, m_Extensions);
            m_ExtensionsList.AddMenuType       = typeof(CollectionExtension);
            m_ExtensionsList.RequiredAttribute = target is StringTableCollection ? typeof(StringTableCollectionExtensionAttribute) : typeof(AssetTableCollectionExtensionAttribute);
            m_ExtensionsList.Header            = Styles.extensions;
            m_ExtensionsList.NoItemMenuItem    = Styles.noExtensions;
            m_ExtensionsList.CreateNewInstance = (type) =>
            {
                var instance = Activator.CreateInstance(type) as CollectionExtension;
                instance.Init(target as LocalizedTableCollection);
                return(instance);
            };

            LocalizationEditorSettings.EditorEvents.TableAddedToCollection     += OnTableModified;
            LocalizationEditorSettings.EditorEvents.TableRemovedFromCollection += OnTableModified;
            Undo.undoRedoPerformed += RefreshTables;
            RefreshTables();
        }
Example #8
0
 void EditorEvents_CollectionModified(LocalizedTableCollection obj)
 {
     s_TableChoicesLabels = null;
     s_TableChoices       = null;
     ClearPropertyDataCache();
 }
Example #9
0
 public StringTableListView(LocalizedTableCollection tableCollection) :
     base(tableCollection)
 {
 }
Example #10
0
 void OnCollectionChange(LocalizedTableCollection col) => ResolveTableCollection();
Example #11
0
 void OnCollectionTableChange(LocalizedTableCollection col, LocalizedTable table) => ResolveTableCollection();
Example #12
0
 public void Select(LocalizedTableCollection collection) => m_AssetTablesField.value = collection;