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

Public Member Functions

override void OnInit ()
 
void RefreshPolicy ()
 
void RefreshPolicyList (UIList list, string cat, string plan)
 
void RefreshPolicyIcons ()
 
- 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

UIList listPolicyLaw
 
UIList listPolicyEconomy
 
UIList listPolicyLife
 
Material matGrayscale
 
- 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
 

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 4 of file LayerPolicy.cs.

Member Function Documentation

◆ OnInit()

override void LayerPolicy.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 14 of file LayerPolicy.cs.

15 {
17 }
void RefreshPolicy()
Definition: LayerPolicy.cs:19

References RefreshPolicy().

◆ RefreshPolicy()

void LayerPolicy.RefreshPolicy ( )
inline

Definition at line 19 of file LayerPolicy.cs.

20 {
21 RefreshPolicyList(listPolicyLaw, "law", "department_law");
22 RefreshPolicyList(listPolicyEconomy, "economy", "department_economy");
23 RefreshPolicyList(listPolicyLife, "life", "department_life");
25 }
UIList listPolicyLaw
Definition: LayerPolicy.cs:6
UIList listPolicyEconomy
Definition: LayerPolicy.cs:8
UIList listPolicyLife
Definition: LayerPolicy.cs:10
void RefreshPolicyList(UIList list, string cat, string plan)
Definition: LayerPolicy.cs:27
void RefreshPolicyIcons()
Definition: LayerPolicy.cs:71

References listPolicyEconomy, listPolicyLaw, listPolicyLife, RefreshPolicyIcons(), and RefreshPolicyList().

Referenced by OnInit().

◆ RefreshPolicyIcons()

void LayerPolicy.RefreshPolicyIcons ( )
inline

Definition at line 71 of file LayerPolicy.cs.

72 {
73 int num = ELayer.Branch.policies.CurrentAP();
75 for (int i = 0; i < array.Length; i++)
76 {
77 UIButton[] componentsInChildren = array[i].GetComponentsInChildren<UIButton>();
78 foreach (UIButton obj in componentsInChildren)
79 {
80 Policy policy = obj.refObj as Policy;
81 obj.icon.material = (policy.active ? null : matGrayscale);
82 obj.imageCheck.SetActive(policy.active);
83 obj.subText.SetText(policy.Cost.ToString() ?? "", (num + policy.Cost <= ELayer.Branch.MaxAP || policy.active) ? FontColor.Good : FontColor.Bad);
84 }
85 }
86 }
FontColor
Definition: FontColor.cs:2
Definition: ELayer.cs:4
static FactionBranch Branch
Definition: ELayer.cs:17
PolicyManager policies
Material matGrayscale
Definition: LayerPolicy.cs:12
int Cost
Definition: POLICY.cs:141
bool active
Definition: POLICY.cs:127
UIText subText
Definition: UIButton.cs:104
Image imageCheck
Definition: UIButton.cs:112
Definition: UIList.cs:9
void SetText(string s)
Definition: UIText.cs:159

References Policy.active, ELayer.Branch, Policy.Cost, PolicyManager.CurrentAP(), UIButton.imageCheck, listPolicyEconomy, listPolicyLaw, listPolicyLife, matGrayscale, FactionBranch.policies, UIText.SetText(), and UIButton.subText.

Referenced by RefreshPolicy().

◆ RefreshPolicyList()

void LayerPolicy.RefreshPolicyList ( UIList  list,
string  cat,
string  plan 
)
inline

Definition at line 27 of file LayerPolicy.cs.

28 {
29 list.callbacks = new UIList.Callback<Policy, UIButton>
30 {
31 onClick = delegate
32 {
33 },
34 onInstantiate = delegate(Policy a, UIButton b)
35 {
37 b.onClick.AddListener(delegate
38 {
40 {
41 SE.Beep();
42 }
43 else
44 {
45 SE.ClickOk();
46 a.active = !a.active;
47 ELayer.Branch.policies.RefreshEffects();
48 RefreshPolicyIcons();
49 }
50 });
51 b.refObj = a;
52 b.tooltip.onShowTooltip = delegate(UITooltip tp)
53 {
54 a.WriteNote(tp.note);
55 };
56 },
57 onList = delegate
58 {
59 foreach (Policy item in ELayer.Branch.policies.list.Where((Policy p) => p.source.categorySub == cat))
60 {
61 list.Add(item);
62 }
63 },
64 onSort = (Policy a, UIList.SortMode m) => a.GetSortVal(m),
65 onRefresh = null
66 };
67 list.List();
68 list.GetComponentInChildren<CanvasGroup>().alpha = ((list.items.Count > 0) ? 0.9f : 0.4f);
69 }
List< Policy > list
Definition: PolicyManager.cs:7
string Name
Definition: POLICY.cs:135
int GetSortVal(UIList.SortMode m)
Definition: POLICY.cs:200
void WriteNote(UINote n)
Definition: POLICY.cs:185
SourceElement.Row source
Definition: POLICY.cs:133
UIText mainText
Definition: UIButton.cs:102
List< object > items
Definition: UIList.cs:241
SortMode
Definition: UIList.cs:27
override void Add(object item)
Definition: UIList.cs:302
override void List()
Definition: UIList.cs:717
UINote note
Definition: UITooltip.cs:21

References Policy.active, UIList.Add(), ELayer.Branch, Policy.Cost, PolicyManager.CurrentAP(), Policy.GetSortVal(), item, UIList.items, UIList.List(), PolicyManager.list, UIButton.mainText, FactionBranch.MaxAP, Policy.Name, UITooltip.note, FactionBranch.policies, UIText.SetText(), Policy.source, and Policy.WriteNote().

Referenced by RefreshPolicy().

Member Data Documentation

◆ listPolicyEconomy

UIList LayerPolicy.listPolicyEconomy

Definition at line 8 of file LayerPolicy.cs.

Referenced by RefreshPolicy(), and RefreshPolicyIcons().

◆ listPolicyLaw

UIList LayerPolicy.listPolicyLaw

Definition at line 6 of file LayerPolicy.cs.

Referenced by RefreshPolicy(), and RefreshPolicyIcons().

◆ listPolicyLife

UIList LayerPolicy.listPolicyLife

Definition at line 10 of file LayerPolicy.cs.

Referenced by RefreshPolicy(), and RefreshPolicyIcons().

◆ matGrayscale

Material LayerPolicy.matGrayscale

Definition at line 12 of file LayerPolicy.cs.

Referenced by RefreshPolicyIcons().


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