15 public override bool blockWidgetClick
24 public override void OnInit()
29 DOTween.To(() =>
ELayer.scene.screenElona.zoom, delegate(
float x)
31 ELayer.scene.screenElona.zoom = x;
32 }, this.endZoom, this.timeZoom).SetEase(this.easeZoom);
36 this.bg.DOFade(this.fadeAlpha, this.fadeTime).SetEase(this.easeFade);
37 ELayer.ui.layerFloat.SetActive(
false);
42 public override void OnKill()
46 ELayer.ui.layerFloat.SetActive(
true);
55 public override void OnSwitchContent(Window window)
61 public int GetTravelFood(
Zone z)
67 return 1 + this.GetTravelHours(z) / (12 +
ELayer.pc.Evalue(407) / 2) / 2;
71 public int GetTravelHours(
Zone z)
73 return z.tempDist * 3;
77 public int GetSortVal(
Zone z)
79 if (
ELayer.pc.homeZone == z)
83 return this.GetTravelHours(z);
89 this.currentZone =
ELayer.scene.elomap.GetZone(
ELayer.pc.pos);
90 if (this.currentZone !=
null && !this.currentZone.isKnown)
92 this.currentZone =
null;
94 this.list.callbacks =
new UIList.Callback<
Zone, UIButton>
96 onInstantiate = delegate(
Zone a, UIButton b)
98 string text =
"travelZone".lang(a.Name, a.tempDist.ToString() ??
"",
null,
null,
null);
99 if (a ==
ELayer.pc.homeZone)
101 text =
"travelHome".lang() + text;
105 text +=
string.Concat(
new string[]
109 (
ELayer.world.date.GetRemainingHours(a.dateExpire) / 24 + 1).ToString(),
114 b.mainText.SetText(text);
115 b.icon.sprite = (TilemapUtils.GetOrCreateTileSprite(
ELayer.scene.elomap.actor.tileset, a.icon, 0f) ?? b.icon.sprite);
116 b.icon.SetNativeSize();
118 int travelFood = this.GetTravelFood(a);
119 int currency =
ELayer.pc.GetCurrency(
"ration");
120 b.subText.SetText(travelFood.ToString() ??
"", (currency >= travelFood) ? FontColor.Good : FontColor.Bad);
121 b.subText2.SetText(
Date.GetText2(
this.GetTravelHours(a)));
123 onClick = delegate(
Zone a, UIButton b)
125 if (a == this.currentZone)
128 ELayer.player.EnterLocalZone(
false);
131 if (!
ELayer.pc.TryPay(
this.GetTravelFood(a),
"ration"))
135 if (
ELayer.pc.burden.GetPhase() >= 3)
137 Msg.Say(
"errorOverweightTravel");
141 ELayer.player.distanceTravel = a.tempDist;
142 ELayer.player.dateTravel =
ELayer.world.date.GetRaw(0);
143 foreach (UIList.ButtonPair buttonPair in
this.list.buttons)
145 UIButton uibutton = buttonPair.component as UIButton;
146 if (uibutton && uibutton != b)
148 uibutton.GetComponent<CanvasGroup>().alpha = 0.5f;
153 int maxHours = this.GetTravelHours(a);
162 ELayer.world.date.AdvanceHour();
166 ELayer.pc.MoveImmediate(a.RegionPos,
true,
true);
167 ELayer.player.lastZonePos =
null;
173 ELayer.pc.MoveZone(a, state);
180 onList = delegate(UIList.SortMode m)
182 List<Zone> list =
ELayer.game.activeZone.Region.ListTravelZones(100);
183 list.Sort((
Zone a,
Zone b) => this.GetSortVal(a) - this.GetSortVal(b));
184 foreach (
Zone o
in list)
186 if (this.windows[0].idTab != 1)
193 this.list.List(
false);
200 public Zone currentZone;
206 public float fadeAlpha;
209 public float fadeTime;
212 public Ease easeFade;
215 public Ease easeZoom;
218 public float startZoom;
221 public float endZoom;
224 public float timeZoom;
227 public bool highlightZone;