Esempio n. 1
0
 public void init(FashionShopConfigItem item)
 {
     _gender    = item.getGender();
     _isDressOn = item.isDressOn();
     _isTry     = false;
     _isExpired = item.isInDate();
     _fashionID = item._fashionID;
 }
Esempio n. 2
0
    static int isInDate(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        FashionShopConfigItem obj = (FashionShopConfigItem)LuaScriptMgr.GetNetObjectSelf(L, 1, "FashionShopConfigItem");
        bool o = obj.isInDate();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Esempio n. 3
0
    void Update()
    {
        if (_leftTimeDetail != null)
        {
            if (_configItem.isInDate())
            {
                // FashionItemDisplay fiDisplay = (FashionItemDisplay)_configItem;
                _leftTimeDetail.text = _configItem.getTimeLeftStr();

                updateExpired(false);
            }
            else
            {
                updateExpired(true);
            }
        }

        if (_configItem.isMine())
        {
            _discountGo.SetActive(false);
            _newGo.SetActive(false);
        }
    }
Esempio n. 4
0
    void BuyYes(GameObject go)
    {
        BuyStoreGoods    msg     = new BuyStoreGoods();
        FashionOperation msgOper = null;

        msg.store_id = StoreType.ST_FASHION;

        uint goldCost    = 0;
        uint diamondCost = 0;

        foreach (KeyValuePair <uint, UIStoreFashion.FashionSelectedItem> item in _uiStoreFashion._fashionSelected._dressOnItems)
        {
            FashionShopConfigItem configItem = item.Value._config;
            Fashion_OBB_item      obbItem    = GetOBBItem(configItem._fashionID);

            if (obbItem == null || !obbItem._isSelect)
            {
                continue;
            }
            if (item.Value._selectIndex < 0)
            {
                continue;
            }

            uint costType;
            uint costNum = configItem.getActuallyCost(item.Value._selectIndex, out costType);

            if (costType == 1)
            {
                diamondCost += costNum;
            }
            else if (costType == 2)
            {
                goldCost += costNum;
            }


            if (configItem.isInDate())
            {
                if (null == msgOper)
                {
                    msgOper = new FashionOperation();
                }

                FashionOperationInfo info = new FashionOperationInfo();
                info.type    = (uint)FashionOperationType.FOT_RENEW;
                info.uuid    = configItem.getGood().GetUUID();
                info.subtype = (uint)item.Value._selectIndex + 1;
                msgOper.info.Add(info);
                if (GlobalConst.IS_FASHION_OPEN == 1)
                {
                    msgOper.role_id = MainPlayer.Instance.CaptainID;
                }
            }
            else
            {
                if (item.Value._selectIndex >= 0)
                {
                    uint type;
                    uint cost = item.Value._config.getActuallyCost(item.Value._selectIndex, out type);

                    int pos = GameSystem.Instance.FashionShopConfig.configsSort.IndexOf(item.Value._config);

                    BuyStoreGoodsInfo info = new BuyStoreGoodsInfo();
                    info.pos  = (uint)pos + 1;
                    info.type = (uint)item.Value._selectIndex + 1;
                    msg.info.Add(info);
                }
            }
        }


        if ((diamondCost > MainPlayer.Instance.DiamondBuy + MainPlayer.Instance.DiamondFree) || goldCost > MainPlayer.Instance.Gold)
        {
            CommonFunction.ShowTip(CommonFunction.GetConstString("UI_FASHION_MONEY_NOT_ENGOUGH"));
            return;
        }

        /*
         * PlatNetwork.Instance.BuyStoreGoodsRequest(msg);
         * if (msgOper != null)
         * {
         * PlatNetwork.Instance.UpdateFashionRequest(msgOper);
         * }
         */
    }