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

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
void OnMoveZone ()
 
void Build ()
 
void Refresh ()
 
void Add (Chara c)
 
void Remove (Chara c)
 
void OnAddMember (Chara c)
 
void OnRemoveMember (Chara c)
 
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 SetDirty ()
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 

Public Attributes

GridLayoutGroup layout
 
ButtonRoster mold
 
RawImage imageGrid
 
Dictionary< Chara, ButtonRosterbuttons = new Dictionary<Chara, ButtonRoster>()
 
UIButton moldDropperLeft
 
UIButton moldDropperRight
 
bool showName
 
bool dirty
 
int maxWidth
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Static Public Attributes

static WidgetRoster Instance
 
- Static Public Attributes inherited from EMono
static Core core
 

Properties

Extra extra [get]
 
override bool AlwaysBottom [get]
 
override Type SetSiblingAfter [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 Member Functions

void OnEnable ()
 
void OnDisable ()
 

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 WidgetRoster.cs.

Member Function Documentation

◆ Add()

void WidgetRoster.Add ( Chara  c)
inline

Definition at line 142 of file WidgetRoster.cs.

143 {
144 ButtonRoster buttonRoster = Util.Instantiate(mold, layout);
145 buttonRoster.SetChara(c);
146 buttons.Add(c, buttonRoster);
147 }
void SetChara(Chara c)
Definition: ButtonRoster.cs:23
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
Dictionary< Chara, ButtonRoster > buttons
Definition: WidgetRoster.cs:44
GridLayoutGroup layout
Definition: WidgetRoster.cs:38
ButtonRoster mold
Definition: WidgetRoster.cs:40

References buttons, layout, mold, ButtonRoster.SetChara(), and Util.

Referenced by Build(), and OnAddMember().

◆ Build()

void WidgetRoster.Build ( )
inline

Definition at line 96 of file WidgetRoster.cs.

97 {
98 buttons.Clear();
99 layout.DestroyChildren();
100 layout.constraint = (extra.vertical ? GridLayoutGroup.Constraint.FixedColumnCount : GridLayoutGroup.Constraint.FixedRowCount);
101 layout.startCorner = (extra.reverse ? GridLayoutGroup.Corner.LowerRight : GridLayoutGroup.Corner.UpperLeft);
102 layout.cellSize = new Vector2(extra.width * 4 / 5, extra.onlyName ? 32 : extra.width);
103 layout.spacing = new Vector2(extra.margin, extra.margin);
104 foreach (Chara member in EMono.pc.party.members)
105 {
106 if (member != EMono.pc || extra.pc)
107 {
108 Add(member);
109 }
110 }
111 if (buttons.Count == 0)
112 {
113 Add(EMono.pc);
114 }
115 layout.RebuildLayout();
116 this.RebuildLayout();
119 }
Definition: Chara.cs:10
Party party
Definition: Chara.cs:43
Definition: EMono.cs:4
static Chara pc
Definition: EMono.cs:13
List< Chara > members
Definition: Party.cs:18
void Add(Chara c)
virtual void OnChangeResolution()
Definition: Widget.cs:457
void ClampToScreen()
Definition: Widget.cs:437

References Add(), buttons, Widget.ClampToScreen(), extra, layout, WidgetRoster.Extra.margin, Party.members, Widget.OnChangeResolution(), WidgetRoster.Extra.onlyName, Chara.party, EMono.pc, WidgetRoster.Extra.pc, and WidgetRoster.Extra.width.

Referenced by OnActivate(), OnMoveZone(), OnSetContextMenu(), and Refresh().

◆ CreateExtra()

override object WidgetRoster.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 62 of file WidgetRoster.cs.

63 {
64 return new Extra();
65 }

◆ OnActivate()

override void WidgetRoster.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 67 of file WidgetRoster.cs.

68 {
69 if (Mathf.Abs(extra.margin) > 100)
70 {
71 extra.margin = 0;
72 extra.width = 40;
73 extra.portrait = false;
74 extra.onlyName = true;
75 }
76 Instance = this;
77 mold = layout.CreateMold<ButtonRoster>();
78 Build();
79 }
static WidgetRoster Instance
Definition: WidgetRoster.cs:36
void Build()
Definition: WidgetRoster.cs:96

References Build(), extra, Instance, layout, WidgetRoster.Extra.margin, and mold.

◆ OnAddMember()

void WidgetRoster.OnAddMember ( Chara  c)
inline

Definition at line 155 of file WidgetRoster.cs.

156 {
157 if (!buttons.ContainsKey(c))
158 {
159 Add(c);
160 }
161 }

References Add(), and buttons.

◆ OnDisable()

void WidgetRoster.OnDisable ( )
inlineprivate

Definition at line 86 of file WidgetRoster.cs.

87 {
88 CancelInvoke();
89 }

◆ OnEnable()

void WidgetRoster.OnEnable ( )
inlineprivate

Definition at line 81 of file WidgetRoster.cs.

82 {
83 InvokeRepeating("Refresh", 0.2f, 0.2f);
84 }

◆ OnMoveZone()

void WidgetRoster.OnMoveZone ( )
inline

Definition at line 91 of file WidgetRoster.cs.

92 {
93 Build();
94 }

References Build().

Referenced by Player.MoveZone().

◆ OnRemoveMember()

void WidgetRoster.OnRemoveMember ( Chara  c)
inline

Definition at line 163 of file WidgetRoster.cs.

164 {
165 if (buttons.ContainsKey(c))
166 {
167 Remove(c);
168 }
169 }
void Remove(Chara c)

References buttons, and Remove().

◆ OnSetContextMenu()

override void WidgetRoster.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 171 of file WidgetRoster.cs.

172 {
173 ButtonRoster b = InputModuleEX.GetComponentOf<ButtonRoster>();
174 int index;
175 if ((bool)b)
176 {
177 index = EMono.pc.party.members.IndexOf(b.chara);
178 int count = EMono.pc.party.members.Count;
179 if (index >= 1 && index < count - 1)
180 {
181 m.AddButton("next", delegate
182 {
183 Move(1);
184 });
185 }
186 if (index >= 2)
187 {
188 m.AddButton("prev", delegate
189 {
190 Move(-1);
191 });
192 }
193 }
194 UIContextMenu uIContextMenu = m.AddChild("setting");
195 uIContextMenu.AddSlider("width", (float a) => a.ToString() ?? "", extra.width, delegate(float a)
196 {
197 extra.width = (int)a;
198 Build();
199 }, 30f, 160f, isInt: true);
200 uIContextMenu.AddSlider("margin", (float a) => a.ToString() ?? "", extra.margin, delegate(float a)
201 {
202 extra.margin = (int)a;
203 Build();
204 }, -50f, 50f, isInt: true);
205 uIContextMenu.AddToggle("roster_pc", extra.pc, delegate(bool a)
206 {
207 extra.pc = a;
208 Build();
209 });
210 uIContextMenu.AddToggle("vertical", extra.vertical, delegate(bool a)
211 {
212 extra.vertical = a;
213 Build();
214 });
215 uIContextMenu.AddToggle("roster_portrait", extra.portrait, delegate(bool a)
216 {
217 extra.portrait = a;
218 Build();
219 });
220 uIContextMenu.AddToggle("roster_onlyname", extra.onlyName, delegate(bool a)
221 {
222 extra.onlyName = a;
223 Build();
224 });
225 uIContextMenu.AddToggle("reverseOrder", extra.reverse, delegate(bool a)
226 {
227 extra.reverse = a;
228 Build();
229 });
230 m.AddChild("style").AddSlider("toggleButtonBG", (float a) => a.ToString() ?? "", base.config.skin.button, delegate(float a)
231 {
232 base.config.skin.button = (int)a;
233 ApplySkin();
234 }, 0f, base.config.skin.Skin.buttons.Count - 1, isInt: true);
236 void Move(int mod)
237 {
238 EMono.pc.party.Replace(b.chara, index + mod);
239 Build();
240 }
241 }
void Replace(Chara c, int index)
Definition: Party.cs:103
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)
void AddButton(Func< string > funcText, UnityAction action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
virtual void ApplySkin()
Definition: Widget.cs:556
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608

References UIContextMenu.AddButton(), UIContextMenu.AddChild(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), Widget.ApplySkin(), Build(), ButtonRoster.chara, extra, WidgetRoster.Extra.margin, Party.members, WidgetRoster.Extra.onlyName, Chara.party, EMono.pc, WidgetRoster.Extra.pc, WidgetRoster.Extra.portrait, Party.Replace(), WidgetRoster.Extra.reverse, Widget.SetBaseContextMenu(), WidgetRoster.Extra.vertical, and WidgetRoster.Extra.width.

◆ Refresh()

void WidgetRoster.Refresh ( )
inline

Definition at line 129 of file WidgetRoster.cs.

130 {
131 if (dirty)
132 {
133 Build();
134 }
135 foreach (ButtonRoster value in buttons.Values)
136 {
137 value.Refresh();
138 }
139 dirty = false;
140 }
void Refresh()
Definition: ButtonRoster.cs:35

References Build(), buttons, dirty, and ButtonRoster.Refresh().

◆ Remove()

void WidgetRoster.Remove ( Chara  c)
inline

Definition at line 149 of file WidgetRoster.cs.

150 {
151 UnityEngine.Object.DestroyImmediate(buttons[c].gameObject);
152 buttons.Remove(c);
153 }

References buttons.

Referenced by OnRemoveMember().

◆ SetDirty()

static void WidgetRoster.SetDirty ( )
inlinestatic

Definition at line 121 of file WidgetRoster.cs.

122 {
123 if ((bool)Instance)
124 {
125 Instance.dirty = true;
126 }
127 }

References Instance.

Referenced by Party.AddMemeber(), and Party.RemoveMember().

Member Data Documentation

◆ buttons

Dictionary<Chara, ButtonRoster> WidgetRoster.buttons = new Dictionary<Chara, ButtonRoster>()

Definition at line 44 of file WidgetRoster.cs.

Referenced by Add(), Build(), OnAddMember(), OnRemoveMember(), Refresh(), and Remove().

◆ dirty

bool WidgetRoster.dirty

Definition at line 52 of file WidgetRoster.cs.

Referenced by Refresh().

◆ imageGrid

RawImage WidgetRoster.imageGrid

Definition at line 42 of file WidgetRoster.cs.

◆ Instance

WidgetRoster WidgetRoster.Instance
static

Definition at line 36 of file WidgetRoster.cs.

Referenced by Player.MoveZone(), OnActivate(), and SetDirty().

◆ layout

GridLayoutGroup WidgetRoster.layout

Definition at line 38 of file WidgetRoster.cs.

Referenced by Add(), Build(), and OnActivate().

◆ maxWidth

int WidgetRoster.maxWidth

Definition at line 54 of file WidgetRoster.cs.

◆ mold

ButtonRoster WidgetRoster.mold

Definition at line 40 of file WidgetRoster.cs.

Referenced by Add(), and OnActivate().

◆ moldDropperLeft

UIButton WidgetRoster.moldDropperLeft

Definition at line 46 of file WidgetRoster.cs.

◆ moldDropperRight

UIButton WidgetRoster.moldDropperRight

Definition at line 48 of file WidgetRoster.cs.

◆ showName

bool WidgetRoster.showName

Definition at line 50 of file WidgetRoster.cs.

Property Documentation

◆ AlwaysBottom

override bool WidgetRoster.AlwaysBottom
get

Definition at line 58 of file WidgetRoster.cs.

◆ extra

Extra WidgetRoster.extra
get

◆ SetSiblingAfter

override Type WidgetRoster.SetSiblingAfter
get

Definition at line 60 of file WidgetRoster.cs.


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