Ejemplo n.º 1
0
 public bool showVersionInfoPopup(bool force = false)
 {
     if (needShowPopup || force)
     {
         try
         {
             UIComponent uIComponent = UIView.library.ShowModal("ExceptionPanel");
             if (uIComponent != null)
             {
                 Cursor.lockState = CursorLockMode.None;
                 Cursor.visible   = true;
                 BindPropertyByKey component = uIComponent.GetComponent <BindPropertyByKey>();
                 if (component != null)
                 {
                     string title = "Transport Lines Manager v" + version;
                     string notes = ResourceLoader.loadResourceString("UI.VersionNotes.txt");
                     string text  = "Transport Lines Manager was updated! Release notes:\r\n\r\n" + notes;
                     string img   = "IconMessage";
                     component.SetProperties(TooltipHelper.Format(new string[]
                     {
                         "title",
                         title,
                         "message",
                         text,
                         "img",
                         img
                     }));
                     needShowPopup            = false;
                     currentSaveVersion.value = fullVersion;
                     return(true);
                 }
                 return(false);
             }
             else
             {
                 if (TLMSingleton.instance != null && TLMSingleton.debugMode)
                 {
                     TLMUtils.doLog("PANEL NOT FOUND!!!!");
                 }
                 return(false);
             }
         }
         catch (Exception e)
         {
             if (TLMSingleton.instance != null && TLMSingleton.debugMode)
             {
                 TLMUtils.doLog("showVersionInfoPopup ERROR {0} {1}", e.GetType(), e.Message);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public bool showVersionInfoPopup(bool force = false)
        {
            if (needShowPopup || force)
            {
                try
                {
                    UIComponent uIComponent = UIView.library.ShowModal("ExceptionPanel");
                    if (uIComponent != null)
                    {
                        Cursor.lockState = CursorLockMode.None;
                        Cursor.visible   = true;
                        BindPropertyByKey component = uIComponent.GetComponent <BindPropertyByKey>();
                        if (component != null)
                        {
                            string title = $"{SimpleName.Replace("&", "and")} v{version}";
                            string notes = Singleton <R> .instance.loadResourceString("UI.VersionNotes.txt");

                            string text = $"{SimpleName.Replace("&", "and")} was updated! Release notes:\r\n\r\n" + notes;
                            string img  = "IconMessage";
                            component.SetProperties(TooltipHelper.Format(new string[]
                            {
                                "title",
                                title,
                                "message",
                                text,
                                "img",
                                img
                            }));
                            needShowPopup            = false;
                            currentSaveVersion.value = fullVersion;
                            return(true);
                        }
                        return(false);
                    }
                    else
                    {
                        doLog("PANEL NOT FOUND!!!!");
                        return(false);
                    }
                }
                catch (Exception e)
                {
                    doErrorLog("showVersionInfoPopup ERROR {0} {1}", e.GetType(), e.Message);
                }
            }
            return(false);
        }