Elin Modding Docs Doc
Loading...
Searching...
No Matches
BaseGameScreen.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000165 RID: 357
5public class BaseGameScreen : EMono
6{
7 // Token: 0x170002A6 RID: 678
8 // (get) Token: 0x06000A75 RID: 2677 RVA: 0x0003F3E0 File Offset: 0x0003D5E0
9 public bool fixFocus
10 {
11 get
12 {
13 ActionMode actionMode = EMono.scene.actionMode;
14 return actionMode != null && actionMode.FixFocus;
15 }
16 }
17
18 // Token: 0x170002A7 RID: 679
19 // (get) Token: 0x06000A76 RID: 2678 RVA: 0x0003F3F7 File Offset: 0x0003D5F7
20 public virtual float TargetZoom
21 {
22 get
23 {
24 return EMono.scene.actionMode.TargetZoom;
25 }
26 }
27
28 // Token: 0x170002A8 RID: 680
29 // (get) Token: 0x06000A77 RID: 2679 RVA: 0x0003F408 File Offset: 0x0003D608
30 protected CameraSupport camSupport
31 {
32 get
33 {
34 return EMono.scene.camSupport;
35 }
36 }
37
38 // Token: 0x170002A9 RID: 681
39 // (get) Token: 0x06000A78 RID: 2680 RVA: 0x0003F414 File Offset: 0x0003D614
40 protected Transform transFocus
41 {
42 get
43 {
44 return EMono.scene.transFocus;
45 }
46 }
47
48 // Token: 0x170002AA RID: 682
49 // (get) Token: 0x06000A79 RID: 2681 RVA: 0x0003F420 File Offset: 0x0003D620
50 public virtual float SkyRate
51 {
52 get
53 {
54 return Mathf.Clamp((1.2f - this.Zoom) * 2f - (EMono._zone.IsSnowCovered ? 0.38f : 0f), 0f, 2f);
55 }
56 }
57
58 // Token: 0x170002AB RID: 683
59 // (get) Token: 0x06000A7A RID: 2682 RVA: 0x0003F45C File Offset: 0x0003D65C
60 public virtual float ViewHeight
61 {
62 get
63 {
64 return this.SkyRate * 10f + 5f;
65 }
66 }
67
68 // Token: 0x170002AC RID: 684
69 // (get) Token: 0x06000A7B RID: 2683 RVA: 0x0003F470 File Offset: 0x0003D670
70 public virtual bool IsGameScreen
71 {
72 get
73 {
74 return true;
75 }
76 }
77
78 // Token: 0x170002AD RID: 685
79 // (get) Token: 0x06000A7C RID: 2684 RVA: 0x0003F473 File Offset: 0x0003D673
80 public virtual bool IsLocalMap
81 {
82 get
83 {
84 return false;
85 }
86 }
87
88 // Token: 0x06000A7D RID: 2685 RVA: 0x0003F478 File Offset: 0x0003D678
89 public void Activate()
90 {
91 if (EMono.core.screen == this)
92 {
93 return;
94 }
95 if (EMono.core.screen != null)
96 {
97 EMono.core.screen.Deactivate();
98 }
99 this.SetUnitSize();
100 EMono.core.screen = this;
101 Point._screen = this;
102 base.gameObject.SetActive(true);
103 EMono.scene.flock.SetActive(this.IsLocalMap);
104 EMono.scene.fireflyNight.SetActive(this.IsLocalMap);
105 EMono.scene.firefly.SetActive(this.IsLocalMap);
106 EMono.scene.star.SetActive(this.IsLocalMap);
107 EMono.scene.sfxRain.SetActive(this.IsGameScreen);
108 EMono.scene.sfxSea.SetActive(this.IsGameScreen);
109 EMono.scene.sfxWind.SetActive(this.IsGameScreen);
110 EMono.scene.sfxFire.SetActive(this.IsGameScreen);
111 this.OnActivate();
112 EMono.scene.rain.main.prewarm = (EMono.scene.snow.main.prewarm = (EMono.scene.ether.main.prewarm = true));
113 ParticleSystem[] blossoms = EMono.scene.blossoms;
114 for (int i = 0; i < blossoms.Length; i++)
115 {
116 blossoms[i].main.prewarm = true;
117 }
118 if (this.overlayShadow)
119 {
120 this.overlayShadow.SetActive(EMono.scene.profile.matOverlay);
121 this.overlayShadow.sharedMaterial = EMono.scene.profile.matOverlay;
122 }
123 EMono.scene.camSupport.grading.material = EMono.scene.profile.matGrading;
124 if (this.IsGameScreen)
125 {
126 EMono.scene.OnChangeHour();
127 EMono.scene.ApplyZoneConfig();
128 this.RefreshAll();
129 this.tileMap.OnActivate(this);
130 WidgetHotbar.RefreshHighlights();
131 return;
132 }
133 if (EMono.core.config != null)
134 {
135 EMono.core.config.RefreshUIBrightness();
136 }
137 }
138
139 // Token: 0x06000A7E RID: 2686 RVA: 0x0003F6C3 File Offset: 0x0003D8C3
140 public virtual void OnActivate()
141 {
142 }
143
144 // Token: 0x06000A7F RID: 2687 RVA: 0x0003F6C5 File Offset: 0x0003D8C5
145 public void Deactivate()
146 {
147 this.OnDeactivate();
148 base.gameObject.SetActive(false);
149 EMono.core.screen = null;
150 }
151
152 // Token: 0x06000A80 RID: 2688 RVA: 0x0003F6E4 File Offset: 0x0003D8E4
153 public virtual void OnDeactivate()
154 {
155 }
156
157 // Token: 0x06000A81 RID: 2689 RVA: 0x0003F6E6 File Offset: 0x0003D8E6
158 public virtual void SetUnitSize()
159 {
160 }
161
162 // Token: 0x06000A82 RID: 2690 RVA: 0x0003F6E8 File Offset: 0x0003D8E8
163 public virtual void OnEndPlayerTurn()
164 {
165 }
166
167 // Token: 0x06000A83 RID: 2691 RVA: 0x0003F6EC File Offset: 0x0003D8EC
168 public unsafe void Draw()
169 {
170 if (!this.IsGameScreen)
171 {
172 return;
173 }
174 if (this.Zoom != this.targetZoom)
175 {
176 bool flag = EMono.scene.actionMode == ActionMode.Bird;
177 CoreConfig.CameraConfig camera = EMono.core.config.camera;
178 float num = camera.zoomSpeed * (flag ? 0.05f : (camera.linearZoom ? 2f : 1f)) * Core.delta;
179 this.zoomTimer += num * 0.3f;
180 float t = (flag || !camera.linearZoom) ? num : this.zoomTimer;
181 float num2 = Mathf.Lerp(EMono.screen.Zoom, this.targetZoom, t);
182 if (Mathf.Abs(num2 - this.targetZoom) < (flag ? 0.0005f : 0.003f))
183 {
184 num2 = this.targetZoom;
185 }
186 if (camera.zoomToMouse && this.zoomPos != Vector3.zero)
187 {
188 this.position = Vector3.Lerp(this.position, this.zoomPos, t);
189 }
190 EMono.core.config.ApplyZoom(num2);
191 }
192 RenderObject.gameSpeed = EMono.scene.actionMode.gameSpeed;
193 RenderObject.gameDelta = Core.gameDeltaNoPause;
194 if (EMono.pc.currentZone == EMono._zone && !EMono._zone.IsRegion && this.focusOption == null && this.focusPos == null && !this.transFocus && this.fixFocus && (this.instantFocus || !EMono.core.config.camera.smoothFollow))
195 {
196 if (this.Zoom != this.targetZoom)
197 {
198 EMono.core.config.ApplyZoom(this.TargetZoom);
199 }
200 Vector3 vector = (EMono.pc.isSynced ? EMono.player.position : (*EMono.pc.pos.Position())) + this.focusFix;
201 this.position = vector;
202 this.scrollX = Mathf.FloorToInt(this.position.x / this.tileWorldSize.x) - this.width / 2 + (int)this.paddingOffset.x;
203 this.scrollY = Mathf.FloorToInt(this.position.y / this.tileWorldSize.y) - this.height / 4 + (int)this.paddingOffset.y;
204 }
205 this.tileMap.Draw();
206 if (this.instantFocus)
207 {
208 this.instantFocus = false;
209 }
210 this.RefreshPosition();
211 if (EMono.game.activeZone != null)
212 {
213 for (int i = EMono._map.pointAnimes.Count - 1; i >= 0; i--)
214 {
215 if (EMono._map.pointAnimes[i].Update())
216 {
217 EMono._map.pointAnimes.RemoveAt(i);
218 }
219 }
220 }
221 this.UpdateShaders(EMono.scene.timeRatio);
222 if (Scene.skipAnime)
223 {
224 EffectManager.Instance.KillAll();
225 Scene.skipAnime = false;
226 }
227 EffectManager.Instance.UpdateEffects();
228 FlockController flock = EMono.scene.flock;
229 bool visible;
230 if (this.targetZoom <= 1.25f)
231 {
232 Room room = EMono.pc.pos.cell.room;
233 visible = (room == null || !room.HasRoof);
234 }
235 else
236 {
237 visible = false;
238 }
239 flock.UpdateVisible(visible);
240 if (EMono.pc.isSynced && EMono.pc.renderer.orbit)
241 {
242 EMono.pc.renderer.orbit.Refresh();
243 }
244 }
245
246 // Token: 0x06000A84 RID: 2692 RVA: 0x0003FA98 File Offset: 0x0003DC98
247 public void UpdateShaders(float time = 0f)
248 {
249 SceneProfile profile = EMono.scene.profile;
250 SceneColorProfile color = profile.color;
251 SceneLightProfile light = profile.light;
252 Color color2 = color.fog.Evaluate(time);
253 float value = light.nightRatioCurve.Evaluate(time);
254 Shader.SetGlobalFloat(this._Snow, EMono._zone.IsSnowCovered ? 1f : 0f);
255 Shader.SetGlobalFloat(this._BackDrawPower, (float)(ActionMode.Cinema.IsActive ? 0 : EMono.game.config.backDrawAlpha));
256 Shader.SetGlobalFloat(this._SkyLevel, this.SkyRate);
257 Shader.SetGlobalFloat(this._NightRate, value);
258 Shader.SetGlobalFloat(this._ViewHeight, this.ViewHeight);
259 Shader.SetGlobalFloat(this._FogStrength, color2.a * 0.1f);
260 Shader.SetGlobalColor(this._FogColor, color2);
261 FowProfile fowProfile = EMono._zone.biome.fowProfile;
262 if (EMono._map.fowProfile)
263 {
264 fowProfile = EMono._map.fowProfile;
265 }
266 if (fowProfile)
267 {
268 FOWType type = fowProfile.type;
269 if (type != FOWType.Color)
270 {
271 if (type != FOWType.ColorAdd)
272 {
273 Shader.SetGlobalColor(this._FowColor, color.fow.Evaluate(time));
274 }
275 else
276 {
277 Shader.SetGlobalColor(this._FowColor, fowProfile.color * color.fow.Evaluate(time));
278 }
279 }
280 else
281 {
282 Shader.SetGlobalColor(this._FowColor, fowProfile.color);
283 }
284 }
285 else
286 {
287 Shader.SetGlobalColor(this._FowColor, color.fow.Evaluate(time));
288 }
289 Shader.SetGlobalColor(this._SunColor, EMono._zone.IsSnowCovered ? color.sunSnow.Evaluate(time) : color.sun.Evaluate(time));
290 Shader.SetGlobalColor(this._SeaColor, color.sea.Evaluate(time));
291 Shader.SetGlobalColor(this._SkyColor, color.sky.Evaluate(time));
292 Shader.SetGlobalColor(this._SkyBGColor, color.skyBG.Evaluate(time));
293 Shader.SetGlobalVector(this._Offset, EMono.core.config.camera.extendZoomMin ? (this.position * 0.3f) : (this.position * 0.5f));
294 Shader.SetGlobalFloat(this._Zoom, this.Zoom);
295 Shader.SetGlobalFloat(this._LightPower, light.lightPower.Evaluate(time) * light.lightPowerMod);
296 Shader.SetGlobalFloat(this._AnimeSpeedGlobal, (float)EMono.game.config.animeSpeed);
297 Shader.SetGlobalColor(this._ScreenFlash, ScreenFlash.currentColor);
298 EMono.scene.godray.main.startColor = (EMono._zone.IsSnowCovered ? color.godraySnow.Evaluate(time) : color.godray.Evaluate(time));
299 this.camSupport.grading.vignettePower = light.vignetteCurve.Evaluate(time);
300 this.camSupport.grading.UpdateVignette(0f);
301 this.camSupport.bloom.threshold = light.bloomCurve.Evaluate(time);
302 this.camSupport.beautify.bloomIntensity = light.bloomCurve2.Evaluate(time);
303 }
304
305 // Token: 0x06000A85 RID: 2693 RVA: 0x0003FDED File Offset: 0x0003DFED
306 public virtual void OnChangeHour()
307 {
308 }
309
310 // Token: 0x06000A86 RID: 2694 RVA: 0x0003FDF0 File Offset: 0x0003DFF0
311 public unsafe virtual void RefreshPosition()
312 {
313 if (EMono.pc.currentZone != EMono._zone)
314 {
315 return;
316 }
317 if (this.focusOption != null)
318 {
319 Vector3 vector = this.focusOption.player ? (*EMono.pc.pos.Position() + this.focusFix) : (*this.focusOption.pos.PositionCenter());
320 vector.z = this.position.z;
321 if (this.focusOption.linear)
322 {
323 this.position = Vector3.MoveTowards(this.position, vector, this.focusOption.speed * Core.delta);
324 }
325 else
326 {
327 this.position = Vector3.Lerp(this.position, vector, this.focusOption.speed * Core.delta);
328 }
329 }
330 else if (this.focusPos != null)
331 {
332 this.focusPos = new Vector3?(new Vector3((this.focusPos ?? this.position).x, (this.focusPos ?? this.position).y, this.position.z));
333 this.position = Vector3.Lerp(this.position, this.focusPos ?? this.position, this.focusSpeedSlow * Core.delta);
334 if (Vector3.Distance(this.position, this.focusPos ?? this.position) < 0.1f)
335 {
336 this.focusPos = null;
337 }
338 }
339 else if (this.transFocus)
340 {
341 this.pushBack = Vector3.zero;
342 this.position.x = this.transFocus.position.x;
343 this.position.y = this.transFocus.position.y;
344 }
345 else if (this.fixFocus)
346 {
347 float z = this.position.z;
348 this.targetZoom = this.TargetZoom;
349 for (int i = 0; i < EMono.core.config.camera.zooms.Length; i++)
350 {
351 if (this.targetZoom == EMono.core.config.camera.zooms[i])
352 {
353 this.targetZoomIndex = i;
354 }
355 }
356 Vector3 b = (EMono.pc.isSynced ? EMono.player.position : (*EMono.pc.pos.Position())) + this.focusFix;
357 if (this.instantFocus)
358 {
359 this.position = b;
360 }
361 else if (EMono.core.config.camera.smoothFollow)
362 {
363 this.position = Vector3.Lerp(this.position, b, this.focusSpeed * Core.delta * Mathf.Lerp(0.2f, 1f, 1f - Mathf.Clamp(ActionMode.Adv.rightMouseTimer, 0f, 1f)));
364 }
365 else
366 {
367 this.position = b;
368 }
369 this.position.z = z;
370 this.pcOrbit.transform.position = EMono.pc.renderer.position;
371 }
372 else
373 {
374 if (ActionMode.Adv.IsActive)
375 {
376 this.targetZoom = ActionMode.Adv.TargetZoom;
377 }
378 this.pushBack = Vector3.zero;
379 int num = this.scrollX - this.scrollY;
380 int num2 = this.scrollY + this.scrollX;
381 if ((float)num <= this.mapLimit.x)
382 {
383 this.pushBack.x = this.mapLimit.x - (float)num;
384 }
385 if ((float)num2 <= this.mapLimit.y)
386 {
387 this.pushBack.y = this.mapLimit.y - (float)num2;
388 }
389 if ((float)num >= (float)EMono._map.Size + this.mapLimit.width - (float)(this.width / 2))
390 {
391 this.pushBack.x = (float)EMono._map.Size + this.mapLimit.width - (float)(this.width / 2) - (float)num;
392 }
393 if ((float)num2 >= (float)EMono._map.Size + this.mapLimit.height - (float)(this.height / 2))
394 {
395 this.pushBack.y = (float)EMono._map.Size + this.mapLimit.height - (float)(this.height / 2) - (float)num2;
396 }
397 this.position += Quaternion.Euler(this.planeAngle) * this.pushBack * Core.delta * this.pushbackSpeed;
398 }
399 this.scrollX = Mathf.FloorToInt(this.position.x / this.tileWorldSize.x) - this.width / 2 + (int)this.paddingOffset.x;
400 this.scrollY = Mathf.FloorToInt(this.position.y / this.tileWorldSize.y) - this.height / 4 + (int)this.paddingOffset.y;
401 if (this.lastPos.x != (float)this.scrollX || this.lastPos.y != (float)this.scrollY)
402 {
403 this.lastPos.x = (float)this.scrollX;
404 this.lastPos.y = (float)this.scrollY;
405 }
406 this.camPos.x = this.position.x;
407 this.camPos.y = this.position.y;
408 this.SnapScreen(ref this.camPos, this.Zoom);
409 this.camPos.z = -500f;
410 this._camPos.x = this.camPos.x + this.screenFixX2 + this.screenFixX4;
411 this._camPos.y = this.camPos.y + this.screenFixY2 + this.screenFixY4;
412 this._camPos.z = this.camPos.z;
413 EMono.scene.cam.transform.localPosition = this._camPos;
414 this.camPos.z = 0f;
415 EMono.scene.transAudio.position = this.camPos;
416 if (WidgetMinimap.Instance)
417 {
418 WidgetMinimap.Instance.OnUpdate();
419 }
420 }
421
422 // Token: 0x06000A87 RID: 2695 RVA: 0x000404A8 File Offset: 0x0003E6A8
423 public void RefreshAll()
424 {
425 this.RefreshScreenSize();
426 bool indoor = EMono._map.config.indoor;
427 ScreenGrading grading = this.camSupport.grading;
428 EMono.scene.flock.SetActive(!indoor);
429 if (indoor)
430 {
431 grading.material.DisableKeyword("CLOUD_ON");
432 }
433 else
434 {
435 grading.material.EnableKeyword("CLOUD_ON");
436 }
437 grading.profile.vignette.enable = EMono.scene.profile.light.vignette;
438 grading.profile.vignette.vignetteColor = EMono.scene.profile.light.vignetteColor;
439 this.RefreshSky();
440 this.RefreshTilt();
441 }
442
443 // Token: 0x06000A88 RID: 2696 RVA: 0x00040564 File Offset: 0x0003E764
444 public void RefreshScreenSize()
445 {
446 this.Zoom = EMono.scene.camSupport.Zoom;
447 this.width = (int)((float)Screen.width / this.tileSize.x / this.Zoom) + (int)this.paddings.x + 2;
448 this.height = (int)((float)Screen.height / (this.tileSize.y / 2f) / this.Zoom) + (int)this.paddings.y + 4;
449 this.camSupport.divier = EMono.core.config.fix.divider;
450 this.camSupport.ResizeCameraToPixelPerfect();
451 Vector3 localScale = new Vector3(EMono.scene.cam.orthographicSize * ((float)Screen.width / (float)Screen.height) * 2.5f, EMono.scene.cam.orthographicSize * 2.5f, 1f);
452 if (EMono.core.IsGameStarted)
453 {
454 EMono.scene.skyBG.transform.localScale = localScale;
455 float num = (ActionMode.IsAdv || this.Zoom >= 1f || EMono._map.IsIndoor) ? 0f : (0.4f / this.Zoom);
456 if (EMono.world.weather.CurrentCondition == Weather.Condition.SnowHeavy)
457 {
458 num += 0.8f;
459 }
460 if (!EMono.player.simulatingZone)
461 {
462 EMono.scene.sfxWind.SetVolume(Mathf.Min(num, 1f));
463 }
464 }
465 Vector3 vector = EMono.scene.cam.transform.position;
466 EMono.scene.cam.transform.position = Vector3.zero;
467 Vector3 vector2 = EMono.scene.cam.WorldToScreenPoint(Vector3.zero);
468 this.screenFixX2 = vector2.x % this.screenFixX * this.screenFixX3;
469 this.screenFixY2 = vector2.y % this.screenFixY * this.screenFixY3;
470 EMono.scene.cam.transform.position = vector;
471 }
472
473 // Token: 0x06000A89 RID: 2697 RVA: 0x0004077C File Offset: 0x0003E97C
474 public Point GetRandomPoint()
475 {
476 int num = EMono.screen.scrollX - EMono.screen.scrollY + this.width / 2 - (this.height / 2 + 1) / 2;
477 int num2 = EMono.screen.scrollY + EMono.screen.scrollX + this.width / 2 + this.height / 2 / 2;
478 num = num - 20 + EMono.rnd(40);
479 num2 = num2 - 20 + EMono.rnd(40);
480 return this._randomPoint.Set(num, num2);
481 }
482
483 // Token: 0x06000A8A RID: 2698 RVA: 0x00040808 File Offset: 0x0003EA08
484 public void RefreshSky()
485 {
486 CoreConfig.GraphicSetting graphic = EMono.core.config.graphic;
487 bool indoor = EMono._map.config.indoor;
488 EMono.scene.firefly.baseParticleCount = graphic.fireflyCount;
489 EMono.scene.fireflyNight.baseParticleCount = graphic.fireflyCount * 10;
490 EMono.scene.star.baseParticleCount = graphic.starCount;
491 EMono.scene.star.gameObject.GetComponent<ParticleSystemRenderer>().enabled = EMono.world.date.IsNight;
492 EMono.scene.star.SetActive(this.IsLocalMap && !indoor);
493 EMono.scene.firefly.SetActive(this.IsLocalMap && graphic.firefly && !indoor);
494 EMono.scene.fireflyNight.SetActive(this.IsLocalMap && graphic.firefly && !indoor);
495 if (this.overlayShadow && EMono.scene.profile.matOverlay && this is GameScreen)
496 {
497 this.overlayShadow.sharedMaterial.SetFloat("_ShadowStrength", EMono._map.config.shadowStrength * (EMono._zone.IsSnowCovered ? 0.5f : 1f) * EMono.setting.render.shadowStrength);
498 }
499 this.RefreshWeather();
500 this.RefreshGrading();
501 }
502
503 // Token: 0x06000A8B RID: 2699 RVA: 0x00040990 File Offset: 0x0003EB90
504 public virtual void RefreshWeather()
505 {
506 bool flag;
507 if (!EMono._map.config.indoor)
508 {
509 if (EMono.pc.IsInActiveZone)
510 {
511 Room room = EMono.pc.pos.cell.room;
512 flag = (room != null && room.HasRoof);
513 }
514 else
515 {
516 flag = false;
517 }
518 }
519 else
520 {
521 flag = true;
522 }
523 bool flag2 = flag;
524 Room room2 = EMono.pc.pos.cell.room;
525 bool flag3 = room2 != null && room2.data.atrium;
526 Weather weather = EMono.world.weather;
527 Weather.Condition currentCondition = weather.CurrentCondition;
528 EMono.scene.filterRain.enabled = (!flag2 && weather.IsRaining && EMono.core.config.graphic.enhanceRain);
529 EMono.scene.filterRain.Fade = ((currentCondition == Weather.Condition.RainHeavy) ? 0.4f : 0.3f);
530 EMono.scene.rain.enableEmission = (!flag2 && weather.IsRaining);
531 EMono.scene.rain.emission.rateOverTime = (float)((currentCondition == Weather.Condition.RainHeavy) ? 750 : 200);
532 EMono.scene.snow.enableEmission = (!flag2 && currentCondition == Weather.Condition.Snow);
533 EMono.scene.ether.enableEmission = (!flag2 && weather.IsEther);
534 bool enableEmission = !flag2 && weather.IsBlossom;
535 ParticleSystem[] array = EMono.scene.blossoms;
536 for (int i = 0; i < array.Length; i++)
537 {
538 array[i].enableEmission = enableEmission;
539 }
540 enableEmission = (!flag2 && currentCondition == Weather.Condition.SnowHeavy && EMono.core.config.graphic.blizzard);
541 array = EMono.scene.blizzards;
542 for (int i = 0; i < array.Length; i++)
543 {
544 array[i].enableEmission = enableEmission;
545 }
546 EMono.scene.transBlizzard.localScale = new Vector3(1f, 1f, 1f);
547 bool flag4 = (EMono._map.config.forceGodRay || (EMono.core.config.graphic.godray && !flag2 && (currentCondition == Weather.Condition.Fine || currentCondition == Weather.Condition.Snow))) && !BuildMenu.Instance;
548 EMono.scene.godray.SetActive(flag4, delegate(bool enabled)
549 {
550 if (!enabled)
551 {
552 EMono.scene.godray.Clear();
553 }
554 });
555 EMono.scene.godrayDust.SetActive(flag4 && EMono.world.date.IsNight);
556 EMono.scene.snow.SetActive(true);
557 EMono.scene.rain.SetActive(true);
558 EMono.scene.ether.SetActive(true);
559 EMono.scene.blossom.SetActive(true);
560 float num = (EMono._zone.lv <= -2) ? 0f : ((EMono._zone.lv <= -1) ? 0.3f : ((flag2 && !flag3) ? 0.6f : 1f));
561 EMono.scene.sfxRain.SetVolume(weather.IsRaining ? num : 0f);
562 EMono.scene.sfxSea.SetVolume(EMono._zone.VolumeSea * num);
563 EMono.scene.camSupport.grading.profile.fog = EMono.setting.render.fogs[EMono._map.config.fog];
564 EMono.scene.camSupport.grading.userFog = ((!EMono._map.config.indoor && flag2) ? 0f : 1f);
565 float num2 = (!EMono._map.IsIndoor && EMono.world.weather.IsRaining) ? ((currentCondition == Weather.Condition.RainHeavy) ? -0.08f : -0.04f) : 0f;
566 if (EMono._zone.IsSnowCovered)
567 {
568 num2 += EMono.scene.profile.global.snowBrightness;
569 }
570 this.camSupport.grading.sceneBrightness = num2;
571 EMono.scene.rain.main.prewarm = (EMono.scene.snow.main.prewarm = (EMono.scene.ether.main.prewarm = false));
572 array = EMono.scene.blossoms;
573 for (int i = 0; i < array.Length; i++)
574 {
575 array[i].main.prewarm = false;
576 }
577 this.camSupport.grading.SetGrading();
578 }
579
580 // Token: 0x06000A8C RID: 2700 RVA: 0x00040E54 File Offset: 0x0003F054
581 public void RefreshGrading()
582 {
583 float timeRatio = EMono.core.IsGameStarted ? EMono.scene.timeRatio : 0f;
584 if (this.camSupport.grading.profile.overlay)
585 {
586 this.camSupport.grading.profile.overlay.Refresh(timeRatio, EMono._zone.IsSnowCovered);
587 }
588 ScreenGrading.blind = EMono.pc.isBlind;
589 this.camSupport.grading.profile.sharpen.enable = (EMono.core.config.graphic.sharpen > 0);
590 this.camSupport.grading.profile.sharpen.Strength = Mathf.Clamp(0.1f * (float)EMono.core.config.graphic.sharpen, 0f, (this is GameScreen) ? 10f : 1f);
591 this.camSupport.beautify.sharpen = Mathf.Clamp(0.01f * (float)EMono.core.config.graphic.sharpen2, 0f, (this is GameScreen) ? 10f : 0.5f);
592 this.camSupport.grading.SetGrading();
593 SceneTemplate sceneTemplate = SceneTemplate.Load(EMono._map.config.idSceneTemplate.IsEmpty(EMono._zone.IDSceneTemplate));
594 Color color = EMono._map.config.colorScreen.Get();
595 if (color.a == 0f)
596 {
597 color = sceneTemplate.colorScreen;
598 }
599 this.camSupport.beautify.tintColor = color;
600 color = EMono._map.config.colorSea.Get();
601 MATERIAL.sourceWaterSea.matColor = ((color.a == 0f) ? MATERIAL.sourceWaterSea.GetColor() : color);
602 EMono.core.config.RefreshUIBrightness();
603 float num = 0f;
604 if (!EMono._map.IsIndoor)
605 {
606 num += 0.01f * EMono.core.config.test.brightnessNight * EMono.scene.profile.light.nightRatioCurve.Evaluate(EMono.scene.timeRatio);
607 }
608 this.camSupport.grading.nightBrightness = num;
609 }
610
611 // Token: 0x06000A8D RID: 2701 RVA: 0x000410B8 File Offset: 0x0003F2B8
612 public void RefreshTilt()
613 {
614 this.camSupport.tiltShift.enabled = ((ActionMode.Bird.IsActive || EMono._zone.IsRegion) ? EMono.game.config.tiltRegion : EMono.game.config.tilt);
615 this.camSupport.tiltShift.blurArea = (ActionMode.Bird.IsActive ? 12f : (0.1f * (float)(EMono._zone.IsRegion ? EMono.game.config.tiltPowerRegion : EMono.game.config.tiltPower)));
616 }
617
618 // Token: 0x06000A8E RID: 2702 RVA: 0x00041164 File Offset: 0x0003F364
619 public void ScrollMouse(float x, float y)
620 {
621 this.position.x = this.position.x + x / this.Zoom;
622 this.position.y = this.position.y + y / this.Zoom;
623 if (x > 0.1f || x < -0.1f || y > 0.1f || y < 0.1f)
624 {
625 this.RefreshPosition();
626 }
627 }
628
629 // Token: 0x06000A8F RID: 2703 RVA: 0x000411C8 File Offset: 0x0003F3C8
630 public void ScrollAxis(Vector3 axis, bool direct = false)
631 {
632 if (direct)
633 {
634 this.position += axis;
635 return;
636 }
637 this.position += axis * Core.delta * this.camSpeed2 * EMono.core.config.camera.senseKeyboard / this.Zoom;
638 }
639
640 // Token: 0x06000A90 RID: 2704 RVA: 0x00041236 File Offset: 0x0003F436
641 public void Focus(Int3 ints)
642 {
643 this.position = new Vector3((float)ints.x, (float)ints.y, (float)ints.z);
644 }
645
646 // Token: 0x06000A91 RID: 2705 RVA: 0x00041258 File Offset: 0x0003F458
647 public void Focus(int x, int y)
648 {
649 if (EMono.AdvMode)
650 {
651 SE.Beep();
652 return;
653 }
654 this.scrollX = x;
655 this.position.x = (float)x;
656 this.scrollY = y;
657 this.position.y = (float)y;
658 }
659
660 // Token: 0x06000A92 RID: 2706 RVA: 0x0004129E File Offset: 0x0003F49E
661 public void Focus(Card c)
662 {
663 if (c == null)
664 {
665 return;
666 }
667 this.Focus(c.GetRootCard().pos);
668 }
669
670 // Token: 0x06000A93 RID: 2707 RVA: 0x000412B8 File Offset: 0x0003F4B8
671 public void FocusCenter()
672 {
673 Point pos = new Point(EMono._map.Size / 2, EMono._map.Size / 2);
674 this.Focus(pos);
675 }
676
677 // Token: 0x06000A94 RID: 2708 RVA: 0x000412EA File Offset: 0x0003F4EA
678 public unsafe void Focus(Point pos)
679 {
680 this.position = *pos.PositionCenter();
681 }
682
683 // Token: 0x06000A95 RID: 2709 RVA: 0x00041300 File Offset: 0x0003F500
684 public void FocusPC()
685 {
686 this.focusPos = null;
687 this.Focus((EMono.pc.currentZone == EMono.game.activeZone) ? EMono.pc.pos : EMono._map.bounds.GetCenterPos());
688 this.instantFocus = true;
689 this.RefreshPosition();
690 }
691
692 // Token: 0x06000A96 RID: 2710 RVA: 0x0004135D File Offset: 0x0003F55D
693 public void FocusImmediate(Point pos)
694 {
695 this.focusPos = null;
696 this.Focus(pos);
697 this.instantFocus = true;
698 this.RefreshPosition();
699 this.RefreshPosition();
700 }
701
702 // Token: 0x06000A97 RID: 2711 RVA: 0x00041388 File Offset: 0x0003F588
703 public void SnapScreen(ref Vector3 v, float zoom)
704 {
705 float num = this.snapSize.x / zoom;
706 float num2 = this.snapSize.y / zoom;
707 switch (EMono.core.config.fix.snapType)
708 {
709 case CoreConfig.ScreenSnapType.Default:
710 v.x = num * (float)Mathf.RoundToInt(v.x / num);
711 v.y = num2 * (float)Mathf.RoundToInt(v.y / num2);
712 return;
713 case CoreConfig.ScreenSnapType.Floor:
714 v.x = num * (float)Mathf.FloorToInt(v.x / num);
715 v.y = num2 * (float)Mathf.FloorToInt(v.y / num2);
716 return;
717 case CoreConfig.ScreenSnapType.Ceil:
718 v.x = num * (float)Mathf.CeilToInt(v.x / num);
719 v.y = num2 * (float)Mathf.CeilToInt(v.y / num2);
720 return;
721 case CoreConfig.ScreenSnapType.Hack3:
722 num = this.snapSize.x;
723 num2 = this.snapSize.y;
724 v.x = num * (float)Mathf.RoundToInt(v.x / num);
725 v.y = num2 * (float)Mathf.RoundToInt(v.y / num2);
726 return;
727 case CoreConfig.ScreenSnapType.Hack4:
728 num = this.snapSize.x;
729 num2 = this.snapSize.y;
730 v.x = num * (float)Mathf.FloorToInt(v.x / num);
731 v.y = num2 * (float)Mathf.FloorToInt(v.y / num2);
732 return;
733 case CoreConfig.ScreenSnapType.Hack5:
734 num = this.snapSize.x;
735 num2 = this.snapSize.y;
736 v.x = num * (float)Mathf.CeilToInt(v.x / num);
737 v.y = num2 * (float)Mathf.CeilToInt(v.y / num2);
738 return;
739 case CoreConfig.ScreenSnapType.Hack6:
740 v.x = 0.01f * (float)Mathf.FloorToInt(v.x * 100f) + 0.001f;
741 v.y = 0.01f * (float)Mathf.FloorToInt(v.y * 100f) + 0.001f;
742 return;
743 case CoreConfig.ScreenSnapType.Hack7:
744 v.x = 0.01f * (float)Mathf.FloorToInt(v.x * 100f) - 0.001f;
745 v.y = 0.01f * (float)Mathf.FloorToInt(v.y * 100f) - 0.001f;
746 return;
747 case CoreConfig.ScreenSnapType.Hack8:
748 v.x = 0.01f * (float)Mathf.RoundToInt(v.x * 100f) + 0.005f;
749 v.y = 0.01f * (float)Mathf.RoundToInt(v.y * 100f) + 0.005f;
750 return;
751 case CoreConfig.ScreenSnapType.Hack9:
752 v.x = 0.01f * (float)Mathf.RoundToInt(v.x * 100f) + 0.025f;
753 v.y = 0.01f * (float)Mathf.RoundToInt(v.y * 100f) + 0.025f;
754 return;
755 default:
756 return;
757 }
758 }
759
760 // Token: 0x06000A98 RID: 2712 RVA: 0x00041670 File Offset: 0x0003F870
761 public void SetZoom(float z)
762 {
763 this.Zoom = z;
764 this.targetZoom = z;
765 EMono.core.config.ApplyZoom(this.targetZoom);
766 this.zoomTimer = 0f;
767 }
768
769 // Token: 0x06000A99 RID: 2713 RVA: 0x000416B0 File Offset: 0x0003F8B0
770 public void SetTargetZoomIndex(int index)
771 {
772 this.targetZoomIndex = index;
773 float num = this.targetZoom;
774 this.targetZoom = EMono.core.config.camera.zooms[this.targetZoomIndex];
775 if (num != this.targetZoom)
776 {
777 this.zoomTimer = 0f;
778 }
779 }
780
781 // Token: 0x06000A9A RID: 2714 RVA: 0x00041700 File Offset: 0x0003F900
782 public void ModTargetZoomIndex(int a)
783 {
784 if (EMono.scene.elomapActor.IsActive)
785 {
786 return;
787 }
788 int num = this.targetZoomIndex;
789 this.targetZoomIndex -= a;
790 int num2 = EMono.core.config.camera.extendZoomMin ? 0 : 1;
791 int num3 = EMono.core.config.camera.extendZoomMax ? 4 : 3;
792 if (this.targetZoomIndex < num2)
793 {
794 this.targetZoomIndex = num2;
795 }
796 else if (this.targetZoomIndex >= num3)
797 {
798 this.targetZoomIndex = num3;
799 }
800 if (this.targetZoomIndex > num && EInput.buttonScroll != null && !EInput.buttonScroll.pressing)
801 {
802 this.zoomPos = EInput.mposWorld;
803 }
804 this.SetTargetZoomIndex(this.targetZoomIndex);
805 }
806
807 // Token: 0x04000937 RID: 2359
808 private readonly int _BackDrawPower = Shader.PropertyToID("_BackDrawPower");
809
810 // Token: 0x04000938 RID: 2360
811 private readonly int _Snow = Shader.PropertyToID("_Snow");
812
813 // Token: 0x04000939 RID: 2361
814 private readonly int _SkyLevel = Shader.PropertyToID("_SkyLevel");
815
816 // Token: 0x0400093A RID: 2362
817 private readonly int _NightRate = Shader.PropertyToID("_NightRate");
818
819 // Token: 0x0400093B RID: 2363
820 private readonly int _ViewHeight = Shader.PropertyToID("_ViewHeight");
821
822 // Token: 0x0400093C RID: 2364
823 private readonly int _FogStrength = Shader.PropertyToID("_FogStrength");
824
825 // Token: 0x0400093D RID: 2365
826 private readonly int _FogColor = Shader.PropertyToID("_FogColor");
827
828 // Token: 0x0400093E RID: 2366
829 private readonly int _FowColor = Shader.PropertyToID("_FowColor");
830
831 // Token: 0x0400093F RID: 2367
832 private readonly int _SunColor = Shader.PropertyToID("_SunColor");
833
834 // Token: 0x04000940 RID: 2368
835 private readonly int _SeaColor = Shader.PropertyToID("_SeaColor");
836
837 // Token: 0x04000941 RID: 2369
838 private readonly int _SkyColor = Shader.PropertyToID("_SkyColor");
839
840 // Token: 0x04000942 RID: 2370
841 private readonly int _SkyBGColor = Shader.PropertyToID("_SkyBGColor");
842
843 // Token: 0x04000943 RID: 2371
844 private readonly int _Offset = Shader.PropertyToID("_Offset");
845
846 // Token: 0x04000944 RID: 2372
847 private readonly int _Zoom = Shader.PropertyToID("_Zoom");
848
849 // Token: 0x04000945 RID: 2373
850 private readonly int _LightPower = Shader.PropertyToID("_LightPower");
851
852 // Token: 0x04000946 RID: 2374
853 private readonly int _AnimeSpeedGlobal = Shader.PropertyToID("_AnimeSpeedGlobal");
854
855 // Token: 0x04000947 RID: 2375
856 private readonly int _ScreenFlash = Shader.PropertyToID("_ScreenFlash");
857
858 // Token: 0x04000948 RID: 2376
859 public float SharpenAmount;
860
861 // Token: 0x04000949 RID: 2377
862 public float camSpeed2;
863
864 // Token: 0x0400094A RID: 2378
865 public float heightLight;
866
867 // Token: 0x0400094B RID: 2379
868 public float pushbackSpeed;
869
870 // Token: 0x0400094C RID: 2380
871 public Vector2 snapSize;
872
873 // Token: 0x0400094D RID: 2381
874 public Vector2 tileSize;
875
876 // Token: 0x0400094E RID: 2382
877 public Vector2 tileAlign;
878
879 // Token: 0x0400094F RID: 2383
880 public Vector2 tileWorldSize;
881
882 // Token: 0x04000950 RID: 2384
883 public Vector2 tileViewSize;
884
885 // Token: 0x04000951 RID: 2385
886 public Vector3 tileWeight;
887
888 // Token: 0x04000952 RID: 2386
889 public Vector3 focusFix;
890
891 // Token: 0x04000953 RID: 2387
892 public Vector3 tileOffsetHeight;
893
894 // Token: 0x04000954 RID: 2388
895 public Vector3 tileWeightHeight;
896
897 // Token: 0x04000955 RID: 2389
898 public Vector3 planeAngle;
899
900 // Token: 0x04000956 RID: 2390
901 public Vector3 planeSpeed;
902
903 // Token: 0x04000957 RID: 2391
904 public Vector2 paddings;
905
906 // Token: 0x04000958 RID: 2392
907 public Vector2 paddingOffset;
908
909 // Token: 0x04000959 RID: 2393
910 public Vector3 lastPos;
911
912 // Token: 0x0400095A RID: 2394
913 public Rect mapLimit;
914
915 // Token: 0x0400095B RID: 2395
916 [Space]
917 public float Zoom;
918
919 // Token: 0x0400095C RID: 2396
920 [Space]
921 public float nextMove;
922
923 // Token: 0x0400095D RID: 2397
924 [Space]
925 public float focusSpeed;
926
927 // Token: 0x0400095E RID: 2398
928 [Space]
929 public float focusSpeedSlow;
930
931 // Token: 0x0400095F RID: 2399
932 [Space]
933 public float focusSpeedSlow2;
934
935 // Token: 0x04000960 RID: 2400
936 public int width;
937
938 // Token: 0x04000961 RID: 2401
939 public int height;
940
941 // Token: 0x04000962 RID: 2402
942 public int scrollX;
943
944 // Token: 0x04000963 RID: 2403
945 public int scrollY;
946
947 // Token: 0x04000964 RID: 2404
948 public int moonLevel;
949
950 // Token: 0x04000965 RID: 2405
951 public BaseTileMap tileMap;
952
953 // Token: 0x04000966 RID: 2406
954 public BaseTileSelector tileSelector;
955
956 // Token: 0x04000967 RID: 2407
957 public ScreenGuide guide;
958
959 // Token: 0x04000968 RID: 2408
960 public Grid grid;
961
962 // Token: 0x04000969 RID: 2409
963 public MeshRenderer overlayShadow;
964
965 // Token: 0x0400096A RID: 2410
966 public PCOrbit pcOrbit;
967
968 // Token: 0x0400096B RID: 2411
969 [NonSerialized]
970 public float forcePrecision;
971
972 // Token: 0x0400096C RID: 2412
973 [NonSerialized]
974 public bool isCameraMoving;
975
976 // Token: 0x0400096D RID: 2413
977 [NonSerialized]
978 public BaseGameScreen.FocusOption focusOption;
979
980 // Token: 0x0400096E RID: 2414
981 [NonSerialized]
982 public Vector3? focusPos;
983
984 // Token: 0x0400096F RID: 2415
985 [NonSerialized]
986 public Vector3 position;
987
988 // Token: 0x04000970 RID: 2416
989 protected Vector3 camPos;
990
991 // Token: 0x04000971 RID: 2417
992 protected Vector3 pushBack;
993
994 // Token: 0x04000972 RID: 2418
995 public float screenFixX;
996
997 // Token: 0x04000973 RID: 2419
998 public float screenFixX2;
999
1000 // Token: 0x04000974 RID: 2420
1001 public float screenFixX3;
1002
1003 // Token: 0x04000975 RID: 2421
1004 public float screenFixX4;
1005
1006 // Token: 0x04000976 RID: 2422
1007 public float screenFixY;
1008
1009 // Token: 0x04000977 RID: 2423
1010 public float screenFixY2;
1011
1012 // Token: 0x04000978 RID: 2424
1013 public float screenFixY3;
1014
1015 // Token: 0x04000979 RID: 2425
1016 public float screenFixY4;
1017
1018 // Token: 0x0400097A RID: 2426
1019 private Vector3 _camPos;
1020
1021 // Token: 0x0400097B RID: 2427
1022 private Point _randomPoint = new Point();
1023
1024 // Token: 0x0400097C RID: 2428
1025 [NonSerialized]
1026 public bool instantFocus;
1027
1028 // Token: 0x0400097D RID: 2429
1029 public int targetZoomIndex;
1030
1031 // Token: 0x0400097E RID: 2430
1032 public float targetZoom = 0.5f;
1033
1034 // Token: 0x0400097F RID: 2431
1035 public float zoomTimer;
1036
1037 // Token: 0x04000980 RID: 2432
1038 public Vector3 zoomPos;
1039
1040 // Token: 0x0200087A RID: 2170
1041 public class FocusOption
1042 {
1043 // Token: 0x0400243A RID: 9274
1044 public Point pos;
1045
1046 // Token: 0x0400243B RID: 9275
1047 public float speed = 2f;
1048
1049 // Token: 0x0400243C RID: 9276
1050 public bool linear = true;
1051
1052 // Token: 0x0400243D RID: 9277
1053 public bool player;
1054 }
1055}
Definition Card.cs:13
Definition EMono.cs:6
Definition Int3.cs:5
Definition Point.cs:11
Definition Room.cs:6
Definition Scene.cs:10