Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetBottomBar.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5public class WidgetBottomBar : Widget
6{
7 public class Extra
8 {
9 public int width;
10
11 public int height;
12
13 public bool subBar;
14 }
15
16 public Image imageSubBar;
17
18 public override bool AlwaysBottom => true;
19
20 public override Type SetSiblingAfter => typeof(WidgetSideScreen);
21
22 public Extra extra => base.config.extra as Extra;
23
24 public override object CreateExtra()
25 {
26 return new Extra();
27 }
28
29 public override void OnActivate()
30 {
31 Refresh();
33 }
34
35 public override void OnSetContextMenu(UIContextMenu m)
36 {
37 _ = base.config.skin;
38 UIContextMenu uIContextMenu = m.AddChild("setting");
39 uIContextMenu.AddSlider("width", (float a) => a.ToString() ?? "", extra.width, delegate(float a)
40 {
41 extra.width = (int)a;
43 }, 10f, 100f, isInt: true);
44 uIContextMenu.AddSlider("height", (float a) => a.ToString() ?? "", extra.height, delegate(float a)
45 {
46 extra.height = (int)a;
48 }, 5f, 300f, isInt: true);
49 uIContextMenu.AddToggle("subBar", extra.subBar, delegate
50 {
52 Refresh();
53 });
55 }
56
57 public void Refresh()
58 {
59 imageSubBar.SetActive(extra.subBar);
60 }
61
62 public override void OnChangeResolution()
63 {
64 base.OnChangeResolution();
65 this.Rect().sizeDelta = new Vector2(0.01f * (float)Screen.width * (float)extra.width / EMono.core.uiScale + 2f, extra.height + 10);
66 }
67}
override float uiScale
Definition: Core.cs:95
Definition: EMono.cs:4
static Core core
Definition: EMono.cs:5
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)
override void OnChangeResolution()
override Type SetSiblingAfter
override object CreateExtra()
override bool AlwaysBottom
override void OnSetContextMenu(UIContextMenu m)
override void OnActivate()
Definition: Widget.cs:7
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608