Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetInspector Class Reference
Inheritance diagram for WidgetInspector:
Widget EMono IChangeResolution ISkinRoot

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
override void OnDeactivate ()
 
void OnUpdateInput ()
 
void _Show ()
 
void SwitchPage (int _index)
 
void Refresh ()
 
void AddLog (string text, Color c=default(Color))
 
void AddButton (string id="test", Action action=null)
 
override void OnSetContextMenu (UIContextMenu m)
 
- Public Member Functions inherited from Widget
void Test ()
 
bool IsInRightMode ()
 
void Activate ()
 
void RefreshOrder ()
 
virtual void OnActivate ()
 
virtual object CreateExtra ()
 
void Deactivate ()
 
virtual void OnDeactivate ()
 
void Close ()
 
void Reactivate ()
 
virtual void OnManagerActivate ()
 
virtual void OnManagerDeactivate ()
 
void SetAnchor (RectPosition p)
 
void SetPivot (RectPosition p)
 
virtual void OnChangePivot ()
 
void UpdateConfig ()
 
virtual void OnUpdateConfig ()
 
void ClampToScreen ()
 
virtual void OnChangeResolution ()
 
void OnChangePosition ()
 
virtual void OnChangeActionMode ()
 
virtual void OnFlip ()
 
bool IsAlignTop ()
 
Layer AddLayer (Layer l, Transform trans)
 
void RefreshTipPivotPosition ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 
void SetSkin (int id, int v=0)
 
void TestSkin ()
 
virtual void ApplySkin ()
 
virtual void OnApplySkin ()
 
void InstantiateDeco (SkinDeco deco)
 
void AddDeco (SkinDeco deco)
 
void RemoveDeco (SkinDeco deco)
 
virtual bool CanShowContextMenu ()
 
void ShowContextMenu ()
 
void SetBaseContextMenu (UIContextMenu m)
 
virtual void OnSetContextMenu (UIContextMenu m)
 
void SetGridContextMenu (UIContextMenu m)
 
void SoundActivate ()
 
void OnChangeResolution ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 

Static Public Member Functions

static void OnClickPoint ()
 
static void Show ()
 
static void Hide ()
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 

Public Attributes

LayoutGroup layoutButton
 
LayoutGroup layoutLog
 
UIText textTitle
 
Image iconCard
 
Image iconArea
 
int maxLog
 
int index
 
Vector3 posFix
 
List< object > list
 
Sprite spriteArea
 
bool selected
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Static Public Attributes

static WidgetInspector Instance
 
static object target
 
- Static Public Attributes inherited from EMono
static Core core
 

Properties

static PointTarget mouseTarget [get]
 
Extra extra [get]
 
- Properties inherited from Widget
string ID [get]
 
Config config [get]
 
SkinRoot skinRoot [get]
 
bool IsSealed [get]
 
virtual bool ShowStyleMenu [get]
 
virtual bool AlwaysTop [get]
 
virtual bool IsStaticPosition [get]
 
virtual bool AlwaysBottom [get]
 
virtual Type SetSiblingAfter [get]
 
virtual bool ShowInBuildMode [get]
 
virtual bool RightClickToClose [get]
 
virtual bool AllowRightClickToClose [get]
 
- 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]
 

Private Attributes

List< UITexttexts = new List<UIText>()
 
UIButton moldButton
 
UIText moldText
 

Additional Inherited Members

- Public Types inherited from Widget
enum  WidgetType { Default , ZoomMenu }
 
enum  State { Active , Inactive }
 
- Protected Member Functions inherited from Widget
void ClampToScreenEnsured (Component c, Vector2 anchoredPos)
 
void ClampToScreen (RectTransform rect, float margin=10f)
 
- Protected Attributes inherited from Widget
bool flip
 

Detailed Description

Definition at line 7 of file WidgetInspector.cs.

Member Function Documentation

◆ _Show()

void WidgetInspector._Show ( )
inline

Definition at line 100 of file WidgetInspector.cs.

101 {
102 base.gameObject.SetActive(value: true);
103 if (extra.moveToMouse)
104 {
105 base.transform.position = Input.mousePosition + posFix;
107 }
108 EMono.Sound.Play("pop_inspector");
109 SwitchPage(0);
110 }
Definition: EMono.cs:4
static SoundManager Sound
Definition: EMono.cs:39
void SwitchPage(int _index)
void ClampToScreen()
Definition: Widget.cs:437

References Widget.ClampToScreen(), extra, WidgetInspector.Extra.moveToMouse, posFix, EMono.Sound, and SwitchPage().

Referenced by OnUpdateInput().

◆ AddButton()

void WidgetInspector.AddButton ( string  id = "test",
Action  action = null 
)
inline

Definition at line 176 of file WidgetInspector.cs.

177 {
179 uIButton.icon.sprite = SpriteSheet.Get("icon_" + id) ?? uIButton.icon.sprite;
180 uIButton.mainText.SetText(id.lang());
181 if (action != null)
182 {
183 uIButton.onClick.AddListener(delegate
184 {
185 action();
186 });
187 }
188 }
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
Image icon
Definition: UIButton.cs:110
UIText mainText
Definition: UIButton.cs:102
void SetText(string s)
Definition: UIText.cs:159
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
LayoutGroup layoutButton

References SpriteSheet.Get(), UIButton.icon, layoutButton, UIButton.mainText, moldButton, UIText.SetText(), and Util.

Referenced by SwitchPage().

◆ AddLog()

void WidgetInspector.AddLog ( string  text,
Color  c = default(Color) 
)
inline

Definition at line 164 of file WidgetInspector.cs.

165 {
167 texts.Add(uIText);
168 uIText.SetText(text);
169 if (texts.Count > maxLog)
170 {
171 UnityEngine.Object.DestroyImmediate(texts[0].gameObject);
172 texts.Remove(texts[0]);
173 }
174 }
Definition: UIText.cs:6
List< UIText > texts
LayoutGroup layoutLog

References layoutLog, maxLog, moldText, UIText.SetText(), texts, and Util.

Referenced by SwitchPage().

◆ CreateExtra()

override object WidgetInspector.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 51 of file WidgetInspector.cs.

52 {
53 return new Extra();
54 }

◆ Hide()

static void WidgetInspector.Hide ( )
inlinestatic

Definition at line 64 of file WidgetInspector.cs.

65 {
66 if ((bool)Instance)
67 {
69 }
70 }
static WidgetInspector Instance
void Close()
Definition: Widget.cs:319

References Widget.Close(), and Instance.

Referenced by AM_Sim._OnUpdateInput().

◆ OnActivate()

override void WidgetInspector.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 72 of file WidgetInspector.cs.

73 {
74 Instance = this;
75 moldButton = layoutButton.CreateMold<UIButton>();
76 moldText = layoutLog.CreateMold<UIText>();
77 }

References Instance, layoutButton, layoutLog, moldButton, and moldText.

◆ OnClickPoint()

static void WidgetInspector.OnClickPoint ( )
inlinestatic

Definition at line 56 of file WidgetInspector.cs.

57 {
58 }

◆ OnDeactivate()

override void WidgetInspector.OnDeactivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 79 of file WidgetInspector.cs.

80 {
81 target = null;
82 }
static object target

References target.

◆ OnSetContextMenu()

override void WidgetInspector.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 190 of file WidgetInspector.cs.

191 {
192 m.AddChild("setting").AddToggle("moveToMouse", extra.moveToMouse, delegate(bool a)
193 {
194 extra.moveToMouse = a;
195 });
196 m.AddChild("style").AddSlider("toggleButtonBG", (float a) => a.ToString() ?? "", base.config.skin.button, delegate(float a)
197 {
198 base.config.skin.button = (int)a;
199 ApplySkin();
200 }, 0f, base.config.skin.Skin.buttons.Count - 1, isInt: true);
202 }
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
virtual void ApplySkin()
Definition: Widget.cs:556
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608

References UIContextMenu.AddChild(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), Widget.ApplySkin(), extra, WidgetInspector.Extra.moveToMouse, and Widget.SetBaseContextMenu().

◆ OnUpdateInput()

void WidgetInspector.OnUpdateInput ( )
inline

Definition at line 84 of file WidgetInspector.cs.

85 {
86 if (!selected)
87 {
89 {
90 _Show();
91 }
92 else if (target != null)
93 {
94 target = null;
95 base.gameObject.SetActive(value: false);
96 }
97 }
98 }
bool hasValidTarget
Definition: PointTarget.cs:22
static PointTarget mouseTarget

References _Show(), PointTarget.hasValidTarget, mouseTarget, selected, and target.

◆ Refresh()

void WidgetInspector.Refresh ( )
inline

Definition at line 156 of file WidgetInspector.cs.

157 {
158 if (target is Chara)
159 {
160 _ = target;
161 }
162 }
Definition: Chara.cs:10

References target.

Referenced by SwitchPage().

◆ Show()

static void WidgetInspector.Show ( )
inlinestatic

Definition at line 60 of file WidgetInspector.cs.

61 {
62 }

◆ SwitchPage()

void WidgetInspector.SwitchPage ( int  _index)
inline

Definition at line 112 of file WidgetInspector.cs.

113 {
114 index = _index;
115 target = list[index];
116 string text = "";
117 layoutButton.DestroyChildren();
118 layoutLog.DestroyChildren();
119 texts.Clear();
120 if (target is Chara)
121 {
122 Chara c = target as Chara;
123 text = c.Name;
125 if (c.IsHomeMember())
126 {
127 AddButton("detail", delegate
128 {
129 EMono.ui.AddLayer<LayerChara>().SetChara(c);
130 });
131 }
132 }
133 else if (target is Thing)
134 {
135 Thing t = target as Thing;
136 text = t.Name;
138 AddButton("detail", delegate
139 {
140 EMono.ui.AddLayer<LayerInfo>().Set(t);
141 });
142 }
143 else
144 {
145 text = (target as Area).Name;
146 }
147 iconCard.rectTransform.pivot = new Vector2(1f, 0f);
148 iconCard.SetActive(target is Card);
149 iconArea.SetActive(target is Area);
150 AddLog(target.ToString());
151 textTitle.SetText(text);
152 Refresh();
153 this.RebuildLayout(recursive: true);
154 }
Definition: Area.cs:4
Definition: Card.cs:11
string Name
Definition: Card.cs:2013
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5355
bool IsHomeMember()
Definition: Chara.cs:5942
static UI ui
Definition: EMono.cs:15
Definition: Thing.cs:8
void AddLog(string text, Color c=default(Color))
List< object > list
void AddButton(string id="test", Action action=null)

References AddButton(), AddLog(), iconArea, iconCard, index, Chara.IsHomeMember(), layoutButton, layoutLog, list, Card.Name, Refresh(), Card.SetImage(), UIText.SetText(), target, texts, textTitle, and EMono.ui.

Referenced by _Show().

Member Data Documentation

◆ iconArea

Image WidgetInspector.iconArea

Definition at line 27 of file WidgetInspector.cs.

Referenced by SwitchPage().

◆ iconCard

Image WidgetInspector.iconCard

Definition at line 25 of file WidgetInspector.cs.

Referenced by SwitchPage().

◆ index

int WidgetInspector.index

Definition at line 31 of file WidgetInspector.cs.

Referenced by SwitchPage().

◆ Instance

WidgetInspector WidgetInspector.Instance
static

Definition at line 15 of file WidgetInspector.cs.

Referenced by Hide(), and OnActivate().

◆ layoutButton

LayoutGroup WidgetInspector.layoutButton

Definition at line 19 of file WidgetInspector.cs.

Referenced by AddButton(), OnActivate(), and SwitchPage().

◆ layoutLog

LayoutGroup WidgetInspector.layoutLog

Definition at line 21 of file WidgetInspector.cs.

Referenced by AddLog(), OnActivate(), and SwitchPage().

◆ list

List<object> WidgetInspector.list

Definition at line 35 of file WidgetInspector.cs.

Referenced by SwitchPage().

◆ maxLog

int WidgetInspector.maxLog

Definition at line 29 of file WidgetInspector.cs.

Referenced by AddLog().

◆ moldButton

UIButton WidgetInspector.moldButton
private

Definition at line 43 of file WidgetInspector.cs.

Referenced by AddButton(), and OnActivate().

◆ moldText

UIText WidgetInspector.moldText
private

Definition at line 45 of file WidgetInspector.cs.

Referenced by AddLog(), and OnActivate().

◆ posFix

Vector3 WidgetInspector.posFix

Definition at line 33 of file WidgetInspector.cs.

Referenced by _Show().

◆ selected

bool WidgetInspector.selected

Definition at line 39 of file WidgetInspector.cs.

Referenced by OnUpdateInput().

◆ spriteArea

Sprite WidgetInspector.spriteArea

Definition at line 37 of file WidgetInspector.cs.

◆ target

object WidgetInspector.target
static

Definition at line 17 of file WidgetInspector.cs.

Referenced by OnDeactivate(), OnUpdateInput(), Refresh(), and SwitchPage().

◆ texts

List<UIText> WidgetInspector.texts = new List<UIText>()
private

Definition at line 41 of file WidgetInspector.cs.

Referenced by AddLog(), and SwitchPage().

◆ textTitle

UIText WidgetInspector.textTitle

Definition at line 23 of file WidgetInspector.cs.

Referenced by SwitchPage().

Property Documentation

◆ extra

Extra WidgetInspector.extra
get

Definition at line 49 of file WidgetInspector.cs.

Referenced by _Show(), and OnSetContextMenu().

◆ mouseTarget

PointTarget WidgetInspector.mouseTarget
staticgetprivate

Definition at line 47 of file WidgetInspector.cs.

Referenced by OnUpdateInput().


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