Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
KSP.UI.Screens.RDTechTreeSearchBar Class Reference
Inheritance diagram for KSP.UI.Screens.RDTechTreeSearchBar:

Public Member Functions

void SelectPartIcons ()
 

Static Public Member Functions

static string[] SearchTagSplit (string terms)
 

Public Attributes

Button clearButton
 
TMPro.TMP_InputField searchField
 
float searchKeystrokeDelay = 0.25f
 

Static Public Attributes

static RDTechTreeSearchBar Instance
 
static Color searchSelectionNodeColor
 
static Color searchSelectionPartColor
 

Protected Types

enum  MatchType {
  MatchType.NONE, MatchType.EQUALS_ONLY, MatchType.TERM_STARTS_WITH_TAG, MatchType.TERM_ENDS_WITH_TAG,
  MatchType.TAG_STARTS_WITH_TERM, MatchType.TAG_ENDS_WITH_TERM, MatchType.EITHER_STARTS_WITH_EITHER, MatchType.EITHER_ENDS_WITH_EITHER,
  MatchType.TERM_CONTAINS_TAG, MatchType.TAG_CONTAINS_TERM, MatchType.EITHER_CONTAINS_EITHER
}
 

Protected Member Functions

bool PartMatchesSearch (AvailablePart part, string[] terms)
 
virtual void SearchField_OnClick (PointerEventData eventData)
 
virtual void SearchField_OnValueChange (string s)
 
virtual IEnumerator SearchRoutine ()
 
virtual void SearchStart ()
 
virtual void SearchStop ()
 
MatchType TagMatchType (ref string tag)
 
bool TermMatchesTag (string term, string tag)
 

Protected Attributes

Image searchFieldBackground
 
PointerClickHandler searchFieldClickHandler
 
Coroutine searchRoutine
 
float searchTimer = 0f
 

Member Enumeration Documentation

enum KSP.UI.Screens.RDTechTreeSearchBar.MatchType
protected
Enumerator
NONE 
EQUALS_ONLY 
TERM_STARTS_WITH_TAG 
TERM_ENDS_WITH_TAG 
TAG_STARTS_WITH_TERM 
TAG_ENDS_WITH_TERM 
EITHER_STARTS_WITH_EITHER 
EITHER_ENDS_WITH_EITHER 
TERM_CONTAINS_TAG 
TAG_CONTAINS_TERM 
EITHER_CONTAINS_EITHER 

Member Function Documentation

bool KSP.UI.Screens.RDTechTreeSearchBar.PartMatchesSearch ( AvailablePart  part,
string[]  terms 
)
inlineprotected

< PartLoader has pre-loaded all metadata from the part config tags and from GeneratePartAutoTags into p.tags.

< For each word in the search, check the title and tags for a match. All words in the search must be found for the part to succeed.

< Avoid short words like the "I" in "Pegasus I Mobility Enhancer". They match nearly everything.

< Check the word using an algorithm determined by TagMatchType.

virtual void KSP.UI.Screens.RDTechTreeSearchBar.SearchField_OnClick ( PointerEventData  eventData)
inlineprotectedvirtual
virtual void KSP.UI.Screens.RDTechTreeSearchBar.SearchField_OnValueChange ( string  s)
inlineprotectedvirtual
virtual IEnumerator KSP.UI.Screens.RDTechTreeSearchBar.SearchRoutine ( )
inlineprotectedvirtual
virtual void KSP.UI.Screens.RDTechTreeSearchBar.SearchStart ( )
inlineprotectedvirtual
virtual void KSP.UI.Screens.RDTechTreeSearchBar.SearchStop ( )
inlineprotectedvirtual
static string [] KSP.UI.Screens.RDTechTreeSearchBar.SearchTagSplit ( string  terms)
inlinestatic
void KSP.UI.Screens.RDTechTreeSearchBar.SelectPartIcons ( )
inline
MatchType KSP.UI.Screens.RDTechTreeSearchBar.TagMatchType ( ref string  tag)
inlineprotected
bool KSP.UI.Screens.RDTechTreeSearchBar.TermMatchesTag ( string  term,
string  tag 
)
inlineprotected

Member Data Documentation

Button KSP.UI.Screens.RDTechTreeSearchBar.clearButton
RDTechTreeSearchBar KSP.UI.Screens.RDTechTreeSearchBar.Instance
static
TMPro.TMP_InputField KSP.UI.Screens.RDTechTreeSearchBar.searchField
Image KSP.UI.Screens.RDTechTreeSearchBar.searchFieldBackground
protected
PointerClickHandler KSP.UI.Screens.RDTechTreeSearchBar.searchFieldClickHandler
protected
float KSP.UI.Screens.RDTechTreeSearchBar.searchKeystrokeDelay = 0.25f
Coroutine KSP.UI.Screens.RDTechTreeSearchBar.searchRoutine
protected
Color KSP.UI.Screens.RDTechTreeSearchBar.searchSelectionNodeColor
static
Color KSP.UI.Screens.RDTechTreeSearchBar.searchSelectionPartColor
static
float KSP.UI.Screens.RDTechTreeSearchBar.searchTimer = 0f
protected

The documentation for this class was generated from the following file: