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

Public Member Functions

override void OnInit ()
 
override void OnKill ()
 
override void OnSwitchContent (Window window)
 
int GetTravelFood (Zone z)
 
int GetTravelHours (Zone z)
 
int GetSortVal (Zone z)
 
void Refresh ()
 
- 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
 
Zone currentZone
 
Image bg
 
float fadeAlpha
 
float fadeTime
 
Ease easeFade
 
Ease easeZoom
 
float startZoom
 
float endZoom
 
float timeZoom
 
bool highlightZone
 
bool useBG
 
bool useZoom
 
- 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

override bool blockWidgetClick [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

Point posHighlight = new Point()
 

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

Member Function Documentation

◆ GetSortVal()

int LayerTravel.GetSortVal ( Zone  z)
inline

Definition at line 87 of file LayerTravel.cs.

88 {
89 if (ELayer.pc.homeZone == z)
90 {
91 return -1;
92 }
93 return GetTravelHours(z);
94 }
Zone homeZone
Definition: Chara.cs:252
Definition: ELayer.cs:4
static Chara pc
Definition: ELayer.cs:15
int GetTravelHours(Zone z)
Definition: LayerTravel.cs:82

References GetTravelHours(), Chara.homeZone, and ELayer.pc.

Referenced by Refresh().

◆ GetTravelFood()

int LayerTravel.GetTravelFood ( Zone  z)
inline

Definition at line 73 of file LayerTravel.cs.

74 {
75 if (z.tempDist == 0)
76 {
77 return 0;
78 }
79 return 1 + GetTravelHours(z) / 24;
80 }
int tempDist
Definition: Zone.cs:74

References GetTravelHours(), and Zone.tempDist.

Referenced by Refresh().

◆ GetTravelHours()

int LayerTravel.GetTravelHours ( Zone  z)
inline

Definition at line 82 of file LayerTravel.cs.

83 {
84 return z.tempDist * 3 * 100 / (100 + ELayer.pc.Evalue(407) * 2);
85 }
int Evalue(int ele)
Definition: Card.cs:2431

References Card.Evalue(), and ELayer.pc.

Referenced by GetSortVal(), GetTravelFood(), and Refresh().

◆ OnInit()

override void LayerTravel.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 39 of file LayerTravel.cs.

40 {
41 if (useZoom)
42 {
44 DOTween.To(() => ELayer.scene.screenElona.zoom, delegate(float x)
45 {
46 ELayer.scene.screenElona.zoom = x;
47 }, endZoom, timeZoom).SetEase(easeZoom);
48 }
49 if (useBG)
50 {
51 bg.DOFade(fadeAlpha, fadeTime).SetEase(easeFade);
52 ELayer.ui.layerFloat.SetActive(enable: false);
53 }
54 }
void SetZoom(float z)
virtual float TargetZoom
static Scene scene
Definition: ELayer.cs:27
static UI ui
Definition: ELayer.cs:21
static BaseGameScreen screen
Definition: ELayer.cs:29
float endZoom
Definition: LayerTravel.cs:25
bool useZoom
Definition: LayerTravel.cs:33
Ease easeFade
Definition: LayerTravel.cs:19
float fadeAlpha
Definition: LayerTravel.cs:15
float fadeTime
Definition: LayerTravel.cs:17
Ease easeZoom
Definition: LayerTravel.cs:21
float timeZoom
Definition: LayerTravel.cs:27
GameScreenElona screenElona
Definition: Scene.cs:91

References bg, easeFade, easeZoom, endZoom, fadeAlpha, fadeTime, ELayer.scene, ELayer.screen, Scene.screenElona, BaseGameScreen.SetZoom(), BaseGameScreen.TargetZoom, timeZoom, ELayer.ui, useBG, useZoom, and GameScreenElona.zoom.

◆ OnKill()

override void LayerTravel.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 56 of file LayerTravel.cs.

57 {
58 if (useBG)
59 {
60 ELayer.ui.layerFloat.SetActive(enable: true);
61 }
62 if (useZoom)
63 {
65 }
66 }

References ELayer.screen, BaseGameScreen.SetZoom(), BaseGameScreen.TargetZoom, ELayer.ui, useBG, and useZoom.

◆ OnSwitchContent()

override void LayerTravel.OnSwitchContent ( Window  window)
inlinevirtual

Reimplemented from Layer.

Definition at line 68 of file LayerTravel.cs.

69 {
70 Refresh();
71 }
void Refresh()
Definition: LayerTravel.cs:96

References Refresh().

◆ Refresh()

void LayerTravel.Refresh ( )
inline

Definition at line 96 of file LayerTravel.cs.

97 {
99 if (currentZone != null && !currentZone.isKnown)
100 {
101 currentZone = null;
102 }
103 list.callbacks = new UIList.Callback<Zone, UIButton>
104 {
105 onInstantiate = delegate(Zone a, UIButton b)
106 {
107 string text = "travelZone".lang(a.Name, a.tempDist.ToString() ?? "");
108 if (a == ELayer.pc.homeZone)
109 {
110 text = "travelHome".lang() + text;
111 }
112 if (a.isRandomSite)
113 {
114 text += (" (" + "days1".lang() + (ELayer.world.date.GetRemainingHours(a.dateExpire) / 24 + 1) + "days2".lang() + ")").TagSize(13);
115 }
116 b.mainText.SetText(text);
117 b.icon.sprite = TilemapUtils.GetOrCreateTileSprite(ELayer.scene.elomap.actor.tileset, a.icon) ?? b.icon.sprite;
118 b.icon.SetNativeSize();
119 b.refObj = a;
120 int travelFood = GetTravelFood(a);
121 int currency = ELayer.pc.GetCurrency("ration");
122 b.subText.SetText(travelFood.ToString() ?? "", (currency >= travelFood) ? FontColor.Good : FontColor.Bad);
124 },
125 onClick = delegate(Zone a, UIButton b)
126 {
127 if (a == currentZone)
128 {
129 Close();
131 }
132 else if (ELayer.pc.TryPay(GetTravelFood(a), "ration"))
133 {
134 if (ELayer.pc.burden.GetPhase() >= 3)
135 {
136 Msg.Say("errorOverweightTravel");
137 Close();
138 }
139 else
140 {
141 ELayer.player.distanceTravel = a.tempDist;
142 ELayer.player.dateTravel = ELayer.world.date.GetRaw();
143 foreach (UIList.ButtonPair button in list.buttons)
144 {
145 UIButton uIButton = button.component as UIButton;
146 if ((bool)uIButton && uIButton != b)
147 {
148 uIButton.GetComponent<CanvasGroup>().alpha = 0.5f;
149 }
150 }
151 float time = 0f;
152 int h = 0;
153 int maxHours = GetTravelHours(a);
154 ELayer.ui.AddLayer<LayerCover>().SetCondition(delegate(float delta)
155 {
156 time += delta;
157 if (time >= 0.035f)
158 {
159 time = 0f;
160 h++;
162 if (h >= maxHours)
163 {
164 Close();
166 ELayer.player.lastZonePos = null;
168 if (a is Zone_Lumiest)
169 {
170 state = ZoneTransition.EnterState.Right;
171 }
172 ELayer.pc.MoveZone(a, state);
173 return true;
174 }
175 }
176 return false;
177 });
178 }
179 }
180 },
181 onList = delegate
182 {
183 List<Zone> obj = ELayer.game.activeZone.Region.ListTravelZones();
184 obj.Sort((Zone a, Zone b) => GetSortVal(a) - GetSortVal(b));
185 foreach (Zone item in obj)
186 {
187 if (windows[0].idTab != 1)
188 {
189 list.Add(item);
190 }
191 }
192 }
193 };
194 list.List();
195 }
@ currency
FontColor
Definition: FontColor.cs:2
int GetCurrency(string id="money")
Definition: Card.cs:3652
Point pos
Definition: Card.cs:55
bool TryPay(int a, string id="money")
Definition: Card.cs:3602
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
Definition: Card.cs:5127
int GetCurrentDir()
Definition: Chara.cs:3305
Stats burden
Definition: Chara.cs:953
void MoveZone(string alias)
Definition: Chara.cs:3010
Definition: Date.cs:4
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
static string GetText2(int hour)
Definition: Date.cs:304
int GetRemainingHours(int rawDeadLine)
Definition: Date.cs:337
static World world
Definition: ELayer.cs:39
static Player player
Definition: ELayer.cs:13
static Game game
Definition: ELayer.cs:9
Tileset tileset
Definition: EloMapActor.cs:15
EloMapActor actor
Definition: EloMap.cs:118
Zone GetZone(Point p)
Definition: EloMap.cs:420
void AdvanceHour()
Definition: GameDate.cs:71
Zone activeZone
Definition: Game.cs:245
Zone currentZone
Definition: LayerTravel.cs:11
UIList list
Definition: LayerTravel.cs:9
int GetSortVal(Zone z)
Definition: LayerTravel.cs:87
int GetTravelFood(Zone z)
Definition: LayerTravel.cs:73
List< Window > windows
Definition: Layer.cs:116
virtual void Close()
Definition: Layer.cs:463
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1736
List< Zone > ListTravelZones(int radius=100)
Definition: Region.cs:276
EloMap elomap
Definition: Scene.cs:143
bool isRandomSite
Definition: Spatial.cs:334
int icon
Definition: Spatial.cs:82
virtual string Name
Definition: Spatial.cs:495
bool isKnown
Definition: Spatial.cs:346
virtual Point RegionPos
Definition: Spatial.cs:546
int dateExpire
Definition: Spatial.cs:166
override int GetPhase()
Definition: Stats.cs:117
UIText subText2
Definition: UIButton.cs:106
UIText subText
Definition: UIButton.cs:104
Image icon
Definition: UIButton.cs:110
UIText mainText
Definition: UIButton.cs:102
Definition: UIList.cs:9
List< ButtonPair > buttons
Definition: UIList.cs:244
override void Add(object item)
Definition: UIList.cs:302
override void List()
Definition: UIList.cs:717
void SetText(string s)
Definition: UIText.cs:159
GameDate date
Definition: World.cs:6
static EnterState DirToState(int dir)
Definition: Zone.cs:12
virtual ZoneTransition.EnterState RegionEnterState
Definition: Zone.cs:170
Region Region
Definition: Zone.cs:160

References Game.activeZone, EloMap.actor, UIList.Add(), GameDate.AdvanceHour(), Chara.burden, UIList.buttons, Layer.Close(), currency, currentZone, World.date, Spatial.dateExpire, ZoneTransition.DirToState(), Scene.elomap, Player.EnterLocalZone(), ELayer.game, Card.GetCurrency(), Chara.GetCurrentDir(), Stats.GetPhase(), Date.GetRaw(), Date.GetRemainingHours(), GetSortVal(), Date.GetText2(), GetTravelFood(), GetTravelHours(), EloMap.GetZone(), Chara.homeZone, UIButton.icon, Spatial.icon, Spatial.isKnown, Spatial.isRandomSite, item, list, UIList.List(), Region.ListTravelZones(), UIButton.mainText, Card.MoveImmediate(), Chara.MoveZone(), Spatial.Name, ELayer.pc, ELayer.player, Card.pos, Zone.Region, Zone.RegionEnterState, Spatial.RegionPos, Msg.Say(), ELayer.scene, UIText.SetText(), UIButton.subText, UIButton.subText2, Zone.tempDist, EloMapActor.tileset, Card.TryPay(), ELayer.ui, Layer.windows, and ELayer.world.

Referenced by OnSwitchContent().

Member Data Documentation

◆ bg

Image LayerTravel.bg

Definition at line 13 of file LayerTravel.cs.

Referenced by OnInit().

◆ currentZone

Zone LayerTravel.currentZone

Definition at line 11 of file LayerTravel.cs.

Referenced by Refresh().

◆ easeFade

Ease LayerTravel.easeFade

Definition at line 19 of file LayerTravel.cs.

Referenced by OnInit().

◆ easeZoom

Ease LayerTravel.easeZoom

Definition at line 21 of file LayerTravel.cs.

Referenced by OnInit().

◆ endZoom

float LayerTravel.endZoom

Definition at line 25 of file LayerTravel.cs.

Referenced by OnInit().

◆ fadeAlpha

float LayerTravel.fadeAlpha

Definition at line 15 of file LayerTravel.cs.

Referenced by OnInit().

◆ fadeTime

float LayerTravel.fadeTime

Definition at line 17 of file LayerTravel.cs.

Referenced by OnInit().

◆ highlightZone

bool LayerTravel.highlightZone

Definition at line 29 of file LayerTravel.cs.

◆ list

UIList LayerTravel.list

Definition at line 9 of file LayerTravel.cs.

Referenced by Refresh().

◆ posHighlight

Point LayerTravel.posHighlight = new Point()
private

Definition at line 35 of file LayerTravel.cs.

◆ startZoom

float LayerTravel.startZoom

Definition at line 23 of file LayerTravel.cs.

◆ timeZoom

float LayerTravel.timeZoom

Definition at line 27 of file LayerTravel.cs.

Referenced by OnInit().

◆ useBG

bool LayerTravel.useBG

Definition at line 31 of file LayerTravel.cs.

Referenced by OnInit(), and OnKill().

◆ useZoom

bool LayerTravel.useZoom

Definition at line 33 of file LayerTravel.cs.

Referenced by OnInit(), and OnKill().

Property Documentation

◆ blockWidgetClick

override bool LayerTravel.blockWidgetClick
get

Definition at line 37 of file LayerTravel.cs.


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