public static float CheckSize(int size, ref ScriptUtil.SIZE_TYPE type) { type = ScriptUtil.SIZE_TYPE.KILOBYTE; float num = (float)size; if (num > 1024f) { num /= 1024f; } if (num > 1024f) { num /= 1024f; type = ScriptUtil.SIZE_TYPE.MEGABYTE; } if (num > 1024f) { num /= 1024f; type = ScriptUtil.SIZE_TYPE.GIGABYTE; } return(num); }
private void DownloadConfirmation(int size, Action callback, bool returnConfirmation = false) { if (size <= 0) { callback(); return; } string[] array = new string[] { StringMaster.GetString("DownloadSizeKB"), StringMaster.GetString("DownloadSizeMB"), StringMaster.GetString("DownloadSizeGB") }; ScriptUtil.SIZE_TYPE size_TYPE = ScriptUtil.SIZE_TYPE.KILOBYTE; ScriptUtil.ShowCommonDialogForMessage(delegate(int index) { if (index == 0) { callback(); } else if (returnConfirmation) { ScriptUtil.ShowCommonDialog(delegate(int id) { if (id == 0) { GUIMain.BackToTOP("UIStartupCaution", 0.8f, 0.8f); } else { this.DownloadConfirmation(size, callback, false); } }, "BackKeyConfirmTitle", "DownloadSizeExit", "SEInternal/Common/se_106"); } else { GUIMain.BackToTOP("UIStartupCaution", 0.8f, 0.8f); } }, StringMaster.GetString("DownloadSizeTitle"), string.Format(StringMaster.GetString("DownloadSizeInfo"), ScriptUtil.CheckSize(size, ref size_TYPE), array[(int)size_TYPE]), "SEInternal/Common/se_106"); }