示例#1
0
        /// <summary>
        /// Force updates the specified mod(s).
        /// </summary>
        private void UpdateMods()
        {
            var instance = ModUpdateHandler.Instance;

            if (instance.IsUpdating)
            {
                PUIElements.ShowMessageDialog(null, ModUpdateDateStrings.UPDATE_INPROGRESS);
            }
            else
            {
                instance.StartModUpdate(this);
            }
        }
示例#2
0
        /// <summary>
        /// Checks the autosave status on the UI thread.
        /// </summary>
        /// <returns>true if save completed, or false otherwise.</returns>
        public bool CheckSaveStatus()
        {
            var  status = this.status;
            bool done   = false;

            switch (status)
            {
            case SaveStatus.Done:
                done = true;
                break;

            case SaveStatus.Failed:
                // Generic error
                done = true;
                PUIElements.ShowMessageDialog(GameScreenManager.Instance.ssOverlayCanvas.
                                              gameObject, string.Format(STRINGS.UI.CRASHSCREEN.SAVEFAILED,
                                                                        "Autosave failed!"));
                break;

            case SaveStatus.IOError:
                // I/O error, raise a dialog
                done = true;
                PUIElements.ShowMessageDialog(GameScreenManager.Instance.ssOverlayCanvas.
                                              gameObject, string.Format(STRINGS.UI.CRASHSCREEN.SAVEFAILED,
                                                                        "IOException. You may not have enough free space!"));
                break;

            case SaveStatus.InProgress:
                break;

            default:
                // NotStarted, time to throw
                throw new InvalidOperationException("Save not started");
            }
            return(done);
        }
示例#3
0
 /// <summary>
 /// Shows a dialog when unsubscribing from a mod fails.
 /// </summary>
 private void OnUnsubFailed()
 {
     PUIElements.ShowMessageDialog(gameObject, UI.UNSUBFAILEDDIALOG.TEXT);
 }
示例#4
0
 private void OnModifyFailed()
 {
     PUIElements.ShowMessageDialog(parent, string.Format(UI.MODIFYFAILEDDIALOG.TEXT,
                                                         mod.label.title));
     Dispose();
 }
示例#5
0
 private void OnModifyComplete()
 {
     PUIElements.ShowMessageDialog(parent, string.Format(UI.MODIFYDIALOG.SUCCESS,
                                                         mod.label.title));
     Dispose();
 }