Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Shows a dialog when unsubscribing from a mod fails.
 /// </summary>
 private void OnUnsubFailed()
 {
     PUIElements.ShowMessageDialog(gameObject, UI.UNSUBFAILEDDIALOG.TEXT);
 }
Ejemplo n.º 4
0
 private void OnModifyFailed()
 {
     PUIElements.ShowMessageDialog(parent, string.Format(UI.MODIFYFAILEDDIALOG.TEXT,
                                                         mod.label.title));
     Dispose();
 }
Ejemplo n.º 5
0
 private void OnModifyComplete()
 {
     PUIElements.ShowMessageDialog(parent, string.Format(UI.MODIFYDIALOG.SUCCESS,
                                                         mod.label.title));
     Dispose();
 }