예제 #1
0
    void OnRefresh(Filter selectedFilter)
    {
        switch (selectedFilter)
        {
        case Filter.All:
            itemList = (from item in staticData.GetList <GDItemData>()
                        where item.type.IsFlagSet(GDItemDataType.NotInv) == false
                        select item).ToList();
            break;

        case Filter.Create:
            itemList = (from item in staticData.GetList <GDItemData>()
                        where item.type.IsFlagSet(GDItemDataType.CustomerEat) == true
                        select item).ToList();
            break;

        case Filter.Farm:
            itemList = (from item in staticData.GetList <GDItemData>()
                        where item.type.IsFlagSet(GDItemDataType.Crop) == true
                        select item).ToList();
            break;

        case Filter.Etc:
            itemList = (from item in staticData.GetList <GDItemData>()
                        where item.type != GDItemDataType.NotInv
                        select item).ToList();
            break;
        }
        scrollView.OnRefresh();
    }
예제 #2
0
    void OnRefresh(Filter selectedFilter)
    {
        switch (selectedFilter)
        {
        case Filter.All:
            itemList = (from item in runtimeData.GetList <DBItem>()
                        where item.count > 0 &&
                        staticData.GetByID <GDItemData>(item.itemID).type.IsFlagSet(GDItemDataType.NotInv) == false
                        select item).ToList();
            break;

        case Filter.Create:
            itemList = (from item in runtimeData.GetList <DBItem>()
                        where item.count > 0 &&
                        staticData.GetByID <GDItemData>(item.itemID).type.IsFlagSet(GDItemDataType.CustomerEat) == true
                        select item).ToList();
            break;

        case Filter.Farm:
            itemList = (from item in runtimeData.GetList <DBItem>()
                        where item.count > 0 &&
                        staticData.GetByID <GDItemData>(item.itemID).type.IsFlagSet(GDItemDataType.Crop) == true
                        select item).ToList();
            break;

        case Filter.Etc:
            itemList = (from item in runtimeData.GetList <DBItem>()
                        where item.count > 0 &&
                        staticData.GetByID <GDItemData>(item.itemID).type != GDItemDataType.NotInv
                        select item).ToList();
            break;
        }
        view.CLSetFormattedText("Window/TopBar/ProgressBar/Text",
                                easy.CurrentStorageItemCnt,
                                easy.MaxStorageItemCnt
                                );

        view.CLGetComponent <Slider>("Window/TopBar/ProgressBar/Slider").value = (float)easy.CurrentStorageItemCnt / (float)easy.MaxStorageItemCnt;
        itemScroll.OnRefresh();

        //UpgradeCheck..
        var listOfUpgrade = staticData.GetList <GDStorageUpgradeData>();

        if (easy.UserInfo.storageUpgradeLv >= listOfUpgrade.Count - 1)
        {
            //FullUpgrade!...
            view.CLGetComponent <Button>("Window/TopBar/Button_Upgrade").interactable = false;
            return;
        }
        view.CLGetComponent <Button>("Window/TopBar/Button_Upgrade").interactable = true;
    }
예제 #3
0
    void OnRefresh(TabType tabType)
    {
//		dataList = new List<Tuple<TabType, int>>();
        switch (tabType)
        {
        case TabType.Ingredient: {
            dataList = staticData.GetList <GDShopIngredient>().Select(x => {
                    return(Tuple.Create <TabType, int>(tabType, x.id));
                }).ToList();
        }
        break;

        case TabType.CraftingTable: {
            dataList = staticData.GetList <GDShopCraftingTable>().Select(x => {
                    return(Tuple.Create <TabType, int>(tabType, x.id));
                }).ToList();
        }
        break;

        case TabType.Interior: {
            dataList = staticData.GetList <GDShopInterior>().Select(x => {
                    return(Tuple.Create <TabType, int>(tabType, x.id));
                }).ToList();
        }
        break;

        case TabType.Dia: {
            dataList = staticData.GetList <GDShopItem>()
                       .Where(x => x.type == GDShopTabType.Dia)
                       .Select(x => {
                    return(Tuple.Create <TabType, int>(tabType, x.id));
                }).ToList();
        }
        break;

        case TabType.Gold: {
            dataList = staticData.GetList <GDShopItem>()
                       .Where(x => x.type == GDShopTabType.Gold)
                       .Select(x => {
                    return(Tuple.Create <TabType, int>(tabType, x.id));
                }).ToList();
        }
        break;

        case TabType.Package: {
            dataList = staticData.GetList <GDShopItem>()
                       .Where(x => x.type == GDShopTabType.Package)
                       .Select(x => {
                    return(Tuple.Create <TabType, int>(tabType, x.id));
                }).ToList();
        }
        break;

        case TabType.Free: {
            dataList = staticData.GetList <GDShopItem>()
                       .Where(x => x.type == GDShopTabType.Free)
                       .Select(x => {
                    return(Tuple.Create <TabType, int>(tabType, x.id));
                }).ToList();
        }
        break;
        }
        scrollView.OnRefresh();
    }
예제 #4
0
    void BindLogic()
    {
        //Quit
        view.CLOnPointerClickAsObservable("Back").Select(x => Unit.Default).Subscribe(_ => {
            popupManager.DestroyPopup(this);
        });

        scrollView.Init(view.CLGetGameObject("Window/ScrollView/Viewport/Content"),
                        (idx, go) => {
            var singleData = dataList[idx];
            go.CLSetFormattedText("Name", singleData.name);

            if (singleData.reqAchiev == GDAchievementType.Invalid)
            {
                go.CLGetGameObject("Button_Reward").SetActive(false);
                go.CLGetGameObject("Slider").SetActive(false);
                go.CLSetFormattedText("Cond", "완료됨");
                return;
            }

            var baseDesc = staticData.GetList <GDAchievementTypeDesc>().Where(x => x.type == singleData.reqAchiev).FirstOrDefault().desc;
            go.CLSetFormattedText("Cond", string.Format(baseDesc, singleData.reqAchievCnt));


            int curCnt          = 0;
            var curAchivCntData = runtimeData.GetList <DBAchievementTypeCount>().Where(x => x.type == singleData.reqAchiev).FirstOrDefault();
            if (curAchivCntData != null)
            {
                curCnt = curAchivCntData.cnt;
            }

            go.CLSetFormattedText("Slider/Text", curCnt, singleData.reqAchievCnt);
            go.CLGetComponent <Slider>("Slider").value = (float)curCnt / (float)singleData.reqAchievCnt;

            if (curCnt >= singleData.reqAchievCnt)
            {
                go.CLGetComponent <Button>("Button_Reward").interactable = true;
            }
            else
            {
                go.CLGetComponent <Button>("Button_Reward").interactable = false;
            }
            var diaItem = staticData.GetByID <GDItemData>(GDInstKey.ItemData_diaPoint);
            go.CLGetComponent <Image>("Button_Reward/Item/Image").sprite = sprite.GetItem(diaItem.imageName);
            go.CLSetFormattedText("Button_Reward/Item/Text", singleData.rewardDiaCnt);
            go.CLOnThrottleClickAsObservable("Button_Reward").Subscribe(_ => {
                server.Get("enc/sess/achievement/collect", JObject.FromObject(new{ id = singleData.id }))
                .Subscribe(x => {
//							popupManager.PushPopup<FIPopupDialog>("업적 보상 받음");
                    var notice = popupManager.PushPopup <FIPopupDialog>();
                    notice.SetNoticePopup("업적 보상 받음");
                    OnRefresh();
                });
            });

//				runtimeData.GetObserver<DBAchievementTypeCount>()
//					.Where(x=>x.Item2.type==singleData.reqAchiev)
//					.Select(x=>x.Item2)
//					.Subscribe(x=>{
//
//					}).AddTo(go);
        }, () => {
            return(dataList.Count);
        });

        OnRefresh();
    }