Elin Modding Docs Doc
Loading...
Searching...
No Matches
Scene.cs
1using System;
2using System.Collections.Generic;
3using System.Runtime.CompilerServices;
4using CreativeSpore.SuperTilemapEditor;
5using UnityEngine;
6using UnityEngine.UI;
7
8// Token: 0x020001A5 RID: 421
9public class Scene : EMono
10{
11 // Token: 0x170002F2 RID: 754
12 // (get) Token: 0x06000BFF RID: 3071 RVA: 0x0004AA15 File Offset: 0x00048C15
13 public EloMap elomap
14 {
15 get
16 {
17 return this.elomapActor.GetEloMap();
18 }
19 }
20
21 // Token: 0x06000C00 RID: 3072 RVA: 0x0004AA22 File Offset: 0x00048C22
22 private void Awake()
23 {
24 base.InvokeRepeating("RefreshActorEx", 0.5f, 0.5f);
25 }
26
27 // Token: 0x06000C01 RID: 3073 RVA: 0x0004AA3C File Offset: 0x00048C3C
28 public void Init(Scene.Mode newMode)
29 {
30 Debug.Log("Scene.Init:" + newMode.ToString());
31 EMono.ui.RemoveLayers(false);
32 BuildMenu.Deactivate();
33 ScreenFlash.Reset();
34 this.mode = newMode;
35 switch (newMode)
36 {
37 case Scene.Mode.None:
38 if (EMono.game != null)
39 {
40 EMono.game.Kill();
41 }
42 EMono.ui.RemoveLayers(false);
43 this.screenNoMap.Activate();
44 break;
45 case Scene.Mode.Title:
46 SoundManager.bgmVolumeMod = (SoundManager.bgmDumpMod = 0f);
47 if (EMono.game != null)
48 {
49 EMono.game.Kill();
50 }
51 EMono.ui.AddLayer<LayerTitle>();
52 if (!Scene.isAnnounced)
53 {
54 Scene.isAnnounced = true;
55 EMono.ui.AddLayer("LayerAnnounce");
56 }
57 ActionMode.Title.Activate(true, false);
58 this.screenNoMap.Activate();
59 break;
60 case Scene.Mode.StartGame:
61 EMono.ui.RemoveLayer<LayerTitle>();
62 EMono.ui.ShowCover(0f, 1f, null, default(Color));
63 this.Init(Scene.Mode.Zone);
64 break;
65 case Scene.Mode.Zone:
66 UIBook.str_pc = EMono.pc.NameSimple;
67 if (EMono.player.zone == null)
68 {
69 EMono.player.zone = (EMono.pc.currentZone = EMono.pc.homeZone);
70 }
71 EMono.core.config.game.ignoreWarnCrime = (EMono.core.config.game.ignoreWarnMana = (EMono.core.config.game.ignoreWarnDisassemble = false));
72 EMono.game.updater.Reset();
73 CellDetail.count = 0;
74 Scene.skipAnime = true;
75 EMono.player.baseActTime = EMono.setting.defaultActPace;
76 EMono.player.Agent.renderer.isSynced = true;
77 EMono.player.Agent.currentZone = EMono.player.zone;
78 Point._screen = (EMono.player.zone.IsRegion ? this.screenElona : this.screenElin);
79 EMono.player.zone.Activate();
80 EMono.player.RefreshEmptyAlly();
81 this.UpdateTimeRatio();
82 EMono.world.weather.RefreshWeather();
83 EMono.screen.Deactivate();
84 Popper.scale = (EMono._zone.IsRegion ? new Vector3(1.7f, 1.7f, 1f) : Vector3.one);
85 if (!EMono.pc.IsInActiveZone)
86 {
87 ActionMode.View.Activate(true, false);
88 }
89 else if (EMono.player.zone is Region)
90 {
91 ActionMode.Region.Activate(true, false);
92 }
93 else
94 {
95 ActionMode.Adv.Activate(true, false);
96 }
97 if (EMono.game.altCraft)
98 {
99 if (EMono._zone.IsRegion)
100 {
101 if (EMono.ui.layerFloat.GetLayer<LayerCraftFloat>(false))
102 {
103 EMono.ui.layerFloat.RemoveLayer<LayerCraftFloat>();
104 }
105 }
106 else if (!EMono.ui.layerFloat.GetLayer<LayerCraftFloat>(false))
107 {
108 EMono.ui.layerFloat.AddLayer<LayerCraftFloat>();
109 }
110 }
111 EMono.screen.tileMap.activeCount = 0;
112 EMono.screen.SetZoom(EMono.screen.TargetZoom);
113 EMono.player.RefreshCurrentHotItem();
114 EMono.screen.FocusPC();
115 EMono.game.updater.recipe.Build(EMono.pc.pos, RecipeUpdater.Mode.Passive);
116 WidgetDate.Refresh();
117 WidgetMenuPanel.OnChangeMode();
118 EMono.player.hotbars.ResetHotbar(2);
119 if (EMono.ui.hud.imageCover.gameObject.activeSelf && !EMono.player.simulatingZone)
120 {
121 EMono.ui.HideCover(4f, null);
122 }
123 if (!EMono.core.debug.ignoreAutoSave && EMono.core.config.game.autoSave && EMono.game.countLoadedMaps > 3 && !EMono.player.simulatingZone)
124 {
125 EMono.game.Save(false, null, false);
126 }
127 foreach (Thing thing in EMono._map.things)
128 {
129 if (thing.IsInstalled)
130 {
131 thing.trait.TryToggle();
132 }
133 }
134 EMono.core.config.ApplyGrading();
135 if (EMono.player.onStartZone != null)
136 {
137 EMono.player.onStartZone();
138 EMono.player.onStartZone = null;
139 }
140 if (ActionMode.Adv.IsActive && (EInput.leftMouse.pressing || EInput.axis != Vector2.zero))
141 {
142 ActionMode.Adv.SetPressedAction(EInput.leftMouse);
143 ActionMode.Adv.RefreshArrow();
144 ActionMode.Adv.SetManualMove();
145 }
146 if (EMono.pc.IsAliveInCurrentZone)
147 {
148 EMono.pc.RecalculateFOV();
149 }
150 EMono.player.flags.OnEnterZone();
151 this.flock.SetSpawnType(EMono._zone.FlockType);
152 if (!EMono.player.simulatingZone)
153 {
154 if (EMono._zone == EMono.pc.homeZone)
155 {
156 EMono.pc.faith.Revelation("welcome", 100);
157 }
158 if (EMono._zone.Boss != null && EMono._zone.Boss.ExistsOnMap)
159 {
160 Msg.Say("beware", EMono._zone.Name, EMono._zone.Boss.NameBraced, null, null);
161 }
162 EMono.game.quests.OnEnterZone();
163 }
164 EInput.keyWait.Consume();
165 if (EMono.player.questTracker && !EMono.ui.widgets.GetWidget("QuestTracker"))
166 {
167 EMono.ui.widgets.Activate("QuestTracker");
168 }
169 break;
170 }
171 this.etherBlossom.SetActive(this.mode == Scene.Mode.Zone && EMono._zone is Zone_WindRest);
172 }
173
174 // Token: 0x06000C02 RID: 3074 RVA: 0x0004B06C File Offset: 0x0004926C
175 public void OnKillGame()
176 {
177 this.actionMode.Deactivate();
178 this.mouseTarget.Clear();
179 this.hideBalloon = false;
180 this.actionMode = null;
181 PCC.PurgeCache();
182 this.Clear();
183 this.flock.Reset();
184 this.elomapActor.OnKillGame();
185 }
186
187 // Token: 0x06000C03 RID: 3075 RVA: 0x0004B0C0 File Offset: 0x000492C0
188 public void Clear()
189 {
190 foreach (ISyncScreen syncScreen in this.syncList)
191 {
192 syncScreen.OnLeaveScreen();
193 }
194 this.syncList.Clear();
195 EffectManager.Instance.KillAll();
196 this.ClearActorEx();
197 this.DestroyPrefabs();
198 }
199
200 // Token: 0x06000C04 RID: 3076 RVA: 0x0004B134 File Offset: 0x00049334
201 public unsafe void OnUpdate()
202 {
203 SoundManager.speed = (EMono.core.IsGameStarted ? Mathf.Clamp(this.actionMode.gameSpeed * 0.75f, 1f, 2f) : 1f);
204 UIButton.UpdateButtons();
205 EMono.ui.RefreshActiveState();
206 bool isShiftDown = EInput.isShiftDown;
207 if (UIDropdown.activeInstance)
208 {
209 EInput.UpdateOnlyAxis();
210 }
211 else
212 {
213 EInput.Update();
214 }
215 CoreConfig.InputSetting input = EMono.core.config.input;
216 if (EInput.middleMouse.pressing)
217 {
218 if (input.middleClick == CoreConfig.GameFunc.EmuShift || input.middlePressLong == CoreConfig.GameFunc.EmuShift)
219 {
220 EInput.isShiftDown = true;
221 }
222 if (input.middleClick == CoreConfig.GameFunc.EmuAlt || input.middlePressLong == CoreConfig.GameFunc.EmuAlt)
223 {
224 EInput.isAltDown = true;
225 }
226 }
227 if (EInput.mouse3.pressing)
228 {
229 if (input.mouse3Click == CoreConfig.GameFunc.EmuShift || input.mouse3PressLong == CoreConfig.GameFunc.EmuShift)
230 {
231 EInput.isShiftDown = true;
232 }
233 if (input.mouse3Click == CoreConfig.GameFunc.EmuAlt || input.mouse3PressLong == CoreConfig.GameFunc.EmuAlt)
234 {
235 EInput.isAltDown = true;
236 }
237 }
238 if (EInput.mouse4.pressing)
239 {
240 if (input.mouse4Click == CoreConfig.GameFunc.EmuShift || input.mouse4PressLong == CoreConfig.GameFunc.EmuShift)
241 {
242 EInput.isShiftDown = true;
243 }
244 if (input.mouse4Click == CoreConfig.GameFunc.EmuAlt || input.mouse4PressLong == CoreConfig.GameFunc.EmuAlt)
245 {
246 EInput.isAltDown = true;
247 }
248 }
249 EInput.hasShiftChanged = (EInput.isShiftDown != isShiftDown);
250 Layer.cancelKeyDown = EInput.isCancel;
251 Layer.rightClicked = EInput.rightMouse.down;
252 int num = EInput.wheel;
253 if (num != 0)
254 {
255 if (EMono.ui.isPointerOverUI)
256 {
257 UIDropdown uidropdown = InputModuleEX.GetComponentOf<UIDropdown>();
258 if (EMono.ui.GetLayer<LayerConfig>(false) && !EMono.debug.enable)
259 {
260 uidropdown = null;
261 }
262 if (uidropdown && !UIDropdown.activeInstance)
263 {
264 if (num < 0)
265 {
266 uidropdown.Next();
267 }
268 else if (num > 0)
269 {
270 uidropdown.Prev();
271 }
272 num = (EInput.wheel = 0);
273 }
274 if (!DropdownGrid.IsActive)
275 {
276 DropdownGrid componentOf = InputModuleEX.GetComponentOf<DropdownGrid>();
277 if (componentOf)
278 {
279 if (num < 0)
280 {
281 componentOf.Next();
282 }
283 else if (num > 0)
284 {
285 componentOf.Prev();
286 }
287 num = (EInput.wheel = 0);
288 }
289 }
290 if (EMono.ui.contextMenu.isActive)
291 {
292 Slider componentOf2 = InputModuleEX.GetComponentOf<Slider>();
293 if (componentOf2)
294 {
295 componentOf2.value += (componentOf2.wholeNumbers ? ((float)num) : (0.1f * (float)num));
296 num = (EInput.wheel = 0);
297 SE.Tab();
298 }
299 }
300 UIScrollView componentOf3 = InputModuleEX.GetComponentOf<UIScrollView>();
301 if (componentOf3)
302 {
303 num = (EInput.wheel = 0);
304 if (componentOf3.verticalScrollbar.isActiveAndEnabled)
305 {
306 EMono.ui.HideMouseHint(0.2f);
307 }
308 }
309 UIButton componentOf4 = InputModuleEX.GetComponentOf<UIButton>();
310 if (componentOf4 && componentOf4.onInputWheel != null)
311 {
312 componentOf4.onInputWheel(num);
313 num = (EInput.wheel = 0);
314 }
315 }
316 if (num != 0)
317 {
318 Layer layer = EMono.ui.IsActive ? EMono.ui.GetTopLayer() : LayerAbility.Instance;
319 if (layer != null && layer.windows.Count > 0)
320 {
321 Window window = layer.windows[0];
322 if (InputModuleEX.IsPointerChildOf(window.rectTab) && !DropdownGrid.IsActive && window.NextTab(num))
323 {
324 EInput.wheel = 0;
325 }
326 }
327 }
328 }
329 if ((EInput.leftMouse.down || EInput.rightMouse.down) && WidgetMainText.Instance && WidgetMainText.Instance.box.isShowingLog && !InputModuleEX.IsPointerChildOf(WidgetMainText.Instance))
330 {
331 WidgetMainText.Instance._ToggleLog();
332 EInput.Consume(false, 1);
333 }
334 Scene.Mode mode = this.mode;
335 if (mode != Scene.Mode.Title)
336 {
337 if (mode != Scene.Mode.Zone)
338 {
339 this.UpdateCursor();
340 EMono.ui.UpdateInput();
341 }
342 else
343 {
344 if (EMono._zone.dirtyElectricity)
345 {
346 EMono._zone.RefreshElectricity();
347 }
348 if (EMono.player.target != null && EMono.player.target.isSynced)
349 {
350 this.srTarget.enabled = true;
351 Vector3 position = *EMono.player.target.pos.PositionCenter();
352 position.y += EMono.player.target.renderer.data.size.y;
353 position.z -= 10f;
354 this.srTarget.transform.parent.position = position;
355 }
356 else
357 {
358 this.srTarget.enabled = false;
359 }
360 EMono.player.pickupDelay -= Core.delta;
361 if (EMono.player.pickupDelay < 0f)
362 {
363 EMono.player.pickupDelay = 0f;
364 }
365 this.actionMode.OnBeforeUpdate();
366 this.paused = (EMono.ui.IsPauseGame || this.actionMode.ShouldPauseGame || Game.IsWaiting);
367 EMono.player.RefreshEmptyAlly();
368 if (!EMono.pc.isDead)
369 {
370 if (AI_PlayMusic.keepPlaying && EInput.skipFrame <= 0 && Input.anyKeyDown)
371 {
372 AI_PlayMusic.CancelKeepPlaying();
373 }
374 this.actionMode.UpdateInput();
375 }
376 else
377 {
378 EMono.ui.UpdateInput();
379 }
380 if (EMono.pc.currentZone != EMono.game.activeZone && EMono.pc.global.transition != null)
381 {
382 EMono.player.flags.OnLeaveZone();
383 if (!LayerDrama.IsActive())
384 {
385 EMono.player.MoveZone(EMono.pc.currentZone);
386 }
387 }
388 if (EMono.pc.isDead && !EMono.player.deathDialog)
389 {
390 EMono.player.deathDialog = true;
391 EMono.player.returnInfo = null;
392 Msg.Say("diebye");
393 EMono.Sound.Play("dead_pc2");
394 EMono.Sound.Play("dead_pc");
395 string[] list = Lang.GetList("lastWords");
396 string lastWord = list.RandomItem<string>();
397 EMono.ui.CloseLayers();
398 Dialog.InputName("dialogLastword", lastWord, delegate(bool cancel, string text)
399 {
400 if (!cancel)
401 {
402 lastWord = text;
403 }
404 Player player = EMono.player;
405 player.deathMsg = player.deathMsg + Lang.space + lastWord.Bracket(1);
406 if (EMono.core.config.net.enable && EMono.core.config.net.sendEvent)
407 {
408 Net.SendChat(EMono.pc.NameTitled, EMono.player.deathMsg, ChatCategory.Dead, Lang.langCode);
409 }
410 Debug.Log(lastWord);
411 Msg.SetColor(Msg.colors.Talk);
412 Msg.Say(lastWord.Bracket(1));
413 List<string> list2 = new List<string>();
414 Zone lastTown = EMono.game.spatials.Find(EMono.player.uidLastTown);
415 bool addTownRevive = lastTown != null && !EMono._zone.IsInstance;
416 if (EMono.game.Difficulty.allowRevive)
417 {
418 if (addTownRevive)
419 {
420 list2.Add("pc_revive_town".lang(lastTown.Name, null, null, null, null));
421 }
422 list2.Add("pc_revive");
423 list2.Add("pc_gameover");
424 }
425 else
426 {
427 list2.Add("pc_gameover");
428 }
429 Debug.Log(list2.Count);
430 Func<int, string, bool> <>9__3;
431 EMono.ui.AddLayer<LayerCover>().SetDuration(1f, delegate
432 {
433 EMono.ui.CloseLayers();
434 string langDetail = "pc_deathChoice".lang();
435 ICollection<string> list2 = list2;
436 Func<string, string> getString = (string j) => j;
437 Func<int, string, bool> onSelect;
438 if ((onSelect = <>9__3) == null)
439 {
440 onSelect = (<>9__3 = delegate(int c, string d)
441 {
442 EMono.player.deathDialog = false;
443 if (EMono.game.Difficulty.allowRevive && (c == 0 || (addTownRevive && c == 1)))
444 {
445 EMono.pc.MakeGrave(lastWord);
446 EMono.pc.Revive(null, false);
447 EMono.pc.RecalculateFOV();
448 Zone zone = EMono.player.spawnZone ?? EMono.pc.homeZone;
449 if (addTownRevive && c == 0)
450 {
451 zone = lastTown;
452 }
453 if (EMono.game.activeZone == zone)
454 {
455 EMono.pc.Teleport(EMono._zone.GetSpawnPos(EMono.pc, ZoneTransition.EnterState.Return), true, true);
456 }
457 else
458 {
459 EMono.player.deathZoneMove = true;
460 EMono.pc.MoveZone(zone, ZoneTransition.EnterState.Return);
461 }
462 EMono.screen.FocusPC();
463 Msg.Say("crawlup");
464 if (EMono.player.stats.death == 0)
465 {
466 Tutorial.Reserve("death", null);
467 }
468 EMono.player.stats.death++;
469 }
470 else
471 {
472 string id = Game.id;
473 bool deleteGameOnDeath = EMono.game.Difficulty.deleteGameOnDeath;
474 EMono.game.GotoTitle(false);
475 if (deleteGameOnDeath)
476 {
477 GameIO.DeleteGame(id);
478 }
479 }
480 return true;
481 });
482 }
483 Dialog.List<string>(langDetail, list2, getString, onSelect, false);
484 });
485 }, Dialog.InputType.Default);
486 }
487 this.UpdateCursor();
488 this.UpdateTimeRatio();
489 EMono.Sound.UpdateBGM();
490 EMono.game.updater.Update();
491 if (WidgetHotbar.dirtyCurrentItem)
492 {
493 EMono.player.RefreshCurrentHotItem();
494 }
495 if (WidgetEquip.dirty)
496 {
497 WidgetEquip.Redraw();
498 }
499 if (EMono.player.wasDirtyWeight)
500 {
501 foreach (Chara chara in EMono.pc.party.members)
502 {
503 chara.CalcBurden();
504 }
505 EMono.player.wasDirtyWeight = false;
506 }
507 if (!EMono.ui.IsActive)
508 {
509 EMono.core.screen.tileSelector.OnUpdate();
510 }
511 else if (EMono.ui.mouseInfo.gameObject.activeSelf)
512 {
513 EMono.ui.mouseInfo.SetText("");
514 }
515 EMono.screen.Draw();
516 this.actionMode.OnAfterUpdate();
517 if (EMono.player.lastTransition != null && !EMono.player.simulatingZone)
518 {
519 if (!EMono.ui.GetLayer<LayerDrama>(false))
520 {
521 ZoneTransition.EnterState state = EMono.player.lastTransition.state;
522 if (state != ZoneTransition.EnterState.Encounter)
523 {
524 switch (state)
525 {
526 case ZoneTransition.EnterState.PortalReturn:
527 case ZoneTransition.EnterState.Return:
528 case ZoneTransition.EnterState.Teleport:
529 case ZoneTransition.EnterState.Moongate:
530 EMono.pc.PlayEffect("teleport", true, 0f, default(Vector3));
531 EMono.pc.PlaySound("return", 1f, true);
532 goto IL_87E;
533 case ZoneTransition.EnterState.Elevator:
534 EMono.pc.PlaySound("elevator", 1f, true);
535 goto IL_87E;
536 case ZoneTransition.EnterState.Fall:
537 EMono.pc.PlaySound("fall", 1f, true);
538 EMono.pc.PlayAnime(AnimeID.FallSky, false);
539 EMono.pc.DamageHP((20 + EMono.rnd(30) + ((EMono.player.lastTransition.lastZone is Zone_Casino) ? 1000 : 0)) / (EMono.pc.isLevitating ? 10 : 1), AttackSource.Fall, null);
540 goto IL_87E;
541 }
542 SE.MoveZone();
543 }
544 }
545 IL_87E:
546 if ((EMono.rnd(5) == 0 && EMono.pc.burden.GetPhase() >= 3) || EMono.pc.burden.GetPhase() >= 4)
547 {
548 EMono.pc.Stumble(100);
549 }
550 EMono.player.lastTransition = null;
551 return;
552 }
553 }
554 return;
555 }
556 if (EMono.scene.elomapActor.IsActive)
557 {
558 this.timeRatio = 0f;
559 EMono.screen.UpdateShaders(0f);
560 }
561 this.godray.SetActive(false);
562 this.UpdateCursor();
563 EMono.ui.UpdateInput();
564 }
565
566 // Token: 0x06000C05 RID: 3077 RVA: 0x0004BA2C File Offset: 0x00049C2C
567 public void OnLateUpdate()
568 {
569 this.DrawPass();
570 CursorSystem.Instance.Draw();
571 }
572
573 // Token: 0x06000C06 RID: 3078 RVA: 0x0004BA40 File Offset: 0x00049C40
574 public void UpdateCursor()
575 {
576 CursorSystem.position = EInput.mposWorld;
577 CursorSystem.position.z = -100f;
578 if (EMono.core.IsGameStarted)
579 {
580 CursorSystem.posOrigin = EMono.screen.position.SetZ(-100f);
581 this.actionMode.OnUpdateCursor();
582 return;
583 }
584 CursorSystem.SetCursor(null, 0);
585 }
586
587 // Token: 0x06000C07 RID: 3079 RVA: 0x0004BAA0 File Offset: 0x00049CA0
588 public void UpdateTimeRatio()
589 {
590 float num = (EMono._map.config.hour != -1) ? ((float)EMono._map.config.hour) : ((float)EMono.world.date.hour + (float)EMono.world.date.min / 60f);
591 if (num > 12f)
592 {
593 num = 24f - num;
594 }
595 this.timeRatio = Mathf.Clamp(num * 100f / 24f * 0.01f + EMono.setting.dayRatioMod, 0f, 1f);
596 }
597
598 // Token: 0x06000C08 RID: 3080 RVA: 0x0004BB3C File Offset: 0x00049D3C
599 public void OnChangeHour()
600 {
601 this.UpdateTimeRatio();
602 this.firefly.OnChangeHour();
603 this.fireflyNight.OnChangeHour();
604 this.star.OnChangeHour();
605 if (EMono.screen.pcOrbit)
606 {
607 EMono.screen.pcOrbit.OnChangeMin();
608 }
609 EMono.screen.RefreshSky();
610 EMono.screen.OnChangeHour();
611 foreach (Transform transform in EMono.ui.rectDynamic.GetComponentsInDirectChildren(true))
612 {
613 if (transform.gameObject.tag != "IgnoreDestroy" && !transform.GetComponent<TC>())
614 {
615 UnityEngine.Object.Destroy(transform.gameObject);
616 }
617 }
618 }
619
620 // Token: 0x06000C09 RID: 3081 RVA: 0x0004BC1C File Offset: 0x00049E1C
621 public void RefreshBG()
622 {
623 this.bg = EMono.setting.render.bgs[EMono._map.config.bg];
624 if (EMono._map.config.bg == MapBG.Sky && EMono._zone.IsSnowZone)
625 {
626 this.bg = EMono.setting.render.bgs[MapBG.Snow];
627 }
628 this.skyBG.SetActive(this.bg.skyBox);
629 this.skyBG.sharedMaterial = this.bg.mat;
630 this.skyPlane.SetActive(this.bg.plane);
631 this.skyPlane.sharedMaterial = this.bg.mat;
632 this.cam.clearFlags = ((!EMono.core.config.graphic.alwaysClearCamera && this.bg.skyBox) ? CameraClearFlags.Depth : CameraClearFlags.Color);
633 }
634
635 // Token: 0x06000C0A RID: 3082 RVA: 0x0004BD14 File Offset: 0x00049F14
636 public void FocusAndPause(Point pos, int a)
637 {
638 if (a >= 1)
639 {
640 EMono.core.screen.Focus(pos);
641 }
642 if (a >= 2)
643 {
644 ActionMode.Sim.Pause(false);
645 }
646 }
647
648 // Token: 0x06000C0B RID: 3083 RVA: 0x0004BD3C File Offset: 0x00049F3C
649 public void ApplyZoneConfig()
650 {
651 if (!EMono.core.IsGameStarted)
652 {
653 return;
654 }
655 Scene.<>c__DisplayClass70_0 CS$<>8__locals1;
656 CS$<>8__locals1.conf = EMono._map.config;
657 LiquidProfile.Apply(CS$<>8__locals1.conf.idLiquid);
658 RefractionProfile.Apply(CS$<>8__locals1.conf.idRefraction);
659 BaseTileMap tileMap = this.screenElin.tileMap;
660 Scene.<ApplyZoneConfig>g__SetOcean|70_0(tileMap.passLiquid.mat, ref CS$<>8__locals1);
661 Scene.<ApplyZoneConfig>g__SetOcean|70_0(tileMap.passFloorWater.mat, ref CS$<>8__locals1);
662 Scene.<ApplyZoneConfig>g__SetOcean|70_0(tileMap.passAutoTileWater.mat, ref CS$<>8__locals1);
663 ScreenGrading grading = this.camSupport.grading;
664 ScreenGradingProfile.Lut lut = grading.lut;
665 grading.profile.funcOverlay = (() => EMono.scene.profile.overlay);
666 if (CS$<>8__locals1.conf.idLut == "None")
667 {
668 lut.tex = null;
669 }
670 else
671 {
672 lut.tex = Resources.Load<Texture2D>("Scene/Profile/Lut/" + CS$<>8__locals1.conf.idLut);
673 lut.Brightness = CS$<>8__locals1.conf.lutBrightness;
674 lut.Saturation = CS$<>8__locals1.conf.lutSaturation;
675 lut.Contrast = CS$<>8__locals1.conf.lutContrast;
676 lut.blend = CS$<>8__locals1.conf.lutBlend;
677 }
678 grading.SetGrading();
679 }
680
681 // Token: 0x06000C0C RID: 3084 RVA: 0x0004BE8C File Offset: 0x0004A08C
682 public void OnToggle()
683 {
684 SE.ClickGeneral();
685 WidgetSystemIndicator.Refresh();
686 WidgetHotbar.RefreshHighlights();
687 }
688
689 // Token: 0x06000C0D RID: 3085 RVA: 0x0004BE9D File Offset: 0x0004A09D
690 public void ToggleShowRoof()
691 {
692 EMono.game.config.showRoof = !EMono.game.config.showRoof;
693 this.OnToggle();
694 }
695
696 // Token: 0x06000C0E RID: 3086 RVA: 0x0004BEC6 File Offset: 0x0004A0C6
697 public void ToggleLight()
698 {
699 EMono.game.config.buildLight = !EMono.game.config.buildLight;
700 this.OnToggle();
701 }
702
703 // Token: 0x06000C0F RID: 3087 RVA: 0x0004BEF0 File Offset: 0x0004A0F0
704 public void ToggleSnapFreePos()
705 {
706 if (!EMono.core.config.game.freePos)
707 {
708 SE.Beep();
709 return;
710 }
711 EMono.game.config.snapFreePos = !EMono.game.config.snapFreePos;
712 this.OnToggle();
713 }
714
715 // Token: 0x06000C10 RID: 3088 RVA: 0x0004BF40 File Offset: 0x0004A140
716 public void ToggleFreePos()
717 {
718 if (!EMono.core.config.game.freePos)
719 {
720 SE.Beep();
721 return;
722 }
723 EMono.game.config.freePos = !EMono.game.config.freePos;
724 this.OnToggle();
725 }
726
727 // Token: 0x06000C11 RID: 3089 RVA: 0x0004BF90 File Offset: 0x0004A190
728 public void ToggleShowWall()
729 {
730 EMono.game.config.showWall = !EMono.game.config.showWall;
731 this.OnToggle();
732 }
733
734 // Token: 0x06000C12 RID: 3090 RVA: 0x0004BFB9 File Offset: 0x0004A1B9
735 public void ToggleRoof()
736 {
737 EMono.game.config.noRoof = !EMono.game.config.noRoof;
738 this.OnToggle();
739 }
740
741 // Token: 0x06000C13 RID: 3091 RVA: 0x0004BFE2 File Offset: 0x0004A1E2
742 public void ToggleSlope()
743 {
744 EMono.game.config.slope = !EMono.game.config.slope;
745 this.OnToggle();
746 Scene.skipAnime = true;
747 }
748
749 // Token: 0x06000C14 RID: 3092 RVA: 0x0004C014 File Offset: 0x0004A214
750 public void ToggleTilt()
751 {
752 if (EMono._zone.IsRegion)
753 {
754 EMono.game.config.tiltRegion = !EMono.game.config.tiltRegion;
755 }
756 else
757 {
758 EMono.game.config.tilt = !EMono.game.config.tilt;
759 }
760 EMono.screen.RefreshTilt();
761 this.OnToggle();
762 }
763
764 // Token: 0x06000C15 RID: 3093 RVA: 0x0004C081 File Offset: 0x0004A281
765 public void ToggleHighlightAct()
766 {
767 EMono.game.config.highlightAct = !EMono.game.config.highlightAct;
768 this.OnToggle();
769 }
770
771 // Token: 0x06000C16 RID: 3094 RVA: 0x0004C0AA File Offset: 0x0004A2AA
772 public void ToggleAreaHighlight()
773 {
774 EMono.game.config.areaHighlight = !EMono.game.config.areaHighlight;
775 this.OnToggle();
776 }
777
778 // Token: 0x06000C17 RID: 3095 RVA: 0x0004C0D3 File Offset: 0x0004A2D3
779 public void ToggleBirdView(bool sound = true)
780 {
781 SE.ClickGeneral();
782 if (EMono.scene.actionMode == ActionMode.Bird)
783 {
784 EMono.scene.actionMode.Deactivate();
785 return;
786 }
787 ActionMode.Bird.Activate(true, false);
788 }
789
790 // Token: 0x06000C18 RID: 3096 RVA: 0x0004C107 File Offset: 0x0004A307
791 public void ToggleBalloon()
792 {
793 this.hideBalloon = !this.hideBalloon;
794 EMono.ui.ShowBalloon(!this.hideBalloon);
795 SE.ClickGeneral();
796 WidgetSystemIndicator.Refresh();
797 }
798
799 // Token: 0x06000C19 RID: 3097 RVA: 0x0004C138 File Offset: 0x0004A338
800 public void ToggleMuteBGM()
801 {
802 EMono.Sound.ToggleMute(EMono.core.config.sound.volumeBGM);
803 SE.ClickGeneral();
804 WidgetSystemIndicator.Refresh();
805 if (!EMono.Sound.muteBGM)
806 {
807 EMono.core.config.ApplyVolume();
808 }
809 }
810
811 // Token: 0x06000C1A RID: 3098 RVA: 0x0004C188 File Offset: 0x0004A388
812 public void RebuildActorEx()
813 {
814 foreach (Thing thing in EMono._map.things)
815 {
816 if (!thing.trait.IDActorEx.IsEmpty())
817 {
818 this.AddActorEx(thing, null);
819 }
820 }
821 }
822
823 // Token: 0x06000C1B RID: 3099 RVA: 0x0004C1F4 File Offset: 0x0004A3F4
824 public void RefreshActorEx()
825 {
826 SoundManager.bgmDumpMod = 0f;
827 foreach (ActorEx actorEx in this.dictActorEx.Values)
828 {
829 actorEx.Refresh();
830 }
831 }
832
833 // Token: 0x06000C1C RID: 3100 RVA: 0x0004C254 File Offset: 0x0004A454
834 public void ClearActorEx()
835 {
836 foreach (ActorEx actorEx in this.dictActorEx.Values)
837 {
838 actorEx.Kill();
839 }
840 this.dictActorEx.Clear();
841 }
842
843 // Token: 0x06000C1D RID: 3101 RVA: 0x0004C2B4 File Offset: 0x0004A4B4
844 public void AddActorEx(Card c, Action<ActorEx> onBeforeSetOwner = null)
845 {
846 ActorEx actorEx = this.dictActorEx.TryGetValue(c, null);
847 if (actorEx != null)
848 {
849 return;
850 }
851 actorEx = Util.Instantiate<ActorEx>("Scene/Render/Actor/Ex/" + c.trait.IDActorEx, null);
852 if (onBeforeSetOwner != null)
853 {
854 onBeforeSetOwner(actorEx);
855 }
856 actorEx.SetOwner(c);
857 this.dictActorEx.Add(c, actorEx);
858 }
859
860 // Token: 0x06000C1E RID: 3102 RVA: 0x0004C314 File Offset: 0x0004A514
861 public void RemoveActorEx(Card c)
862 {
863 ActorEx actorEx = this.dictActorEx.TryGetValue(c, null);
864 if (actorEx == null)
865 {
866 return;
867 }
868 actorEx.Kill();
869 this.dictActorEx.Remove(c);
870 }
871
872 // Token: 0x06000C1F RID: 3103 RVA: 0x0004C34C File Offset: 0x0004A54C
873 public void InitPass()
874 {
875 MeshPass[] array = this.passes;
876 for (int i = 0; i < array.Length; i++)
877 {
878 array[i].Init();
879 }
880 foreach (ModItem<Sprite> modItem in MOD.sprites.list)
881 {
882 Sprite sprite = SpriteSheet.Get(modItem.id);
883 if (sprite)
884 {
885 Sprite @object = modItem.GetObject(new SpriteLoadOption
886 {
887 pivot = new Vector2(sprite.pivot.x / (sprite.bounds.size.x * 100f), sprite.pivot.y / (sprite.bounds.size.y * 100f))
888 });
889 SpriteSheet.dict[modItem.id] = @object;
890 }
891 }
892 }
893
894 // Token: 0x06000C20 RID: 3104 RVA: 0x0004C450 File Offset: 0x0004A650
895 public void DrawPass()
896 {
897 if (this.cam.enabled)
898 {
899 MeshPass[] array = this.passes;
900 for (int i = 0; i < array.Length; i++)
901 {
902 array[i].Draw();
903 }
904 }
905 else
906 {
907 MeshPass[] array = this.passes;
908 for (int i = 0; i < array.Length; i++)
909 {
910 array[i].DrawEmpty();
911 }
912 }
913 this.RefreshSync();
914 if (EMono.screen.guide)
915 {
916 EMono.screen.guide.OnDrawPass();
917 }
918 }
919
920 // Token: 0x06000C21 RID: 3105 RVA: 0x0004C4CC File Offset: 0x0004A6CC
921 public void RefreshSync()
922 {
923 for (int i = this.syncList.Count - 1; i >= 0; i--)
924 {
925 ISyncScreen syncScreen = this.syncList[i];
926 if (syncScreen.Sync != this.syncFrame)
927 {
928 syncScreen.OnLeaveScreen();
929 this.syncList.RemoveAt(i);
930 }
931 }
932 this.syncFrame += 1L;
933 RenderObject.syncFrame = this.syncFrame;
934 }
935
936 // Token: 0x06000C22 RID: 3106 RVA: 0x0004C538 File Offset: 0x0004A738
937 public Transform LoadPrefab(string id)
938 {
939 Transform transform = Util.Instantiate<Transform>("Scene/Prefab/" + id, null);
940 transform.name = id;
941 this.loadedPrefabs.Add(transform.gameObject);
942 return transform;
943 }
944
945 // Token: 0x06000C23 RID: 3107 RVA: 0x0004C570 File Offset: 0x0004A770
946 public void DestroyPrefabs()
947 {
948 foreach (GameObject obj in this.loadedPrefabs)
949 {
950 UnityEngine.Object.Destroy(obj);
951 }
952 this.loadedPrefabs.Clear();
953 }
954
955 // Token: 0x06000C24 RID: 3108 RVA: 0x0004C5CC File Offset: 0x0004A7CC
956 public void DestroyPrefab(string id)
957 {
958 GameObject gameObject = GameObject.Find(id);
959 if (gameObject)
960 {
961 UnityEngine.Object.DestroyImmediate(gameObject);
962 }
963 }
964
965 // Token: 0x06000C27 RID: 3111 RVA: 0x0004C638 File Offset: 0x0004A838
966 [CompilerGenerated]
967 internal static void <ApplyZoneConfig>g__SetOcean|70_0(Material m, ref Scene.<>c__DisplayClass70_0 A_1)
968 {
969 m.SetFloat("_GradientWater", EMono.core.config.graphic.gradientWater ? EMono.core.config.graphic.gradientWaterLevel : 0f);
970 if (A_1.conf.seaDir != 0)
971 {
972 m.EnableKeyword("WAVE_ON");
973 Vector4[] array = new Vector4[]
974 {
975 new Vector4(-2f, -1f, -1f, 1f),
976 new Vector4(1f, 0f, 1f, 1f),
977 new Vector4(2f, 1f, -1f, 1f),
978 new Vector4(-1f, 0f, 1f, 1f)
979 };
980 m.SetVector("_WaveDir", array[A_1.conf.seaDir - 1]);
981 return;
982 }
983 m.DisableKeyword("WAVE_ON");
984 }
985
986 // Token: 0x04000AE7 RID: 2791
987 public Vector2[] test;
988
989 // Token: 0x04000AE8 RID: 2792
990 public static bool isAnnounced;
991
992 // Token: 0x04000AE9 RID: 2793
993 public static Point HitPoint = new Point();
994
995 // Token: 0x04000AEA RID: 2794
996 public static Point ClickPoint = new Point();
997
998 // Token: 0x04000AEB RID: 2795
999 public static bool skipAnime;
1000
1001 // Token: 0x04000AEC RID: 2796
1002 public Transform transFocus;
1003
1004 // Token: 0x04000AED RID: 2797
1005 public Transform transBlizzard;
1006
1007 // Token: 0x04000AEE RID: 2798
1008 public Transform transAudio;
1009
1010 // Token: 0x04000AEF RID: 2799
1011 public AudioListener audioListener;
1012
1013 // Token: 0x04000AF0 RID: 2800
1014 public Camera cam;
1015
1016 // Token: 0x04000AF1 RID: 2801
1017 public Camera camTreasure;
1018
1019 // Token: 0x04000AF2 RID: 2802
1020 public CameraSupport camSupport;
1021
1022 // Token: 0x04000AF3 RID: 2803
1023 public VFX firefly;
1024
1025 // Token: 0x04000AF4 RID: 2804
1026 public VFX fireflyNight;
1027
1028 // Token: 0x04000AF5 RID: 2805
1029 public VFX star;
1030
1031 // Token: 0x04000AF6 RID: 2806
1032 public ParticleSystem rain;
1033
1034 // Token: 0x04000AF7 RID: 2807
1035 public ParticleSystem snow;
1036
1037 // Token: 0x04000AF8 RID: 2808
1038 public ParticleSystem ether;
1039
1040 // Token: 0x04000AF9 RID: 2809
1041 public ParticleSystem godray;
1042
1043 // Token: 0x04000AFA RID: 2810
1044 public ParticleSystem godrayDust;
1045
1046 // Token: 0x04000AFB RID: 2811
1047 public ParticleSystem blossom;
1048
1049 // Token: 0x04000AFC RID: 2812
1050 public ParticleSystem etherBlossom;
1051
1052 // Token: 0x04000AFD RID: 2813
1053 public ParticleSystem[] blossoms;
1054
1055 // Token: 0x04000AFE RID: 2814
1056 public ParticleSystem[] blizzards;
1057
1058 // Token: 0x04000AFF RID: 2815
1059 public FlockController flock;
1060
1061 // Token: 0x04000B00 RID: 2816
1062 public MeshRenderer skyBG;
1063
1064 // Token: 0x04000B01 RID: 2817
1065 public MeshRenderer skyPlane;
1066
1067 // Token: 0x04000B02 RID: 2818
1068 public SceneProfile profile;
1069
1070 // Token: 0x04000B03 RID: 2819
1071 public CameraFilterPack_Atmosphere_Rain filterRain;
1072
1073 // Token: 0x04000B04 RID: 2820
1074 public ActionMode actionMode;
1075
1076 // Token: 0x04000B05 RID: 2821
1077 public SoundSource sfxRain;
1078
1079 // Token: 0x04000B06 RID: 2822
1080 public SoundSource sfxWind;
1081
1082 // Token: 0x04000B07 RID: 2823
1083 public SoundSource sfxSea;
1084
1085 // Token: 0x04000B08 RID: 2824
1086 public SoundSource sfxFire;
1087
1088 // Token: 0x04000B09 RID: 2825
1089 public SoundSource sfxEther;
1090
1091 // Token: 0x04000B0A RID: 2826
1092 public GameScreen screenElin;
1093
1094 // Token: 0x04000B0B RID: 2827
1095 public GameScreenElona screenElona;
1096
1097 // Token: 0x04000B0C RID: 2828
1098 public GameScreenNoMap screenNoMap;
1099
1100 // Token: 0x04000B0D RID: 2829
1101 public PopperManager popper;
1102
1103 // Token: 0x04000B0E RID: 2830
1104 public EloMapActor elomapActor;
1105
1106 // Token: 0x04000B0F RID: 2831
1107 public SpriteRenderer srTarget;
1108
1109 // Token: 0x04000B10 RID: 2832
1110 public Tileset tileset;
1111
1112 // Token: 0x04000B11 RID: 2833
1113 public ParticleSystem psFoot;
1114
1115 // Token: 0x04000B12 RID: 2834
1116 public ParticleSystem psSmoke;
1117
1118 // Token: 0x04000B13 RID: 2835
1119 public ParticleSystem psRainSplash;
1120
1121 // Token: 0x04000B14 RID: 2836
1122 public ParticleSystem psRainSplashWater;
1123
1124 // Token: 0x04000B15 RID: 2837
1125 public MeshPass[] passes;
1126
1127 // Token: 0x04000B16 RID: 2838
1128 [NonSerialized]
1130
1131 // Token: 0x04000B17 RID: 2839
1132 [NonSerialized]
1133 public Scene.Mode mode;
1134
1135 // Token: 0x04000B18 RID: 2840
1136 [NonSerialized]
1137 public float timeRatio;
1138
1139 // Token: 0x04000B19 RID: 2841
1140 [NonSerialized]
1141 public List<GameObject> loadedPrefabs = new List<GameObject>();
1142
1143 // Token: 0x04000B1A RID: 2842
1144 public PointTarget mouseTarget = new PointTarget();
1145
1146 // Token: 0x04000B1B RID: 2843
1147 public List<ISyncScreen> syncList = new List<ISyncScreen>();
1148
1149 // Token: 0x04000B1C RID: 2844
1150 [NonSerialized]
1151 public bool paused;
1152
1153 // Token: 0x04000B1D RID: 2845
1154 public long syncFrame;
1155
1156 // Token: 0x04000B1E RID: 2846
1157 public Dictionary<Card, ActorEx> dictActorEx = new Dictionary<Card, ActorEx>();
1158
1159 // Token: 0x04000B1F RID: 2847
1160 [NonSerialized]
1161 public bool hideBalloon;
1162
1163 // Token: 0x0200088B RID: 2187
1164 public enum Mode
1165 {
1166 // Token: 0x04002482 RID: 9346
1167 None,
1168 // Token: 0x04002483 RID: 9347
1169 Title,
1170 // Token: 0x04002484 RID: 9348
1171 StartGame,
1172 // Token: 0x04002485 RID: 9349
1173 Zone
1174 }
1175}
Definition Card.cs:13
Definition Chara.cs:12
Definition EMono.cs:6
Definition Game.cs:10
Definition Msg.cs:7
Definition Net.cs:12
Definition Point.cs:11
Definition Scene.cs:10
Definition TC.cs:6
Definition Thing.cs:10
Definition VFX.cs:6
Definition Zone.cs:14