Elin Decompiled Documentation EA 23.102 Nightly
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 imageBG.sprite = spriteBG[num];
66 Rand.SetSeed();
67 base.Awake();
68 }
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:197
int days
Definition: Player.cs:68
Stats stats
Definition: Player.cs:817
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 85 of file LayerShippingResult.cs.

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

71 {
72 Show(ELayer.player.shippingResults.LastItem() ?? new ShippingResult());
73 SE.Play("money_shipping");
74 InvokeRepeating("UpdateRepeating", 0f, duration / (float)maxUpdate);
75 }
List< ShippingResult > shippingResults
Definition: Player.cs:925

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

Referenced by Show().

◆ Show() [2/2]

void LayerShippingResult.Show ( ShippingResult  _result)
inline

Definition at line 148 of file LayerShippingResult.cs.

149 {
150 result = _result;
152 _ = zone.branch;
153 list.callbacks = new UIList.Callback<ShippingResult.Item, UIItem>
154 {
155 onInstantiate = delegate(ShippingResult.Item a, UIItem b)
156 {
157 b.text1.SetText(a.text);
158 b.text2.SetText(a.income.ToFormat());
159 }
160 };
161 list.Clear();
162 foreach (ShippingResult.Item item in result.items)
163 {
164 list.Add(item);
165 }
166 list.Refresh();
167 Date date = Date.ToDate(result.rawDate);
168 textTitle.text = date.month + "/" + date.day + " " + date.year;
169 textHome.text = "shipping_home".lang(zone.Name);
170 Refresh();
171 int count = ELayer.player.shippingResults.Count;
172 int index = ELayer.player.shippingResults.IndexOf(result);
173 buttonNext.SetActive(index != -1 && count > index + 1);
174 buttonPrev.SetActive(index > 0);
175 buttonNext.SetOnClick(delegate
176 {
177 showEffect = false;
178 Show(ELayer.player.shippingResults[index + 1]);
179 });
180 buttonPrev.SetOnClick(delegate
181 {
182 showEffect = false;
183 Show(ELayer.player.shippingResults[index - 1]);
184 });
185 this.RebuildLayout(recursive: true);
186 }
Definition: Date.cs:4
static Date ToDate(int raw)
Definition: Date.cs:393
int year
Definition: Date.cs:38
List< Item > items
virtual string Name
Definition: Spatial.cs:495
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 77 of file LayerShippingResult.cs.

78 {
79 if (showEffect)
80 {
81 Refresh();
82 }
83 }

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: