Elin Decompiled Documentation EA 23.303 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 6 of file LayerShippingResult.cs.

Member Function Documentation

◆ Awake()

new void LayerShippingResult.Awake ( )
inlineprivatevirtual

Reimplemented from Layer.

Definition at line 54 of file LayerShippingResult.cs.

55 {
57 List<int> list = new List<int> { 0, 1 };
58 Add("corgon", 2);
59 Add("loytel", 3);
60 Add("farris", 4);
61 if (ELayer.game.quests.IsCompleted("negotiation_darkness") && !ELayer.player.flags.killedDuponne)
62 {
63 Add("demitas", 6);
64 }
65 else
66 {
67 Add("demitas", 5);
68 }
69 Add("kettle", 7);
70 int num = list.RandomItem();
71 imageBG.sprite = spriteBG[num];
72 Rand.SetSeed();
73 base.Awake();
74 void Add(string id, int index)
75 {
77 if (chara != null && chara.IsPCFaction)
78 {
79 list.Add(index);
80 }
81 }
82 }
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
Definition: Chara.cs:10
override bool IsPCFaction
Definition: Chara.cs:685
Definition: ELayer.cs:4
static Player player
Definition: ELayer.cs:13
static Game game
Definition: ELayer.cs:9
CardManager cards
Definition: Game.cs:156
QuestManager quests
Definition: Game.cs:183
int seed
Definition: Game.cs:201
bool killedDuponne
Definition: Player.cs:592
int days
Definition: Player.cs:75
Flags flags
Definition: Player.cs:1161
Stats stats
Definition: Player.cs:1083
bool IsCompleted(string id)
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:44
override void Add(object item)
Definition: UIList.cs:354

References UIList.Add(), Game.cards, Player.Stats.days, CardManager.GlobalCharaList.Find(), Player.flags, ELayer.game, CardManager.globalCharas, QuestManager.IsCompleted(), Chara.IsPCFaction, Player.Flags.killedDuponne, list, ELayer.player, Game.quests, Game.seed, Rand.SetSeed(), spriteBG, and Player.stats.

◆ Refresh()

void LayerShippingResult.Refresh ( )
inline

Definition at line 99 of file LayerShippingResult.cs.

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

85 {
86 Show(ELayer.player.shippingResults.LastItem() ?? new ShippingResult());
87 SE.Play("money_shipping");
88 InvokeRepeating("UpdateRepeating", 0f, duration / (float)maxUpdate);
89 }
List< ShippingResult > shippingResults
Definition: Player.cs:1191

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

Referenced by Show().

◆ Show() [2/2]

void LayerShippingResult.Show ( ShippingResult  _result)
inline

Definition at line 162 of file LayerShippingResult.cs.

163 {
164 result = _result;
166 _ = zone.branch;
167 list.callbacks = new UIList.Callback<ShippingResult.Item, UIItem>
168 {
169 onInstantiate = delegate(ShippingResult.Item a, UIItem b)
170 {
171 b.text1.SetText(a.text);
172 b.text2.SetText(a.income.ToFormat());
173 }
174 };
175 list.Clear();
176 foreach (ShippingResult.Item item in result.items)
177 {
178 list.Add(item);
179 }
180 list.Refresh();
181 Date date = Date.ToDate(result.rawDate);
182 textTitle.text = date.month + "/" + date.day + " " + date.year;
183 textHome.text = "shipping_home".lang(zone.Name);
184 Refresh();
185 int count = ELayer.player.shippingResults.Count;
186 int index = ELayer.player.shippingResults.IndexOf(result);
187 buttonNext.SetActive(index != -1 && count > index + 1);
188 buttonPrev.SetActive(index > 0);
189 buttonNext.SetOnClick(delegate
190 {
191 showEffect = false;
192 Show(ELayer.player.shippingResults[index + 1]);
193 });
194 buttonPrev.SetOnClick(delegate
195 {
196 showEffect = false;
197 Show(ELayer.player.shippingResults[index - 1]);
198 });
199 this.RebuildLayout(recursive: true);
200 }
Definition: Date.cs:4
static Date ToDate(int raw)
Definition: Date.cs:399
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:401
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:476
void SetText(string s)
Definition: UIText.cs:163
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 91 of file LayerShippingResult.cs.

92 {
93 if (showEffect)
94 {
95 Refresh();
96 }
97 }

References Refresh(), and showEffect.

Member Data Documentation

◆ buttonNext

UIButton LayerShippingResult.buttonNext

Definition at line 10 of file LayerShippingResult.cs.

Referenced by Show().

◆ buttonPrev

UIButton LayerShippingResult.buttonPrev

Definition at line 12 of file LayerShippingResult.cs.

Referenced by Show().

◆ duration

float LayerShippingResult.duration

Definition at line 42 of file LayerShippingResult.cs.

Referenced by Show().

◆ gaugeDebt

Image LayerShippingResult.gaugeDebt

Definition at line 18 of file LayerShippingResult.cs.

Referenced by Refresh().

◆ gaugeGold

Image LayerShippingResult.gaugeGold

Definition at line 14 of file LayerShippingResult.cs.

◆ gaugeHearth

Image LayerShippingResult.gaugeHearth

Definition at line 16 of file LayerShippingResult.cs.

◆ imageBG

Image LayerShippingResult.imageBG

Definition at line 20 of file LayerShippingResult.cs.

◆ lastBonus

int LayerShippingResult.lastBonus
private

Definition at line 52 of file LayerShippingResult.cs.

Referenced by Refresh().

◆ list

UIList LayerShippingResult.list

Definition at line 8 of file LayerShippingResult.cs.

Referenced by Awake(), and Show().

◆ maxUpdate

int LayerShippingResult.maxUpdate

Definition at line 46 of file LayerShippingResult.cs.

Referenced by Refresh(), and Show().

◆ result

ShippingResult LayerShippingResult.result

Definition at line 48 of file LayerShippingResult.cs.

Referenced by Refresh(), and Show().

◆ showEffect

bool LayerShippingResult.showEffect = true

Definition at line 40 of file LayerShippingResult.cs.

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

◆ spriteBG

Sprite [] LayerShippingResult.spriteBG

Definition at line 50 of file LayerShippingResult.cs.

Referenced by Awake().

◆ textDebt

UIText LayerShippingResult.textDebt

Definition at line 38 of file LayerShippingResult.cs.

◆ textGold

UIText LayerShippingResult.textGold

Definition at line 22 of file LayerShippingResult.cs.

◆ textGold2

UIText LayerShippingResult.textGold2

Definition at line 24 of file LayerShippingResult.cs.

◆ textHearth

UIText LayerShippingResult.textHearth

Definition at line 26 of file LayerShippingResult.cs.

◆ textHearth2

UIText LayerShippingResult.textHearth2

Definition at line 28 of file LayerShippingResult.cs.

◆ textHome

UIText LayerShippingResult.textHome

Definition at line 30 of file LayerShippingResult.cs.

◆ textIncome

UIText LayerShippingResult.textIncome

Definition at line 32 of file LayerShippingResult.cs.

◆ textIncomeTotal

UIText LayerShippingResult.textIncomeTotal

Definition at line 34 of file LayerShippingResult.cs.

◆ textTitle

UIText LayerShippingResult.textTitle

Definition at line 36 of file LayerShippingResult.cs.

◆ update

int LayerShippingResult.update

Definition at line 44 of file LayerShippingResult.cs.

Referenced by Refresh().


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