Beispiel #1
0
        public static void Init(bool restart = false)
        {
            if (!restart)
            {
                try
                {
                    HID = HardwareIdManager.GetId();
                }
                catch (Exception)
                {
                    HID = "";
                }

                if (!CheckCardsStuffUpdate())
                {
                    AssetsManager.LoadSmileys();
                    LoadCDB();
                    BoosterManager.LoadList();
                }
#if DEBUG
                ClientConfig.TestMode = false;
                AppDesignConfig       = new AppDesignConfig(); //To debug config
#endif
                LoadBanlist();

                SaveConfig();
            }
            Client = new GameClient();

            Client.PopMessageBox           += Client_PopMessageBox;
            Client.PopMessageBoxShowDialog += Client_PopMessageBoxShowDialog;
            Client.ChoicePopBox            += Client_ChoicePopBox;
            Client.ShadowDuelRequest       += Client_ShadowDuelRequest;
            Client.RoomNeedPassword        += Client_RoomNeedPassword;
            Client.Shutdown += Client_Shutdown;
            Client.PrivateMessageReceived   += Client_PrivateMessageReceived;
            Client.LaunchYGOPro             += Client_LaunchYGOPro;
            Client.LaunchYGOProWithoutRoom  += Client_LaunchYGOProWithoutRoom;
            Client.LoadPlayerCustomizations += Client_LoadPlayerCustomizations;
            Client.LaunchTrade              += Client_LaunchTrade;
            Client.CloseBrocante            += Client_CloseBrocante;
            Client.LaunchBonusBox           += Client_LaunchBonusBox;
            Client.LoadOfflineMessages      += Client_LoadOfflineMessages;
            Client.RecieveDeck              += Client_RecieveDeck;
            Client.RecieveReplay            += Client_RecieveReplay;
            Client.Restart                  += Client_Restart;
            Client.CustomizationAchievement += Client_CustomizationAchievement;
            Client.LoadBoosterCollection    += Client_LoadBoosterCollection;
            Client.GetMonthlyBonus          += Client_GetMonthlyBonus;

            if (IsWindowOpen <Login>())
            {
                _login.Restart = true;
                _login.Close();
            }

            _login = new Login(Client.LoginAdmin);

            logger.Trace("FormExecution initialisation.");
        }
Beispiel #2
0
        private static void Client_LoadBoosterCollection(string tag, List <int> ids, List <int> quantities, List <CardRarity> rarities)
        {
            CollectionViewer viewer = new CollectionViewer(BoosterManager.GetBoosterInfo(tag), ids, quantities, rarities);

            Task.Run(() => viewer.LoadCard());
            viewer.Show();
            Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() => viewer.Activate()));
        }
Beispiel #3
0
    void Awake()
    {
        if (instance != null)
        {
            throw new System.Exception("You have more than 1 BoosterManager in the scene.");
        }

        // Initialize the static class variables
        instance = this;
        //DontDestroyOnLoad(gameObject);
    }
Beispiel #4
0
        private static void CardsUpdateDownloader_UpdateCompleted()
        {
            _windowload.EndDownload();
            _windowload.Close();

            CardsUpdateDownloader.LoadingProgress -= CardsUpdateDownloader_LoadingProgress;
            CardsUpdateDownloader.UpdateCompleted -= CardsUpdateDownloader_UpdateCompleted;

            LoadCDB();
            AssetsManager.LoadSmileys();
            BoosterManager.LoadList();
        }
 private void Btn_get_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (current_bonus.Type == BonusType.Booster)
     {
         FormExecution.OpenPurchase(BoosterManager.GetBoosterInfo(current_bonus.Gift), current_bonus.Cards);
     }
     else
     {
         BonusBox box = new BonusBox(current_bonus.Type, cnumber, current_bonus.Gift);
         box.Show();
         box.Topmost = true;
     }
     Close();
 }
Beispiel #6
0
        private void LoadPurchase(string Item)
        {
            BoosterChoosen = BoosterManager.InitializeBooster(Item);
            _admin.AskBooster(BoosterChoosen.PurchaseTag);
            tb_numberpack.Text = "1";
            tb_date.Text       = BoosterChoosen.Date + ".";
            if (BoosterChoosen.Type == PurchaseType.Demarrage)
            {
                tb_numbercardpack.Text = "C'est un deck de Démarrage.";
            }
            if (BoosterChoosen.Type == PurchaseType.Structure)
            {
                tb_numbercardpack.Text = "C'est un deck de Structure.";
            }

            tb_card1.Text = BoosterChoosen.MostImportantCards[0];
            tb_card2.Text = BoosterChoosen.MostImportantCards[1];
            tb_card3.Text = BoosterChoosen.MostImportantCards[2];
            tb_card4.Text = BoosterChoosen.MostImportantCards[3];

            img_booster.Source = FormExecution.AssetsManager.GetImage(new string[] { "Booster", "pics", BoosterChoosen.PurchaseTag + ".png" });
        }
Beispiel #7
0
	void Awake()
	{
		Instance = this;
	}
Beispiel #8
0
 void Awake()
 {
     Instance = this;
 }