11 public override object CreateExtra()
28 public override bool AlwaysBottom
38 public override Type SetSiblingAfter
47 public override void OnActivate()
49 if (Mathf.Abs(
this.extra.margin) > 100)
51 this.extra.margin = 0;
52 this.extra.width = 40;
53 this.extra.portrait =
false;
54 this.extra.onlyName =
true;
56 WidgetRoster.Instance =
this;
57 this.mold = this.layout.CreateMold(
null);
62 private void OnEnable()
64 base.InvokeRepeating(
"Refresh", 0.2f, 0.2f);
68 private void OnDisable()
74 public void OnMoveZone()
83 this.layout.DestroyChildren(
false,
true);
84 this.layout.constraint = (this.extra.vertical ? GridLayoutGroup.Constraint.FixedColumnCount : GridLayoutGroup.Constraint.FixedRowCount);
85 this.layout.startCorner = (this.extra.reverse ? GridLayoutGroup.Corner.LowerRight : GridLayoutGroup.Corner.UpperLeft);
86 this.layout.cellSize =
new Vector2((
float)(this.extra.width * 4 / 5), (
float)(
this.extra.onlyName ? 32 :
this.extra.width));
87 this.layout.spacing =
new Vector2((
float)this.extra.margin, (
float)
this.extra.margin);
88 foreach (
Chara chara
in EMono.pc.party.members)
90 if (chara !=
EMono.pc ||
this.extra.pc)
95 if (this.buttons.Count == 0)
99 this.layout.RebuildLayout(
false);
100 this.RebuildLayout(
false);
101 this.OnChangeResolution();
102 base.ClampToScreen();
106 public static void SetDirty()
110 WidgetRoster.Instance.dirty =
true;
115 public void Refresh()
121 foreach (
ButtonRoster buttonRoster
in this.buttons.Values)
123 buttonRoster.Refresh();
129 public void Add(
Chara c)
132 buttonRoster.SetChara(c);
133 this.buttons.Add(c, buttonRoster);
137 public void Remove(
Chara c)
139 UnityEngine.Object.DestroyImmediate(this.buttons[c].gameObject);
140 this.buttons.Remove(c);
144 public void OnAddMember(
Chara c)
146 if (this.buttons.ContainsKey(c))
154 public void OnRemoveMember(
Chara c)
156 if (!this.buttons.ContainsKey(c))
164 public override void OnSetContextMenu(UIContextMenu m)
166 UIContextMenu uicontextMenu = m.AddChild(
"setting");
167 uicontextMenu.AddSlider(
"width", (
float a) => a.ToString() ??
"", (
float)
this.extra.width, delegate(
float a)
169 this.extra.width = (int)a;
171 }, 30f, 160f,
true,
true,
false);
172 uicontextMenu.AddSlider(
"margine", (
float a) => a.ToString() ??
"", (
float)
this.extra.margin, delegate(
float a)
174 this.extra.margin = (int)a;
176 }, -50f, 50f,
true,
true,
false);
177 uicontextMenu.AddToggle(
"roster_pc", this.extra.pc, delegate(
bool a)
182 uicontextMenu.AddToggle(
"vertical", this.extra.vertical, delegate(
bool a)
184 this.extra.vertical = a;
187 uicontextMenu.AddToggle(
"roster_portrait", this.extra.portrait, delegate(
bool a)
189 this.extra.portrait = a;
192 uicontextMenu.AddToggle(
"roster_onlyname", this.extra.onlyName, delegate(
bool a)
194 this.extra.onlyName = a;
197 uicontextMenu.AddToggle(
"reverseOrder", this.extra.reverse, delegate(
bool a)
199 this.extra.reverse = a;
202 m.AddChild(
"style").AddSlider(
"toggleButtonBG", (
float a) => a.ToString() ??
"", (
float)base.config.skin.button, delegate(
float a)
204 base.config.skin.button = (int)a;
206 }, 0f, (float)(base.config.skin.Skin.buttons.Count - 1),
true,
true,
false);
207 base.SetBaseContextMenu(m);
214 public GridLayoutGroup layout;
220 public RawImage imageGrid;
223 public Dictionary<Chara, ButtonRoster> buttons =
new Dictionary<Chara, ButtonRoster>();
226 public UIButton moldDropperLeft;
229 public UIButton moldDropperRight;
232 public bool showName;
245 public int width = 40;
253 public bool vertical;
261 public bool portrait;
269 public bool onlyName;