Ejemplo n.º 1
0
    public void AddItemList(BaseLangData data)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.BeginVertical(GUILayout.Width(pw.mWidth));
        EditorGUILayout.Separator();
        EditorGUILayout.BeginVertical("box");
        SP1 = EditorGUILayout.BeginScrollView(SP1);

        if(data.GetDataCount() > 0)
        {
            var prev = selection;
            selection = GUILayout.SelectionGrid(selection, data.GetNameList(true), 1);
            if(prev != selection)
            {
                this.tmpIcon = null;
                GUI.FocusControl("ID");
            }
        }
        EditorGUILayout.EndScrollView();
        EditorGUILayout.EndVertical();
        EditorGUILayout.EndVertical();
    }
Ejemplo n.º 2
0
    public void AddItemListFilter(BaseLangData data, string title, string[] filterList)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.BeginVertical(GUILayout.Width(pw.mWidth));
        EditorGUILayout.Separator();
        EditorGUILayout.BeginVertical("box");
        SP1 = EditorGUILayout.BeginScrollView(SP1);

        bool hlp = data.filter.useFilter[0];
        int hlp2 = data.filter.filterID[0];
        data.filter.useFilter[0] = EditorGUILayout.Toggle("Filter by "+title, data.filter.useFilter[0]);
        if(data.filter.useFilter[0])
        {
            data.filter.filterID[0] = EditorGUILayout.Popup(data.filter.filterID[0], filterList);
        }
        if(hlp != data.filter.useFilter[0] || hlp2 != data.filter.filterID[0])
        {
            data.CreateFilterList(true);
        }

        EditorGUILayout.Separator();
        if(data.GetDataCount() > 0)
        {
            int prev = selection;
            if(data.filter.useFilter[0])
            {
                hlp2 = GUILayout.SelectionGrid(data.filter.GetFakeID(selection), data.filter.nameList, 1);
                if(hlp2 < data.filter.realID.Length) selection = data.filter.realID[hlp2];
                else selection = -1;
            }
            else
            {
                selection = GUILayout.SelectionGrid(selection, data.GetNameList(true), 1);
            }
            if(prev != selection)
            {
                this.tmpIcon = null;
                GUI.FocusControl("ID");
            }
        }
        EditorGUILayout.EndScrollView();
        EditorGUILayout.EndVertical();
        EditorGUILayout.EndVertical();
    }