예제 #1
0
        public void ButtonEvt_BuyFlower()
        {
            var coins = LWData.current.Coins;

            if (_flower.Cost > coins)
            {
                return;
            }

            LWData.current.Coins -= _flower.Cost;
            //extra check but it should be -1
            var date = DateTime.Parse(_currentFlower.Date);
            var dict = LWData.current.FlowerDictionary;

            if (_currentFlower.PlantIndex == -1)
            {
                _currentFlower.PlantIndex  = _flower.Index;
                _currentFlower.SpriteIndex = 0;

                dict[date.Month + "/" + date.Year][date.Day - 1] = _currentFlower;
            }

            LWData.current.FlowerDictionary = dict;
            Evt_BoughtFlower(LWData.current.Coins.ToString());
            SerializationManager.Save(LWConfig.DataSaveName, LWData.current);
            LWTransitionController.TransitionTo(LWTransitionController.Controllers.Shop,
                                                LWTransitionController.Controllers.Water);
        }
예제 #2
0
 public void ButtonEvt_FlowerPot()
 {
     if (_currentFlower.PlantIndex == -1)
     {
         LWTransitionController.TransitionOn(LWTransitionController.Controllers.Shop);
     }
     else
     {
         LWTransitionController.TransitionOn(LWTransitionController.Controllers.Popup);
     }
 }
예제 #3
0
 public void ButtonEvt_OpenWater()
 {
     if (_currentFlower.PlantIndex == -1)
     {
         LWTransitionController.TransitionOn(LWTransitionController.Controllers.Shop);
     }
     else
     {
         LWTransitionController.TransitionOn(LWTransitionController.Controllers.Water);
     }
 }
예제 #4
0
        private void Evt_OpenPopup(string day)
        {
            var date = DateTime.Parse(day);
            var dict = LWData.current.FlowerDictionary;

            LWData.current.MainFlower = date.ToShortDateString();
            if (dict[date.Month + "/" + date.Year][date.Day - 1].PlantIndex != -1)
            {
                LWTransitionController.TransitionOn(LWTransitionController.Controllers.Popup);
            }
            else
            {
                LWTransitionController.TransitionTo(LWTransitionController.Controllers.Pot,
                                                    LWTransitionController.Controllers.Shop);
            }
        }
예제 #5
0
 public void ButtonEvt_Close(int index)
 {
     LWTransitionController.TransitionOff((LWTransitionController.Controllers)index);
 }
예제 #6
0
 public void ButtonEvt_Open(int index)
 {
     LWTransitionController.TransitionOn((LWTransitionController.Controllers)index);
 }
 public void ButtonEvt_Edit()
 {
     LWTransitionController.TransitionOff(LWTransitionController.Controllers.Popup);
     LWTransitionController.TransitionTo(LWTransitionController.Controllers.Pot,
                                         LWTransitionController.Controllers.Water);
 }