2using System.Collections.Generic;
61 public void Init(
bool _backup,
string _pathBackup =
"",
string _idDest =
"")
68 for (
int i = 0; i < 2; i++)
70 Vector2 anchoredPosition =
windows[i].Rect().anchoredPosition;
71 windows[i].Rect().anchoredPosition =
new Vector2(anchoredPosition.x + 40f, anchoredPosition.y - 30f);
74 if (!
backup && Application.isEditor)
76 FileInfo[] files =
new DirectoryInfo(
"D:\\Download").GetFiles();
77 foreach (FileInfo fileInfo
in files)
79 if (fileInfo.Name.StartsWith(
"world") && fileInfo.Name.EndsWith(
".zip"))
81 string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileInfo.Name);
82 string path = CorePath.RootSave + fileNameWithoutExtension;
83 if (!Directory.Exists(path))
85 Directory.CreateDirectory(path);
86 new StreamWriter(
new MemoryStream());
87 ReadOptions options =
new ReadOptions();
88 ZipFile.Read(fileInfo.FullName, options).ExtractAll(path);
96 windows[0].ClearBottomButtons();
97 windows[0].AddBottomButton(
"toggleCloud", delegate
110 windows[0].SetCaption(
"saveList".lang() + (
cloud ? (
" " +
"isCloud".lang()) :
""));
115 goInfo.SetActive(value:
false);
123 string s = a.Title + ((ELayer.core.IsGameStarted && a.id ==
Game.
id) ?
"currentSave".lang() :
"") + Environment.NewLine;
149 goInfo.SetActive(value:
true);
182 ColorUtility.TryParseHtmlString(
"#" + i.
color, out color);
204 bool flag2 = Directory.Exists(text2);
205 if (Directory.Exists(text) || Directory.Exists(text3))
208 ELayer.ui.Say(
"cloud_conflict");
217 Debug.Log(
"Converting Backup files:");
218 Directory.Move(text2, text3);
219 foreach (GameIndex game in GameIO.GetGameList(((!cloud) ? CorePath.PathBackupCloud : CorePath.PathBackup) + i.id +
"/"))
221 Debug.Log(
"Processing:" + game.id +
": " + game.path);
224 GameIO.PrepareSteamCloud(game.id, game.path);
228 Debug.Log(
"Converting Current World:");
229 Directory.Move(sourceDirName, text);
232 GameIO.UpdateGameIndex(i);
235 GameIO.PrepareSteamCloud(i.id);
280 buttonDelete.SetOnClick(delegate
290 buttonListBackup.SetOnClick(delegate
294 buttonBackup.SetOnClick(delegate
298 ELayer.game.backupTime = 0.0;
306 buttonOpen.SetOnClick(delegate
310 buttonLoad.SetActive(flag);
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
static string RootSaveCloud
static string PathBackupCloud
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
static SourceManager sources
static void DeleteGame(string id, bool cloud, bool deleteBackup=true)
static void UpdateGameIndex(GameIndex i)
static List< GameIndex > GetGameList(string path, bool sortByName=false, bool includeEmptyFolder=false)
static void MakeBackup(GameIndex index, string suffix="")
static void Load(string id, bool cloud)
static bool TryLoad(string id, bool cloud, Action onLoad)
bool Save(bool isAutoSave=false, bool silent=false)
static void CopyDir(string sourceDirectory, string targetDirectory, Func< string, bool > funcExclude=null)
void RefreshInfo(GameIndex i)
void Init(bool _backup, string _pathBackup="", string _idDest="")
UIButton buttonListBackup
void SetPortrait(string id, Color colorOverlay=default(Color), bool applyColorMod=true)
override void Add(object item)
virtual void Refresh(bool highlightLast=false)
UIItem AddTopic(string id, string text, string value=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
void Space(int sizeY=0, int sizeX=1)
static void ShowExplorer(string itemPath, bool selectFirstFile=false)
bool IsSaveCompatible(Version v)