Exemplo n.º 1
0
 private void CloseShop()
 {
     Globals.GameShop = null;
     mShopWindow?.Close();
     mShopWindow = null;
     PacketSender.SendCloseShop();
 }
Exemplo n.º 2
0
        public void OpenShop()
        {
            mShopWindow?.Close();

            mShopWindow     = new ShopWindow(GameCanvas);
            mShouldOpenShop = false;
        }
Exemplo n.º 3
0
        public void OpenShop()
        {
            if (mShopWindow != null)
            {
                mShopWindow.Close();
            }

            mShopWindow     = new ShopWindow(GameCanvas);
            mShouldOpenShop = false;
        }
Exemplo n.º 4
0
    private void Awake()
    {
        // Singleton
        instance = this;
        shopWindowHolder.SetActive(false);

        // Loading Characters From Shop Window
        Component[] components = charactersContentHolder.transform.GetComponentsInChildren(typeof(ShopWindowCharacterItem), true);
        for (int i = 0; i < components.Length; i++)
        {
            ShopWindowCharacterItem currentCharacter = components[i] as ShopWindowCharacterItem;
            currentCharacter.characterID = i;
            if (PlayerPrefs.GetInt("character" + i.ToString() + "_unlocked", 0) == 1)
            {
                currentCharacter.unlocked = true;
            }

            addCharacter(currentCharacter);
            currentCharacter.onAdded();
        }
    }
Exemplo n.º 5
0
        //Commands
        private void ShowShopWindow()
        {
            var window = new ShopWindow();

            window.Show();
        }
Exemplo n.º 6
0
        // các xử lí của mainviewmodel
        public MainViewModel()
        {
            // ẩn mainWindow trước khi thực hiện đăng nhập - sử dụng truyền parameter p_Window
            LoadedWindowCommand = new RelayCommand <Window>((p_Window) => { return(true); }, (p_Window) => {
                if (p_Window == null)
                {
                    return;
                }
                else
                {
                    p_Window.Hide();
                    Isloaded = true;
                    LoginWindow loginWindow = new LoginWindow();
                    loginWindow.ShowDialog();

                    // dùng datacontext để lấy biến islogin bên LoginViewModel
                    if (loginWindow.DataContext == null)
                    {
                        return;
                    }

                    var login = loginWindow.DataContext as LoginViewModel;

                    if (login.IsLogin == true)
                    {
                        p_Window.Show();
                    }
                    else
                    {
                        p_Window.Close();
                    }
                }
            });

            // các comment
            SellCommand     = new RelayCommand <object>((p_Window) => { return(true); }, (p_Window) => { SellWindow wd = new SellWindow(); wd.ShowDialog(); });
            BillCommand     = new RelayCommand <object>((p_Window) => { return(true); }, (p_Window) => { BillWindow wd = new BillWindow(); wd.ShowDialog(); });
            RegisterCommand = new RelayCommand <object>((p_Window) => { return(true); }, (p_Window) => { RegisterWindow wd = new RegisterWindow(); wd.ShowDialog(); });

            // những chức năng chỉ người chủ mới được thực hiện
            StatisticCommand = new RelayCommand <object>((p_Window) => { return(true); }, (p_Window) => { StatisticWindow wd = new StatisticWindow(); wd.ShowDialog(); });
            InputCommand     = new RelayCommand <object>((p_Window) => { return(true); }, (p_Window) => { InputWindow wd = new InputWindow(); wd.ShowDialog(); });

            ShopCommand = new RelayCommand <object>((p_Window) => { return(true); }, (p_Window) => { ShopWindow wd = new ShopWindow(); wd.ShowDialog(); });
            QTVCommand  = new RelayCommand <object>((p_Window) => { return(true); }, (p_Window) => { QTVWindow wd = new QTVWindow(); wd.ShowDialog(); });
        }
Exemplo n.º 7
0
        public GamesViewModel()
        {
            LoginViewModel      = new LoginViewModel();
            ScoreboardViewModel = new ScoreboardViewModel();
            TicTacToeViewModel  = new TicTacToeViewModel();
            PairGameViewModel   = new PairGameViewModel();
            RatingViewModel     = new RatingViewModel();
            SnakeViewModel      = new SnakeViewModel();
            DoorsGameViewModel  = new DoorsGameViewModel();
            MoneyViewModel      = new MoneyViewModel();

            _playerManager = new PlayerManager();


            NewGameCommand = new RelayCommand(param => StartGame((string)param));

            ShopCommand = new RelayCommand(param =>
            {
                ShopWindow shopWindow = new ShopWindow();
                shopWindow.ShowDialog();
            });

            ScoreboardCommand = new RelayCommand(param =>
            {
                ScoreboardViewModel.Refresh();
                ScoreboardView scoreboardView = new ScoreboardView();
                scoreboardView.ShowDialog();
            });

            RatingCommand = new RelayCommand(param =>
            {
                RatingView ratingView = new RatingView();
                ratingView.ShowDialog();
            });

            PlayerEditCommand = new RelayCommand(param =>
            {
                EditView editView = new EditView();
                editView.ShowDialog();
            });

            AddMoneyCommand = new RelayCommand(param =>
            {
                MoneyView moneyView = new MoneyView();
                moneyView.ShowDialog();
            });

            StartGameTestingCommand = new RelayCommand(param => { StartGameTesting((string)param); });


            BuyItemCommand = new RelayCommand(param =>
            {
                if (int.Parse(param.ToString()) > Money)
                {
                    MessageBox.Show("You do not have enough to buy this game.\n Consider adding money to your balance.",
                                    "Message", MessageBoxButton.OK);
                }
                else
                {
                    _playerManager.AddMoney(LoginViewModel.Player.Id, -int.Parse(param.ToString()));
                    Money = Money;
                }
            });
        }
Exemplo n.º 8
0
    void Start()
    {
        Ani = GetComponent<Animator>();
        transitionImage = transitionImageObject.GetComponent<Image>();
        transitionImage.color = new Color(0.0f, 0.0f, 0.0f, 1f);
        transitionImageObject.SetActive(true);

        shopWindowC = shopWindow.GetComponent<ShopWindow>();
        lootWindowC = lootWindow.GetComponent<LootWindow>();

        portalDialogText = portalDialog.transform.FindChild("Text").gameObject.GetComponent<Text>();

        itemDragImage = itemDragContainerObject.transform.FindChild("ItemDragImage").gameObject.GetComponent<Image>();

        messageImage = messageImageObject.GetComponent<Image>();
        messageImage.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
        messageText = messageImageObject.transform.FindChild("MessageText").gameObject.GetComponent<Text>();
        messageText.color = new Color(1.0f, 0.7f, 0.0f, 0.0f);

        loadDialogCanvasGroup = loadDialog.GetComponent<CanvasGroup>();

        PlayerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>().CurrentHealth;
    }
Exemplo n.º 9
0
    private void openWindowArgs(WindowLinkSample sample, WindowBase win)
    {
        if (sample.windowArgs.Length <= 0)
        {
            return;
        }
        if (win is NoticeWindow)
        {
            (win as NoticeWindow).entranceId = NoticeSampleManager.Instance.getNoticeSampleBySid(StringKit.toInt(sample.windowArgs [0])).entranceId;
            (win as NoticeWindow).updateSelectButton(StringKit.toInt(sample.windowArgs [0]));
        }
        else if (win is GuildMainWindow)
        {
            (win as GuildMainWindow).initWindow();
        }
        else if (win is TeamPrepareWindow)
        {
            FuBenInfoFPort port = FPortManager.Instance.getFPort("FuBenInfoFPort") as FuBenInfoFPort;
            port.info(() => {
                FuBenManagerment.Instance.selectedChapterSid = FuBenManagerment.Instance.getPracticeChapter().sid;
                FuBenManagerment.Instance.selectedMapSid     = 1;

                (win as TeamPrepareWindow).Initialize(FuBenManagerment.Instance.selectedChapterSid, TeamPrepareWindow.WIN_PRACTICE_ITEM_TYPE);
            }, ChapterType.PRACTICE);
        }
        else if (win is IntensifyCardWindow)
        {
            if (sample.sid == INTENSIFY_CARD_EVLOUTION)
            {
                IntensifyCardManager.Instance.setMainCard(ArmyManager.Instance.getActiveArmy().getLeastCombatCardExistMain());
            }
            else
            {
                IntensifyCardManager.Instance.setMainCard(ArmyManager.Instance.getActiveArmy().getLeastCombatCard());
            }
            (win as IntensifyCardWindow).initWindow(StringKit.toInt(sample.windowArgs [0]));
        }
        else if (win is HonorWindow)
        {
            (win as HonorWindow).updateInfo();
        }
        else if (win is GoddessWindow)
        {
//			(win as GoddessWindow).initWin ();
        }
        else if (win is ExChangeWindow)
        {
            (win as ExChangeWindow).setDefaultIndex(StringKit.toInt(sample.windowArgs [0]));
        }
        else if (win is ShopWindow)
        {
            int        type       = StringKit.toInt(sample.windowArgs [0]);
            ShopWindow shopWindow = win as ShopWindow;
            /** 神秘商城 */
            if (type == ShopWindow.TAP_MYSTICAL_CONTENT)
            {
                shopWindow.setTitle(LanguageConfigManager.Instance.getLanguage("shop_mystical"));
                shopWindow.init(ShopWindow.TAP_MYSTICAL_CONTENT);
            }
            /** 钻石商城 */
            else if (type == ShopWindow.TAP_SHOP_CONTENT)
            {
                shopWindow.setTitle(LanguageConfigManager.Instance.getLanguage("shop02"));
                shopWindow.init(ShopWindow.TAP_SHOP_CONTENT);
            }
        }
    }
Exemplo n.º 10
0
 private void CloseShop()
 {
     Globals.GameShop = null;
     mShopWindow?.Close();
     mShopWindow = null;
 }
Exemplo n.º 11
0
        private void OpenShop()
        {
            var shopWindow = new ShopWindow();

            shopWindow.Visibility = System.Windows.Visibility.Visible;
        }
Exemplo n.º 12
0
 public void SetWindow(ShopWindow window)
 {
     this.window = window;
 }
Exemplo n.º 13
0
        //--- Shop ---

        public void ShowShop()
        {
            _shopWindow = new ShopWindow();
            _shopWindow.Show();
            _ninjaListVM.CloseInventoryNinja();
        }
 private void ShowShop()
 {
     CloseShop();
     _showWindow = new ShopWindow();
     _showWindow.Show();
 }