Elin Decompiled Documentation EA 23.102 Nightly
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
LayerWorldSetting Class Reference
Inheritance diagram for LayerWorldSetting:
ELayer Layer IUISkin

Public Member Functions

override void OnInit ()
 
void SetTemplate (int idx)
 
void RefreshTemplate ()
 
void Refresh ()
 
void StartGame ()
 
override void OnKill ()
 
void Apply ()
 
- 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

UISelectableGroup groupTemplate
 
List< UIButtonbuttonTemplates
 
GamePrincipal pp
 
UIButton toggleEvaluate
 
UIButton toggleDeathPenaltyProtection
 
UIButton toggleManualSave
 
UIButton togglePermadeath
 
UIButton toggleInfiniteMarketFund
 
UIButton toggleOPMilk
 
UIButton toggleUsermapBenefit
 
UIButton toggleDropRate
 
UIButton toggleTax
 
UIText textScore
 
UIText textTitle
 
UIText textValidScore
 
UIText textDetail
 
UISlider sliderDropRate
 
Image imageScoreBar
 
UIButton moldToggle
 
UIButton moldSlider
 
UIButton buttonEmbark
 
UIButton buttonWorkaround
 
UIItem moldHeader
 
Transform transCustom
 
Transform transMold
 
List< Sprite > sprites
 
- 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
 

Properties

int IdxCustom [get]
 
bool IsEmbark [get]
 
- 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]
 

Private Attributes

bool started
 

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
 

Detailed Description

Definition at line 6 of file LayerWorldSetting.cs.

Member Function Documentation

◆ Apply()

void LayerWorldSetting.Apply ( )
inline

Definition at line 216 of file LayerWorldSetting.cs.

217 {
218 if (!IsEmbark)
219 {
220 pp.modified = ELayer.game.principal.modified;
221 foreach (GamePrincipal.Item item in pp.ListItems())
222 {
223 if (item.IsModified())
224 {
225 pp.modified.Add(item.id);
226 }
227 }
228 }
229 ELayer.game.principal = pp;
231 {
232 ELayer.player.resetPrincipal = false;
233 }
234 ELayer.pc.SetFeat(1220, pp.permadeath ? 1 : 0);
235 }
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:8964
Definition: ELayer.cs:4
static Chara pc
Definition: ELayer.cs:15
static Player player
Definition: ELayer.cs:13
static Game game
Definition: ELayer.cs:9
HashSet< string > modified
List< Item > ListItems()
GamePrincipal principal
Definition: Game.cs:221
bool resetPrincipal
Definition: Player.cs:978

References ELayer.game, IsEmbark, item, GamePrincipal.ListItems(), GamePrincipal.modified, ELayer.pc, GamePrincipal.permadeath, ELayer.player, pp, Game.principal, Player.resetPrincipal, and Chara.SetFeat().

Referenced by OnKill().

◆ OnInit()

override void LayerWorldSetting.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 76 of file LayerWorldSetting.cs.

77 {
78 buttonEmbark.SetActive(IsEmbark);
79 buttonWorkaround.SetActive(enable: true);
80 if (IsEmbark)
81 {
83 }
84 pp = IO.DeepCopy(ELayer.game.principal);
85 transMold.SetActive(enable: false);
86 for (int j = 0; j < buttonTemplates.Count; j++)
87 {
88 int i = j;
89 UIButton uIButton = buttonTemplates[i];
90 uIButton.mainText.SetText(Lang.GetList("pp_templates")[i]);
91 if (i != IdxCustom)
92 {
93 uIButton.refObj = ELayer.setting.start.principals[i];
94 }
95 uIButton.SetOnClick(delegate
96 {
97 SetTemplate(i);
98 });
99 }
101 {
102 ELayer.player.showWorkaround = a;
103 Refresh();
104 });
105 Refresh();
106 }
static GameSetting setting
Definition: ELayer.cs:33
List< GamePrincipal > principals
Definition: GameSetting.cs:244
StartSetting start
Definition: GameSetting.cs:305
Definition: IO.cs:11
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
void SetTemplate(int idx)
List< UIButton > buttonTemplates
bool showWorkaround
Definition: Player.cs:802
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

References buttonEmbark, buttonTemplates, buttonWorkaround, ELayer.game, Lang.GetList(), IdxCustom, IsEmbark, UIButton.mainText, GamePrincipal.modified, ELayer.player, pp, Game.principal, GameSetting.StartSetting.principals, Refresh(), SetTemplate(), UIText.SetText(), ELayer.setting, UIButton.SetToggle(), Player.showWorkaround, GameSetting.start, and transMold.

◆ OnKill()

override void LayerWorldSetting.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 211 of file LayerWorldSetting.cs.

212 {
213 Apply();
214 }

References Apply().

◆ Refresh()

void LayerWorldSetting.Refresh ( )
inline

Definition at line 135 of file LayerWorldSetting.cs.

136 {
138 transCustom.DestroyChildren();
139 List<GamePrincipal.Item> items = pp.ListItems();
140 AddCategory(GamePrincipal.Type.Oath);
142 {
143 AddCategory(GamePrincipal.Type.Workaround);
144 }
145 transCustom.RebuildLayout();
146 void AddCategory(GamePrincipal.Type type)
147 {
148 Util.Instantiate(moldHeader, transCustom).text1.SetText(("pp_" + type).lang());
149 foreach (GamePrincipal.Item item in items.Where((GamePrincipal.Item a) => a.type == type))
150 {
151 UIButton b = null;
153 if (itemSlider == null)
154 {
155 if (item != null)
156 {
157 _ = item;
159 }
160 }
161 else
162 {
164 b.GetComponentInChildren<UISlider>().SetSlider(itemSlider.GetInt(), delegate(float a)
165 {
166 itemSlider.SetInt((int)a);
167 return itemSlider.funcText((int)a);
168 }, 0, itemSlider.max, notify: false);
169 }
170 bool flag = item.id == "permadeath" && !IsEmbark && !item.WasSealed();
171 b.mainText.SetText(("pp_" + item.id).lang());
172 b.icon.SetActive(item.IsSealed() || item.WasSealed());
173 b.icon.SetAlpha(item.IsSealed() ? 1f : 0.3f);
174 b.icon.sprite = sprites[item.grade];
175 b.icon.SetNativeSize();
176 b.GetOrCreate<CanvasGroup>().alpha = (flag ? 0.5f : 1f);
177 string text = "pp_" + item.id + "_hint";
178 b.SetTooltipLang(text);
179 b.tooltip.enable = Lang.Has(text);
180 b.interactable = !flag;
181 b.SetToggle(item.Get(), delegate(bool a)
182 {
183 item.Set(a);
184 if (!pp.IsCustom)
185 {
186 pp.id = -1;
187 RefreshTemplate();
188 }
189 b.icon.SetActive(item.IsSealed() || item.WasSealed());
190 b.icon.SetAlpha(item.IsSealed() ? 1f : 0.3f);
191 });
192 }
193 }
194 }
Func< int, string > funcText
void SetInt(int value)
static bool Has(string id)
Definition: Lang.cs:100
List< Sprite > sprites
Image icon
Definition: UIButton.cs:110
void SetTooltipLang(string lang=null)
Definition: UIButton.cs:373
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References GamePrincipal.ItemSlider.funcText, GamePrincipal.ItemSlider.GetInt(), Lang.Has(), UIButton.icon, GamePrincipal.IsCustom, IsEmbark, item, GamePrincipal.ListItems(), UIButton.mainText, GamePrincipal.ItemSlider.max, moldHeader, moldSlider, moldToggle, ELayer.player, pp, RefreshTemplate(), GamePrincipal.ItemSlider.SetInt(), UIText.SetText(), UIButton.SetToggle(), UIButton.SetTooltipLang(), Player.showWorkaround, sprites, transCustom, and Util.

Referenced by OnInit(), and SetTemplate().

◆ RefreshTemplate()

void LayerWorldSetting.RefreshTemplate ( )
inline

Definition at line 122 of file LayerWorldSetting.cs.

123 {
124 if (pp.IsCustom)
125 {
127 }
128 else
129 {
131 }
132 textDetail.SetText(("vow_" + pp.id).lang());
133 }
UISelectableGroup groupTemplate
void Select(UIButton button, bool check=true)

References buttonTemplates, groupTemplate, GamePrincipal.id, GamePrincipal.IsCustom, pp, UISelectableGroup.Select(), UIText.SetText(), and textDetail.

Referenced by Refresh().

◆ SetTemplate()

void LayerWorldSetting.SetTemplate ( int  idx)
inline

Definition at line 108 of file LayerWorldSetting.cs.

109 {
110 pp.id = idx;
111 if (idx == IdxCustom)
112 {
113 pp.id = -1;
114 }
115 else
116 {
117 pp = IO.DeepCopy(ELayer.setting.start.principals[idx]);
118 }
119 Refresh();
120 }

References IdxCustom, pp, GameSetting.StartSetting.principals, Refresh(), ELayer.setting, and GameSetting.start.

Referenced by OnInit().

◆ StartGame()

void LayerWorldSetting.StartGame ( )
inline

Definition at line 196 of file LayerWorldSetting.cs.

197 {
199 {
200 Close();
201 return;
202 }
203 started = true;
204 Close();
205 if (!LayerDrama.Instance)
206 {
207 LayerDrama.ActivateMain("mono", "1-1");
208 }
209 }
static LayerDrama Instance
Definition: LayerDrama.cs:20
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:61
virtual void Close()
Definition: Layer.cs:463

References LayerDrama.ActivateMain(), Layer.Close(), LayerDrama.Instance, ELayer.player, Player.resetPrincipal, and started.

Member Data Documentation

◆ buttonEmbark

UIButton LayerWorldSetting.buttonEmbark

Definition at line 48 of file LayerWorldSetting.cs.

Referenced by OnInit().

◆ buttonTemplates

List<UIButton> LayerWorldSetting.buttonTemplates

Definition at line 10 of file LayerWorldSetting.cs.

Referenced by OnInit(), and RefreshTemplate().

◆ buttonWorkaround

UIButton LayerWorldSetting.buttonWorkaround

Definition at line 50 of file LayerWorldSetting.cs.

Referenced by OnInit().

◆ groupTemplate

UISelectableGroup LayerWorldSetting.groupTemplate

Definition at line 8 of file LayerWorldSetting.cs.

Referenced by RefreshTemplate().

◆ imageScoreBar

Image LayerWorldSetting.imageScoreBar

Definition at line 42 of file LayerWorldSetting.cs.

◆ moldHeader

UIItem LayerWorldSetting.moldHeader

Definition at line 52 of file LayerWorldSetting.cs.

Referenced by Refresh().

◆ moldSlider

UIButton LayerWorldSetting.moldSlider

Definition at line 46 of file LayerWorldSetting.cs.

Referenced by Refresh().

◆ moldToggle

UIButton LayerWorldSetting.moldToggle

Definition at line 44 of file LayerWorldSetting.cs.

Referenced by Refresh().

◆ pp

GamePrincipal LayerWorldSetting.pp

Definition at line 12 of file LayerWorldSetting.cs.

Referenced by Apply(), OnInit(), Refresh(), RefreshTemplate(), and SetTemplate().

◆ sliderDropRate

UISlider LayerWorldSetting.sliderDropRate

Definition at line 40 of file LayerWorldSetting.cs.

◆ sprites

List<Sprite> LayerWorldSetting.sprites

Definition at line 58 of file LayerWorldSetting.cs.

Referenced by Refresh().

◆ started

bool LayerWorldSetting.started
private

Definition at line 60 of file LayerWorldSetting.cs.

Referenced by StartGame().

◆ textDetail

UIText LayerWorldSetting.textDetail

Definition at line 38 of file LayerWorldSetting.cs.

Referenced by RefreshTemplate().

◆ textScore

UIText LayerWorldSetting.textScore

Definition at line 32 of file LayerWorldSetting.cs.

◆ textTitle

UIText LayerWorldSetting.textTitle

Definition at line 34 of file LayerWorldSetting.cs.

◆ textValidScore

UIText LayerWorldSetting.textValidScore

Definition at line 36 of file LayerWorldSetting.cs.

◆ toggleDeathPenaltyProtection

UIButton LayerWorldSetting.toggleDeathPenaltyProtection

Definition at line 16 of file LayerWorldSetting.cs.

◆ toggleDropRate

UIButton LayerWorldSetting.toggleDropRate

Definition at line 28 of file LayerWorldSetting.cs.

◆ toggleEvaluate

UIButton LayerWorldSetting.toggleEvaluate

Definition at line 14 of file LayerWorldSetting.cs.

◆ toggleInfiniteMarketFund

UIButton LayerWorldSetting.toggleInfiniteMarketFund

Definition at line 22 of file LayerWorldSetting.cs.

◆ toggleManualSave

UIButton LayerWorldSetting.toggleManualSave

Definition at line 18 of file LayerWorldSetting.cs.

◆ toggleOPMilk

UIButton LayerWorldSetting.toggleOPMilk

Definition at line 24 of file LayerWorldSetting.cs.

◆ togglePermadeath

UIButton LayerWorldSetting.togglePermadeath

Definition at line 20 of file LayerWorldSetting.cs.

◆ toggleTax

UIButton LayerWorldSetting.toggleTax

Definition at line 30 of file LayerWorldSetting.cs.

◆ toggleUsermapBenefit

UIButton LayerWorldSetting.toggleUsermapBenefit

Definition at line 26 of file LayerWorldSetting.cs.

◆ transCustom

Transform LayerWorldSetting.transCustom

Definition at line 54 of file LayerWorldSetting.cs.

Referenced by Refresh().

◆ transMold

Transform LayerWorldSetting.transMold

Definition at line 56 of file LayerWorldSetting.cs.

Referenced by OnInit().

Property Documentation

◆ IdxCustom

int LayerWorldSetting.IdxCustom
get

Definition at line 62 of file LayerWorldSetting.cs.

Referenced by OnInit(), and SetTemplate().

◆ IsEmbark

bool LayerWorldSetting.IsEmbark
get

Definition at line 64 of file LayerWorldSetting.cs.

65 {
66 get
67 {
69 {
71 }
72 return true;
73 }
74 }
bool IsGameStarted
Definition: Core.cs:84
static Core core
Definition: ELayer.cs:7

Referenced by Apply(), OnInit(), and Refresh().


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