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

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
void _OnChangeMode ()
 
override void OnChangeResolution ()
 
void FixSize ()
 
void Build ()
 
UIButton AddButton (LayoutGroup _layout, string id, Action action, bool enableSubtext=false)
 
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 OnChangeMode ()
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 

Public Attributes

LayoutGroup layout
 
LayoutGroup layout2
 
UIButton mold
 
RawImage imageGrid
 
int maxWidth
 
int marginLeft
 
int marginRight
 
UIButton buttonHome
 
UIButton buttonBuild
 
UIButton buttonPeople
 
UIButton buttonGlobalMap
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Static Public Attributes

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

Properties

Extra extra [get]
 
bool allMenu [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]
 

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 5 of file WidgetMenuPanel.cs.

Member Function Documentation

◆ _OnChangeMode()

void WidgetMenuPanel._OnChangeMode ( )
inline

Definition at line 63 of file WidgetMenuPanel.cs.

64 {
65 if ((bool)Instance && !(Instance == null))
66 {
68 int num = ((EMono._zone.mainFaction == EMono.pc.faction) ? 2 : 0) + (EMono._zone.CanEnterBuildModeAnywhere ? 1 : 0);
69 imageGrid.uvRect = new Rect(1f, 1f, num, 1f);
70 }
71 }
Faction faction
Definition: Chara.cs:412
Definition: EMono.cs:4
static Chara pc
Definition: EMono.cs:13
static Zone _zone
Definition: EMono.cs:19
static WidgetMenuPanel Instance
UIButton buttonBuild
bool CanEnterBuildModeAnywhere
Definition: Zone.cs:449

References EMono._zone, buttonBuild, Zone.CanEnterBuildModeAnywhere, Chara.faction, Instance, and EMono.pc.

Referenced by Build(), and OnChangeMode().

◆ AddButton()

UIButton WidgetMenuPanel.AddButton ( LayoutGroup  _layout,
string  id,
Action  action,
bool  enableSubtext = false 
)
inline

Definition at line 105 of file WidgetMenuPanel.cs.

106 {
107 UIButton uIButton = Util.Instantiate(mold, _layout);
108 uIButton.icon.sprite = SpriteSheet.Get("icon_" + id);
109 uIButton.subText.SetActive(enableSubtext);
110 uIButton.tooltip.text = id.lang();
111 if (action != null)
112 {
113 uIButton.onClick.AddListener(delegate
114 {
115 action();
116 });
117 }
118 return uIButton;
119 }
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
UIText subText
Definition: UIButton.cs:104
string lang
Definition: UIText.cs:9
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References SpriteSheet.Get(), UIText.lang, mold, UIButton.subText, and Util.

Referenced by Build().

◆ Build()

void WidgetMenuPanel.Build ( )
inline

Definition at line 82 of file WidgetMenuPanel.cs.

83 {
84 layout.DestroyChildren();
85 layout2.DestroyChildren();
86 buttonBuild = AddButton(layout, "Inspect", delegate
87 {
88 if (EMono.ui.BlockInput)
89 {
90 SE.BeepSmall();
91 }
92 else
93 {
94 EMono.player.hotbars.ResetHotbar(3);
95 EMono.player.hotbars.bars[3].dirty = true;
96 EMono.player.hotbars.ResetHotbar(4);
97 EMono.player.hotbars.bars[4].dirty = true;
98 ActionMode.Inspect.Activate();
99 }
100 });
102 this.RebuildLayout(recursive: true);
103 }
static UI ui
Definition: EMono.cs:15
LayoutGroup layout
LayoutGroup layout2
UIButton AddButton(LayoutGroup _layout, string id, Action action, bool enableSubtext=false)

References _OnChangeMode(), AddButton(), buttonBuild, layout, layout2, and EMono.ui.

Referenced by OnActivate().

◆ CreateExtra()

override object WidgetMenuPanel.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 43 of file WidgetMenuPanel.cs.

44 {
45 return new Extra();
46 }

◆ FixSize()

void WidgetMenuPanel.FixSize ( )
inline

Definition at line 78 of file WidgetMenuPanel.cs.

79 {
80 }

◆ OnActivate()

override void WidgetMenuPanel.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 48 of file WidgetMenuPanel.cs.

49 {
50 Instance = this;
51 mold.skinRoot = GetComponent<SkinRoot>();
52 Build();
53 }

References Build(), and Instance.

◆ OnChangeMode()

static void WidgetMenuPanel.OnChangeMode ( )
inlinestatic

Definition at line 55 of file WidgetMenuPanel.cs.

56 {
57 if ((bool)Instance)
58 {
60 }
61 }

References _OnChangeMode(), and Instance.

Referenced by Scene.Init(), TraitDeed.OnRead(), and CoreDebug.UpdateInput().

◆ OnChangeResolution()

override void WidgetMenuPanel.OnChangeResolution ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 73 of file WidgetMenuPanel.cs.

74 {
75 base.OnChangeResolution();
76 }

◆ OnSetContextMenu()

override void WidgetMenuPanel.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 121 of file WidgetMenuPanel.cs.

122 {
123 UIContextMenu uIContextMenu = m.AddChild("style");
124 uIContextMenu.AddSlider("toggleButtonBG", (float a) => a.ToString() ?? "", base.config.skin.button, delegate(float a)
125 {
126 base.config.skin.button = (int)a;
127 ApplySkin();
128 }, 0f, base.config.skin.Skin.buttons.Count - 1, isInt: true);
129 SetGridContextMenu(uIContextMenu);
131 }
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
void SetGridContextMenu(UIContextMenu m)
Definition: Widget.cs:709

References UIContextMenu.AddChild(), UIContextMenu.AddSlider(), Widget.ApplySkin(), Widget.SetBaseContextMenu(), and Widget.SetGridContextMenu().

Member Data Documentation

◆ buttonBuild

UIButton WidgetMenuPanel.buttonBuild

Definition at line 31 of file WidgetMenuPanel.cs.

Referenced by _OnChangeMode(), and Build().

◆ buttonGlobalMap

UIButton WidgetMenuPanel.buttonGlobalMap

Definition at line 37 of file WidgetMenuPanel.cs.

◆ buttonHome

UIButton WidgetMenuPanel.buttonHome

Definition at line 28 of file WidgetMenuPanel.cs.

◆ buttonPeople

UIButton WidgetMenuPanel.buttonPeople

Definition at line 34 of file WidgetMenuPanel.cs.

◆ imageGrid

RawImage WidgetMenuPanel.imageGrid

Definition at line 19 of file WidgetMenuPanel.cs.

◆ Instance

WidgetMenuPanel WidgetMenuPanel.Instance
static

Definition at line 11 of file WidgetMenuPanel.cs.

Referenced by _OnChangeMode(), OnActivate(), OnChangeMode(), and LayerHome.RefreshFeat().

◆ layout

LayoutGroup WidgetMenuPanel.layout

Definition at line 13 of file WidgetMenuPanel.cs.

Referenced by Build().

◆ layout2

LayoutGroup WidgetMenuPanel.layout2

Definition at line 15 of file WidgetMenuPanel.cs.

Referenced by Build().

◆ marginLeft

int WidgetMenuPanel.marginLeft

Definition at line 23 of file WidgetMenuPanel.cs.

◆ marginRight

int WidgetMenuPanel.marginRight

Definition at line 25 of file WidgetMenuPanel.cs.

◆ maxWidth

int WidgetMenuPanel.maxWidth

Definition at line 21 of file WidgetMenuPanel.cs.

◆ mold

UIButton WidgetMenuPanel.mold

Definition at line 17 of file WidgetMenuPanel.cs.

Referenced by AddButton().

Property Documentation

◆ allMenu

bool WidgetMenuPanel.allMenu
getprivate

Definition at line 41 of file WidgetMenuPanel.cs.

◆ extra

Extra WidgetMenuPanel.extra
get

Definition at line 39 of file WidgetMenuPanel.cs.


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