Elin Decompiled Documentation EA 23.246 Nightly
Loading...
Searching...
No Matches
ActionMode.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Linq;
3using UnityEngine;
4
5public class ActionMode : EClass
6{
7 public static ActionMode DefaultMode;
8
9 public static AM_Title Title = new AM_Title();
10
11 public static AM_Sim Sim;
12
13 public static AM_ViewZone View;
14
15 public static AM_Adv Adv;
16
17 public static AM_Region Region;
18
19 public static AM_ADV_Target AdvTarget;
20
21 public static AM_EloMap EloMap;
22
23 public static AM_Inspect Inspect;
24
25 public static AM_NoMap NoMap;
26
27 public static AM_MiniGame MiniGame;
28
29 public static AM_NewZone NewZone;
30
31 public static AM_Bird Bird;
32
33 public static AM_Mine Mine;
34
35 public static AM_Dig Dig;
36
37 public static AM_Harvest Harvest;
38
39 public static AM_Cut Cut;
40
42
43 public static AM_Picker Picker;
44
45 public static AM_Copy Copy;
46
47 public static AM_Blueprint Blueprint;
48
49 public static AM_Build Build;
50
52
53 public static AM_EditArea EditArea;
54
56
58
59 public static AM_Select Select;
60
62
63 public static AM_ViewMap ViewMap;
64
65 public static AM_Terrain Terrain;
66
67 public static AM_Populate Populate;
68
70
72
73 public static AM_Cinema Cinema;
74
75 public static AM_Paint Paint;
76
77 public static AM_FlagCell FlagCell;
78
80
82
83 public static bool ignoreSound;
84
85 private static float smoothX = 0f;
86
87 private static float smoothY = 0f;
88
89 private static float textTimer = 0f;
90
91 protected static Vector3 mpos;
92
93 public static float[] GameSpeeds = new float[4] { 0f, 1f, 2f, 5f };
94
95 public static List<TCSimpleText> simpleTexts = new List<TCSimpleText>();
96
97 public Layer layer;
98
99 public int brushRadius = 4;
100
101 private static float focusTimer;
102
103 public static float hotElementTimer;
104
105 public static AM_Adv AdvOrRegion
106 {
107 get
108 {
109 if (!EClass._zone.IsRegion)
110 {
111 return Adv;
112 }
113 return Region;
114 }
115 }
116
117 public static bool IsAdv => DefaultMode is AM_Adv;
118
119 public virtual float gameSpeed => 1f;
120
121 public bool IsActive => EClass.scene.actionMode == this;
122
124
126
128
129 public virtual bool ContinuousClick => false;
130
131 public virtual int hitW => 1;
132
133 public virtual int hitH => 1;
134
136
137 public bool Multisize
138 {
139 get
140 {
141 if (hitW == 1)
142 {
143 return hitW != 1;
144 }
145 return true;
146 }
147 }
148
149 public virtual string id => GetType().Name.Split('_')[1];
150
151 public virtual CursorInfo DefaultCursor => null;
152
153 public virtual string idHelpTopic => "4";
154
155 public virtual string idSound => null;
156
157 public virtual bool enableMouseInfo => false;
158
159 public virtual bool hideBalloon => false;
160
161 public virtual string textHintTitle => null;
162
163 public virtual bool AllowAutoClick => false;
164
165 public virtual bool ShowActionHint => true;
166
167 public virtual bool ShowMouseoverTarget => true;
168
170
171 public virtual bool CanSelectTile => false;
172
173 public virtual bool CanTargetOutsideBounds => true;
174
175 public virtual bool ShouldPauseGame => true;
176
177 public virtual bool FixFocus => false;
178
179 public virtual bool HideSubWidgets => true;
180
181 public virtual bool IsBuildMode => false;
182
183 public virtual bool ShowBuildWidgets => IsBuildMode;
184
186 {
187 get
188 {
189 if (!IsBuildMode)
190 {
191 return BuildMenu.Mode.None;
192 }
193 return BuildMenu.Mode.Hide;
194 }
195 }
196
197 public virtual bool ShouldHideBuildMenu
198 {
199 get
200 {
201 if (IsBuildMode)
202 {
203 return tileSelector.start != null;
204 }
205 return false;
206 }
207 }
208
209 public virtual bool CanTargetFog => false;
210
211 public virtual int CostMoney => 0;
212
213 public virtual bool AllowBuildModeShortcuts => IsBuildMode;
214
215 public virtual bool AllowMiddleClickFunc => false;
216
217 public virtual bool AllowHotbar => true;
218
219 public virtual bool AllowGeneralInput => true;
220
221 public virtual bool ShowMaskedThings => false;
222
223 public virtual int SelectorHeight => -1;
224
225 public virtual bool AllowWheelZoom => true;
226
227 public virtual float TargetZoom => 1f;
228
230
231 public virtual BaseGameScreen TargetGameScreen => null;
232
233 public virtual bool IsNoMap => false;
234
235 public virtual bool UseSubMenu => false;
236
237 public virtual bool UseSubMenuSlider => false;
238
239 public virtual bool SubMenuAsGroup => false;
240
241 public virtual int SubMenuModeIndex => 0;
242
243 public virtual bool ShowExtraHint => Lang.GetList("exhint_" + GetType().Name) != null;
244
246
247 public static void OnGameInstantiated()
248 {
249 LastBuildMode = null;
250 Sim = new AM_Sim();
251 View = new AM_ViewZone();
252 Adv = new AM_Adv();
253 AdvTarget = new AM_ADV_Target();
254 Region = new AM_Region();
255 NoMap = new AM_NoMap();
256 MiniGame = new AM_MiniGame();
257 EloMap = new AM_EloMap();
258 NewZone = new AM_NewZone();
259 Select = new AM_Select();
260 Inspect = new AM_Inspect();
261 Bird = new AM_Bird();
263 Mine = new AM_Mine();
264 Dig = new AM_Dig();
265 Harvest = new AM_Harvest();
266 Cut = new AM_Cut();
267 Copy = new AM_Copy();
268 Blueprint = new AM_Blueprint();
269 Build = new AM_Build();
270 Picker = new AM_Picker();
273 EditArea = new AM_EditArea();
277 ViewMap = new AM_ViewMap();
278 Terrain = new AM_Terrain();
279 Populate = new AM_Populate();
282 Cinema = new AM_Cinema();
283 FlagCell = new AM_FlagCell();
284 Paint = new AM_Paint();
285 }
286
287 public virtual int TopHeight(Point p)
288 {
289 return -1;
290 }
291
292 public virtual void SEExecuteSummary()
293 {
294 SE.Play("plan");
295 }
296
297 public virtual bool HighlightWall(Point p)
298 {
299 return false;
300 }
301
302 public virtual void OnClickSubMenu(int a)
303 {
304 }
305
306 public virtual string OnSetSubMenuButton(int a, UIButton b)
307 {
308 return null;
309 }
310
311 public virtual bool IsRoofEditMode(Card c = null)
312 {
313 return false;
314 }
315
316 public virtual bool IsFillMode()
317 {
318 return false;
319 }
320
321 public virtual int GetDefaultTile(Point p)
322 {
323 return 0;
324 }
325
326 public virtual void OnShowExtraHint(UINote n)
327 {
328 string[] list = Lang.GetList("exhint_" + GetType().Name);
329 if (list != null)
330 {
331 string[] array = list;
332 foreach (string text in array)
333 {
334 n.AddText("NoteText_extrahint", text, Color.white);
335 }
336 }
337 }
338
339 public void Activate(bool toggle = true, bool forceActivate = false)
340 {
341 if (TargetGameScreen != null)
342 {
344 }
345 if (EClass.scene.actionMode == this && !forceActivate)
346 {
347 if (toggle && EClass.scene.actionMode != DefaultMode)
348 {
350 }
351 return;
352 }
353 if (ignoreSound)
354 {
355 ignoreSound = false;
356 }
357 else
358 {
359 EClass.Sound.Play(idSound);
360 }
361 EInput.Consume(0);
362 ActionMode actionMode = EClass.scene.actionMode;
363 EClass.scene.actionMode = this;
364 if (actionMode != null)
365 {
366 if (actionMode.IsBuildMode && !(actionMode is AM_ViewMap))
367 {
368 LastBuildMode = actionMode;
369 }
370 actionMode.ClearSimpleTexts();
371 actionMode.OnDeactivate();
373 {
374 foreach (Card item in ((IEnumerable<Card>)EClass._map.things).Concat((IEnumerable<Card>)EClass._map.charas))
375 {
376 item.renderer.DespawnSimpleText();
377 }
378 }
379 _ = NoMap;
380 EClass.ui.RemoveLayers();
381 }
382 if (IsBuildMode)
383 {
386 }
387 else
388 {
390 }
391 if (!(this is AM_Adv))
392 {
393 EClass.ui.hud.transRight.SetActive(enable: false);
394 }
395 EClass.ui.hud.frame.SetActive(IsBuildMode && EClass.game.altUI);
396 if (hideBalloon)
397 {
398 EClass.ui.ShowBalloon(enable: false);
399 }
400 else
401 {
402 EClass.ui.ShowBalloon(!EClass.scene.hideBalloon);
403 }
404 OnActivate();
405 RefreshTexts();
406 ShowLayer();
407 EClass.ui.widgets.OnChangeActionMode();
408 EClass.ui.extraHint.OnChangeActionMode();
409 CursorSystem.leftIcon = null;
411 }
412
413 public virtual void OnActivate()
414 {
415 }
416
417 public void RefreshTexts()
418 {
420 {
421 return;
422 }
425 {
426 foreach (Spatial child in EClass._zone.children)
427 {
428 if (!child.destryoed)
429 {
430 Sprite sprite = null;
431 if (child.isRandomSite && !child.isConquered && child.visitCount > 0)
432 {
434 }
435 else if (child.isConquered)
436 {
438 }
439 else if (!child.IsPlayerFaction && child is Zone_Field && child.isDeathLocation)
440 {
441 sprite = EClass.core.refs.tcs.spriteDeath;
442 }
443 if ((bool)sprite)
444 {
445 TCSimpleText tCSimpleText = TCSimpleText.SpawnIcon(sprite);
446 simpleTexts.Add(tCSimpleText);
447 Cell cell = child.RegionPos.cell;
448 tCSimpleText.transform.position = cell.GetPoint().PositionTopdown() + EClass.setting.render.tc.simpleTextPos;
449 }
450 }
451 }
452 }
454 {
455 return;
456 }
457 foreach (Card item in ((IEnumerable<Card>)EClass._map.things).Concat((IEnumerable<Card>)EClass._map.charas))
458 {
459 string simpleText = GetSimpleText(item);
460 if (!simpleText.IsEmpty())
461 {
462 TCSimpleText tCSimpleText2 = TCSimpleText.Spawn();
463 Popper.SetText(tCSimpleText2.tm, simpleText);
464 simpleTexts.Add(tCSimpleText2);
465 tCSimpleText2.transform.position = item.pos.Position() + EClass.setting.render.tc.simpleTextPos;
466 }
467 }
468 if (!Application.isEditor)
469 {
470 return;
471 }
472 foreach (KeyValuePair<int, int> backerObj in EClass._map.backerObjs)
473 {
474 SourceBacker.Row row = EClass.sources.backers.map[backerObj.Value];
475 string text = "Backer:" + row.id + "/" + row.Name;
476 if (row.isStatic != 0)
477 {
478 text = "★" + text;
479 }
480 TCSimpleText tCSimpleText3 = TCSimpleText.Spawn();
481 Popper.SetText(tCSimpleText3.tm, text);
482 simpleTexts.Add(tCSimpleText3);
483 Cell cell2 = EClass._map.GetCell(backerObj.Key);
484 tCSimpleText3.transform.position = cell2.GetPoint().Position() + EClass.setting.render.tc.simpleTextPos;
485 }
486 foreach (Card card in EClass._map.Cards)
487 {
488 if (!card.isBackerContent)
489 {
490 continue;
491 }
492 SourceBacker.Row row2 = EClass.sources.backers.map.TryGetValue(card.c_idBacker);
493 if (row2 != null)
494 {
495 string text2 = "Backer:" + row2.id + "/" + row2.Name;
496 if (row2.isStatic != 0)
497 {
498 text2 = "★" + text2;
499 }
500 TCSimpleText tCSimpleText4 = TCSimpleText.Spawn();
501 Popper.SetText(tCSimpleText4.tm, text2);
502 simpleTexts.Add(tCSimpleText4);
503 tCSimpleText4.transform.position = card.renderer.position + EClass.setting.render.tc.simpleTextPos;
504 }
505 }
506 }
507
508 public virtual string GetSimpleText(Card c)
509 {
510 if (c.trait is TraitRoomPlate && c.Cell.room != null)
511 {
512 return "#" + c.Cell.room.data.group;
513 }
514 return null;
515 }
516
517 public void ClearSimpleTexts()
518 {
519 foreach (TCSimpleText simpleText in simpleTexts)
520 {
521 if (simpleText != null)
522 {
523 PoolManager.Despawn(simpleText);
524 }
525 }
526 simpleTexts.Clear();
527 }
528
529 public void Deactivate()
530 {
532 }
533
534 public virtual void OnDeactivate()
535 {
536 }
537
538 public virtual void OnCancel()
539 {
540 if (!IsBuildMode || EClass.core.config.input.rightClickExitBuildMode || Input.GetKey(KeyCode.Escape))
541 {
542 Deactivate();
543 }
544 }
545
546 public virtual void OnBeforeUpdate()
547 {
548 }
549
550 public virtual void OnAfterUpdate()
551 {
552 }
553
554 public virtual void OnUpdateCursor()
555 {
556 CursorSystem.leftIcon = null;
558 }
559
560 public void OnRotate()
561 {
563 }
564
565 public void SetCursorOnMap(CursorInfo cursor)
566 {
567 CursorSystem.SetCursor(EClass.ui.isPointerOverUI ? null : cursor);
568 }
569
570 public void UpdateInput()
571 {
572 mpos = Input.mousePosition;
573 if (!IsNoMap)
574 {
576 if ((bool)WidgetMouseover.Instance)
577 {
579 }
580 }
581 if (LayerAbility.hotElement != null)
582 {
586 {
588 {
590 SE.SelectHotitem();
591 }
592 else
593 {
594 ButtonGrid componentOf = InputModuleEX.GetComponentOf<ButtonGrid>();
595 if ((bool)componentOf && componentOf.invOwner != null && componentOf.invOwner.owner == EClass.pc && (componentOf.card == null || componentOf.card.trait is TraitAbility) && !(componentOf.invOwner is InvOwnerEquip))
596 {
597 if (componentOf.card != null)
598 {
599 componentOf.card.Destroy();
600 }
601 SE.Equip();
603 Thing thing = ThingGen.Create("ability");
604 int num = ((componentOf.invOwner is InvOwnerHotbar) ? 1 : 0);
605 componentOf.invOwner.Container.AddThing(thing, tryStack: false, componentOf.index, num);
606 thing.c_idAbility = hotElement.source.alias;
607 thing.invY = num;
608 thing.invX = componentOf.index;
609 WidgetCurrentTool.dirty = true;
610 }
611 else
612 {
613 SE.BeepSmall();
614 }
615 }
617 }
619 {
621 }
622 }
623 else
624 {
625 hotElementTimer = 0f;
626 }
628 if (EClass.ui.isPointerOverUI && (EInput.leftMouse.down || EInput.rightMouse.down || (EClass.core.config.ui.autoFocusWindow && !Input.GetMouseButton(0))))
629 {
630 LayerInventory componentOf2 = InputModuleEX.GetComponentOf<LayerInventory>();
631 if (componentOf2 != null)
632 {
633 LayerInventory layerInventory = LayerInventory.GetLayer(InputModuleEX.GetComponentOf<ButtonGrid>()?.card);
634 if ((bool)layerInventory)
635 {
636 LayerInventory.highlightInv = layerInventory.invs[0].owner;
637 }
638 if (focusTimer > 0.1f)
639 {
640 if (EClass.ui.layerFloat.layers.Contains(componentOf2) && !layerInventory)
641 {
642 componentOf2.transform.SetAsLastSibling();
643 }
644 LayerAbility componentOf3 = InputModuleEX.GetComponentOf<LayerAbility>();
645 if (componentOf3 != null && EClass.ui.layerFloat.layers.Contains(componentOf3))
646 {
647 componentOf3.transform.SetAsLastSibling();
648 }
649 focusTimer = 0f;
650 }
651 }
652 }
653 if ((EInput.isShiftDown && Input.GetMouseButton(0)) || (EInput.rightMouse.dragging2 && !Input.GetMouseButtonDown(1) && Input.GetMouseButton(1)))
654 {
655 bool rightMouse = !Input.GetMouseButtonDown(1) && Input.GetMouseButton(1);
656 ButtonGrid componentOf4 = InputModuleEX.GetComponentOf<ButtonGrid>();
657 if (componentOf4 != null && componentOf4.invOwner != null && componentOf4.card != null && componentOf4.invOwner.CanShiftClick(componentOf4, rightMouse) && EClass.ui.AllowInventoryInteractions)
658 {
659 componentOf4.invOwner.OnShiftClick(componentOf4, rightMouse);
660 }
661 }
663 {
664 LayerInventory componentOf5 = InputModuleEX.GetComponentOf<LayerInventory>();
665 if (componentOf5 != null && EClass.ui.layerFloat.layers.Contains(componentOf5) && EInput.rightMouse.down && !componentOf5.mainInv && !InputModuleEX.GetComponentOf<UIButton>() && !componentOf5.windows[0].saveData.noRightClickClose)
666 {
667 componentOf5.Close();
668 }
669 if (EClass.ui.contextMenu.isActive)
670 {
671 EClass.ui.contextMenu.currentMenu.Hide();
673 Layer.rightClicked = false;
674 }
675 if (DropdownGrid.IsActive && !EClass.ui.GetLayer<LayerInfo>())
676 {
679 Layer.rightClicked = false;
680 }
681 }
683 {
684 EInput.Consume();
685 }
687 bool flag = (EInput.mouse3.clicked && input.mouse3Click == CoreConfig.GameFunc.AllAction) || (EInput.mouse4.clicked && input.mouse4Click == CoreConfig.GameFunc.AllAction) || (EInput.mouse3.pressedLong && input.mouse3PressLong == CoreConfig.GameFunc.AllAction) || (EInput.mouse4.pressedLong && input.mouse4PressLong == CoreConfig.GameFunc.AllAction);
689 {
690 UIButton componentOf6 = InputModuleEX.GetComponentOf<UIButton>();
691 if ((bool)componentOf6 && componentOf6.CanMiddleClick() && (flag || EInput.middleMouse.clicked || EInput.middleMouse.pressedLong))
692 {
693 componentOf6.OnMiddleClick(flag);
694 }
695 }
696 if ((bool)EClass.ui.contextMenu.currentMenu)
697 {
698 UIContextMenu.timeSinceClosed = 0f;
699 }
700 else
701 {
702 UIContextMenu.timeSinceClosed += Time.deltaTime;
703 }
704 if (EClass.ui.currentDrag != null)
705 {
706 EClass.ui.OnDrag();
708 {
709 if (Input.GetMouseButton(0) && EInput.rightMouse.down)
710 {
711 EClass.ui.OnDragSpecial();
712 }
713 else
714 {
716 }
717 }
718 }
719 ButtonState middleMouse = EInput.middleMouse;
720 if (middleMouse.pressedLongAction != null)
721 {
722 if (middleMouse.pressedLong)
723 {
724 middleMouse.pressedLongAction();
725 middleMouse.pressedLongAction = null;
726 }
727 else if (!EInput.middleMouse.pressing)
728 {
729 middleMouse.pressedLongAction = null;
730 }
731 }
732 EClass.ui.UpdateInput();
733 if (EInput.action == EAction.Mute)
734 {
736 }
737 if (AllowGeneralInput && !EClass.ui.IsDragging)
738 {
739 if (Input.GetKeyDown(KeyCode.Tab) && !EClass.debug.debugInput && !EClass.ui.BlockInput && !IsBuildMode && !EInput.waitReleaseAnyKey)
740 {
741 if (!EClass.ui.IsInventoryOpen)
742 {
743 SE.PopInventory();
744 }
745 EClass.ui.ToggleInventory();
746 }
747 if (!EClass.ui.BlockInput && !IsBuildMode && !EInput.waitReleaseAnyKey)
748 {
749 switch (EInput.action)
750 {
751 case EAction.MenuChara:
752 EClass.ui.ToggleLayer<LayerChara>()?.SetChara(EClass.pc);
753 break;
754 case EAction.MenuJournal:
755 EClass.ui.ToggleLayer<LayerJournal>();
756 break;
757 case EAction.MenuAbility:
758 if (!EClass.debug.enable)
759 {
760 EClass.ui.ToggleAbility();
761 }
762 break;
763 case EAction.MenuInventory:
764 if (!EClass.ui.IsInventoryOpen)
765 {
766 SE.PopInventory();
767 }
768 EClass.ui.ToggleInventory();
769 break;
770 }
771 }
772 if (!FixFocus)
773 {
775 }
776 if (!EClass.ui.canvas.enabled && EInput.IsAnyKeyDown())
777 {
778 EClass.ui.ToggleCanvas();
779 EInput.Consume();
780 return;
781 }
782 }
783 if (EInput.action == EAction.Examine && !IsBuildMode)
784 {
785 ButtonGrid componentOf7 = InputModuleEX.GetComponentOf<ButtonGrid>();
786 Card card = null;
787 if ((bool)componentOf7 && componentOf7.card != null)
788 {
789 card = componentOf7.card;
790 }
791 if (card == null)
792 {
793 UIItem componentOf8 = InputModuleEX.GetComponentOf<UIItem>();
794 if ((bool)componentOf8 && componentOf8.refObj is Thing)
795 {
796 card = (Thing)componentOf8.refObj;
797 }
798 }
799 if (card == null)
800 {
801 LayerCraft layerCraft = EClass.ui.GetLayer<LayerCraft>();
802 if ((bool)layerCraft)
803 {
804 card = layerCraft.product;
805 }
806 }
807 if (card != null)
808 {
809 if ((bool)EClass.ui.GetLayer<LayerInfo>())
810 {
811 EClass.ui.RemoveLayer<LayerInfo>();
812 }
813 EClass.ui.AddLayer<LayerInfo>().Set(card, _examine: true);
814 }
815 }
817 {
819 }
820 if (EClass.ui.BlockActions)
821 {
822 return;
823 }
824 if (AllowBuildModeShortcuts && Input.GetKeyDown(KeyCode.Q) && Picker.CanActivate)
825 {
827 }
829 {
830 Point hitPoint = Scene.HitPoint;
831 bool flag2 = EInput.wheel > 0;
832 if (EClass.scene.mouseTarget.card != null)
833 {
835 if (card2.isThing && card2.IsInstalled)
836 {
837 SourceMaterial.Row currentMat = (card2.isDyed ? card2.DyeMat : card2.material);
838 List<SourceMaterial.Row> source = EClass.sources.materials.rows.Where((SourceMaterial.Row m) => m.thing == currentMat.thing).ToList();
840 {
841 source = EClass.sources.materials.rows;
842 }
843 SourceMaterial.Row row = (flag2 ? source.NextItem(currentMat) : source.PrevItem(currentMat));
844 if (row == null)
845 {
846 row = card2.DyeMat;
847 }
848 if (EInput.isAltDown)
849 {
850 row = lastEditorMat;
851 }
852 if (card2.isDyed)
853 {
854 card2.Dye(row);
855 }
856 else
857 {
858 card2.ChangeMaterial(row);
859 }
860 lastEditorMat = row;
861 Msg.Say(row.GetName() + "(" + row.alias + ")");
862 }
863 }
864 else if (hitPoint.HasObj)
865 {
866 SourceMaterial.Row matObj = hitPoint.cell.matObj;
867 List<SourceMaterial.Row> rows = EClass.sources.materials.rows;
868 SourceMaterial.Row row2 = (flag2 ? rows.NextItem(matObj) : rows.PrevItem(matObj));
869 if (EInput.isAltDown)
870 {
871 row2 = lastEditorMat;
872 }
873 hitPoint.cell.objMat = (byte)row2.id;
874 lastEditorMat = row2;
875 Msg.Say(row2.GetName());
876 }
877 else if (hitPoint.HasBlock)
878 {
879 SourceMaterial.Row matBlock = hitPoint.cell.matBlock;
880 List<SourceMaterial.Row> rows2 = EClass.sources.materials.rows;
881 SourceMaterial.Row row3 = (flag2 ? rows2.NextItem(matBlock) : rows2.PrevItem(matBlock));
882 if (EInput.isAltDown)
883 {
884 row3 = lastEditorMat;
885 }
886 hitPoint.cell._blockMat = (byte)row3.id;
887 lastEditorMat = row3;
888 Msg.Say(row3.GetName());
889 }
890 else
891 {
892 SourceMaterial.Row matFloor = hitPoint.cell.matFloor;
893 List<SourceMaterial.Row> rows3 = EClass.sources.materials.rows;
894 SourceMaterial.Row row4 = (flag2 ? rows3.NextItem(matFloor) : rows3.PrevItem(matFloor));
895 if (EInput.isAltDown)
896 {
897 row4 = lastEditorMat;
898 }
899 hitPoint.cell._floorMat = (byte)row4.id;
900 lastEditorMat = row4;
901 Msg.Say(row4.GetName());
902 }
903 EInput.Consume();
904 }
906 {
907 if (EInput.hotkey != -1)
908 {
909 WidgetCurrentTool.Instance.Select(EInput.hotkey, fromHotkey: true);
911 }
912 else if (!EClass.debug.enable && EInput.functionkey != -1)
913 {
915 if ((bool)hotbarExtra)
916 {
917 hotbarExtra.TryUse(EInput.functionkey);
918 }
919 }
920 }
922 if (EClass.debug.enable)
923 {
925 }
927 if (textTimer > 0.1f)
928 {
929 textTimer = 0f;
930 RefreshTexts();
931 }
933 {
935 {
936 DoFunc(input.b_middleClick);
937 }
939 {
942 }
944 {
945 DoFunc(input.b_mouse3Click);
946 }
947 else if (EInput.mouse3.pressedLong)
948 {
951 }
953 {
954 DoFunc(input.b_mouse4Click);
955 }
956 else if (EInput.mouse4.pressedLong)
957 {
960 }
961 }
962 }
963
964 public void InputMovement()
965 {
966 float num = 0f;
967 float num2 = 0f;
968 Vector2 axis = EInput.axis;
969 bool flag = !EClass.core.IsGameStarted;
971 {
972 if (Input.GetKey(KeyCode.LeftShift))
973 {
974 axis *= 3f;
975 }
977 {
978 Vector2 zero = Vector2.zero;
979 if (mpos.x < 16f)
980 {
981 zero.x -= 1f;
982 }
983 if (mpos.x > (float)(Screen.width - 16))
984 {
985 zero.x += 1f;
986 }
987 if (mpos.y < 8f)
988 {
989 zero.y -= 1f;
990 }
991 if (mpos.y > (float)(Screen.height - 8))
992 {
993 zero.y += 1f;
994 }
995 if (zero != Vector2.zero)
996 {
997 axis += zero * (EClass.core.config.camera.sensEdge * 2f);
998 }
999 }
1000 EInput.hasAxisMoved = axis != Vector2.zero;
1001 _ = EInput.buttonScroll;
1002 if (Adv.IsActive)
1003 {
1004 _ = Adv.zoomOut;
1005 }
1006 if (EInput.buttonScroll != null && EInput.buttonScroll.pressing && (flag || !EClass.ui.BlockActions))
1007 {
1008 num = EInput.dragAmount.x * (0.1f + EClass.core.config.camera.sensDrag);
1009 num2 = EInput.dragAmount.y * (0.1f + EClass.core.config.camera.sensDrag);
1011 {
1012 num *= -1f;
1013 }
1015 {
1016 num2 *= -1f;
1017 }
1019 {
1020 EInput.hasAxisMoved = true;
1021 }
1022 }
1023 if (EInput.hasAxisMoved)
1024 {
1025 EClass.screen.zoomPos = Vector3.zero;
1026 }
1027 if (EInput.wheel != 0 && !InputModuleEX.GetComponentOf<UIScrollView>())
1028 {
1030 }
1031 }
1032 float momentum = EClass.core.config.camera.momentum;
1033 if (momentum > 0f && EInput.axis == Vector2.zero)
1034 {
1035 smoothX = Mathf.Lerp(smoothX, num, Time.smoothDeltaTime * momentum);
1036 smoothY = Mathf.Lerp(smoothY, num2, Time.smoothDeltaTime * momentum);
1037 }
1038 else
1039 {
1040 smoothX = num;
1041 smoothY = num2;
1042 }
1043 EClass.screen.ScrollMouse(smoothX * 0.1f, smoothY * 0.1f);
1044 if (EInput.hasAxisMoved)
1045 {
1046 OnScroll();
1047 EClass.screen.ScrollAxis(axis);
1048 }
1049 }
1050
1051 public virtual void InputWheel(int wheel)
1052 {
1053 if (AllowWheelZoom)
1054 {
1056 }
1057 }
1058
1059 public virtual void OnUpdateInput()
1060 {
1061 }
1062
1064 {
1065 switch (func)
1066 {
1067 case CoreConfig.GameFuncBuild.ExitBuildMode:
1069 break;
1070 case CoreConfig.GameFuncBuild.ToggleFreepos:
1072 break;
1073 case CoreConfig.GameFuncBuild.ToggleRoof:
1075 break;
1076 case CoreConfig.GameFuncBuild.ToggleSlope:
1078 break;
1079 case CoreConfig.GameFuncBuild.Rotate:
1080 OnRotate();
1081 break;
1082 case CoreConfig.GameFuncBuild.ToggleWall:
1084 break;
1085 case CoreConfig.GameFuncBuild.TogglePicker:
1086 if (Picker.CanActivate)
1087 {
1088 Picker.Activate();
1089 }
1090 break;
1091 case CoreConfig.GameFuncBuild.SnapFreepos:
1093 break;
1094 case CoreConfig.GameFuncBuild.ToggleBuildLight:
1096 break;
1097 }
1099 }
1100
1102 {
1105 {
1106 return input.middleClick == func;
1107 }
1109 {
1110 return input.middlePressLong == func;
1111 }
1112 if (EInput.mouse3.clicked)
1113 {
1114 return input.mouse3Click == func;
1115 }
1117 {
1118 return input.mouse3PressLong == func;
1119 }
1120 if (EInput.mouse4.clicked)
1121 {
1122 return input.mouse4Click == func;
1123 }
1125 {
1126 return input.mouse4PressLong == func;
1127 }
1128 return false;
1129 }
1130
1131 public void DoFunc(CoreConfig.GameFunc func)
1132 {
1134 switch (func)
1135 {
1136 default:
1137 return;
1138 case CoreConfig.GameFunc.OpenAllyInv:
1139 if (!EClass.pc.HasNoGoal || (targetChara != null && !targetChara.IsPCFaction))
1140 {
1141 return;
1142 }
1144 {
1145 if (!EClass.ui.IsInventoryOpen)
1146 {
1147 SE.PopInventory();
1148 }
1149 EClass.ui.ToggleInventory();
1150 }
1151 else if (targetChara != null && EClass.pc.Dist(targetChara) <= 1)
1152 {
1153 LayerInventory.CreateContainer(targetChara);
1154 }
1155 break;
1156 case CoreConfig.GameFunc.EmptyHand:
1157 EInput.action = EAction.EmptyHand;
1158 return;
1159 case CoreConfig.GameFunc.Fire:
1160 if (EInput.keyFire.Update(forcePress: true))
1161 {
1162 EInput.action = EAction.Fire;
1163 return;
1164 }
1165 break;
1166 case CoreConfig.GameFunc.SwitchHotbar:
1168 break;
1169 case CoreConfig.GameFunc.PropertySearch:
1170 EClass.ui.widgets.Toggle("Search")?.SoundActivate();
1171 break;
1172 case CoreConfig.GameFunc.Talk:
1173 if (!EClass.pc.HasNoGoal || targetChara == null || targetChara.hostility <= Hostility.Enemy || targetChara.IsPC || EClass.pc.Dist(targetChara) > 2)
1174 {
1175 return;
1176 }
1177 ACT.Chat.Perform(EClass.pc, targetChara);
1178 break;
1179 case CoreConfig.GameFunc.AllAction:
1180 if (!EClass.ui.isPointerOverUI)
1181 {
1183 }
1184 return;
1185 case CoreConfig.GameFunc.ToggleBuild:
1187 {
1188 SE.Beep();
1189 Msg.Say("invalidAction");
1190 return;
1191 }
1192 BuildMenu.Toggle();
1193 break;
1194 case CoreConfig.GameFunc.ShowJournal:
1195 {
1196 LayerJournal layerJournal = EClass.ui.ToggleLayer<LayerJournal>();
1197 if ((bool)layerJournal)
1198 {
1199 layerJournal.windows[0].SetRect(EClass.core.refs.rects.center);
1200 layerJournal.Delay();
1201 }
1202 break;
1203 }
1204 case CoreConfig.GameFunc.ToggleLog:
1206 break;
1207 case CoreConfig.GameFunc.ShowInv:
1208 EClass.ui.ToggleInventory(delay: true);
1209 break;
1210 case CoreConfig.GameFunc.ShowChara:
1211 {
1212 LayerChara layerChara = EClass.ui.ToggleLayer<LayerChara>();
1213 if ((bool)layerChara)
1214 {
1215 layerChara.SetChara(EClass.pc);
1216 layerChara.windows[0].SetRect(EClass.core.refs.rects.center);
1217 layerChara.Delay();
1218 }
1219 break;
1220 }
1221 case CoreConfig.GameFunc.ShowAbility:
1222 EClass.ui.ToggleAbility(delay: true);
1223 break;
1224 case CoreConfig.GameFunc.ToggleNoRoof:
1225 EClass.game.config.noRoof = !EClass.game.config.noRoof;
1226 break;
1227 case CoreConfig.GameFunc.ToggleZoom:
1228 Adv.ToggleZoom();
1229 break;
1230 case CoreConfig.GameFunc.EmuShift:
1231 case CoreConfig.GameFunc.EmuAlt:
1232 return;
1233 }
1234 EInput.Consume();
1235 }
1236
1237 public virtual void OnScroll()
1238 {
1239 }
1240
1242 {
1243 Widget componentOf = InputModuleEX.GetComponentOf<Widget>();
1244 if ((bool)componentOf && componentOf.RightClickToClose)
1245 {
1246 componentOf.Close();
1247 }
1248 }
1249
1250 public bool TryShowWidgetMenu()
1251 {
1252 Widget componentOf = InputModuleEX.GetComponentOf<Widget>();
1253 if ((bool)componentOf && componentOf.CanShowContextMenu())
1254 {
1255 if (componentOf.RightClickToClose)
1256 {
1257 componentOf.Close();
1258 return true;
1259 }
1260 componentOf.ShowContextMenu();
1261 return true;
1262 }
1263 return false;
1264 }
1265
1266 public HitResult _HitTest(Point point, Point start)
1267 {
1269 {
1270 return HitResult.NoTarget;
1271 }
1272 if (!point.IsValid)
1273 {
1274 return HitResult.NoTarget;
1275 }
1276 if (!CanTargetFog && !point.cell.isSeen)
1277 {
1278 return HitResult.Default;
1279 }
1280 return HitTest(point, start);
1281 }
1282
1283 public virtual HitResult HitTest(Point point, Point start)
1284 {
1285 return HitResult.Default;
1286 }
1287
1288 public virtual void OnSelectStart(Point point)
1289 {
1290 }
1291
1292 public virtual void OnSelectEnd(bool cancel)
1293 {
1294 }
1295
1296 public virtual MeshPass GetGuidePass(Point point)
1297 {
1298 if ((!point.HasNonWallBlock && !point.HasBlockRecipe && point.IsSeen) || (point.sourceBlock.tileType.Invisible && !IsBuildMode))
1299 {
1301 }
1303 }
1304
1305 public virtual void OnRenderTile(Point point, HitResult result, int dir)
1306 {
1307 if (result != HitResult.NoTarget && point.IsValid && (point.IsSeen || CanTargetFog))
1308 {
1309 MeshPass guidePass = GetGuidePass(point);
1310 int num = (int)result;
1311 if (tileSelector.start != null && result == HitResult.Default)
1312 {
1313 num = 2;
1314 }
1315 Vector3 vector = point.Position();
1316 if (num == 0)
1317 {
1318 num = GetDefaultTile(point);
1319 }
1320 guidePass.Add(vector.x, vector.y, vector.z - 0.01f, num, 0.3f);
1321 if (!IsRoofEditMode() && point.HasWallOrFence && !point.cell.hasDoor && HighlightWall(point))
1322 {
1323 EClass.screen.guide.DrawWall(point, EClass.Colors.blockColors.Passive, useMarkerPass: true);
1324 }
1325 if (IsBuildMode && EClass.screen.tileSelector.start == null && point.Installed != null && Inspect.IsActive)
1326 {
1327 point.Installed.trait.OnRenderTile(point, result, dir);
1328 }
1329 }
1330 }
1331
1332 public void OnRenderTileFloor(Point point, HitResult result)
1333 {
1334 if (result != HitResult.NoTarget && point.IsValid && (point.IsSeen || CanTargetFog))
1335 {
1336 MeshPass guidePass = GetGuidePass(point);
1337 int num = (int)result;
1338 if (tileSelector.start != null && result == HitResult.Default)
1339 {
1340 num = 2;
1341 }
1342 Vector3 vector = point.Position(point.cell.height);
1343 if (num == 0)
1344 {
1345 num = GetDefaultTile(point);
1346 }
1347 guidePass.Add(vector.x, vector.y, vector.z - 0.01f, num, 0.3f);
1348 }
1349 }
1350
1351 public virtual bool CanProcessTiles()
1352 {
1353 if (Multisize && Summary.countValid != hitW * hitH)
1354 {
1355 return false;
1356 }
1357 return true;
1358 }
1359
1360 public virtual void OnBeforeProcessTiles()
1361 {
1362 }
1363
1364 public virtual void OnProcessTiles(Point point, int dir)
1365 {
1366 }
1367
1368 public virtual void OnAfterProcessTiles(Point start, Point end)
1369 {
1370 }
1371
1372 public virtual void OnFinishProcessTiles()
1373 {
1374 }
1375
1376 public virtual void OnRefreshSummary(Point point, HitResult result, HitSummary summary)
1377 {
1378 if (result == HitResult.Valid || result == HitResult.Warning)
1379 {
1380 summary.money += CostMoney;
1381 summary.countValid++;
1382 }
1383 }
1384
1385 public void ShowLayer()
1386 {
1387 layer = OnShowLayer();
1388 if (layer != null)
1389 {
1391 }
1392 else
1393 {
1395 }
1396 if ((bool)EClass.core.screen.tileSelector)
1397 {
1399 }
1400 EClass.ui.hud.hint.Refresh();
1401 }
1402
1403 public virtual Layer OnShowLayer()
1404 {
1405 return null;
1406 }
1407
1408 public void HideLayer()
1409 {
1410 EClass.ui.RemoveLayer(layer);
1412 EClass.ui.hud.hint.UpdateText();
1413 OnHideLayer();
1414 }
1415
1416 public virtual void OnHideLayer()
1417 {
1418 }
1419
1420 public virtual string GetHintText()
1421 {
1422 string text = textHintTitle.IsEmpty(Lang.Get(id)) + " - ";
1423 BaseTileSelector baseTileSelector = EClass.screen.tileSelector;
1424 ActionMode actionMode = EClass.scene.actionMode;
1425 if (!layer)
1426 {
1427 text = ((actionMode == Inspect && Inspect.target != null) ? "hintMoveTarget".lang() : ((selectType == BaseTileSelector.SelectType.Single) ? (text + "hintSelectSingle".lang()) : ((baseTileSelector.start != null) ? (text + "hintSelectEnd".lang()) : (text + "hintSelectStart".lang()))));
1428 }
1429 else
1430 {
1431 if (actionMode == Build)
1432 {
1433 text += "hintBuild".lang();
1434 }
1435 if (actionMode == CreateArea)
1436 {
1437 text += "hintCreateArea".lang();
1438 }
1439 }
1440 if (actionMode == Build && Build.recipe != null && baseTileSelector.start == null)
1441 {
1443 {
1444 text = text + " " + "hintRotate".lang();
1445 }
1446 if (Build.MaxAltitude > 0)
1447 {
1448 text = text + " " + "hintAltitude2".lang();
1449 }
1450 }
1451 return text;
1452 }
1453
1454 public virtual void RotateUnderMouse()
1455 {
1456 SE.Rotate();
1457 Point hitPoint = Scene.HitPoint;
1458 if (!hitPoint.IsValid)
1459 {
1460 return;
1461 }
1462 hitPoint.cell.RotateAll();
1463 if (EClass.debug.enable)
1464 {
1465 hitPoint.growth?.Grow(100);
1466 if (hitPoint.Installed?.trait is TraitSeed)
1467 {
1468 (hitPoint.Installed.trait as TraitSeed).TrySprout(force: true);
1469 }
1470 }
1471 }
1472
1473 public virtual ref string SetMouseInfo(ref string s)
1474 {
1475 return ref s;
1476 }
1477
1478 public void TogglePause()
1479 {
1480 if (IsAdv)
1481 {
1482 EClass.core.config.game.autopause = !EClass.core.config.game.autopause;
1484 {
1485 SE.Play("tick0");
1486 }
1487 else
1488 {
1489 SE.Play("tick1");
1490 }
1491 }
1492 else if (EClass.game.gameSpeedIndex != 0)
1493 {
1494 Pause(sound: true);
1495 }
1496 else
1497 {
1498 UnPause(sound: true);
1499 }
1500 }
1501
1502 public void Pause(bool sound = false)
1503 {
1504 ChangeGameSpeed(1, sound);
1505 }
1506
1507 public void UnPause(bool sound = false)
1508 {
1510 }
1511
1512 public void ChangeGameSpeed(int a, bool sound = false)
1513 {
1514 if (EClass.game.gameSpeedIndex != a)
1515 {
1516 if (sound)
1517 {
1518 SE.Play("tick" + a);
1519 }
1520 EClass.game.gameSpeedIndex = a;
1521 if (a != 0)
1522 {
1523 EClass.game.lastGameSpeedIndex = a;
1524 }
1526 }
1527 }
1528}
AreaHighlightMode
EAction
Definition: EAction.cs:2
HitResult
Definition: HitResult.cs:2
Hostility
Definition: Hostility.cs:2
Definition: ACT.cs:6
static ActChat Chat
Definition: ACT.cs:9
Definition: AM_Adv.cs:6
void ToggleZoom()
Definition: AM_Adv.cs:1060
bool zoomOut
Definition: AM_Adv.cs:103
void UpdatePlans()
Definition: AM_Adv.cs:400
void ShowAllAction()
Definition: AM_Adv.cs:1014
Recipe recipe
Definition: AM_Build.cs:10
int MaxAltitude
Definition: AM_Build.cs:63
Definition: AM_Cut.cs:2
Definition: AM_Dig.cs:2
bool CanActivate
Definition: AM_Picker.cs:33
Definition: AM_Sim.cs:2
override bool Perform()
Definition: ActChat.cs:9
static AM_Inspect Inspect
Definition: ActionMode.cs:23
virtual MeshPass GetGuidePass(Point point)
Definition: ActionMode.cs:1296
static AM_Copy Copy
Definition: ActionMode.cs:45
static bool ignoreSound
Definition: ActionMode.cs:83
virtual void OnCancel()
Definition: ActionMode.cs:538
virtual bool AllowBuildModeShortcuts
Definition: ActionMode.cs:213
static AM_Title Title
Definition: ActionMode.cs:9
virtual void InputWheel(int wheel)
Definition: ActionMode.cs:1051
static AM_RemoveDesignation RemoveDesignation
Definition: ActionMode.cs:61
static AM_Select Select
Definition: ActionMode.cs:59
static AM_Sim Sim
Definition: ActionMode.cs:11
virtual void OnBeforeProcessTiles()
Definition: ActionMode.cs:1360
static AM_Picker Picker
Definition: ActionMode.cs:43
static AM_Cut Cut
Definition: ActionMode.cs:39
void OnRotate()
Definition: ActionMode.cs:560
virtual bool IsRoofEditMode(Card c=null)
Definition: ActionMode.cs:311
virtual bool HighlightWall(Point p)
Definition: ActionMode.cs:297
static float hotElementTimer
Definition: ActionMode.cs:103
virtual int SubMenuModeIndex
Definition: ActionMode.cs:241
void ChangeGameSpeed(int a, bool sound=false)
Definition: ActionMode.cs:1512
virtual void OnBeforeUpdate()
Definition: ActionMode.cs:546
virtual bool AllowAutoClick
Definition: ActionMode.cs:163
virtual int hitW
Definition: ActionMode.cs:131
virtual int hitH
Definition: ActionMode.cs:133
virtual int SelectorHeight
Definition: ActionMode.cs:223
static float textTimer
Definition: ActionMode.cs:89
void OnRenderTileFloor(Point point, HitResult result)
Definition: ActionMode.cs:1332
virtual void OnRefreshSummary(Point point, HitResult result, HitSummary summary)
Definition: ActionMode.cs:1376
virtual BaseTileSelector.SelectType selectType
Definition: ActionMode.cs:125
virtual void OnUpdateInput()
Definition: ActionMode.cs:1059
static AM_Paint Paint
Definition: ActionMode.cs:75
bool TryShowWidgetMenu()
Definition: ActionMode.cs:1250
static AM_Harvest Harvest
Definition: ActionMode.cs:37
static float smoothY
Definition: ActionMode.cs:87
virtual void OnFinishProcessTiles()
Definition: ActionMode.cs:1372
virtual void OnScroll()
Definition: ActionMode.cs:1237
virtual void OnActivate()
Definition: ActionMode.cs:413
static AM_Region Region
Definition: ActionMode.cs:17
virtual void OnSelectEnd(bool cancel)
Definition: ActionMode.cs:1292
static float[] GameSpeeds
Definition: ActionMode.cs:93
static bool IsAdv
Definition: ActionMode.cs:117
virtual string textHintTitle
Definition: ActionMode.cs:161
void UnPause(bool sound=false)
Definition: ActionMode.cs:1507
static Vector3 mpos
Definition: ActionMode.cs:91
static AM_ADV_Target AdvTarget
Definition: ActionMode.cs:19
virtual bool AllowGeneralInput
Definition: ActionMode.cs:219
virtual bool ShowExtraHint
Definition: ActionMode.cs:243
virtual void OnDeactivate()
Definition: ActionMode.cs:534
virtual string idHelpTopic
Definition: ActionMode.cs:153
HitResult _HitTest(Point point, Point start)
Definition: ActionMode.cs:1266
Layer layer
Definition: ActionMode.cs:97
void DoFunc(CoreConfig.GameFunc func)
Definition: ActionMode.cs:1131
static AM_StateEditor StateEditor
Definition: ActionMode.cs:41
virtual bool AllowHotbar
Definition: ActionMode.cs:217
void TogglePause()
Definition: ActionMode.cs:1478
virtual float TargetZoom
Definition: ActionMode.cs:227
virtual bool ShouldPauseGame
Definition: ActionMode.cs:175
static AM_ViewMap ViewMap
Definition: ActionMode.cs:63
static AM_Build Build
Definition: ActionMode.cs:49
HitSummary Summary
Definition: ActionMode.cs:135
static AM_ExpandArea ExpandArea
Definition: ActionMode.cs:55
static ActionMode DefaultMode
Definition: ActionMode.cs:7
virtual bool ShowMouseoverTarget
Definition: ActionMode.cs:167
virtual AreaHighlightMode AreaHihlight
Definition: ActionMode.cs:169
virtual BaseGameScreen TargetGameScreen
Definition: ActionMode.cs:231
static AM_NewZone NewZone
Definition: ActionMode.cs:29
static float smoothX
Definition: ActionMode.cs:85
static AM_EditArea EditArea
Definition: ActionMode.cs:53
static AM_MiniGame MiniGame
Definition: ActionMode.cs:27
virtual void OnUpdateCursor()
Definition: ActionMode.cs:554
virtual bool UseSubMenu
Definition: ActionMode.cs:235
void UpdateInput()
Definition: ActionMode.cs:570
virtual bool ShowBuildWidgets
Definition: ActionMode.cs:183
void RefreshTexts()
Definition: ActionMode.cs:417
void Pause(bool sound=false)
Definition: ActionMode.cs:1502
virtual void OnSelectStart(Point point)
Definition: ActionMode.cs:1288
static AM_Populate Populate
Definition: ActionMode.cs:67
void Deactivate()
Definition: ActionMode.cs:529
void InputMovement()
Definition: ActionMode.cs:964
virtual bool AllowMiddleClickFunc
Definition: ActionMode.cs:215
void ShowLayer()
Definition: ActionMode.cs:1385
virtual void SEExecuteSummary()
Definition: ActionMode.cs:292
virtual Layer OnShowLayer()
Definition: ActionMode.cs:1403
virtual string OnSetSubMenuButton(int a, UIButton b)
Definition: ActionMode.cs:306
virtual void OnClickSubMenu(int a)
Definition: ActionMode.cs:302
virtual void OnAfterProcessTiles(Point start, Point end)
Definition: ActionMode.cs:1368
virtual bool CanSelectTile
Definition: ActionMode.cs:171
virtual bool hideBalloon
Definition: ActionMode.cs:159
void Activate(bool toggle=true, bool forceActivate=false)
Definition: ActionMode.cs:339
virtual BuildMenu.Mode buildMenuMode
Definition: ActionMode.cs:186
virtual bool FixFocus
Definition: ActionMode.cs:177
void SetCursorOnMap(CursorInfo cursor)
Definition: ActionMode.cs:565
virtual BaseTileMap.CardIconMode cardIconMode
Definition: ActionMode.cs:229
static AM_Blueprint Blueprint
Definition: ActionMode.cs:47
void HideLayer()
Definition: ActionMode.cs:1408
virtual bool AllowWheelZoom
Definition: ActionMode.cs:225
virtual bool ShowMaskedThings
Definition: ActionMode.cs:221
static List< TCSimpleText > simpleTexts
Definition: ActionMode.cs:95
bool IsActive
Definition: ActionMode.cs:121
virtual ref string SetMouseInfo(ref string s)
Definition: ActionMode.cs:1473
virtual bool ShowActionHint
Definition: ActionMode.cs:165
virtual bool CanProcessTiles()
Definition: ActionMode.cs:1351
void DoFunc(CoreConfig.GameFuncBuild func)
Definition: ActionMode.cs:1063
virtual bool ShouldHideBuildMenu
Definition: ActionMode.cs:198
static AM_FlagCell FlagCell
Definition: ActionMode.cs:77
virtual BaseTileSelector.BoxType boxType
Definition: ActionMode.cs:127
virtual bool CanTargetOutsideBounds
Definition: ActionMode.cs:173
virtual bool IsBuildMode
Definition: ActionMode.cs:181
virtual int GetDefaultTile(Point p)
Definition: ActionMode.cs:321
virtual bool HideSubWidgets
Definition: ActionMode.cs:179
static AM_Visibility Visibility
Definition: ActionMode.cs:71
virtual string GetSimpleText(Card c)
Definition: ActionMode.cs:508
static AM_Dig Dig
Definition: ActionMode.cs:35
static AM_Terrain Terrain
Definition: ActionMode.cs:65
virtual HitResult HitTest(Point point, Point start)
Definition: ActionMode.cs:1283
static SourceMaterial.Row lastEditorMat
Definition: ActionMode.cs:81
static AM_Deconstruct Deconstruct
Definition: ActionMode.cs:57
virtual bool UseSubMenuSlider
Definition: ActionMode.cs:237
virtual string GetHintText()
Definition: ActionMode.cs:1420
virtual bool IsNoMap
Definition: ActionMode.cs:233
virtual void OnAfterUpdate()
Definition: ActionMode.cs:550
virtual string idSound
Definition: ActionMode.cs:155
bool IsFuncPressed(CoreConfig.GameFunc func)
Definition: ActionMode.cs:1101
static AM_Cinema Cinema
Definition: ActionMode.cs:73
static AM_Adv AdvOrRegion
Definition: ActionMode.cs:106
BaseTileSelector tileSelector
Definition: ActionMode.cs:245
virtual CursorInfo DefaultCursor
Definition: ActionMode.cs:151
virtual void RotateUnderMouse()
Definition: ActionMode.cs:1454
static void OnGameInstantiated()
Definition: ActionMode.cs:247
static ActionMode LastBuildMode
Definition: ActionMode.cs:79
static AM_ViewZone View
Definition: ActionMode.cs:13
virtual float gameSpeed
Definition: ActionMode.cs:119
void TryRightClickCloseWidget()
Definition: ActionMode.cs:1241
static AM_EloMap EloMap
Definition: ActionMode.cs:21
static float focusTimer
Definition: ActionMode.cs:101
virtual bool SubMenuAsGroup
Definition: ActionMode.cs:239
static AM_NoMap NoMap
Definition: ActionMode.cs:25
virtual void OnHideLayer()
Definition: ActionMode.cs:1416
void ClearSimpleTexts()
Definition: ActionMode.cs:517
virtual bool ContinuousClick
Definition: ActionMode.cs:129
virtual BaseTileSelector.HitType hitType
Definition: ActionMode.cs:123
virtual bool CanTargetFog
Definition: ActionMode.cs:209
static AM_Bird Bird
Definition: ActionMode.cs:31
virtual int CostMoney
Definition: ActionMode.cs:211
virtual bool enableMouseInfo
Definition: ActionMode.cs:157
static AM_EditMarker EditMarker
Definition: ActionMode.cs:69
virtual void OnShowExtraHint(UINote n)
Definition: ActionMode.cs:326
static AM_CreateArea CreateArea
Definition: ActionMode.cs:51
static AM_Mine Mine
Definition: ActionMode.cs:33
virtual void OnRenderTile(Point point, HitResult result, int dir)
Definition: ActionMode.cs:1305
static AM_Adv Adv
Definition: ActionMode.cs:15
virtual bool IsFillMode()
Definition: ActionMode.cs:316
virtual int TopHeight(Point p)
Definition: ActionMode.cs:287
bool Multisize
Definition: ActionMode.cs:138
int brushRadius
Definition: ActionMode.cs:99
virtual void OnProcessTiles(Point point, int dir)
Definition: ActionMode.cs:1364
int group
Definition: AreaData.cs:18
AreaData data
Definition: BaseArea.cs:29
ScreenGuide guide
void ModTargetZoomIndex(int a)
void ScrollAxis(Vector3 axis, bool direct=false)
void ScrollMouse(float x, float y)
BaseTileSelector tileSelector
static void Deactivate()
Definition: BuildMenu.cs:173
static BuildMenu Instance
Definition: BuildMenu.cs:77
static void Toggle()
Definition: BuildMenu.cs:93
TerrainMenu terrainMenu
Definition: BuildMenu.cs:49
static void Activate()
Definition: BuildMenu.cs:117
SourceElement.Row source
Definition: ButtonAbility.cs:8
Card card
Definition: ButtonGrid.cs:24
InvOwner invOwner
Definition: ButtonGrid.cs:28
bool dragging2
Definition: ButtonState.cs:45
bool pressing
Definition: ButtonState.cs:35
bool clicked
Definition: ButtonState.cs:37
void Consume()
Definition: ButtonState.cs:184
bool pressedLong
Definition: ButtonState.cs:64
Action pressedLongAction
Definition: ButtonState.cs:61
static void SetNormalRarity(bool fixedMat=false)
Definition: Card.cs:11
virtual bool isThing
Definition: Card.cs:2081
SourceMaterial.Row DyeMat
Definition: Card.cs:1940
SourceMaterial.Row material
Definition: Card.cs:2051
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3041
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3104
Point pos
Definition: Card.cs:59
void Dye(string idMat)
Definition: Card.cs:6011
Trait trait
Definition: Card.cs:53
bool isDyed
Definition: Card.cs:458
void Destroy()
Definition: Card.cs:5070
bool IsInstalled
Definition: Card.cs:2381
int Dist(Card c)
Definition: Card.cs:7665
Cell Cell
Definition: Card.cs:2055
Definition: Cell.cs:7
Room room
Definition: Cell.cs:102
SourceMaterial.Row matBlock
Definition: Cell.cs:1030
SourceMaterial.Row matObj
Definition: Cell.cs:1036
byte height
Definition: Cell.cs:72
SourceMaterial.Row matFloor
Definition: Cell.cs:1032
bool isSeen
Definition: Cell.cs:282
Point GetPoint()
Definition: Cell.cs:1101
void RotateAll()
Definition: Cell.cs:1493
bool hasDoor
Definition: Cell.cs:258
Definition: Chara.cs:10
override bool IsPC
Definition: Chara.cs:612
override bool IsPCFaction
Definition: Chara.cs:671
bool HasNoGoal
Definition: Chara.cs:1000
Hostility hostility
Definition: Chara.cs:291
BlockColors blockColors
GameFuncBuild b_mouse4PressLong
Definition: CoreConfig.cs:258
GameFuncBuild b_middlePressLong
Definition: CoreConfig.cs:250
GameFuncBuild b_mouse3Click
Definition: CoreConfig.cs:252
GameFuncBuild b_mouse3PressLong
Definition: CoreConfig.cs:254
GameFuncBuild b_middleClick
Definition: CoreConfig.cs:248
GameFuncBuild b_mouse4Click
Definition: CoreConfig.cs:256
new GameConfig game
Definition: CoreConfig.cs:609
CameraConfig camera
Definition: CoreConfig.cs:617
new UISetting ui
Definition: CoreConfig.cs:601
InputSetting input
Definition: CoreConfig.cs:615
DebugHotkey debugHotkeys
Definition: CoreDebug.cs:143
void UpdateInput()
Definition: CoreDebug.cs:864
bool enable
Definition: CoreDebug.cs:286
bool godBuild
Definition: CoreDebug.cs:304
bool ignoreBuildRule
Definition: CoreDebug.cs:185
RectData center
Definition: CoreRef.cs:166
Sprite spriteConquer
Definition: CoreRef.cs:248
Sprite spriteDeath
Definition: CoreRef.cs:250
Sprite spriteVisited
Definition: CoreRef.cs:246
TCs tcs
Definition: CoreRef.cs:353
Rects rects
Definition: CoreRef.cs:361
Definition: Core.cs:14
CoreRef refs
Definition: Core.cs:51
CoreDebug debug
Definition: Core.cs:31
BaseGameScreen screen
Definition: Core.cs:67
bool IsGameStarted
Definition: Core.cs:84
static float delta
Definition: Core.cs:17
CoreConfig config
Definition: Core.cs:70
static CursorInfo Select
Definition: CursorSystem.cs:58
static void SetCursor(CursorInfo info=null, int _priority=0)
static bool IsActive
Definition: DropdownGrid.cs:8
static DropdownGrid Instance
Definition: DropdownGrid.cs:10
void Deactivate()
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static ColorProfile Colors
Definition: EClass.cs:39
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static SourceManager sources
Definition: EClass.cs:43
static BaseGameScreen screen
Definition: EClass.cs:33
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
static SoundManager Sound
Definition: EClass.cs:47
static UI ui
Definition: EClass.cs:17
static GameSetting setting
Definition: EClass.cs:35
bool Update(bool forcePress=false)
Definition: EInput.cs:215
Definition: EInput.cs:8
static bool IsAnyKeyDown(bool includeAxis=true, bool _skipframe=true)
Definition: EInput.cs:619
static bool isCancel
Definition: EInput.cs:378
static int wheel
Definition: EInput.cs:289
static bool hasMouseMoved
Definition: EInput.cs:311
static ButtonState middleMouse
Definition: EInput.cs:353
static bool isCtrlDown
Definition: EInput.cs:263
static void Consume(int _skipFrame)
Definition: EInput.cs:656
static bool isAltDown
Definition: EInput.cs:265
static ButtonState mouse4
Definition: EInput.cs:357
static Vector2 axis
Definition: EInput.cs:331
static ButtonState buttonCtrl
Definition: EInput.cs:361
static ButtonState leftMouse
Definition: EInput.cs:349
static bool isShiftDown
Definition: EInput.cs:261
static ButtonState buttonScroll
Definition: EInput.cs:359
static ButtonState rightMouse
Definition: EInput.cs:351
static int functionkey
Definition: EInput.cs:285
static ButtonState mouse3
Definition: EInput.cs:355
static bool waitReleaseAnyKey
Definition: EInput.cs:317
static KeyboardPress keyFire
Definition: EInput.cs:249
static int hotkey
Definition: EInput.cs:283
static bool hasAxisMoved
Definition: EInput.cs:271
static EAction action
Definition: EInput.cs:259
Definition: EloMap.cs:8
RenderSetting render
Definition: GameSetting.cs:301
bool noRoof
Definition: Game.cs:27
bool altUI
Definition: Game.cs:267
int lastGameSpeedIndex
Definition: Game.cs:231
int gameSpeedIndex
Definition: Game.cs:229
Config config
Definition: Game.cs:218
void Grow(int mtp=1)
Definition: GrowSystem.cs:340
int countValid
Definition: HitSummary.cs:10
static TaskBuild taskBuild
Definition: HotItemHeld.cs:7
virtual void OnShiftClick(ButtonGrid b, bool rightMouse=false)
Definition: InvOwner.cs:939
Card Container
Definition: InvOwner.cs:535
virtual bool CanShiftClick(ButtonGrid b, bool rightMouse=false)
Definition: InvOwner.cs:976
Definition: Lang.cs:6
static string Get(string id)
Definition: Lang.cs:91
static string[] GetList(string id)
Definition: Lang.cs:114
static ButtonAbility hotElement
Definition: LayerAbility.cs:23
static void ClearHotElement()
LayerChara SetChara(Chara c)
Definition: LayerChara.cs:9
Thing product
Definition: LayerCraft.cs:20
static LayerDrama Instance
Definition: LayerDrama.cs:20
List< UIInventory > invs
static LayerInventory CreateContainer(Card owner)
static LayerInventory GetLayer(Card t)
static void Close(Thing t)
Definition: Layer.cs:9
List< Window > windows
Definition: Layer.cs:116
void Delay(float duration=0.05f)
Definition: Layer.cs:597
Cell GetCell(int index)
Definition: Map.cs:887
IEnumerable< Card > Cards
Definition: Map.cs:135
List< Thing > things
Definition: Map.cs:49
Dictionary< int, int > backerObjs
Definition: Map.cs:67
List< Chara > charas
Definition: Map.cs:81
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
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 SetCurrentHotItem(HotItem item)
Definition: Player.cs:2268
void Update(Point _pos)
Definition: PointTarget.cs:52
Chara TargetChara
Definition: PointTarget.cs:41
Definition: Point.cs:9
Thing Installed
Definition: Point.cs:327
bool IsSeen
Definition: Point.cs:342
SourceBlock.Row sourceBlock
Definition: Point.cs:63
ref Vector3 Position(int height)
Definition: Point.cs:548
ref Vector3 PositionTopdown()
Definition: Point.cs:569
bool HasWallOrFence
Definition: Point.cs:155
bool IsInBoundsPlus
Definition: Point.cs:116
bool HasBlockRecipe
Definition: Point.cs:217
bool Equals(int _x, int _z)
Definition: Point.cs:960
bool IsValid
Definition: Point.cs:88
bool HasObj
Definition: Point.cs:137
bool HasBlock
Definition: Point.cs:141
Cell cell
Definition: Point.cs:51
GrowSystem growth
Definition: Point.cs:77
bool HasNonWallBlock
Definition: Point.cs:194
static void Despawn(Component c)
Definition: PoolManager.cs:128
Definition: Popper.cs:6
Popper SetText(string s, Color c=default(Color))
Definition: Popper.cs:28
virtual bool CanRotate
Definition: Recipe.cs:299
Definition: Region.cs:7
Definition: Scene.cs:8
void ToggleShowRoof()
Definition: Scene.cs:885
void ToggleShowWall()
Definition: Scene.cs:919
void ToggleMuteBGM()
Definition: Scene.cs:979
void ToggleLight()
Definition: Scene.cs:891
static Point HitPoint
Definition: Scene.cs:21
bool hideBalloon
Definition: Scene.cs:147
void ToggleSlope()
Definition: Scene.cs:931
ActionMode actionMode
Definition: Scene.cs:79
void UpdateCursor()
Definition: Scene.cs:755
void ToggleFreePos()
Definition: Scene.cs:908
void ToggleSnapFreePos()
Definition: Scene.cs:897
PointTarget mouseTarget
Definition: Scene.cs:135
void DrawWall(Point point, int color, bool useMarkerPass=false, float offsetZ=0f)
Definition: ScreenGuide.cs:42
MeshPass passGuideBlock
Definition: ScreenGuide.cs:5
MeshPass passGuideFloor
Definition: ScreenGuide.cs:7
SourceMaterial materials
SourceBacker backers
bool isRandomSite
Definition: Spatial.cs:334
bool isDeathLocation
Definition: Spatial.cs:418
bool IsPlayerFaction
Definition: Spatial.cs:455
virtual bool IsRegion
Definition: Spatial.cs:515
bool destryoed
Definition: Spatial.cs:45
bool isConquered
Definition: Spatial.cs:382
virtual Point RegionPos
Definition: Spatial.cs:560
int visitCount
Definition: Spatial.cs:154
List< Spatial > children
Definition: Spatial.cs:37
static TCSimpleText SpawnIcon(Sprite sprite=null)
Definition: TCSimpleText.cs:16
static TCSimpleText Spawn()
Definition: TCSimpleText.cs:11
TextMesh tm
Definition: TCSimpleText.cs:5
void Show(ActionMode _am)
Definition: TerrainMenu.cs:11
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
virtual void OnRenderTile(Point point, HitResult result, int dir)
Definition: Trait.cs:706
virtual bool CanMiddleClick()
Definition: UIButton.cs:212
virtual void OnMiddleClick(bool forceClick)
Definition: UIButton.cs:217
Definition: UIItem.cs:5
object refObj
Definition: UIItem.cs:30
Definition: UINote.cs:6
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
static WidgetCurrentTool Instance
void Select(int index, bool fromHotkey=false)
static void RefreshHighlights()
static WidgetHotbar HotbarExtra
Definition: WidgetHotbar.cs:40
void TryUse(int index)
static void ToggleLog()
static WidgetMouseover Instance
Definition: Widget.cs:7
virtual bool RightClickToClose
Definition: Widget.cs:208
void ShowContextMenu()
Definition: Widget.cs:601
void Close()
Definition: Widget.cs:319
virtual bool CanShowContextMenu()
Definition: Widget.cs:596
bool CanEnterBuildModeAnywhere
Definition: Zone.cs:458