Exemplo 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 = $"{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);
        }