Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerFaith Class Reference
Inheritance diagram for LayerFaith:
ELayer Layer IUISkin

Classes

class  Slot
 

Public Member Functions

void Activate (Religion r, Action< Religion > _onWorship)
 
void Move (int a)
 
void RefreshSlots ()
 
void AddReligion (Religion r)
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Public Attributes

Vector2 startPos
 
float time
 
float bgAlpha
 
float startDelay
 
Slot slotVoid
 
List< Slotslots
 
UIItem moldItem
 
LayoutGroup layout
 
Action< ReligiononWorship
 
bool isBranchFaith
 
int index
 
List< UIItemitems = new List<UIItem>()
 
List< UIItemorders = new List<UIItem>()
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Private Member Functions

void Update ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Detailed Description

Definition at line 7 of file LayerFaith.cs.

Member Function Documentation

◆ Activate()

void LayerFaith.Activate ( Religion  r,
Action< Religion _onWorship 
)
inline

Definition at line 51 of file LayerFaith.cs.

52 {
53 onWorship = _onWorship;
54 if (r == null)
55 {
57 {
58 if (!item.IsMinorGod)
59 {
61 }
62 }
63 isBranchFaith = true;
64 }
65 else
66 {
67 AddReligion(r);
68 }
69 TweenUtil.Tween(startDelay, RefreshSlots);
70 SE.Play("zoomIn");
71 }
Definition: ELayer.cs:4
static Game game
Definition: ELayer.cs:9
ReligionManager religions
Definition: Game.cs:158
void RefreshSlots()
Definition: LayerFaith.cs:96
bool isBranchFaith
Definition: LayerFaith.cs:40
float startDelay
Definition: LayerFaith.cs:27
void AddReligion(Religion r)
Definition: LayerFaith.cs:162
Action< Religion > onWorship
Definition: LayerFaith.cs:37
List< Religion > list

References AddReligion(), ELayer.game, isBranchFaith, item, ReligionManager.list, onWorship, RefreshSlots(), Game.religions, and startDelay.

◆ AddReligion()

void LayerFaith.AddReligion ( Religion  r)
inline

Definition at line 162 of file LayerFaith.cs.

163 {
165 uIItem.text1.SetText(r.source.GetDetail());
166 uIItem.text2.SetText(r.Name);
167 uIItem.button1.icon.sprite = Resources.Load<Sprite>("Media/Graphics/Image/Faction/" + r.source.id);
168 if (isBranchFaith && !r.IsAvailable)
169 {
170 uIItem.button2.mainText.SetText("faithUnavailable".lang());
171 }
172 uIItem.refObj = r;
173 items.Add(uIItem);
174 uIItem.Rect().anchoredPosition = startPos;
175 }
List< UIItem > items
Definition: LayerFaith.cs:46
LayoutGroup layout
Definition: LayerFaith.cs:35
UIItem moldItem
Definition: LayerFaith.cs:33
Vector2 startPos
Definition: LayerFaith.cs:21
string Name
Definition: Religion.cs:30
SourceReligion.Row source
Definition: Religion.cs:32
virtual bool IsAvailable
Definition: Religion.cs:28
UIText mainText
Definition: UIButton.cs:102
Definition: UIItem.cs:5
UIText text2
Definition: UIItem.cs:8
UIButton button2
Definition: UIItem.cs:20
UIText text1
Definition: UIItem.cs:6
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 UIItem.button2, Religion.IsAvailable, isBranchFaith, items, layout, UIButton.mainText, moldItem, Religion.Name, UIText.SetText(), Religion.source, startPos, UIItem.text1, UIItem.text2, and Util.

Referenced by Activate().

◆ Move()

void LayerFaith.Move ( int  a)
inline

Definition at line 81 of file LayerFaith.cs.

82 {
83 index += a;
84 if (index >= items.Count)
85 {
86 index = 0;
87 }
88 else if (index < 0)
89 {
90 index = items.Count - 1;
91 }
93 SE.Play("zoomOut");
94 }

References index, items, and RefreshSlots().

Referenced by RefreshSlots(), and Update().

◆ RefreshSlots()

void LayerFaith.RefreshSlots ( )
inline

Definition at line 96 of file LayerFaith.cs.

97 {
98 orders.Clear();
99 int num = index;
100 for (int i = 0; i < items.Count; i++)
101 {
102 if (num >= items.Count)
103 {
104 num = 0;
105 }
106 orders.Add(items[num]);
107 num++;
108 }
109 for (int j = 0; j < items.Count; j++)
110 {
111 Slot slot = ((j >= slots.Count) ? slotVoid : slots[j]);
112 UIItem item = orders[j];
113 bool flag = j == 2;
114 if (items.Count == 1)
115 {
116 flag = true;
117 slot = slots[2];
118 }
119 item.button1.icon.raycastTarget = !flag;
120 if (j == 1)
121 {
122 item.button1.SetOnClick(delegate
123 {
124 Move(-1);
125 });
126 }
127 if (j == 3)
128 {
129 item.button1.SetOnClick(delegate
130 {
131 Move(1);
132 });
133 }
134 item.button2.SetOnClick(delegate
135 {
136 Religion religion = item.refObj as Religion;
137 if (religion.IsAvailable || !isBranchFaith)
138 {
139 Close();
141 }
142 else
143 {
144 SE.Beep();
145 }
146 });
147 item.button3.SetOnClick(delegate
148 {
149 Close();
150 });
151 item.button2.GetComponent<CanvasGroup>().DOFade(flag ? 1f : 0f, time).SetEase(slot.ease);
152 item.button3.GetComponent<CanvasGroup>().DOFade(flag ? 1f : 0f, time).SetEase(slot.ease);
153 item.text1.DOFade(flag ? 1f : 0f, time).SetEase(slot.ease);
154 item.text3.DOFade(flag ? 1f : 0f, time).SetEase(slot.ease);
155 item.image2.DOFade(flag ? bgAlpha : 0f, time).SetEase(slot.ease);
156 item.Rect().DOAnchorPos(slot.position, time).SetEase(slot.ease);
157 item.Rect().DOScale(slot.scale, time).SetEase(slot.ease);
158 item.GetComponent<CanvasGroup>().DOFade(slot.alpha, time).SetEase(slot.ease);
159 }
160 }
List< UIItem > orders
Definition: LayerFaith.cs:49
float time
Definition: LayerFaith.cs:23
Slot slotVoid
Definition: LayerFaith.cs:29
void Move(int a)
Definition: LayerFaith.cs:81
List< Slot > slots
Definition: LayerFaith.cs:31
float bgAlpha
Definition: LayerFaith.cs:25
virtual void Close()
Definition: Layer.cs:463

References LayerFaith.Slot.alpha, bgAlpha, Layer.Close(), LayerFaith.Slot.ease, index, isBranchFaith, item, items, Move(), onWorship, orders, LayerFaith.Slot.position, religion, LayerFaith.Slot.scale, slots, slotVoid, and time.

Referenced by Activate(), and Move().

◆ Update()

void LayerFaith.Update ( )
inlineprivate

Definition at line 73 of file LayerFaith.cs.

74 {
75 if (EInput.wheel != 0)
76 {
77 Move((EInput.wheel > 0) ? 1 : (-1));
78 }
79 }
Definition: EInput.cs:8
static int wheel
Definition: EInput.cs:289

References Move(), and EInput.wheel.

Member Data Documentation

◆ bgAlpha

float LayerFaith.bgAlpha

Definition at line 25 of file LayerFaith.cs.

Referenced by RefreshSlots().

◆ index

int LayerFaith.index

Definition at line 43 of file LayerFaith.cs.

Referenced by Move(), and RefreshSlots().

◆ isBranchFaith

bool LayerFaith.isBranchFaith

Definition at line 40 of file LayerFaith.cs.

Referenced by Activate(), AddReligion(), and RefreshSlots().

◆ items

List<UIItem> LayerFaith.items = new List<UIItem>()

Definition at line 46 of file LayerFaith.cs.

Referenced by AddReligion(), Move(), and RefreshSlots().

◆ layout

LayoutGroup LayerFaith.layout

Definition at line 35 of file LayerFaith.cs.

Referenced by AddReligion().

◆ moldItem

UIItem LayerFaith.moldItem

Definition at line 33 of file LayerFaith.cs.

Referenced by AddReligion().

◆ onWorship

Action<Religion> LayerFaith.onWorship

Definition at line 37 of file LayerFaith.cs.

Referenced by Activate(), and RefreshSlots().

◆ orders

List<UIItem> LayerFaith.orders = new List<UIItem>()

Definition at line 49 of file LayerFaith.cs.

Referenced by RefreshSlots().

◆ slots

List<Slot> LayerFaith.slots

Definition at line 31 of file LayerFaith.cs.

Referenced by RefreshSlots().

◆ slotVoid

Slot LayerFaith.slotVoid

Definition at line 29 of file LayerFaith.cs.

Referenced by RefreshSlots().

◆ startDelay

float LayerFaith.startDelay

Definition at line 27 of file LayerFaith.cs.

Referenced by Activate().

◆ startPos

Vector2 LayerFaith.startPos

Definition at line 21 of file LayerFaith.cs.

Referenced by AddReligion().

◆ time

float LayerFaith.time

Definition at line 23 of file LayerFaith.cs.

Referenced by RefreshSlots().


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