Пример #1
0
    static bool WantsToQuit()
    {
        if (QuitForced)
        {
            return(true);
        }

        if (Current == null)
        {
            return(true);
        }

        if (MapLuaParser.SavingMapProcess)
        {
            return(false);
        }

        if (!string.IsNullOrEmpty(MapLuaParser.Current.FolderName) && !string.IsNullOrEmpty(MapLuaParser.Current.ScenarioFileName) && !Current.AllowQuit)
        {
            if (!Current.Popup.activeSelf)
            {
                Current.Popup.SetActive(true);
                GenericPopup.RemoveAll();
            }
            return(false);
        }

        if (Current.AllowQuit && MapLuaParser.SavingMapProcess)
        {
            return(false);
        }

        return(true);
    }
Пример #2
0
    public void CompleteRegistration()
    {
        new GameSparks.Api.Requests.RegistrationRequest()
        .SetDisplayName(DisplayName.text)
        .SetPassword(Password.text)
        .SetUserName(EmailAddress.text)
        .Send((response) => {
            if (!response.HasErrors)
            {
                System.Action onUserLoadComplete = delegate
                {
                    PlayerPrefs.SetString("LastUserEmail", EmailAddress.text);
                    PlayerPrefs.SetString("LastUserPassword", Password.text);

                    Logging.Log("Player Registered…");
                    GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Registration Complete!", "Successfully Registered a new account. You will now return to the main menu!", false);
                    popup.OkButton.onClick.AddListener(() =>
                    {
                        SceneManager.Instance.LoadScene("MainMenu");
                    });
                };

                User.ActiveUser = new User(DisplayName.text, EmailAddress.text, onUserLoadComplete);
            }
            else
            {
                GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Registration Error!", response.Errors.JSON, false);

                Logging.Log("Error Registering Player: " + response.Errors.ToString());
            }
        }
              );
    }
Пример #3
0
    public void OnPressSignIn()
    {
        new GameSparks.Api.Requests.AuthenticationRequest().SetUserName(EmailAddress.text).SetPassword(Password.text).Send((response) => {
            if (!response.HasErrors)
            {
                PlayerPrefs.SetString("LastUserEmail", EmailAddress.text);
                PlayerPrefs.SetString("LastUserPassword", Password.text);

                System.Action onCompleteUserInit = delegate
                {
                    GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Welcome Back!", "Hi, " + response.DisplayName + "! Let's check out your Breakaway Fantasy Team!", false, "Let's Go!");
                    popup.OkButton.onClick.AddListener(() => SceneManager.Instance.LoadScene("MainMenu"));

                    Logging.Log("Player Authenticated SUCCESS...");
                };

                User.ActiveUser = new User(response.DisplayName, EmailAddress.text, onCompleteUserInit);
            }
            else
            {
                GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Error!", "Unable to authenticate using those credentials. Please try again or select 'Forgot Password'.", true, "Ok", "Forgot Password");
                popup.CancelButton.onClick.AddListener(() => SceneManager.Instance.LoadScene("ForgotPassword"));
                Logging.Log("Error Authenticating Player...");
            }
        });
    }
Пример #4
0
    public void SaveMapAs()
    {
        if (!MapLuaParser.IsMapLoaded)
        {
            return;
        }

        LateUpdate();


        var paths = StandaloneFileBrowser.OpenFolderPanel("Save map as...", EnvPaths.GetMapsPath(), false);

        if (paths.Length > 0 && !string.IsNullOrEmpty(paths[0]))
        {
            if (System.IO.Directory.GetDirectories(paths[0]).Length > 0 || System.IO.Directory.GetFiles(paths[0]).Length > 0)
            {
                Debug.LogError("Selected directory is not empty! " + paths[0]);
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.Error, "Error", "Selected folder is not empty! Select empty folder.", "OK", null);
                return;
            }

            string[] PathSeparation = paths[0].Replace("\\", "/").Split("/".ToCharArray());

            string FileBeginName = PathSeparation[PathSeparation.Length - 1].ToLower();
            //MapLuaParser.Current.ScenarioFileName = FileBeginName + "_scenario";

            string NewFolderName = PathSeparation[PathSeparation.Length - 1];
            SaveAsNewFolder(NewFolderName, FileBeginName);
        }
    }
Пример #5
0
    public void OnSubmitNewPassword()
    {
        //Sending the request with spaces for Username and Password so no errors are given and scriptData is sent
        //Response is breaken down and the result of the action is determined for debug or feedback to user
        GameSparks.Core.GSRequestData script = new GameSparks.Core.GSRequestData();

        script.Add("action", "resetPassword");
        script.Add("token", TokenInput.text);
        script.Add("password", NewPasswordInput.text);

        new AuthenticationRequest().SetUserName("").SetPassword("").SetScriptData(script).Send((response) => {
            if (response.HasErrors)
            {
                if (response.Errors.GetString("action") == "complete")
                {
                    GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Success!", "Password changed. You will now be returned to the main menu.", false);
                    popup.OkButton.onClick.AddListener(() => SceneManager.Instance.LoadScene("TitleScreen"));

                    TokenInput.text       = "";
                    NewPasswordInput.text = "";
                }
                else
                {
                    Backend.Utility.MakeNewGenericPopup("Failed!", "Please ensure token is valid", false);
                }
            }
        });
    }
Пример #6
0
        public void CreateMap()
        {
            if (string.IsNullOrEmpty(Name.text))
            {
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.OneButton, "Warning", "Name must not be empty!", "OK", null);
                return;
            }

            MapPath = EnvPaths.GetMapsPath();
            string Error = "";

            if (!System.IO.Directory.Exists(MapPath))
            {
                Error = "Maps folder not exist: " + MapPath;
                Debug.LogError(Error);
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.OneButton, "Warning", "The map folder does not exist:\n" + MapPath, "OK", null);

                return;
            }

            FolderName = Name.text.Replace(" ", "_") + ".v0001";

            string path = MapPath + FolderName;

            Debug.Log(path);
            if (Directory.Exists(path))
            {
                Error = "Map folder already exist: " + path;
                Debug.LogError(Error);
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.OneButton, "Warning", "Map already exist: \n" + path, "OK", null);
                return;
            }

            StartCoroutine(CreateFiles());
        }
Пример #7
0
    public void OnSubmitTokenRequest()
    {
        //Construction a GSRquestData object to pass in as scriptData

        GameSparks.Core.GSRequestData script = new GameSparks.Core.GSRequestData();

        script.Add("action", "passwordRecoveryRequest");
        script.Add("email", EmailAddress.text);


        //Sending the request with spaces for Username and Password so no errors are given and scriptData is sent
        //Response is breaken down and the result of the action is determined for debug or feedback to user
        new AuthenticationRequest().SetUserName("").SetPassword("").SetScriptData(script).Send((response) => {
            if (response.HasErrors)
            {
                if (response.Errors.GetString("action") == "complete")
                {
                    GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Email sent!", "Check your email for a reset token.", false);
                    popup.OkButton.onClick.AddListener(() => StartCoroutine(TransitionBetweenCanvasGroups(ForgotPwdCanvasGroup, NewPwdCanvasGroup)));

                    EmailAddress.text = "";
                }
                else
                {
                    Backend.Utility.MakeNewGenericPopup("Email not sent!", "Please ensure email is linked to account", false);
                }
            }
        });
    }
Пример #8
0
        public void RemoveGroup(UnitListObject parent, bool Forced = false)
        {
            if (parent == null || parent.IsRoot || parent.Parent == null)
            {
                return;
            }

            if (!Forced && (parent.Source.Units.Count > 0 || parent.Source.UnitGroups.Count > 0))
            {
                LastRemoveObject = parent;
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.TwoButton, "Remove group", "Group " + parent.Source.Name + " is not empty!\nRemove it anyway?", "Yes", RemoveGroupYes, "No", null);
                return;
            }

            ClearRename();

            Undo.RegisterGroupRemove(parent.Parent);

            StoreSelection.Clear();
            StoreSelection = GetAllSelectedGroups();

            ClearGrpSelection();
            UpdateGroupSelection();


            parent.Source.ClearGroup(true);

            //parent.Parent.UnitGroups.Remove(parent.Source);
            parent.Parent.RemoveGroup(parent.Source);

            Generate(false);
        }
Пример #9
0
    //---------------------------------------------------------------------------------------------------------------
    public IEnumerator HidePanel()
    {
        if (container.childCount <= 0)
        {
            yield break;
        }

        GenericPopup RemovedPopUp = container.GetComponentInChildren <GenericPopup>();

        if (RemovedPopUp == null)
        {
            Debug.LogError("Attempt to Hide Popup panel that doesn't already exist.");
        }
        else
        {
            RemovedPopUp.OnClose();
        }

        yield return(AnimHidePanel());



        container.ClearChilds();


        yield return(null);
    }
Пример #10
0
    //---------------------------------------------------------------------------------------------------------------
    private bool LoadAndActivateRoutines(String path, object data, GenricPopUpCallback CallBack = null)
    {
        if (path == String.Empty)
        {
            Debug.LogError("path == String.Empty");
        }

        GameObject prefab = Resources.Load(path) as GameObject;

        if (prefab == null)
        {
            Debug.Log("Attempt to Instantiate popup with path " + path + ", but Resources.Load returned null.");
            return(false);
        }
        currentPopup          = Instantiate(prefab, container).GetComponent <GenericPopup>();
        currentPopup.CallBack = CallBack;
        currentPopup.Activate(data);

        defaultDecor.gameObject.SetActive(!currentPopup.HasCustomDecor);

        if (currentPopup.DisableBlur)
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }
Пример #11
0
 public void CreateTablesFile()
 {
     GenericPopup.ShowPopup(GenericPopup.PopupTypes.TriButton, "Creating Tables", "Replace current script.lua file?\nThis can't be undone.",
                            "Yes", ReplaceScript,
                            "No", NoScript,
                            "Cancel", Cancel
                            );
 }
Пример #12
0
    public void createPopup(string title, string desc, string popupName, string url)
    {
        GenericPopup popup = new GenericPopup();

        if (GameObject.Find("MainMenuCanvas") != null)
        {
            popup.create(title, desc, popupPrefab, GameObject.Find("MainMenuCanvas"), popupName, url);
        }
    }
Пример #13
0
        /// <summary>
        /// Search for all markers of defined types that name prefix is not correct
        /// </summary>
        void FixAiMarkersNamesExecute()
        {
            HashSet <MapLua.SaveLua.Marker> ToChange = new HashSet <MapLua.SaveLua.Marker>();

            for (int mc = 0; mc < MapLuaParser.Current.SaveLuaFile.Data.MasterChains.Length; mc++)
            {
                int Mcount = MapLuaParser.Current.SaveLuaFile.Data.MasterChains[mc].Markers.Count;
                for (int m = 0; m < Mcount; m++)
                {
                    switch (MapLuaParser.Current.SaveLuaFile.Data.MasterChains[mc].Markers[m].MarkerType)
                    {
                    case MapLua.SaveLua.Marker.MarkerTypes.NavalArea:
                    case MapLua.SaveLua.Marker.MarkerTypes.ExpansionArea:
                    case MapLua.SaveLua.Marker.MarkerTypes.LargeExpansionArea:
                        string RequiredPrefix = MapLua.SaveLua.GetPrefixByType(MapLuaParser.Current.SaveLuaFile.Data.MasterChains[mc].Markers[m].MarkerType);
                        if (!MapLuaParser.Current.SaveLuaFile.Data.MasterChains[mc].Markers[m].Name.StartsWith(RequiredPrefix))
                        {
                            ToChange.Add(MapLuaParser.Current.SaveLuaFile.Data.MasterChains[mc].Markers[m]);
                        }
                        break;
                    }
                }
            }

            if (ToChange.Count <= 0)
            {
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.OneButton, "Fix AI Marker names", "There are no AI markers that need name fix.", "OK", null);
                return;
            }

            MapLua.SaveLua.Marker[] UndoMarkersArray = new MapLua.SaveLua.Marker[ToChange.Count];
            ToChange.CopyTo(UndoMarkersArray);

            Undo.RegisterUndo(new UndoHistory.HistoryMarkersChange(), new UndoHistory.HistoryMarkersChange.MarkersChangeHistoryParameter(UndoMarkersArray));

            int ChangedMarkersCount = 0;

            for (int i = 0; i < UndoMarkersArray.Length; i++)
            {
                //string RequiredPrefix = MapLua.SaveLua.GetPrefixByType(UndoMarkersArray[i].MarkerType);
                //if (!RequiredPrefix.StartsWith(RequiredPrefix))
                //{
                MapLua.SaveLua.RemoveMarker(UndoMarkersArray[i].Name);
                UndoMarkersArray[i].Name = MapLua.SaveLua.GetLowestName(UndoMarkersArray[i].MarkerType);
                if (UndoMarkersArray[i].MarkerObj)
                {
                    UndoMarkersArray[i].MarkerObj.gameObject.name = UndoMarkersArray[i].Name;
                }
                MapLua.SaveLua.AddNewMarker(UndoMarkersArray[i]);
                ChangedMarkersCount++;
                //}
            }

            GenericPopup.ShowPopup(GenericPopup.PopupTypes.OneButton, "Fix AI Marker names", "Changed names of " + ChangedMarkersCount + " markers.", "OK", null);

            MarkerSelectionOptions.UpdateOptions();
        }
Пример #14
0
 private void OnDisable()
 {
     Main.instance.m_canvasBlurManager.RemoveBlurRef_MainCanvas();
     Main.instance.m_canvasBlurManager.RemoveBlurRef_Level2Canvas();
     Main.instance.m_backButtonManager.PopBackAction();
     if (GenericPopup.DisabledAction != null)
     {
         GenericPopup.DisabledAction();
     }
 }
Пример #15
0
    public override void OnInspectorGUI()
    {
        GenericPopup popup = (GenericPopup)target;

        if (GUILayout.Button("Edit"))
        {
            popup.OpenForEdit();
        }

        DrawDefaultInspector();
    }
Пример #16
0
 public void OpenMap()
 {
     if (MapLuaParser.IsMapLoaded)
     {
         GenericPopup.ShowPopup(GenericPopup.PopupTypes.TriButton, "Save map", "Save current map before opening another map?", "Yes", OpenMapYes, "No", OpenMapNo, "Cancel", OpenMapCancel);
     }
     else
     {
         OpenMapProcess();
     }
 }
Пример #17
0
        public static bool Prefix(GenericPopup __instance)
        {
            Logger.Debug("[GenericPopup_HandleEnterKeypress_PREFIX] Fields.IsCustomPopup: " + Fields.IsCustomPopup);

            if (Fields.IsCustomPopup)
            {
                Logger.Debug("[GenericPopup_HandleEnterKeypress_PREFIX] Disable EnterKeyPress");
                return(false);
            }
            return(true);
        }
Пример #18
0
    public void SaveAsNewVersion()
    {
        if (!MapLuaParser.IsMapLoaded)
        {
            return;
        }

        int NextVersion = (int)MapLuaParser.Current.ScenarioLuaFile.Data.map_version + 1;

        GenericPopup.ShowPopup(GenericPopup.PopupTypes.TwoButton, "Create new version", "Create version " + NextVersion + " of this map?", "Yes", SaveAsNewVersionYes, "No", null);
    }
Пример #19
0
 public void OpenNewMap()
 {
     if (MapLuaParser.IsMapLoaded)
     {
         GenericPopup.ShowPopup(GenericPopup.PopupTypes.TriButton, "Save map", "Save current map before creating new map?", "Yes", OpenNewMapYes, "No", OpenNewMapNo, "Cancel", OpenNewMapCancel);
     }
     else
     {
         NewMapWindow.SetActive(true);
     }
 }
Пример #20
0
        public void Render()
        {
            GenericPopupBuilder builder = GenericPopupBuilder.Create("__/CAE.Components/__", this.BuildText());

            builder.AddButton("X", null, true);
            builder.AddButton("+", new Action(this.Left), false);
            builder.AddButton("<-", new Action(this.Up), false);
            builder.AddButton("-", new Action(this.Right), false);
            builder.AddButton("->", new Action(this.Down), false);
            builder.AddButton("Ок", null, true);
            popup = builder.CancelOnEscape().Render();
        }
Пример #21
0
    public void SaveMapAs()
    {
        if (!MapLuaParser.IsMapLoaded)
        {
            return;
        }

        LateUpdate();


        var paths = StandaloneFileBrowser.OpenFolderPanel("Save map as...", EnvPaths.GetMapsPath(), false);

        if (paths.Length > 0 && !string.IsNullOrEmpty(paths[0]))
        {
            if (System.IO.Directory.GetDirectories(paths[0]).Length > 0 || System.IO.Directory.GetFiles(paths[0]).Length > 0)
            {
                Debug.LogWarning("Selected directory is not empty! " + paths[0]);
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.Error, "Error", "Selected folder is not empty! Select empty folder.", "OK", null);
                return;
            }

            string[] PathSeparation = paths[0].Replace("\\", "/").Split("/".ToCharArray());

            string FileBeginName = PathSeparation[PathSeparation.Length - 1].Replace(" ", "_");
            //MapLuaParser.Current.ScenarioFileName = FileBeginName + "_scenario";

            string NewFolderName = PathSeparation[PathSeparation.Length - 1];
            NewFolderName = NewFolderName.Replace(" ", "_");

            if (!NewFolderName.Contains(".v"))
            {
                NewFolderName += ".v0001";
                MapLuaParser.Current.ScenarioLuaFile.Data.map_version = 1;
            }
            else
            {
                int MapVersion = 1;

                if (int.TryParse(NewFolderName.Remove(0, NewFolderName.Length - 4), out MapVersion))
                {
                }

                MapLuaParser.Current.ScenarioLuaFile.Data.map_version = MapVersion;
            }

            SaveAsNewFolder(NewFolderName, FileBeginName);
        }
    }
Пример #22
0
 public ComponentsMenu(AbstractActor unit)
 {
     SelectedComponent = 0;
     components        = new List <MechComponent>();
     componentsStates  = new Dictionary <MechComponent, string>();
     popup             = null;
     foreach (MechComponent component in unit.allComponents)
     {
         ActivatableComponent activatable = component.componentDef.GetComponent <ActivatableComponent>();
         if (activatable != null)
         {
             components.Add(component);
         }
         ;
     }
 }
Пример #23
0
    IEnumerator FindLatest()
    {
        //using (WWW www = new WWW(url))
        DownloadHandler dh = new DownloadHandlerBuffer();

        using (UnityWebRequest www = new UnityWebRequest(url, "GET", dh, null))
        {
            yield return(www.SendWebRequest());

            //yield return www;

            /*if (www.responseHeaders.Count > 0)
             * {
             *      foreach (KeyValuePair<string, string> entry in www.responseHeaders)
             *      {
             *              Debug.Log(entry.Key + " = " + entry.Value);
             *      }
             * }*/
            string[] Tags = www.url.Replace("\\", "/").Split("/".ToCharArray());

            if (Tags.Length > 0)
            {
                LatestTag = Tags[Tags.Length - 1];
                FoundUrl  = www.url;

                double Latest            = System.Math.Round(BuildFloat(LatestTag), 3);
                double Current           = System.Math.Round(BuildFloat(EditorBuildVersion), 3);
                double CurrentWithOffset = System.Math.Round(Current + VersionOffset, 3);
                if (CurrentWithOffset < Latest)
                {
                    Debug.Log("New version avaiable: " + Latest + "\n" + (Current + VersionOffset));
                    GenericPopup.ShowPopup(GenericPopup.PopupTypes.TwoButton, "New version",
                                           "New version of Map Editor is avaiable.\nCurrent: " + EditorBuildVersion.ToLower() + TagString + "\t\tNew: " + LatestTag + "\nDo you want to download it now?",
                                           "Download", DownloadLatest,
                                           "Cancel", CancelDownload
                                           );
                }
                else
                {
                    Debug.Log("Latest version: " + System.Math.Max(Latest, Current) + " " + EditorBuildTag);
                }
            }
        }
    }
Пример #24
0
    void OnFiles(List <string> aFiles, POINT aPos)
    {
        // do something with the dropped file names. aPos will contain the
        // mouse position within the window where the files has been dropped.
        Debug.Log("Dropped " + aFiles.Count + " files at: " + aPos + "\n" +
                  aFiles.Aggregate((a, b) => a + "\n" + b));

        if (aFiles.Count == 0)
        {
            return;
        }


        if (IsScenarioPath(aFiles[0]))
        {
            StoreSelectedFile = aFiles[0];
        }
        else
        {
            string[] AllFiles = System.IO.Directory.GetFiles(aFiles[0]);

            for (int i = 0; i < AllFiles.Length; i++)
            {
                if (IsScenarioPath(AllFiles[i]))
                {
                    StoreSelectedFile = AllFiles[i];
                    break;
                }
            }
        }


        if (!string.IsNullOrEmpty(StoreSelectedFile))
        {
            if (MapLuaParser.IsMapLoaded)
            {
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.TriButton, "Save map", "Save current map before opening another map?", "Yes", OpenMapYes, "No", OpenMapNo, "Cancel", OpenMapCancel);
            }
            else
            {
                OpenMapProcess();
            }
        }
    }
Пример #25
0
    public void OpenRecentMap()
    {
        if (MapLuaParser.Current.ScenarioFileName == PlayerPrefs.GetString(LoadRecentMaps.ScenarioFile + LoadRecentMaps.RecentMapSelected, "") &&
            MapLuaParser.Current.FolderName == PlayerPrefs.GetString(LoadRecentMaps.FolderPath + LoadRecentMaps.RecentMapSelected, "") &&
            MapLuaParser.Current.FolderParentPath == PlayerPrefs.GetString(LoadRecentMaps.ParentPath + LoadRecentMaps.RecentMapSelected, ""))
        {
            Debug.LogWarning("Same map: Ignore loading recent map");
            return;             // Same map
        }

        if (MapLuaParser.IsMapLoaded)
        {
            PlaySystemSound.PlayBeep();
            GenericPopup.ShowPopup(GenericPopup.PopupTypes.TriButton, "Save map", "Save current map before opening another map?", "Yes", OpenRecentMapYes, "No", OpenRecentMapNo, "Cancel", OpenMapCancel);
        }
        else
        {
            OpenRecentMapNo();
        }
    }
Пример #26
0
        public static void Info(string message)
        {
            Fields.IsCustomPopup = true;

            GenericPopup popup = GenericPopupBuilder
                                 .Create(title, message)
                                 .AddButton("Ok", null, true, null)
                                 .CancelOnEscape()
                                 .AddFader(new UIColorRef?(LazySingletonBehavior <UIManager> .Instance.UILookAndColorConstants.PopupBackfill), 0.5f, true)
                                 .SetAlwaysOnTop()
                                 .SetOnClose(delegate
            {
                Fields.IsCustomPopup = false;
            })
                                 .Render();

            LocalizableText ___contentText = (LocalizableText)AccessTools.Field(typeof(GenericPopup), "_contentText").GetValue(popup);

            ___contentText.alignment = TMPro.TextAlignmentOptions.TopLeft;
        }
Пример #27
0
    IEnumerator FindLatest()
    {
        using (WWW www = new WWW(url))
        {
            yield return(www);

            if (www.responseHeaders.Count > 0)
            {
                /*
                 * foreach (KeyValuePair<string, string> entry in www.responseHeaders)
                 * {
                 *      Debug.Log(entry.Key + " = " + entry.Value);
                 * }
                 */
            }
            string[] Tags = www.url.Replace("\\", "/").Split("/".ToCharArray());

            if (Tags.Length > 0)
            {
                LatestTag = Tags[Tags.Length - 1];
                FoundUrl  = www.url;


                float Latest  = BuildFloat(LatestTag);
                float Current = BuildFloat(EditorBuildVersion) + VersionOffset;
                if (Current < Latest)
                {
                    Debug.Log("New version avaiable: " + Latest);
                    GenericPopup.ShowPopup(GenericPopup.PopupTypes.TwoButton, "New version",
                                           "New version of Map Editor is avaiable.\nCurrent: " + EditorBuildVersion.ToLower() + "\t\tNew: " + LatestTag + "\nDo you want to download it now?",
                                           "Download", DownloadLatest,
                                           "Cancel", CancelDownload
                                           );
                }
                else
                {
                    Debug.Log("Latest version: " + Mathf.Max(Latest, Current));
                }
            }
        }
    }
Пример #28
0
        public static GenericPopup MakeNewGenericPopup(string titleText, string messageText, bool showTwoButtons, string buttonOneText = "Ok", string buttonTwoText = "Cancel")
        {
            GenericPopup popup = UnityEngine.MonoBehaviour.Instantiate(Resources.Load <GenericPopup>("GenericPopup")) as GenericPopup;

            popup.TitleText.text   = titleText;
            popup.MessageText.text = messageText;

            if (showTwoButtons)
            {
                popup.CancelButton.gameObject.SetActive(true);
            }
            else
            {
                popup.CancelButton.gameObject.SetActive(false);
            }

            popup.OkButtonText.text     = buttonOneText;
            popup.CancelButtonText.text = buttonTwoText;

            return(popup);
        }
Пример #29
0
    void HandleLog(string logString, string stackTrace, LogType type)
    {
        switch (type)
        {
        case LogType.Exception:
            if (!ErrorFound)
            {
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.TwoButton, "Crash! (Exception)", "Editor crashed is now unsafe! Report bug with log file!\n" + logString, "Show log", ShowEditorLog, "Continue", null);
            }
            ErrorFound = true;
            break;

        case LogType.Error:
            if (!ErrorFound)
            {
                GenericPopup.ShowPopup(GenericPopup.PopupTypes.TwoButton, "Error", logString, "Show log", ShowEditorLog, "Continue", null);
            }
            ErrorFound = true;
            break;
        }
    }
Пример #30
0
    void SetupUI()
    {
        FantasyTeamComparer comparer = new FantasyTeamComparer();

        List <FantasyTeam> teamList = GetFantasyTeamList();

        teamList.Sort(comparer);
        if (teamList.Count == StandingsSlots.Count)
        {
            for (int i = 0; i < StandingsSlots.Count; i++)
            {
                StandingsSlots[i].RankText.text     = teamList[i].Salary.ToString();
                StandingsSlots[i].RecordText.text   = teamList[i].FPPG;
                StandingsSlots[i].TeamNameText.text = teamList[i].TeamName;
            }
        }
        else
        {
            GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Uh Oh!", "Something went wrong trying to populate the standings list. Try to restart your application. If the problem persists, contact me at [email protected]. Press Ok to quit the application.", false);
            popup.OkButton.onClick.AddListener(() => Application.Quit());
        }
    }