private void ShowBackToTitleDialog() { if (this.isSendEvent) { return; } this.StopSomething(); string @string = StringMaster.GetString("SaveFailedTitle"); string string2 = StringMaster.GetString("AlertJsonErrorInfo"); AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Title; AlertManager.ShowAlertDialog(delegate(int i) { GUIMain.BackToTOP("UIStartupCaution", 0.8f, 0.8f); }, @string, string2, actionType, false); }
private void Open(string errorCode, string title, string message, bool isRetry, Action <int> onClosed, Func <CMD_Alert.ExtraFunctionReturnValue> onAlertButton) { if (Loading.IsShow()) { Loading.Invisible(); if (APIAlert.< > f__mg$cache0 == null) { APIAlert.< > f__mg$cache0 = new Action(Loading.ResumeDisplay); } this.ClosedAction = APIAlert.< > f__mg$cache0; } AlertManager.onCreateAlert = delegate(bool isCreate, CMD_Alert alert) { if (isCreate) { this.isOpen = true; if (null != alert && onAlertButton != null) { alert.SetActionButtonExtraFunction(onAlertButton); } } }; if (AlertManager.CheckDialogMessage(errorCode)) { AlertManager.ShowAlertDialog(onClosed, errorCode); } else { AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Close; if (isRetry) { actionType = AlertManager.ButtonActionType.Retry; } AlertManager.ShowAlertDialog(onClosed, title, message, actionType, false); } }
public static bool ShowAlertDialog(Action <int> action, string errorCode) { AlertManager.lastErrorCode = errorCode; if (errorCode == "LOCAL_ERROR_TIMEOUT") { string @string = StringMaster.GetString("AlertNetworkErrorTitle"); string string2 = StringMaster.GetString("AlertNetworkErrorTimeOut"); return(AlertManager.ShowAlertDialog(action, @string, string2, AlertManager.ButtonActionType.Retry, true)); } if (errorCode == "LOCAL_ERROR_WWW") { string string3 = StringMaster.GetString("AlertDataErrorTitle"); string string4 = StringMaster.GetString("AlertDataErrorInfo"); return(AlertManager.ShowAlertDialog(action, string3, string4, AlertManager.ButtonActionType.Retry, true)); } if (errorCode == "LOCAL_ERROR_JSONPARSE") { string string5 = StringMaster.GetString("SaveFailedTitle"); string string6 = StringMaster.GetString("AlertJsonErrorInfo"); return(AlertManager.ShowAlertDialog(action, string5, string6, AlertManager.ButtonActionType.Title, true)); } if (errorCode == "LOCAL_ERROR_ASSET_DATA") { string string7 = StringMaster.GetString("AlertNetworkErrorTitle"); string string8 = StringMaster.GetString("AlertNetworkErrorRetry"); return(AlertManager.ShowAlertDialog(action, string7, string8, AlertManager.ButtonActionType.Retry, true)); } if (errorCode == "LOCAL_ERROR_SAVE_DATA_IO") { string string9 = StringMaster.GetString("SaveFailedTitle"); string string10 = StringMaster.GetString("SaveFailed-02"); return(AlertManager.ShowAlertDialog(action, string9, string10, AlertManager.ButtonActionType.Close, true)); } if (errorCode == "LOCAL_ERROR_SAVE_DATA_OTHER") { string string11 = StringMaster.GetString("SaveFailedTitle"); string string12 = StringMaster.GetString("SaveFailed-01"); return(AlertManager.ShowAlertDialog(action, string11, string12, AlertManager.ButtonActionType.Close, true)); } if (errorCode == "LOCAL_ERROR_SAVE_DATA_SECURITY") { string string13 = StringMaster.GetString("SaveFailedTitle"); string string14 = StringMaster.GetString("SaveFailed-03"); return(AlertManager.ShowAlertDialog(action, string13, string14, AlertManager.ButtonActionType.Close, true)); } if (errorCode == "E-AL09") { string string15 = StringMaster.GetString("TakeOver-12"); string string16 = StringMaster.GetString("TakeOver-13"); return(AlertManager.ShowAlertDialog(action, string15, string16, AlertManager.ButtonActionType.Close, true)); } if (errorCode == "E-AL10") { string string17 = StringMaster.GetString("TakeOver-12"); string string18 = StringMaster.GetString("TakeOver-13"); return(AlertManager.ShowAlertDialog(action, string17, string18, AlertManager.ButtonActionType.Close, true)); } if (!string.IsNullOrEmpty(AlertManager.GetNeptuneErrorString(errorCode))) { return(AlertManager.ShowAlertDialog(action, AlertManager.GetNeptuneErrorTitle(errorCode), AlertManager.GetNeptuneErrorString(errorCode), AlertManager.ButtonActionType.Close, true)); } GameWebAPI.RespDataMA_MessageM.MessageM alert = AlertMaster.GetAlert(errorCode); if (alert == null) { alert = AlertMaster.GetAlert("E-GP01"); } if (alert == null) { return(AlertManager.ErrorCallback(action, errorCode)); } AlertManager.ButtonActionType actionType = (AlertManager.ButtonActionType) int.Parse(alert.actionType); AlertManager.DialogType dialogType = (AlertManager.DialogType) int.Parse(alert.actionValue); if (dialogType == AlertManager.DialogType.Alert) { return(AlertManager.ShowAlertDialog(action, alert.messageTitle, alert.messageText, actionType, true)); } if (dialogType != AlertManager.DialogType.Modal) { return(AlertManager.ShowAlertDialog(action, alert.messageTitle, alert.messageText, actionType, true)); } return(AlertManager.ShowModalMessage(action, alert.messageTitle, alert.messageText, actionType, true)); }
private static bool ShowDialog <CMD_Type>(Action <int> action, string title, string message, string dialogName = "", AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Close, bool isWarningIcon = true, bool useErrorCode = false) where CMD_Type : CMD { Action <int> action2 = delegate(int i) { if (action != null) { action(i); } }; if (AlertManager.alertOpenedAction != null) { AlertManager.alertOpenedAction(); } if (!useErrorCode) { AlertManager.lastErrorCode = "unknown:" + AlertManager.lastErrorCode; } PlayerPrefs.SetString("LastErrorInfo", ServerDateTime.Now + ":" + AlertManager.lastErrorCode); CMD_Type cmd_Type = GUIMain.ShowCommonDialog(action2, dialogName, null) as CMD_Type; if (cmd_Type != null) { string text = typeof(CMD_Type).ToString(); if (text != null) { if (!(text == "CMD_Alert")) { if (!(text == "CMD_maintenance")) { if (text == "CMD_ModalMessage") { CMD_ModalMessage cmd_ModalMessage = cmd_Type as CMD_ModalMessage; cmd_ModalMessage.Title = title; cmd_ModalMessage.Info = message; AlertManager.ExecuteOnCreateAlert(true, null); } } else { CMD_maintenance cmd_maintenance = cmd_Type as CMD_maintenance; cmd_maintenance.Info = message; } } else { CMD_Alert cmd_Alert = cmd_Type as CMD_Alert; cmd_Alert.Title = title; cmd_Alert.Info = message; cmd_Alert.IsWarning = isWarningIcon; switch (actionType) { case AlertManager.ButtonActionType.Close: cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.CLOSE); break; case AlertManager.ButtonActionType.Retry: cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.RETRY); break; case AlertManager.ButtonActionType.TitleAndRetry: cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.TITLE_AND_RETRY); break; case AlertManager.ButtonActionType.Title: cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.TITLE); break; } AlertManager.ExecuteOnCreateAlert(true, cmd_Alert); } } return(true); } if (action != null) { action(0); } UnityEngine.Debug.Log("Create Failed CMD : " + title + ", " + message); return(false); }
public static bool ShowModalMessage(Action <int> action, string title, string message, AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Close, bool useErrorCode = false) { return(AlertManager.ShowDialog <CMD_ModalMessage>(action, title, message, "CMD_ModalMessage", actionType, true, useErrorCode)); }
public static bool ShowNoWarningIconAlertDialog(Action <int> action, string title, string message, AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Close) { return(AlertManager.ShowDialog <CMD_Alert>(action, title, message, "CMD_Alert", actionType, false, false)); }