1using System.Collections.Generic;
22 public List<int>
ruined =
new List<int>();
86 public static string PathTemp => CorePath.MapPieceSave +
"_temp.mp";
90 public string ID =>
new FileInfo(
path).Name.Replace(
".mp",
"");
107 item.skipRender =
false;
150 int maxX = point.x +
w;
151 int maxZ = point.z +
h;
157 minZ = point.z -
w + 1;
161 minX = point.x -
w + 1;
163 minZ = point.z -
h + 1;
167 minX = point.x -
h + 1;
176 this.result.
ruined.Clear();
179 for (
int i = 0; i <
w; i++)
181 for (
int j = 0; j <
h; j++)
184 p.
Set(point.
x + num2, point.
z + num3);
199 c1.skipRender =
true;
206 guidePass.
Add(vector.x, vector.y, vector.z - 0.01f, num4, 0.3f);
236 this.result.ruined.Add(p.
index);
275 c1.decal = cell.
decal;
276 c1._dirs = cell.
_dirs;
282 c1.isModified =
true;
289 c1.height = (byte)Mathf.Clamp(height + cell.
height - num, 0, 255);
290 c1.bridgeHeight = (byte)Mathf.Clamp((cell.
bridgeHeight != 0) ? (c1.height + (cell.bridgeHeight - cell.
height)) : 0, 0, 255);
341 p.
Set(point.
x, point.
z);
413 public void Save(
int _x,
int _z,
int _w,
int _h)
420 for (
int i = _x; i < _x +
w; i++)
422 for (
int j = _z; j < _z +
h; j++)
445 partialMap.ruinChance = 0f;
452 bool flag =
path.IsEmpty();
457 if (!File.Exists(
path))
462 if (metaData ==
null || metaData.
partial ==
null)
478 map =
GameIO.LoadFile<
Map>(EClass._zone.pathTemp +
"map");
488 for (
int i = 0; i <
w; i++)
490 for (
int j = 0; j <
h; j++)
511 string fullFileNameWithoutExtension =
path.GetFullFileNameWithoutExtension();
513 IO.DeleteFile(fullFileNameWithoutExtension +
".jpg");
514 IO.DeleteFile(fullFileNameWithoutExtension +
".txt");
522 if (!
string.IsNullOrEmpty(pathDest))
534 string fileName = CorePath.Temp +
"preview.jpg";
535 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
538 RenderTexture renderTexture =
new RenderTexture(num, num2, 0);
539 renderTexture.Create();
540 RenderTexture active = RenderTexture.active;
541 RenderTexture.active = renderTexture;
542 Graphics.Blit(texture2D, renderTexture);
543 Texture2D texture2D2 =
new Texture2D(num, num2, texture2D.format, mipChain:
false);
544 texture2D2.ReadPixels(
new Rect(0f, 0f, num, num2), 0, 0);
546 RenderTexture.active = active;
547 renderTexture.Release();
548 File.WriteAllBytes(fileName, texture2D2.EncodeToJPG());
549 ZipFile zipFile = ZipFile.Read(
path);
550 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
551 zipFile.AddFile(fileName,
"");
552 zipFile.Save(pathDest);
554 IO.DeleteFile(fileName);
555 Object.Destroy(texture2D2);
556 Object.Destroy(texture2D);
557 Object.Destroy(renderTexture);
virtual MeshPass GetGuidePass(Point point)
void WaitForEndOfFrame(Action action)
List< Action > actionsNextFrame
static int GetTilePrice(TileRow row, SourceMaterial.Row mat)
int GetCurrency(string id="money")
SourceBlock.Row sourceBlock
SourceMaterial.Row matBlock
SourceFloor.Row sourceFloor
SourceMaterial.Row matRoofBlock
SourceMaterial.Row matObj
SourceMaterial.Row matBridge
SourceFloor.Row sourceBridge
SourceMaterial.Row matFloor
SourceBlock.Row sourceRoofBlock
static string MapPieceSaveUser
static string MapPieceSave
static void RebuildCritter(Cell cell)
static SourceManager sources
bool Contains(int dx, int dz)
static void UpdateMetaData(string pathZip, PartialMap partial=null)
static MapMetaData GetMetaData(string pathZip)
void Load(string path, bool import=false, PartialMap partial=null)
void Add(Point point, float tile=0f, float color=0f)
static string SayRaw(string text)
static void Delete(string path)
ZoneExportData exportData
void Apply(Point _point, ApplyMode mode)
static void SavePreview(string path, string pathDest)
static PartialMap Load(string path=null)
static PartialMap Apply(string path, Point pos)
HashSet< int > validPoints
static void ExportDialog(string dir=null)
void Save(int _x, int _z, int _w, int _h)
ref Vector3 Position(int height)
Point Set(int _x, int _z)
bool Within(int _x, int _z, int _w, int _h)
static int Range(int min, int max)
virtual void OnRenderMarker(Point point, bool active, HitResult result, bool main, int dir, int bridgeHeight)
static Recipe GetOrCreate(string id)
static string SaveFilePanel(string title, string directory, string defaultName, string extension)
void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial=null)
Dictionary< string, CardRow > map
override int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
virtual bool CanBeDestroyed
virtual bool CanCopyInBlueprint
SerializedCards serializedCards
ZoneExportData Import(string path)
void Export(string path, PartialMap partial=null, bool usermap=false)