Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIInspector Class Reference
Inheritance diagram for UIInspector:
ELayer Layer IUISkin

Public Member Functions

void SetVisible (bool enable)
 
void Hide ()
 
bool InspectUnderMouse ()
 
void Inspect (IInspect newTarget)
 
void Inspect (InspectGroup g)
 
void OnUpdate ()
 
void Refresh ()
 
void DrawHighlight (IInspect i, bool selected=false)
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Public Attributes

InspectGroup group
 
LayoutGroup layoutBody
 
LayoutGroup layoutButtons
 
UIButton mold
 
Vector3 offset
 
Vector3 modPos
 
SoundData soundPop
 
WindowChara windowChara
 
RectTransform rectInfo
 
RectTransform rectRoom
 
UINote note
 
UINote noteRoom
 
UIText textName
 
UIImage bg
 
Point point
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Properties

bool IsActive [get]
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Private Attributes

bool initialized
 

Additional Inherited Members

- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 

Detailed Description

Definition at line 5 of file UIInspector.cs.

Member Function Documentation

◆ DrawHighlight()

void UIInspector.DrawHighlight ( IInspect  i,
bool  selected = false 
)
inline

Definition at line 194 of file UIInspector.cs.

195 {
196 if (i is Area || i is EloPos)
197 {
198 return;
199 }
200 Vector3 v = i.InspectPosition;
201 Point inspectPoint = i.InspectPoint;
202 if (inspectPoint == null)
203 {
204 return;
205 }
206 MeshPass meshPass = ((inspectPoint.HasNonWallBlock || inspectPoint.HasBlockRecipe) ? ELayer.screen.guide.passGuideBlock : ELayer.screen.guide.passGuideFloor);
207 if (i is Chara)
208 {
209 v += ELayer.screen.pcOrbit.crystal.transform.position;
210 ELayer.screen.tileMap.passIcon.Add(ref v, 1f);
211 return;
212 }
213 if (i is Thing)
214 {
215 Thing thing = i as Thing;
216 if (thing.IsInstalled && thing.sourceCard.multisize)
217 {
218 if (selected)
219 {
220 thing.ForeachPoint(delegate(Point pos, bool main)
221 {
222 v = pos.Position();
223 v.z -= 0.01f;
225 });
226 }
227 return;
228 }
229 if (thing.TileType.IsBlockMount)
230 {
232 }
233 }
234 else if (i is TaskBuild)
235 {
236 Recipe recipe = (i as TaskBuild).recipe;
237 if (recipe.MultiSize)
238 {
239 if (selected)
240 {
241 i.InspectPoint.ForeachMultiSize(recipe.W, recipe.H, delegate(Point pos, bool main)
242 {
243 v = pos.Position();
244 v.z -= 0.01f;
246 });
247 }
248 return;
249 }
250 }
251 v.z -= 0.01f;
252 meshPass.Add(ref v, 7f);
253 }
Definition: Area.cs:4
ScreenGuide guide
BaseTileMap tileMap
MeshPass passIcon
Definition: BaseTileMap.cs:185
void ForeachPoint(Action< Point, bool > action)
Definition: Card.cs:6942
TileType TileType
Definition: Card.cs:2011
bool IsInstalled
Definition: Card.cs:2241
Definition: Chara.cs:10
Definition: ELayer.cs:4
static BaseGameScreen screen
Definition: ELayer.cs:29
Definition: EloPos.cs:5
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
Transform crystal
Definition: PCOrbit.cs:5
Definition: Point.cs:9
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1349
ref Vector3 Position(int height)
Definition: Point.cs:524
bool HasBlockRecipe
Definition: Point.cs:205
Definition: Recipe.cs:7
virtual int H
Definition: Recipe.cs:252
bool MultiSize
Definition: Recipe.cs:266
virtual int W
Definition: Recipe.cs:240
bool multisize
Definition: RenderRow.cs:64
MeshPass passGuideBlock
Definition: ScreenGuide.cs:5
MeshPass passGuideFloor
Definition: ScreenGuide.cs:7
Definition: Thing.cs:8
override CardRow sourceCard
Definition: Thing.cs:47
virtual bool IsBlockMount
Definition: TileType.cs:163
Point InspectPoint
Definition: IInspect.cs:18
Vector3 InspectPosition
Definition: IInspect.cs:20

References MeshPass.Add(), PCOrbit.crystal, Point.ForeachMultiSize(), Card.ForeachPoint(), BaseGameScreen.guide, Recipe.H, Point.HasBlockRecipe, IInspect.InspectPoint, IInspect.InspectPosition, TileType.IsBlockMount, Card.IsInstalled, Recipe.MultiSize, RenderRow.multisize, ScreenGuide.passGuideBlock, ScreenGuide.passGuideFloor, BaseTileMap.passIcon, BaseGameScreen.pcOrbit, Point.Position(), ELayer.screen, Thing.sourceCard, BaseGameScreen.tileMap, Card.TileType, and Recipe.W.

Referenced by OnUpdate().

◆ Hide()

void UIInspector.Hide ( )
inline

Definition at line 50 of file UIInspector.cs.

51 {
52 group = null;
53 point = null;
54 base.gameObject.SetActive(value: false);
55 }
Point point
Definition: UIInspector.cs:35
InspectGroup group
Definition: UIInspector.cs:7

References group, and point.

Referenced by OnUpdate(), and Refresh().

◆ Inspect() [1/2]

void UIInspector.Inspect ( IInspect  newTarget)
inline

Definition at line 69 of file UIInspector.cs.

70 {
71 if (group?.FirstTarget != newTarget)
72 {
73 Inspect(InspectGroup.Create(newTarget));
74 }
75 }
static InspectGroup Create(IInspect t)
Definition: InspectGroup.cs:37
void Inspect(IInspect newTarget)
Definition: UIInspector.cs:69

References InspectGroup< T >.Create(), group, and Inspect().

Referenced by Inspect(), and InspectUnderMouse().

◆ Inspect() [2/2]

void UIInspector.Inspect ( InspectGroup  g)
inline

Definition at line 77 of file UIInspector.cs.

78 {
79 base.gameObject.SetActive(value: true);
80 if (!initialized)
81 {
83 initialized = true;
84 mold = layoutButtons.CreateMold<UIButton>();
85 IUISkin[] componentsInChildren = base.transform.GetComponentsInChildren<IUISkin>(includeInactive: true);
86 for (int i = 0; i < componentsInChildren.Length; i++)
87 {
88 componentsInChildren[i].ApplySkin();
89 }
91 }
92 group = g;
93 soundPop.Play();
94 Refresh();
95 }
void InitInspector()
Definition: ELayer.cs:62
List< Window > windows
Definition: Layer.cs:116
LayoutGroup layoutButtons
Definition: UIInspector.cs:11
UIButton mold
Definition: UIInspector.cs:13
void Refresh()
Definition: UIInspector.cs:114
SoundData soundPop
Definition: UIInspector.cs:19
bool initialized
Definition: UIInspector.cs:37
WindowChara windowChara
Definition: UIInspector.cs:21
void ApplySkin()

References IUISkin.ApplySkin(), group, initialized, ELayer.InitInspector(), layoutButtons, mold, Refresh(), soundPop, WindowController.window, windowChara, and Layer.windows.

◆ InspectUnderMouse()

bool UIInspector.InspectUnderMouse ( )
inline

Definition at line 57 of file UIInspector.cs.

58 {
60 {
61 return false;
62 }
63 List<IInspect> source = ELayer.scene.mouseTarget.pos.ListInspectorTargets();
65 Inspect(source.NextItem(group?.FirstTarget));
66 return true;
67 }
static Scene scene
Definition: ELayer.cs:27
IInspect FirstTarget
Definition: InspectGroup.cs:31
List< IInspect > ListInspectorTargets()
Definition: Point.cs:1316
bool IsValid
Definition: Point.cs:88
Definition: Scene.cs:8
static Point HitPoint
Definition: Scene.cs:21
PointTarget mouseTarget
Definition: Scene.cs:129

References InspectGroup< T >.FirstTarget, group, Scene.HitPoint, Inspect(), Point.IsValid, Point.ListInspectorTargets(), Scene.mouseTarget, point, PointTarget.pos, and ELayer.scene.

◆ OnUpdate()

void UIInspector.OnUpdate ( )
inline

Definition at line 97 of file UIInspector.cs.

98 {
99 if (group == null || !IsActive)
100 {
101 return;
102 }
103 if (!group.CanInspect())
104 {
105 Hide();
106 return;
107 }
108 foreach (IInspect target in group.targets)
109 {
110 DrawHighlight(target, selected: true);
111 }
112 }
bool CanInspect()
Definition: InspectGroup.cs:73
List< IInspect > targets
Definition: InspectGroup.cs:29
bool IsActive
Definition: UIInspector.cs:39
void DrawHighlight(IInspect i, bool selected=false)
Definition: UIInspector.cs:194
void Hide()
Definition: UIInspector.cs:50

References InspectGroup< T >.CanInspect(), DrawHighlight(), group, Hide(), IsActive, and InspectGroup< T >.targets.

◆ Refresh()

void UIInspector.Refresh ( )
inline

Definition at line 114 of file UIInspector.cs.

115 {
116 if (!group.CanInspect())
117 {
118 Hide();
119 return;
120 }
122 layoutButtons.DestroyChildren();
123 foreach (InspectGroup.Item item in group.actions)
124 {
125 if (!group.Solo && !item.multi)
126 {
127 continue;
128 }
130 uIButton.icon.sprite = SpriteSheet.Get(item.idSprite.IsEmpty("icon_" + item.text)) ?? uIButton.icon.sprite;
131 uIButton.mainText.SetText((item.textFunc != null) ? item.textFunc() : item.text.lang());
132 uIButton.onClick.AddListener(delegate
133 {
134 if (group.CanInspect())
135 {
136 if (item.sound)
137 {
138 soundPop.Play();
139 }
140 foreach (IInspect target in group.targets)
141 {
142 item.action(target);
143 }
144 }
145 if (group == null || !group.CanInspect())
146 {
147 Hide();
148 }
149 else
150 {
151 Refresh();
152 }
153 });
154 uIButton.RebuildLayout(recursive: true);
155 }
156 Chara chara = group.FirstTarget as Chara;
157 bool flag = group.Solo && chara != null && chara.IsHomeMember();
158 Room room = null;
159 if (!flag && ELayer.core.IsGameStarted && point != null)
160 {
161 room = point.cell.room;
162 }
163 bool flag2 = room != null;
164 windowChara.SetActive(flag);
165 rectInfo.SetActive(!flag);
166 rectRoom.SetActive(flag2);
167 note.Clear();
168 if (flag)
169 {
170 windowChara.SetChara(chara);
171 }
172 else if (group.Solo)
173 {
175 }
176 else
177 {
179 note.Build();
180 }
181 if (flag2)
182 {
183 UINote uINote = noteRoom;
184 uINote.Clear();
185 uINote.AddHeader("Room");
186 uINote.AddText(room.points.Count.ToString() ?? "");
187 uINote.Build();
188 }
189 layoutButtons.RebuildLayout(recursive: true);
190 layoutBody.RebuildLayout();
192 }
PointList points
Definition: BaseArea.cs:26
Room room
Definition: Cell.cs:102
bool IsHomeMember()
Definition: Chara.cs:5942
bool IsGameStarted
Definition: Core.cs:84
static Core core
Definition: ELayer.cs:7
virtual void SetActions()
string GetName()
Definition: InspectGroup.cs:94
List< Item > actions
Definition: InspectGroup.cs:27
Cell cell
Definition: Point.cs:51
Definition: Room.cs:4
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
Image icon
Definition: UIButton.cs:110
UIText mainText
Definition: UIButton.cs:102
UINote note
Definition: UIInspector.cs:27
RectTransform rectInfo
Definition: UIInspector.cs:23
LayoutGroup layoutBody
Definition: UIInspector.cs:9
RectTransform rectRoom
Definition: UIInspector.cs:25
UINote noteRoom
Definition: UIInspector.cs:29
Definition: UINote.cs:6
void Clear()
Definition: UINote.cs:35
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:159
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
void SetChara(Chara c)
Definition: WindowChara.cs:163
void OnInspect()
void WriteNote(UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)

References InspectGroup< T >.actions, InspectGroup< T >.CanInspect(), SpriteSheet.Get(), group, Hide(), UIButton.icon, item, layoutButtons, UIButton.mainText, mold, InspectGroup< T >.SetActions(), UIText.SetText(), InspectGroup< T >.Solo, InspectGroup< T >.targets, and Util.

Referenced by Inspect(), and SetVisible().

◆ SetVisible()

void UIInspector.SetVisible ( bool  enable)
inline

Definition at line 41 of file UIInspector.cs.

42 {
43 base.gameObject.SetActive(enable && group != null);
44 if (enable && group != null)
45 {
46 Refresh();
47 }
48 }

References group, and Refresh().

Member Data Documentation

◆ bg

UIImage UIInspector.bg

Definition at line 33 of file UIInspector.cs.

◆ group

InspectGroup UIInspector.group

Definition at line 7 of file UIInspector.cs.

Referenced by Hide(), Inspect(), InspectUnderMouse(), OnUpdate(), Refresh(), and SetVisible().

◆ initialized

bool UIInspector.initialized
private

Definition at line 37 of file UIInspector.cs.

Referenced by Inspect().

◆ layoutBody

LayoutGroup UIInspector.layoutBody

Definition at line 9 of file UIInspector.cs.

◆ layoutButtons

LayoutGroup UIInspector.layoutButtons

Definition at line 11 of file UIInspector.cs.

Referenced by Inspect(), and Refresh().

◆ modPos

Vector3 UIInspector.modPos

Definition at line 17 of file UIInspector.cs.

◆ mold

UIButton UIInspector.mold

Definition at line 13 of file UIInspector.cs.

Referenced by Inspect(), and Refresh().

◆ note

UINote UIInspector.note

Definition at line 27 of file UIInspector.cs.

◆ noteRoom

UINote UIInspector.noteRoom

Definition at line 29 of file UIInspector.cs.

◆ offset

Vector3 UIInspector.offset

Definition at line 15 of file UIInspector.cs.

◆ point

Point UIInspector.point

Definition at line 35 of file UIInspector.cs.

Referenced by Hide(), and InspectUnderMouse().

◆ rectInfo

RectTransform UIInspector.rectInfo

Definition at line 23 of file UIInspector.cs.

◆ rectRoom

RectTransform UIInspector.rectRoom

Definition at line 25 of file UIInspector.cs.

◆ soundPop

SoundData UIInspector.soundPop

Definition at line 19 of file UIInspector.cs.

Referenced by Inspect().

◆ textName

UIText UIInspector.textName

Definition at line 31 of file UIInspector.cs.

◆ windowChara

WindowChara UIInspector.windowChara

Definition at line 21 of file UIInspector.cs.

Referenced by Inspect().

Property Documentation

◆ IsActive

bool UIInspector.IsActive
get

Definition at line 39 of file UIInspector.cs.

Referenced by OnUpdate().


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