コード例 #1
0
    private int ComparePriority(StoreUtil.StoneStoreData A, StoreUtil.StoneStoreData B)
    {
        int priority  = A.priority;
        int priority2 = B.priority;

        if (priority < priority2)
        {
            return(-1);
        }
        if (priority > priority2)
        {
            return(1);
        }
        return(0);
    }
コード例 #2
0
 public void AllBuild(List <StoreUtil.StoneStoreData> dts)
 {
     if (!base.selectParts.activeSelf)
     {
         base.selectParts.SetActive(true);
     }
     if (!this.largeContentItem.activeSelf)
     {
         this.largeContentItem.SetActive(true);
     }
     base.InitBuild();
     this.partsCount = dts.Count;
     if (null != base.selectCollider)
     {
         GUISelectPanelStone.PanelBuildDataForShop panelBuildDataForShop = this.CalcBuildDataForShop(dts);
         for (int i = 0; i < dts.Count; i++)
         {
             StoreUtil.StoneStoreData stoneStoreData = dts[i];
             GameObject selectParts;
             if (stoneStoreData.packFlg)
             {
                 selectParts = this.largeContentItem;
             }
             else
             {
                 selectParts = base.selectParts;
             }
             GameObject        gameObject = base.AddBuildPart(selectParts);
             GUIListPartsStone component  = gameObject.GetComponent <GUIListPartsStone>();
             if (null != component)
             {
                 component.Callback = this.Callback;
                 component.SetOriginalPos(panelBuildDataForShop.posList[i]);
                 component.Data = stoneStoreData;
                 component.ShowGUI();
             }
         }
         base.height = panelBuildDataForShop.lenH;
         base.InitMinMaxLocation(-1, 0f);
     }
     base.selectParts.SetActive(false);
     this.largeContentItem.SetActive(false);
 }
コード例 #3
0
 public List <StoreUtil.StoneStoreData> GetStoneStoreDataList()
 {
     this.stoneStoreDataList = new List <StoreUtil.StoneStoreData>();
     GameWebAPI.RespDataSH_Info respDataSH_Info = DataMng.Instance().RespDataSH_Info;
     if (respDataSH_Info.shopList.Length > 0)
     {
         GameWebAPI.RespDataSH_Info.ProductList[] productList = respDataSH_Info.shopList[0].productList;
         if (productList.Length > 0)
         {
             for (int i = 0; i < productList.Length; i++)
             {
                 StoreUtil.StoneStoreData stoneStoreData = new StoreUtil.StoneStoreData();
                 stoneStoreData.productId    = productList[i].productId;
                 stoneStoreData.num          = int.Parse(productList[i].acquireList[0].assetNum);
                 stoneStoreData.price        = int.Parse(productList[i].price);
                 stoneStoreData.productTitle = productList[i].productTitle;
                 stoneStoreData.storePrice   = productList[i].price;
                 if (this.storeProductData != null && this.storeProductData.storeProductInfoList != null)
                 {
                     StoreUtil.StoreProductInfo[] storeProductInfoList = this.storeProductData.storeProductInfoList;
                     for (int j = 0; j < storeProductInfoList.Length; j++)
                     {
                         if (storeProductInfoList[j].sku == stoneStoreData.productId)
                         {
                             stoneStoreData.storePrice    = storeProductInfoList[j].price;
                             stoneStoreData.storePriceNum = this.GetPriceNumberFromStorePrice(stoneStoreData.storePrice);
                         }
                     }
                 }
                 stoneStoreData.priority   = int.Parse(productList[i].priority);
                 stoneStoreData.limitCount = int.Parse(productList[i].limitCount);
                 if (!string.IsNullOrEmpty(productList[i].purchasedCount))
                 {
                     stoneStoreData.purchasedCount = int.Parse(productList[i].purchasedCount);
                 }
                 else
                 {
                     stoneStoreData.purchasedCount = 0;
                 }
                 if (productList[i].countDownDispFlg == "1")
                 {
                     stoneStoreData.countDownDispFlg = true;
                 }
                 else
                 {
                     stoneStoreData.countDownDispFlg = false;
                 }
                 if (productList[i].packFlg == "1")
                 {
                     stoneStoreData.packFlg = true;
                 }
                 else
                 {
                     stoneStoreData.packFlg = false;
                 }
                 stoneStoreData.closeTime = productList[i].closeTime;
                 if (stoneStoreData.packFlg)
                 {
                     stoneStoreData.imgPath    = productList[i].img;
                     stoneStoreData.spriteType = StoreUtil.StoneSpriteType.STONE_SHOPLIST_1;
                 }
                 else
                 {
                     stoneStoreData.spriteType = (StoreUtil.StoneSpriteType) int.Parse(productList[i].img);
                 }
                 stoneStoreData.itemList  = new List <GameWebAPI.RespDataSH_Info.AcquireList>();
                 stoneStoreData.omakeList = new List <GameWebAPI.RespDataSH_Info.AcquireList>();
                 for (int k = 0; k < productList[i].acquireList.Length; k++)
                 {
                     if (productList[i].acquireList[k].omakeFlg == "1")
                     {
                         stoneStoreData.omakeList.Add(productList[i].acquireList[k]);
                     }
                     else if (productList[i].acquireList[k].omakeFlg == "0")
                     {
                         stoneStoreData.itemList.Add(productList[i].acquireList[k]);
                     }
                 }
                 this.stoneStoreDataList.Add(stoneStoreData);
             }
             this.stoneStoreDataList.Sort(new Comparison <StoreUtil.StoneStoreData>(this.ComparePriority));
         }
     }
     return(this.stoneStoreDataList);
 }
コード例 #4
0
    private void consumeProductCallBackSuccess()
    {
        int numFromProductId = this.GetNumFromProductId(this._productId);

        if (Loading.IsShow())
        {
            RestrictionInput.EndLoad();
        }
        if (GUIMain.IsBarrierON())
        {
            GUIMain.BarrierOFF();
        }
        CMD_ModalMessage cmd_ModalMessage = (CMD_ModalMessage)GUIMain.ShowCommonDialog(delegate(int x)
        {
            if (this.actCallBackReConsume != null)
            {
                this.actCallBackReConsume(true);
            }
            if (Loading.IsShow())
            {
                Loading.ResumeDisplay();
            }
            if (GUIMain.IsBarrierON())
            {
                GUIMain.BarrierON(null);
            }
        }, "CMD_ModalMessage", null);

        StoreUtil.StoneStoreData stoneStoreDataFromProductId = this.GetStoneStoreDataFromProductId(this._productId);
        if (!this.isFromStart)
        {
            cmd_ModalMessage.Title = StringMaster.GetString("ShopRestoreTitle");
            cmd_ModalMessage.Info  = StringMaster.GetString("ShopRestoreInfo");
        }
        else
        {
            if (!stoneStoreDataFromProductId.packFlg)
            {
                cmd_ModalMessage.Title = StringMaster.GetString("ShopConfirmTitle");
            }
            else
            {
                cmd_ModalMessage.Title = stoneStoreDataFromProductId.productTitle;
            }
            cmd_ModalMessage.Info = string.Format(StringMaster.GetString("ShopCompleted"), numFromProductId.ToString());
        }
        if (this.isFromStart)
        {
            DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.point += numFromProductId;
            GUIPlayerStatus.RefreshParams_S(false);
        }
        else
        {
            if (DataMng.Instance().RespDataUS_PlayerInfo != null)
            {
                DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.point += numFromProductId;
            }
            GUIPlayerStatus.RefreshParams_S(false);
        }
        StoreUtil.StoreProductInfo storeProductInfo_ByProductId = this.GetStoreProductInfo_ByProductId(this._productId);
        string currency = "JPY";

        if (storeProductInfo_ByProductId != null)
        {
            currency = storeProductInfo_ByProductId.currencyCode;
        }
        AdjustWrapper.Instance.TrackEvent(AdjustWrapper.EVENT_ID_SEND_PAYMENT, this.GetStorePriceFromProductId(this._productId), currency);
        GUICollider.EnableAllCollider("StoreUtil");
    }
コード例 #5
0
    private GUISelectPanelStone.PanelBuildDataForShop CalcBuildDataForShop(List <StoreUtil.StoneStoreData> dts)
    {
        GUISelectPanelStone.PanelBuildDataForShop panelBuildDataForShop = new GUISelectPanelStone.PanelBuildDataForShop();
        panelBuildDataForShop.posList = new List <Vector3>();
        if (null != base.selectParts && !base.selectParts.activeSelf)
        {
            base.selectParts.SetActive(true);
        }
        float       width     = base.selectCollider.width;
        float       height    = base.selectCollider.height;
        float       num       = width + this.horizontalMargin;
        GUICollider component = this.largeContentItem.GetComponent <GUICollider>();
        float       height2   = component.height;
        bool        flag      = false;
        float       num2      = 0f;
        float       num3      = 0f;
        float       num4      = num * 2f - this.horizontalMargin;
        float       num5      = -(num4 / 2f) + width / 2f;
        float       y         = 0f;
        float       z         = -5f;

        for (int i = 0; i < dts.Count; i++)
        {
            StoreUtil.StoneStoreData stoneStoreData = dts[i];
            float x;
            if (stoneStoreData.packFlg)
            {
                x     = 0f;
                num3  = ((i != 0) ? (num3 - this.verticalMargin) : (num3 - this.verticalBorder));
                num3 -= height2;
                y     = num3 + height2 / 2f;
                flag  = false;
            }
            else if (!flag)
            {
                x     = num5;
                num3  = ((i != 0) ? (num3 - this.verticalMargin) : (num3 - this.verticalBorder));
                num3 -= height;
                y     = num3 + height / 2f;
                flag  = true;
            }
            else
            {
                x    = num5 + num;
                flag = false;
            }
            Vector3 item = new Vector3(x, y, z);
            panelBuildDataForShop.posList.Add(item);
        }
        num3 -= this.verticalBorder;
        panelBuildDataForShop.lenH = Mathf.Abs(num3);
        float num6 = Mathf.Abs(num3) / 2f;

        num2 += num6;
        num3 += num6;
        for (int j = 0; j < dts.Count; j++)
        {
            Vector3 value = panelBuildDataForShop.posList[j];
            value.y += num6;
            panelBuildDataForShop.posList[j] = value;
        }
        return(panelBuildDataForShop);
    }