Elin Decompiled Documentation EA 23.247 Stable Patch 1
Loading...
Searching...
No Matches
LayerShippingResult Class Reference
Inheritance diagram for LayerShippingResult:
ELayer Layer IUISkin

Public Member Functions

void Show ()
 
void UpdateRepeating ()
 
void Refresh ()
 
void Show (ShippingResult _result)
 
- 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 list
 
UIButton buttonNext
 
UIButton buttonPrev
 
Image gaugeGold
 
Image gaugeHearth
 
Image gaugeDebt
 
Image imageBG
 
UIText textGold
 
UIText textGold2
 
UIText textHearth
 
UIText textHearth2
 
UIText textHome
 
UIText textIncome
 
UIText textIncomeTotal
 
UIText textTitle
 
UIText textDebt
 
bool showEffect = true
 
float duration
 
int update
 
int maxUpdate
 
ShippingResult result
 
Sprite[] spriteBG
 
- 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

new void Awake ()
 

Private Attributes

int lastBonus
 

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 ()
 
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 5 of file LayerShippingResult.cs.

Member Function Documentation

◆ Awake()

new void LayerShippingResult.Awake ( )
inlineprivatevirtual

Reimplemented from Layer.

Definition at line 53 of file LayerShippingResult.cs.

54 {
56 int num = ELayer.rnd(spriteBG.Length);
57 if (num == 1 && ELayer.game.cards.globalCharas.Find("corgon") == null)
58 {
59 num = 0;
60 }
61 if (num == 2 && ELayer.game.cards.globalCharas.Find("loytel") == null)
62 {
63 num = 0;
64 }
65 if (num == 3 && ELayer.game.cards.globalCharas.Find("farris") == null)
66 {
67 num = 0;
68 }
69 imageBG.sprite = spriteBG[num];
70 Rand.SetSeed();
71 base.Awake();
72 }
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
Definition: ELayer.cs:4
static Player player
Definition: ELayer.cs:13
static int rnd(int a)
Definition: ELayer.cs:49
static Game game
Definition: ELayer.cs:9
CardManager cards
Definition: Game.cs:155
int seed
Definition: Game.cs:200
int days
Definition: Player.cs:75
Stats stats
Definition: Player.cs:1016
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:37

References Game.cards, Player.Stats.days, CardManager.GlobalCharaList.Find(), ELayer.game, CardManager.globalCharas, ELayer.player, ELayer.rnd(), Game.seed, Rand.SetSeed(), spriteBG, and Player.stats.

◆ Refresh()

void LayerShippingResult.Refresh ( )
inline

Definition at line 89 of file LayerShippingResult.cs.

90 {
91 if (update == 0)
92 {
93 lastBonus = 0;
94 }
95 if (!showEffect)
96 {
97 if (update != maxUpdate)
98 {
99 DOTweenAnimation[] componentsInChildren = GetComponentsInChildren<DOTweenAnimation>();
100 foreach (DOTweenAnimation dOTweenAnimation in componentsInChildren)
101 {
102 if (dOTweenAnimation.tween != null)
103 {
104 dOTweenAnimation.tween.Kill(complete: true);
105 }
106 }
107 }
109 }
111 float num = (float)update / (float)maxUpdate;
112 int income = result.GetIncome();
113 income = (int)((float)income * num);
114 long num2 = result.total + income;
115 textIncome.text = Lang._currency(income, showUnit: true);
116 textIncomeTotal.text = Lang._currency(num2, showUnit: true);
117 int shippingBonus = ELayer.player.stats.GetShippingBonus(result.total);
118 int shippingBonus2 = ELayer.player.stats.GetShippingBonus(num2);
119 int lastShippingExp = ELayer.player.stats.lastShippingExp;
120 int lastShippingExpMax = ELayer.player.stats.lastShippingExpMax;
121 int hearthLv = result.hearthLv;
122 int num3 = (int)((float)result.hearthExpGained * num);
123 int nextExp = branch.GetNextExp(hearthLv);
124 int num4 = result.hearthExp + num3;
125 gaugeGold.rectTransform.sizeDelta = new Vector2(Mathf.Min(300, 300 * lastShippingExp / lastShippingExpMax), 50f);
126 gaugeHearth.rectTransform.sizeDelta = new Vector2(Mathf.Min(300, 300 * num4 / nextExp), 50f);
127 gaugeDebt.rectTransform.sizeDelta = new Vector2(Mathf.Min(300f, 300f * ((float)result.debt / 20000000f)), 50f);
128 textGold.text = "shipping_nextGold".lang(lastShippingExp.ToFormat(), lastShippingExpMax.ToFormat());
129 int num5 = shippingBonus2 - shippingBonus;
130 textGold2.text = ((num5 == 0) ? "" : ("+" + num5));
131 textHearth.text = "shipping_hearth".lang(hearthLv.ToString() ?? "", (100f * (float)num4 / (float)nextExp).ToString("F1"));
132 float num6 = 100f * (float)num3 / (float)nextExp;
133 textHearth2.text = ((num6 == 0f) ? "" : ("+" + num6.ToString("F1") + "%"));
134 textDebt.text = (ELayer.game.quests.IsStarted<QuestDebt>() ? (Lang._currency(result.debt, showUnit: true) ?? "") : "???");
135 gaugeDebt.SetActive(ELayer.game.quests.IsStarted<QuestDebt>());
136 if (shippingBonus2 - shippingBonus != lastBonus)
137 {
138 lastBonus = shippingBonus2 - shippingBonus;
139 if (showEffect)
140 {
141 SE.Play("ore_drop");
142 }
143 }
144 update++;
145 if (showEffect && update > maxUpdate)
146 {
147 SE.Play("regi");
148 showEffect = false;
149 }
150 }
Zone homeZone
Definition: Chara.cs:267
static Chara pc
Definition: ELayer.cs:15
int GetNextExp(int _lv=-1)
SpatialManager spatials
Definition: Game.cs:152
QuestManager quests
Definition: Game.cs:182
Definition: Lang.cs:6
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
int GetShippingBonus(long _a)
Definition: Player.cs:219
int lastShippingExp
Definition: Player.cs:131
int lastShippingExpMax
Definition: Player.cs:133
Zone Find(string id)

References Lang._currency(), ShippingResult.debt, SpatialManager.Find(), ELayer.game, gaugeDebt, ShippingResult.GetIncome(), FactionBranch.GetNextExp(), Player.Stats.GetShippingBonus(), ShippingResult.hearthLv, Chara.homeZone, lastBonus, Player.Stats.lastShippingExp, Player.Stats.lastShippingExpMax, maxUpdate, ELayer.pc, ELayer.player, Game.quests, result, showEffect, Game.spatials, Player.stats, ShippingResult.total, ShippingResult.uidZone, and update.

Referenced by Show(), and UpdateRepeating().

◆ Show() [1/2]

void LayerShippingResult.Show ( )
inline

Definition at line 74 of file LayerShippingResult.cs.

75 {
76 Show(ELayer.player.shippingResults.LastItem() ?? new ShippingResult());
77 SE.Play("money_shipping");
78 InvokeRepeating("UpdateRepeating", 0f, duration / (float)maxUpdate);
79 }
List< ShippingResult > shippingResults
Definition: Player.cs:1124

References duration, maxUpdate, ELayer.player, Player.shippingResults, and Show().

Referenced by Show().

◆ Show() [2/2]

void LayerShippingResult.Show ( ShippingResult  _result)
inline

Definition at line 152 of file LayerShippingResult.cs.

153 {
154 result = _result;
156 _ = zone.branch;
157 list.callbacks = new UIList.Callback<ShippingResult.Item, UIItem>
158 {
159 onInstantiate = delegate(ShippingResult.Item a, UIItem b)
160 {
161 b.text1.SetText(a.text);
162 b.text2.SetText(a.income.ToFormat());
163 }
164 };
165 list.Clear();
166 foreach (ShippingResult.Item item in result.items)
167 {
168 list.Add(item);
169 }
170 list.Refresh();
171 Date date = Date.ToDate(result.rawDate);
172 textTitle.text = date.month + "/" + date.day + " " + date.year;
173 textHome.text = "shipping_home".lang(zone.Name);
174 Refresh();
175 int count = ELayer.player.shippingResults.Count;
176 int index = ELayer.player.shippingResults.IndexOf(result);
177 buttonNext.SetActive(index != -1 && count > index + 1);
178 buttonPrev.SetActive(index > 0);
179 buttonNext.SetOnClick(delegate
180 {
181 showEffect = false;
182 Show(ELayer.player.shippingResults[index + 1]);
183 });
184 buttonPrev.SetOnClick(delegate
185 {
186 showEffect = false;
187 Show(ELayer.player.shippingResults[index - 1]);
188 });
189 this.RebuildLayout(recursive: true);
190 }
Definition: Date.cs:4
static Date ToDate(int raw)
Definition: Date.cs:397
int year
Definition: Date.cs:38
List< Item > items
virtual string Name
Definition: Spatial.cs:509
Definition: UIItem.cs:5
UIText text2
Definition: UIItem.cs:8
UIText text1
Definition: UIItem.cs:6
Definition: UIList.cs:9
override void Clear()
Definition: UIList.cs:349
override void Add(object item)
Definition: UIList.cs:302
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:424
void SetText(string s)
Definition: UIText.cs:159
Definition: Zone.cs:12
FactionBranch branch
Definition: Zone.cs:34

References UIList.Add(), Zone.branch, buttonNext, buttonPrev, UIList.Clear(), SpatialManager.Find(), ELayer.game, Chara.homeZone, item, ShippingResult.items, list, Spatial.Name, ELayer.pc, ELayer.player, ShippingResult.rawDate, Refresh(), UIList.Refresh(), result, UIText.SetText(), Player.shippingResults, Show(), showEffect, Game.spatials, UIItem.text1, UIItem.text2, Date.ToDate(), ShippingResult.uidZone, and Date.year.

◆ UpdateRepeating()

void LayerShippingResult.UpdateRepeating ( )
inline

Definition at line 81 of file LayerShippingResult.cs.

82 {
83 if (showEffect)
84 {
85 Refresh();
86 }
87 }

References Refresh(), and showEffect.

Member Data Documentation

◆ buttonNext

UIButton LayerShippingResult.buttonNext

Definition at line 9 of file LayerShippingResult.cs.

Referenced by Show().

◆ buttonPrev

UIButton LayerShippingResult.buttonPrev

Definition at line 11 of file LayerShippingResult.cs.

Referenced by Show().

◆ duration

float LayerShippingResult.duration

Definition at line 41 of file LayerShippingResult.cs.

Referenced by Show().

◆ gaugeDebt

Image LayerShippingResult.gaugeDebt

Definition at line 17 of file LayerShippingResult.cs.

Referenced by Refresh().

◆ gaugeGold

Image LayerShippingResult.gaugeGold

Definition at line 13 of file LayerShippingResult.cs.

◆ gaugeHearth

Image LayerShippingResult.gaugeHearth

Definition at line 15 of file LayerShippingResult.cs.

◆ imageBG

Image LayerShippingResult.imageBG

Definition at line 19 of file LayerShippingResult.cs.

◆ lastBonus

int LayerShippingResult.lastBonus
private

Definition at line 51 of file LayerShippingResult.cs.

Referenced by Refresh().

◆ list

UIList LayerShippingResult.list

Definition at line 7 of file LayerShippingResult.cs.

Referenced by Show().

◆ maxUpdate

int LayerShippingResult.maxUpdate

Definition at line 45 of file LayerShippingResult.cs.

Referenced by Refresh(), and Show().

◆ result

ShippingResult LayerShippingResult.result

Definition at line 47 of file LayerShippingResult.cs.

Referenced by Refresh(), and Show().

◆ showEffect

bool LayerShippingResult.showEffect = true

Definition at line 39 of file LayerShippingResult.cs.

Referenced by Refresh(), Show(), and UpdateRepeating().

◆ spriteBG

Sprite [] LayerShippingResult.spriteBG

Definition at line 49 of file LayerShippingResult.cs.

Referenced by Awake().

◆ textDebt

UIText LayerShippingResult.textDebt

Definition at line 37 of file LayerShippingResult.cs.

◆ textGold

UIText LayerShippingResult.textGold

Definition at line 21 of file LayerShippingResult.cs.

◆ textGold2

UIText LayerShippingResult.textGold2

Definition at line 23 of file LayerShippingResult.cs.

◆ textHearth

UIText LayerShippingResult.textHearth

Definition at line 25 of file LayerShippingResult.cs.

◆ textHearth2

UIText LayerShippingResult.textHearth2

Definition at line 27 of file LayerShippingResult.cs.

◆ textHome

UIText LayerShippingResult.textHome

Definition at line 29 of file LayerShippingResult.cs.

◆ textIncome

UIText LayerShippingResult.textIncome

Definition at line 31 of file LayerShippingResult.cs.

◆ textIncomeTotal

UIText LayerShippingResult.textIncomeTotal

Definition at line 33 of file LayerShippingResult.cs.

◆ textTitle

UIText LayerShippingResult.textTitle

Definition at line 35 of file LayerShippingResult.cs.

◆ update

int LayerShippingResult.update

Definition at line 43 of file LayerShippingResult.cs.

Referenced by Refresh().


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