Elin Decompiled Documentation EA 23.285 Nightly
Loading...
Searching...
No Matches
UISearchPeople Class Reference
Inheritance diagram for UISearchPeople:
EMono

Public Member Functions

void Init (ListOwner _list)
 
bool FuncFilter (object _c)
 
void Search (string s)
 
void ClearSearch ()
 
void Redraw ()
 

Public Attributes

InputField inputSearch
 
UIButton buttonClearSearch
 
UIDropdown dropdown
 
ListOwner list
 
bool disable
 
float intervalSearch
 

Private Member Functions

void LateUpdate ()
 

Private Attributes

int uidFilterZone = -1
 
float timerSearch
 
string lastSearch = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 4 of file UISearchPeople.cs.

Member Function Documentation

◆ ClearSearch()

void UISearchPeople.ClearSearch ( )
inline

Definition at line 106 of file UISearchPeople.cs.

107 {
108 inputSearch.text = "";
109 timerSearch = 0f;
110 lastSearch = "";
111 Redraw();
112 }

References lastSearch, Redraw(), and timerSearch.

◆ FuncFilter()

bool UISearchPeople.FuncFilter ( object  _c)
inline

Definition at line 76 of file UISearchPeople.cs.

77 {
78 Chara chara = _c as Chara;
79 if (uidFilterZone != -1 && (chara.homeZone == null || chara.homeZone.uid != uidFilterZone))
80 {
81 return false;
82 }
83 if (!lastSearch.IsEmpty() && !chara.NameBraced.ToLower().Contains(lastSearch))
84 {
85 return false;
86 }
87 return true;
88 }
Definition: Chara.cs:10
string NameBraced
Definition: Chara.cs:516
Zone homeZone
Definition: Chara.cs:269
int uid
Definition: Spatial.cs:70

References Chara.homeZone, lastSearch, Chara.NameBraced, Spatial.uid, and uidFilterZone.

Referenced by Init().

◆ Init()

void UISearchPeople.Init ( ListOwner  _list)
inline

Definition at line 24 of file UISearchPeople.cs.

25 {
26 if (disable)
27 {
28 base.gameObject.SetActive(value: false);
29 return;
30 }
31 this.list = _list;
32 inputSearch.onValueChanged.AddListener(Search);
33 inputSearch.onSubmit.AddListener(Search);
34 List<int> list = new List<int> { -1 };
35 foreach (FactionBranch child in EMono.pc.faction.GetChildren())
36 {
37 list.Add(child.owner.uid);
38 }
39 dropdown.SetList(0, list, delegate(int a, int i)
40 {
41 object obj;
42 if (a != -1)
43 {
44 obj = EMono.game.spatials.Find(a)?.Name;
45 if (obj == null)
46 {
47 return "???";
48 }
49 }
50 else
51 {
52 obj = "all".lang();
53 }
54 return (string)obj;
55 }, delegate(int i, int a)
56 {
57 SE.ClickOk();
58 uidFilterZone = a;
59 this.list.List();
60 });
61 this.list.list.funcFilter = FuncFilter;
62 }
Faction faction
Definition: Chara.cs:429
Definition: EMono.cs:4
static Chara pc
Definition: EMono.cs:13
static Game game
Definition: EMono.cs:7
List< FactionBranch > GetChildren()
Definition: FACTION.cs:202
SpatialManager spatials
Definition: Game.cs:153
Zone Find(string id)
ListOwner list
UIDropdown dropdown
bool FuncFilter(object _c)
InputField inputSearch

References disable, dropdown, Chara.faction, SpatialManager.Find(), FuncFilter(), EMono.game, Faction.GetChildren(), inputSearch, ListOwner< T1, T2 >.List(), list, FactionBranch.owner, EMono.pc, Search, Game.spatials, Spatial.uid, and uidFilterZone.

Referenced by LayerPeople.InitList().

◆ LateUpdate()

void UISearchPeople.LateUpdate ( )
inlineprivate

Definition at line 64 of file UISearchPeople.cs.

65 {
66 if (!disable && timerSearch > 0f)
67 {
69 if (timerSearch <= 0f)
70 {
71 Search(inputSearch.text);
72 }
73 }
74 }
Definition: Core.cs:14
static float delta
Definition: Core.cs:17

References Core.delta, disable, inputSearch, Search, and timerSearch.

◆ Redraw()

void UISearchPeople.Redraw ( )
inline

Definition at line 114 of file UISearchPeople.cs.

115 {
116 list.List();
117 }
virtual void List()
Definition: ListOwner.cs:77

References ListOwner< T1, T2 >.List(), and list.

Referenced by ClearSearch(), and Search().

◆ Search()

void UISearchPeople.Search ( string  s)
inline

Definition at line 90 of file UISearchPeople.cs.

91 {
92 s = s.ToLower();
93 if (s.IsEmpty())
94 {
95 s = "";
96 }
97 buttonClearSearch.SetActive(inputSearch.text != "");
98 if (!(s == lastSearch))
99 {
101 lastSearch = s;
102 Redraw();
103 }
104 }
UIButton buttonClearSearch

References buttonClearSearch, inputSearch, intervalSearch, lastSearch, Redraw(), and timerSearch.

Member Data Documentation

◆ buttonClearSearch

UIButton UISearchPeople.buttonClearSearch

Definition at line 8 of file UISearchPeople.cs.

Referenced by Search().

◆ disable

bool UISearchPeople.disable

Definition at line 14 of file UISearchPeople.cs.

Referenced by Init(), and LateUpdate().

◆ dropdown

UIDropdown UISearchPeople.dropdown

Definition at line 10 of file UISearchPeople.cs.

Referenced by Init().

◆ inputSearch

InputField UISearchPeople.inputSearch

Definition at line 6 of file UISearchPeople.cs.

Referenced by Init(), LateUpdate(), and Search().

◆ intervalSearch

float UISearchPeople.intervalSearch

Definition at line 16 of file UISearchPeople.cs.

Referenced by Search().

◆ lastSearch

string UISearchPeople.lastSearch = ""
private

Definition at line 22 of file UISearchPeople.cs.

Referenced by ClearSearch(), FuncFilter(), and Search().

◆ list

ListOwner UISearchPeople.list

Definition at line 12 of file UISearchPeople.cs.

Referenced by Init(), and Redraw().

◆ timerSearch

float UISearchPeople.timerSearch
private

Definition at line 20 of file UISearchPeople.cs.

Referenced by ClearSearch(), LateUpdate(), and Search().

◆ uidFilterZone

int UISearchPeople.uidFilterZone = -1
private

Definition at line 18 of file UISearchPeople.cs.

Referenced by FuncFilter(), and Init().


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