Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ZoneInspector.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class ZoneInspector : EMono
4{
5 public class FillUtil
6 {
7 public int flatHeight;
8
9 public int fillFloor = 5;
10
11 public int fillBlock = 1;
12
13 public bool randomFillDir;
14
15 public void FlattenHeight()
16 {
17 EMono._map.ForeachCell(delegate(Cell c)
18 {
19 c.height = (byte)flatHeight;
20 });
22 }
23
24 public void FillFloor()
25 {
26 EMono._map.ForeachCell(delegate(Cell c)
27 {
28 int dir = (randomFillDir ? EMono.rnd(4) : 0);
29 EMono._map.SetFloor(c.x, c.z, EMono.sources.floors.rows[fillFloor].DefaultMaterial.id, fillFloor, dir);
30 });
31 }
32
33 public void FillBlock()
34 {
35 EMono._map.ForeachCell(delegate(Cell c)
36 {
37 int dir = (randomFillDir ? EMono.rnd(4) : 0);
38 EMono._map.SetBlock(c.x, c.z, EMono.sources.blocks.rows[fillBlock].DefaultMaterial.id, fillBlock, dir);
39 });
40 }
41
42 public void ClearBlock()
43 {
44 EMono._map.ForeachCell(delegate(Cell c)
45 {
46 EMono._map.SetBlock(c.x, c.z);
47 });
48 }
49
50 public void ClearObj()
51 {
52 EMono._map.ForeachCell(delegate(Cell c)
53 {
54 EMono._map.SetObj(c.x, c.z);
55 });
56 }
57
58 public void ClearBridge()
59 {
60 EMono._map.ForeachCell(delegate(Cell c)
61 {
62 EMono._map.SetObj(c.x, c.z);
63 });
64 }
65 }
66
67 public class ResizeUtil
68 {
69 public int newSize;
70
71 public Vector2Int offset;
72
73 public void Apply()
74 {
75 if (EMono._map.Size != newSize)
76 {
78 }
79 if (offset.x != 0 || offset.y != 0)
80 {
82 }
83 }
84 }
85
86 public static ZoneInspector Instance;
87
89
90 public FillUtil fill = new FillUtil();
91
92 public Zone zone;
93
94 public string idExport => zone?.idExport;
95
97 {
98 get
99 {
100 return zone?.map.config;
101 }
102 set
103 {
104 zone.map.config = value;
105 }
106 }
107
109 {
110 get
111 {
112 return zone?.map.bounds;
113 }
114 set
115 {
116 zone.map.bounds = value;
117 }
118 }
119
120 private void Awake()
121 {
122 Instance = this;
123 }
124
125 public void RefreshAll()
126 {
128 }
129
130 public void RefreshScreen()
131 {
133 {
134 EMono.scene.profile = SceneProfile.Load(EMono._map.config.idSceneProfile.IsEmpty("default"));
136 if (EMono.player.zone is Region)
137 {
139 }
140 else
141 {
143 }
144 EMono.screen.SetZoom(0.5f);
146 }
147 }
148
150 {
151 foreach (Thing thing in EMono._map.things)
152 {
153 thing.isPlayerCreation = true;
154 }
155 foreach (Chara chara in EMono._map.charas)
156 {
157 chara.isPlayerCreation = true;
158 }
159 }
160
161 public void Export()
162 {
164 }
165
166 private void OnValidate()
167 {
168 if (Application.isPlaying)
169 {
171 }
172 }
173}
static AM_Region Region
Definition: ActionMode.cs:17
void Activate(bool toggle=true, bool forceActivate=false)
Definition: ActionMode.cs:339
static AM_Adv Adv
Definition: ActionMode.cs:15
void SetZoom(float z)
void RefreshScreenSize()
Definition: Cell.cs:7
byte z
Definition: Cell.cs:58
byte x
Definition: Cell.cs:56
Definition: Chara.cs:10
bool IsGameStarted
Definition: Core.cs:84
Definition: EMono.cs:4
static Core core
Definition: EMono.cs:5
static Player player
Definition: EMono.cs:11
static Zone _zone
Definition: EMono.cs:19
static BaseGameScreen screen
Definition: EMono.cs:29
static int rnd(int a)
Definition: EMono.cs:47
static Map _map
Definition: EMono.cs:17
static SourceManager sources
Definition: EMono.cs:41
int Size
Definition: MapBounds.cs:20
string idSceneProfile
Definition: MapConfig.cs:8
new void ForeachCell(Action< Cell > action)
Definition: Map.cs:2324
void Shift(Vector2Int offset)
Definition: Map.cs:254
List< Thing > things
Definition: Map.cs:49
void SetFloor(int x, int z, int idMat=0, int idFloor=0)
Definition: Map.cs:951
void SetBlock(int x, int z, int idMat=0, int idBlock=0)
Definition: Map.cs:990
MapConfig config
Definition: Map.cs:37
List< Chara > charas
Definition: Map.cs:81
void Resize(int newSize)
Definition: Map.cs:226
void RefreshAllTiles()
Definition: Map.cs:2086
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1522
MapBounds bounds
Definition: Map.cs:52
Zone zone
Definition: Player.cs:883
Definition: Region.cs:7
static SceneProfile Load(string id)
Definition: SceneProfile.cs:18
SourceBlock blocks
SourceFloor floors
Definition: Thing.cs:8
ResizeUtil resize
void RefreshScreen()
MapConfig mapConfig
FillUtil fill
void SetAllPlayerCreation()
static ZoneInspector Instance
MapBounds bounds
Definition: Zone.cs:12
virtual string idExport
Definition: Zone.cs:147
void Export(string path, PartialMap partial=null, bool usermap=false)
Definition: Zone.cs:2898
Map map
Definition: Zone.cs:60