예제 #1
0
        /// <summary>
        /// Girişte profilin seçilip seçilmediğini kontrol eder.
        /// </summary>
        public async void CheckProfile(bool norebember = false)
        {
            //Bir önceki oturumda seçimi hatırla seçeneği işaretli ise hatırlanan profili yükler.
            if (!norebember)
            {
                GlobalVariants.ActiveProfile = await ProfileSelector.GetRebemberProfile();

                if (GlobalVariants.ActiveProfile != null)
                {
                    GlobalVariants.ActiveProfile.LastactivityDate = DateTime.Now;
                }
            }
            if (GlobalVariants.ActiveProfile == null)
            {
                this.Visible = false;
                GlobalVariants.ActiveProfile = ProfileSelector.SelectProfile();
                if (GlobalVariants.ActiveProfile == null)
                {
                    return;
                }
                this.Visible = true;
            }
            grpStartGame.SetText(GlobalVariants.ActiveProfile?.ProfileName);
            if (GlobalVariants.ActiveProfile.LastGameProp == null)
            {
                GlobalVariants.ActiveProfile.LastGameProp = new SayiTahminIcerik();
            }
            GlobalVariants.ActiveProfile.LastGameProp.VectorelMode = false;
            fillStartGameLv(GlobalVariants.ActiveProfile.LastGameProp);
            GlobalVariants.ActiveProfile.LastGameProp.VectorelMode = CWMode;
            starZorluk.YıldızPuanı = SayiTahminChecker.GetDifficultLevel(GlobalVariants.ActiveProfile.LastGameProp);
            UserProfileStatsGenerator.RecordProfile(GlobalVariants.ActiveProfile, ActiveGame);
            disableWarningsToolStripMenuItem.Checked = !GlobalVariants.ActiveProfile.DisableWarnings;
        }
예제 #2
0
        /// <summary>
        /// Diğer formdan profil seçtirmek için kullanacağımız fonksiyon.
        /// </summary>
        /// <returns></returns>
        public static UserProfile SelectProfile()
        {
            ProfileSelector pselector = new ProfileSelector();

            pselector.ShowDialog();
            //Başlıca istatistikler yoksa sıralamada üstte görünsünler diye otomatik eklenecek.
            UserProfileUtils.InitializeStatistics(pselector.uProfil);
            return(pselector.uProfil);
        }
예제 #3
0
        private void profilDeğiştirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string      oldname = GlobalVariants.ActiveProfile.ProfileName;
            UserProfile uProfil = ProfileSelector.SelectProfile();

            if (uProfil != null && oldname != uProfil.ProfileName)
            {
                if (ActiveGame.IsGameStarted)
                {
                    ActiveGame.Resign();
                }
                grpStartNew.Visible = true;
                grpGame.Visible     = false;
                UserProfileUtils.SaveUserProfile(GlobalVariants.ActiveProfile);
                GlobalVariants.ActiveProfile = uProfil;
                UserProfileStatsGenerator.RecordProfile(GlobalVariants.ActiveProfile, ActiveGame);
            }
        }