Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ActionHint Class Reference
Inheritance diagram for ActionHint:
EMono

Public Member Functions

void Refresh ()
 
void AddToggle (string lang, bool on, Action< bool > action)
 
void UpdateText ()
 
void Show (string lang, bool icon=true)
 
void SetText (string s, bool anime=false)
 

Public Attributes

Transform extra
 
LayoutGroup layoutDynamic
 
UIText textTitle
 
UIText textDetail
 
UIButton buttonPick
 
UIButton buttonSavePartialMap
 
UIButton buttonDeletePartialMap
 
UISelectableGroup groupRadio
 
UISelectableGroup groupToggle
 
Anime animePop
 
Image iconNerun
 
CanvasGroup cg
 
bool dynamic
 

Properties

ActionMode mode [get]
 
BaseTileSelector ts [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 Awake ()
 

Private Attributes

UIButton moldDynamic
 
Vector3 oriPos
 
string lastText
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 

Detailed Description

Definition at line 5 of file ActionHint.cs.

Member Function Documentation

◆ AddToggle()

void ActionHint.AddToggle ( string  lang,
bool  on,
Action< bool >  action 
)
inline

Definition at line 111 of file ActionHint.cs.

112 {
114 uIButton.mainText.SetText(lang.lang());
115 uIButton.SetToggle(on, action);
116 dynamic = true;
117 }
UIButton moldDynamic
Definition: ActionHint.cs:34
bool dynamic
Definition: ActionHint.cs:32
LayoutGroup layoutDynamic
Definition: ActionHint.cs:9
UIText mainText
Definition: UIButton.cs:102
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341
void SetText(string s)
Definition: UIText.cs:159
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References dynamic, layoutDynamic, UIButton.mainText, moldDynamic, UIText.SetText(), UIButton.SetToggle(), and Util.

◆ Awake()

void ActionHint.Awake ( )
inlineprivate

Definition at line 44 of file ActionHint.cs.

45 {
46 moldDynamic = layoutDynamic.CreateMold<UIButton>();
47 oriPos = this.Rect().anchoredPosition;
48 }
Vector3 oriPos
Definition: ActionHint.cs:36

References layoutDynamic, moldDynamic, and oriPos.

◆ Refresh()

void ActionHint.Refresh ( )
inline

Definition at line 50 of file ActionHint.cs.

51 {
52 if (mode == null)
53 {
54 return;
55 }
56 bool flag = EMono.core.IsGameStarted && mode.ShowActionHint;
57 base.gameObject.SetActive(flag);
58 if (!flag)
59 {
60 return;
61 }
62 extra.SetActive(enable: true);
63 bool digRamp = mode == ActionMode.Dig && ActionMode.Dig.mode == TaskDig.Mode.Ramp;
64 bool mineRamp = mode == ActionMode.Mine && ActionMode.Mine.mode == TaskMine.Mode.Ramp;
65 groupRadio.SetActive(digRamp || mineRamp);
66 if (digRamp || mineRamp)
67 {
68 groupRadio.Init(0, delegate(int a)
69 {
70 if (digRamp)
71 {
72 if (a == 0)
73 {
74 ActionMode.Dig.ramp = 3;
75 }
76 if (a == 1)
77 {
78 ActionMode.Dig.ramp = 4;
79 }
80 if (a == 2)
81 {
82 ActionMode.Dig.ramp = 5;
83 }
85 }
86 if (mineRamp)
87 {
88 if (a == 0)
89 {
90 ActionMode.Mine.ramp = 3;
91 }
92 if (a == 1)
93 {
94 ActionMode.Mine.ramp = 4;
95 }
96 if (a == 2)
97 {
98 ActionMode.Mine.ramp = 5;
99 }
101 }
102 });
103 groupRadio.ToggleInteractable(enable: true);
104 }
105 dynamic = false;
106 layoutDynamic.DestroyChildren();
107 groupToggle.SetActive(dynamic);
108 UpdateText();
109 }
override void OnCreateMold(bool processing=false)
Definition: AM_Dig.cs:51
override void OnCreateMold(bool processing=false)
Definition: AM_Mine.cs:66
UISelectableGroup groupToggle
Definition: ActionHint.cs:23
UISelectableGroup groupRadio
Definition: ActionHint.cs:21
ActionMode mode
Definition: ActionHint.cs:40
void UpdateText()
Definition: ActionHint.cs:119
Transform extra
Definition: ActionHint.cs:7
virtual bool ShowActionHint
Definition: ActionMode.cs:165
static AM_Dig Dig
Definition: ActionMode.cs:35
static AM_Mine Mine
Definition: ActionMode.cs:33
Mode
Definition: TaskDig.cs:4
virtual void Init(int index=0, UnityAction< int > action=null, bool directChildren=false)
void ToggleInteractable(bool enable)

References ActionMode.Dig, dynamic, extra, groupRadio, groupToggle, UISelectableGroup.Init(), layoutDynamic, ActionMode.Mine, mode, AM_Dig.OnCreateMold(), AM_Mine.OnCreateMold(), ActionMode.ShowActionHint, UISelectableGroup.ToggleInteractable(), and UpdateText().

Referenced by UI.OnChangeLayer().

◆ SetText()

void ActionHint.SetText ( string  s,
bool  anime = false 
)
inline

Definition at line 143 of file ActionHint.cs.

144 {
145 this.Rect().anchoredPosition = oriPos;
147 this.RebuildLayout();
148 if (anime)
149 {
150 animePop.Play(base.transform);
151 }
152 }
Anime animePop
Definition: ActionHint.cs:25
UIText textTitle
Definition: ActionHint.cs:11
virtual Tween Play(Transform trans, UnityAction onComplete=null, float duration=-1f, float delay=0f)
Definition: Anime.cs:7

References animePop, oriPos, Anime.Play(), UIText.SetText(), and textTitle.

Referenced by Show(), and UpdateText().

◆ Show()

void ActionHint.Show ( string  lang,
bool  icon = true 
)
inline

Definition at line 131 of file ActionHint.cs.

132 {
133 string text = lang.lang();
134 bool anime = text != lastText || !base.gameObject.activeSelf;
135 lastText = text;
136 iconNerun.SetActive(enable: false);
137 base.gameObject.SetActive(value: true);
138 buttonPick.SetActive(enable: false);
139 extra.SetActive(enable: false);
140 SetText(text, anime);
141 }
void SetText(string s, bool anime=false)
Definition: ActionHint.cs:143
Image iconNerun
Definition: ActionHint.cs:27
UIButton buttonPick
Definition: ActionHint.cs:15
string lastText
Definition: ActionHint.cs:38

References buttonPick, extra, iconNerun, lastText, and SetText().

◆ UpdateText()

void ActionHint.UpdateText ( )
inline

Definition at line 119 of file ActionHint.cs.

120 {
121 string hintText = mode.GetHintText();
122 base.gameObject.SetActive(EMono.scene.actionMode.ShowActionHint && !hintText.IsEmpty());
123 SetText(hintText);
125 buttonPick.SetOnClick(delegate
126 {
128 });
129 }
static AM_Inspect Inspect
Definition: ActionMode.cs:23
virtual string GetHintText()
Definition: ActionMode.cs:1387
Definition: EMono.cs:4
static Scene scene
Definition: EMono.cs:27
ActionMode actionMode
Definition: Scene.cs:77

References Scene.actionMode, buttonPick, AM_MoveInstalled.CanPutAway(), ActionMode.GetHintText(), ActionMode.Inspect, mode, EMono.scene, SetText(), ActionMode.ShowActionHint, and AM_MoveInstalled.TryPutAway().

Referenced by Refresh().

Member Data Documentation

◆ animePop

Anime ActionHint.animePop

Definition at line 25 of file ActionHint.cs.

Referenced by SetText().

◆ buttonDeletePartialMap

UIButton ActionHint.buttonDeletePartialMap

Definition at line 19 of file ActionHint.cs.

◆ buttonPick

UIButton ActionHint.buttonPick

Definition at line 15 of file ActionHint.cs.

Referenced by Show(), and UpdateText().

◆ buttonSavePartialMap

UIButton ActionHint.buttonSavePartialMap

Definition at line 17 of file ActionHint.cs.

◆ cg

CanvasGroup ActionHint.cg

Definition at line 29 of file ActionHint.cs.

◆ dynamic

bool ActionHint.dynamic

Definition at line 32 of file ActionHint.cs.

Referenced by AddToggle(), and Refresh().

◆ extra

Transform ActionHint.extra

Definition at line 7 of file ActionHint.cs.

Referenced by Refresh(), and Show().

◆ groupRadio

UISelectableGroup ActionHint.groupRadio

Definition at line 21 of file ActionHint.cs.

Referenced by AM_Dig.OnSelectEnd(), AM_Dig.OnSelectStart(), and Refresh().

◆ groupToggle

UISelectableGroup ActionHint.groupToggle

Definition at line 23 of file ActionHint.cs.

Referenced by Refresh().

◆ iconNerun

Image ActionHint.iconNerun

Definition at line 27 of file ActionHint.cs.

Referenced by Show().

◆ lastText

string ActionHint.lastText
private

Definition at line 38 of file ActionHint.cs.

Referenced by Show().

◆ layoutDynamic

LayoutGroup ActionHint.layoutDynamic

Definition at line 9 of file ActionHint.cs.

Referenced by AddToggle(), Awake(), and Refresh().

◆ moldDynamic

UIButton ActionHint.moldDynamic
private

Definition at line 34 of file ActionHint.cs.

Referenced by AddToggle(), and Awake().

◆ oriPos

Vector3 ActionHint.oriPos
private

Definition at line 36 of file ActionHint.cs.

Referenced by Awake(), and SetText().

◆ textDetail

UIText ActionHint.textDetail

Definition at line 13 of file ActionHint.cs.

◆ textTitle

UIText ActionHint.textTitle

Definition at line 11 of file ActionHint.cs.

Referenced by SetText().

Property Documentation

◆ mode

ActionMode ActionHint.mode
get

Definition at line 40 of file ActionHint.cs.

Referenced by Refresh(), and UpdateText().

◆ ts

BaseTileSelector ActionHint.ts
getprivate

Definition at line 42 of file ActionHint.cs.


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