private void Client_DataRetrievalInfos(bool success, LoginFailReason reason, bool end)
        {
            if (success)
            {
                if (end)
                {
                    EndLoading?.Invoke();
                    FormExecution.Client_PopMessageBox("La récupération de données est terminée !", "Récupération de données");
                }
                else
                {
                    StartLoading?.Invoke();
                }
            }
            else
            {
                EndLoading?.Invoke();
                string error = "Une erreur s'est produite lors de la récupération : ";
                switch (reason)
                {
                case LoginFailReason.InvalidCombinaison:
                    error += "La combinaison pseudo/mot de passe n'est pas bonne. Mauvais mot de passe ou pseudo inexistant sur la v1";
                    break;

                case LoginFailReason.DataRetrievalAlreadyMade:
                    error += "Tu as déjà récupéré tes données !";
                    break;
                }
                FormExecution.Client_PopMessageBox(error, "Récupération de données");
            }
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            if (Properties.Settings.Default.DarkTheme == false)
            {
                ConfigureSettings.ConfigColors.ChangeToLightTheme();
            }

            InitializeComponent();
            Loaded          += delegate { StartLoading.PreStart(); };
            ContentRendered += delegate { StartLoading.Start(); };
        }
Ejemplo n.º 3
0
        private static IEnumerator DoChangeScene(string name)
        {
            StartLoading?.Invoke();

            // grab the current scene, before it gets unloaded
            var unloadScene = CurrentScene;

            // find all the cleanup operations
            var unloadOperations = unloadScene.FindInterfaces <ISceneUnloadAsyncOperation>();
            // cache the number of unload operations
            var numOperations = unloadOperations.Count + 1;

            yield return(UnloadOperations(unloadOperations, numOperations));

            // unload the scene
            var unload = SceneManager.UnloadSceneAsync(CurrentScene);

            while (!unload.isDone)
            {
                // send an event telling anything that's listening how far through the unload process we are
                // divide by two because unloading is the first part of the sequence - we want a number between 0 and 0.5
                UpdateProgress?.Invoke(GetOperationListProgress(unload.progress, unloadOperations.Count, numOperations) / 2);
                yield return(null);
            }

            // load the scene
            var load = SceneManager.LoadSceneAsync(name);

            while (!load.isDone)
            {
                // send an event telling anything that's listening how far through the unload process we are
                // divide by two, add 0.5 because unloading is the first part of the sequence - we want a number between 0.5 and 1
                UpdateProgress?.Invoke(GetOperationListProgress(load.progress, 0, 5) / 2 + 0.5f);
                yield return(null);
            }

            var loadedScene = CurrentScene;
            // find all the cleanup operations
            var loadOperations = loadedScene.FindInterfaces <ISceneLoadAsyncOperation>();

            // cache the number of unload operations
            numOperations = loadOperations.Count + 1;
            yield return(LoadOperations(loadOperations, numOperations));

            FinishedLoading?.Invoke();
        }