Esempio n. 1
0
 public void Draw(int id)
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label(Localizer.Format("quicksearch_lastSearch"));
     GUILayout.FlexibleSpace();
     GUILayout.Label(QSettings.Instance.historySortby == (int)SortBy.COUNT ? Localizer.Format("quicksearch_count") : Localizer.Format("quicksearch_date"));
     GUILayout.EndHorizontal();
     for (int i = 0, count = history.Count; i < count; i++)
     {
         if (i >= QSettings.Instance.historyIndex)
         {
             break;
         }
         GUILayout.BeginHorizontal();
         Search s = history[i];
         if (GUILayout.Button(QUtils.Texture.Search, btnStyle, GUILayout.Width(20), GUILayout.Height(20)))
         {
             if (HighLogic.LoadedSceneIsEditor)
             {
                 PartCategorizer.Instance.searchField.text = s.text;
             }
             else
             {
                 QRnD.Instance.Text         = s.text;
                 GUIUtility.keyboardControl = 0;
             }
         }
         GUIStyle st = index == i ? LblActive : GUI.skin.label;
         GUILayout.Label(s.text, st);
         GUILayout.FlexibleSpace();
         GUILayout.Label(QSettings.Instance.historySortby == (int)SortBy.COUNT ? s.count.ToString() : s.getDate(), st);
         GUILayout.EndHorizontal();
     }
 }