private void EndEject(int resultCode)
 {
     if (resultCode == 1)
     {
         this.SetBarrier(true);
         int num = this.selectedChipParameter.ConvertButtonIndex();
         this.chipSphereIconButtons[num].SetupEmpty();
         this.RefreshItemCountColor();
         this.RefreshStatus();
         this.RefreshItemNumbers();
         this.RefreshYellowLines();
         string texname = string.Format("ChipThumbnail/{0}", "eject_slot_01");
         foreach (UITexture uiTex in this.ejectItemCutinTextures)
         {
             NGUIUtil.ChangeUITextureFromFileASync(uiTex, texname, false, null);
         }
         this.ejectItemCutinGO.transform.localPosition = this.chipButtonsPositions[num];
         this.ejectItemCutinGO.SetActive(false);
         this.ejectItemCutinGO.SetActive(true);
         this.ejectAnimationTrigger.OnFinishAnimation = delegate(string str)
         {
             this.SetBarrier(false);
             this.isLoopOff = true;
         };
         SoundMng.Instance().TryPlaySE("SEInternal/Common/se_108", 0f, false, true, null, -1);
         this.chipSphereIconButtons[num].OnTouch();
         RestrictionInput.EndLoad();
     }
     else
     {
         ChipTools.CheckResultCode(resultCode);
         this.DispErrorModal(resultCode);
     }
 }
示例#2
0
 public void SetupEmpty()
 {
     this.isOpened = true;
     this.frameSprite.spriteName = "Chip_Sphere_Thumbnail_OFF";
     this.myParameter.menuType   = CMD_ChipSphere.MenuType.Empty;
     NGUITools.SetActiveSelf(this.rankSprite.gameObject, false);
     NGUITools.SetActiveSelf(this.chargesGO, false);
     NGUITools.SetActiveSelf(this.lookGO, false);
     NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_Empty", false, null);
 }
示例#3
0
 private void SetupNotYet()
 {
     NGUITools.SetActiveSelf(this.rankSprite.gameObject, false);
     NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_NotOpen", false, null);
     NGUITools.SetActiveSelf(this.chargesGO, false);
     NGUITools.SetActiveSelf(this.lookGO, true);
     NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true);
     this.chipNameLabel.text = this.myParameter.chipName;
     NGUITools.SetActiveSelf(this.lookSprite.gameObject, true);
     this.lookSprite.spriteName = "Common02_Icon_KeyQ";
 }
示例#4
0
 private void SetupExtendable()
 {
     this.isOpened = false;
     NGUITools.SetActiveSelf(this.rankSprite.gameObject, false);
     this.chipNameLabel.text = this.myParameter.chipName;
     NGUITools.SetActiveSelf(this.chipDescriptLabel.gameObject, true);
     this.chipDescriptLabel.text = string.Format(StringMaster.GetString("SystemItemCount2"), this.myParameter.itemCount);
     NGUITools.SetActiveSelf(this.chargesGO, true);
     NGUITools.SetActiveSelf(this.lookSprite.gameObject, false);
     NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_NotOpen", false, null);
 }
示例#5
0
 public void SetupDetail(int userChipId, GameWebAPI.RespDataMA_ChipM.Chip chipData)
 {
     this.isOpened = true;
     this.SetupOnlyDetailParams(userChipId, chipData);
     this.frameSprite.spriteName = "Chip_Sphere_Thumbnail_ON";
     NGUITools.SetActiveSelf(this.chargesGO, false);
     NGUITools.SetActiveSelf(this.lookGO, false);
     NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true);
     NGUITools.SetActiveSelf(this.chipDescriptLabel.gameObject, true);
     this.chipNameLabel.text     = this.myParameter.chipName;
     this.chipDescriptLabel.text = this.myParameter.chipDetail;
     NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, chipData.GetIconPath(), false, null);
     NGUITools.SetActiveSelf(this.rankSprite.gameObject, true);
     this.rankSprite.spriteName = ChipTools.GetRankPath(chipData.rank);
 }
示例#6
0
 private void SetupIcon(GameWebAPI.RespDataMA_ChipM.Chip chipMainData)
 {
     NGUITools.SetActiveSelf(this.thumbnailTexture.gameObject, true);
     NGUIUtil.ChangeUITextureFromFileASync(this.thumbnailTexture, chipMainData.GetIconPath(), false, null);
     if (this.rareSprite != null)
     {
         this.rareSprite.spriteName = ChipTools.GetRankPath(chipMainData.rank);
         NGUITools.SetActiveSelf(this.rareSprite.gameObject, true);
     }
     if (this.noChipLabel != null)
     {
         NGUITools.SetActiveSelf(this.noChipLabel.gameObject, false);
     }
     if (this.chipNameLabel != null)
     {
         NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true);
         this.chipNameLabel.text = chipMainData.name;
     }
 }
示例#7
0
 public void SetupEmptyIcon()
 {
     NGUIUtil.ChangeUITextureFromFileASync(this.thumbnailTexture, "ChipThumbnail/Chip_NotOpen", false, null);
     if (this.chipNameLabel != null)
     {
         NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, false);
     }
     if (this.rareSprite != null)
     {
         NGUITools.SetActiveSelf(this.rareSprite.gameObject, false);
     }
     if (this.noChipLabel != null)
     {
         NGUITools.SetActiveSelf(this.noChipLabel.gameObject, true);
         this.noChipLabel.text = StringMaster.GetString("ChipInstalling-13");
     }
     if (this.thumbnailTexture != null)
     {
         NGUITools.SetActiveSelf(this.thumbnailTexture.gameObject, false);
     }
 }
    public void SetItem(string assetCategoryId, string objectId, string num, bool isLoadASync = false, Action callback = null)
    {
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(assetCategoryId);
        MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory)assetCategory.assetCategoryId.ToInt32();
        this.itemName = this.GetPresentName(assetCategory, objectId);
        string arg;

        if (assetCategory2 == MasterDataMng.AssetCategory.TIP)
        {
            arg = StringFormat.Cluster(num);
        }
        else
        {
            arg = num;
        }
        if (this.itemNameLabel != null)
        {
            if (assetCategory2 == MasterDataMng.AssetCategory.FACILITY_KEY)
            {
                this.itemNameLabel.text = this.itemName;
            }
            else
            {
                this.itemNameLabel.text = string.Format(StringMaster.GetString("SystemItemCount"), this.itemName, arg);
            }
        }
        switch (assetCategory2)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            if (null != this.monsterIcon)
            {
                UnityEngine.Object.Destroy(this.monsterIcon.gameObject);
            }
            this.monsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(MonsterDataMng.Instance().CreateMonsterDataByMID(objectId), Vector3.one, Vector3.zero, this.iconSprite.transform, true, false);
            this.monsterIcon.ResizeIcon(this.iconSprite.width, this.iconSprite.height);
            if (null != this.monsterIcon)
            {
                DepthController depthController = this.monsterIcon.GetDepthController();
                if (null != depthController)
                {
                    depthController.AddWidgetDepth(this.monsterIcon.transform, this.iconSprite.depth + 10);
                }
            }
            if (callback != null)
            {
                callback();
            }
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
        case MasterDataMng.AssetCategory.LINK_POINT:
        case MasterDataMng.AssetCategory.TIP:
        case MasterDataMng.AssetCategory.EXP:
        case MasterDataMng.AssetCategory.MEAT:
            this.iconSprite.enabled    = true;
            this.iconSprite.spriteName = this.GetSpriteName(assetCategory2);
            if (callback != null)
            {
                callback();
            }
            break;

        case MasterDataMng.AssetCategory.ITEM:
        case MasterDataMng.AssetCategory.SOUL:
        case MasterDataMng.AssetCategory.FACILITY_KEY:
        case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            this.iconTexture.enabled = true;
            if (isLoadASync)
            {
                NGUIUtil.ChangeUITextureFromFileASync(this.iconTexture, this.GetTexturePath(assetCategory2, objectId), false, callback);
            }
            else
            {
                NGUIUtil.ChangeUITextureFromFile(this.iconTexture, this.GetTexturePath(assetCategory2, objectId), false);
                if (callback != null)
                {
                    callback();
                }
            }
            if (assetCategory2 == MasterDataMng.AssetCategory.FACILITY_KEY)
            {
                this.iconSprite.enabled    = true;
                this.iconSprite.spriteName = "Common02_item_flame";
            }
            break;

        case MasterDataMng.AssetCategory.CHIP:
        {
            GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(objectId);
            ChipDataMng.MakePrefabByChipData(chipMainData, this.iconSprite.gameObject, this.iconSprite.transform.localPosition, this.iconSprite.transform.localScale, delegate(ChipIcon result)
                {
                    if (callback != null)
                    {
                        callback();
                    }
                }, this.iconSprite.width, this.iconSprite.height, true);
            break;
        }
        }
        this.uiBasicSprites = base.transform.GetComponentsInParent <UIBasicSprite>(true);
    }
示例#9
0
    public void SetupDetail(ChipSphereIconButton.Parameter parameter)
    {
        switch (parameter.menuType)
        {
        case CMD_ChipSphere.MenuType.Empty:
            NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_Empty", false, null);
            NGUITools.SetActiveSelf(this.chipTexture.gameObject, true);
            NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, false);
            NGUITools.SetActiveSelf(this.rareSprite.gameObject, false);
            NGUITools.SetActiveSelf(this.chipLookTexture.gameObject, false);
            NGUITools.SetActiveSelf(this.lookGO, false);
            this.messageLabel.text       = StringMaster.GetString("ChipInstalling-03");
            this.buttonLabel.text        = StringMaster.GetString("ChipInstalling-04");
            this.chipNameLabel.color     = Color.white;
            this.myMenuType              = parameter.menuType;
            this.buttonSprite.spriteName = "Common02_Btn_Green";
            this.buttonCollider.enabled  = true;
            this.buttonLabel.color       = Color.white;
            this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor;
            break;

        case CMD_ChipSphere.MenuType.Extendable:
        {
            NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_NotOpen", true, null);
            NGUITools.SetActiveSelf(this.lookGO, true);
            NGUITools.SetActiveSelf(this.rareSprite.gameObject, false);
            NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true);
            NGUITools.SetActiveSelf(this.chipLookTexture.gameObject, false);
            NGUITools.SetActiveSelf(this.chipTexture.gameObject, true);
            int itemCount = parameter.itemCount;
            this.chipNameLabel.text = string.Format("×{0}", itemCount);
            this.buttonLabel.text   = StringMaster.GetString("ChipInstalling-08");
            global::Debug.LogFormat("{0} >= {1}, isOpened:{2}", new object[]
                {
                    this.extendItemCount,
                    itemCount,
                    parameter.isOpened
                });
            bool flag = this.extendItemCount >= itemCount;
            if (flag)
            {
                this.chipNameLabel.color = Color.white;
            }
            else
            {
                this.chipNameLabel.color = Color.red;
            }
            if (flag && parameter.isExtendable)
            {
                this.messageLabel.text       = StringMaster.GetString("ChipInstalling-07");
                this.buttonSprite.spriteName = "Common02_Btn_Green";
                this.buttonCollider.enabled  = true;
                this.buttonLabel.color       = Color.white;
                this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor;
            }
            else
            {
                this.messageLabel.text       = StringMaster.GetString("ChipInstalling-11");
                this.buttonSprite.spriteName = "Common02_Btn_Gray";
                this.buttonCollider.enabled  = false;
                this.buttonLabel.color       = ConstValue.DEACTIVE_BUTTON_LABEL;
                this.buttonLabel.effectColor = ConstValue.DEACTIVE_BUTTON_LABEL;
            }
            this.myMenuType = parameter.menuType;
            break;
        }

        case CMD_ChipSphere.MenuType.NotYet:
        {
            this.chipNameLabel.text = parameter.chipName;
            NGUITools.SetActiveSelf(this.rareSprite.gameObject, false);
            string text = string.Format(StringMaster.GetString("ChipInstalling-10"), parameter.chipDetail);
            this.messageLabel.text = text;
            break;
        }

        case CMD_ChipSphere.MenuType.Detail:
        {
            this.chipNameLabel.text = parameter.chipName;
            this.messageLabel.text  = parameter.chipDetail;
            NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, parameter.chipIconPath, false, null);
            NGUITools.SetActiveSelf(this.chipTexture.gameObject, true);
            this.rareSprite.spriteName = ChipTools.GetRankPath(parameter.chipRank);
            NGUITools.SetActiveSelf(this.rareSprite.gameObject, true);
            this.buttonSprite.spriteName = "Common02_Btn_Red";
            this.buttonCollider.enabled  = true;
            this.buttonLabel.color       = Color.white;
            this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor;
            GameWebAPI.RespDataMA_ChipM.Chip chipEnhancedData = ChipDataMng.GetChipEnhancedData(parameter.ConvertChipId());
            if (chipEnhancedData != null)
            {
                if (this.reinforcementButtonSprite != null)
                {
                    this.reinforcementButtonSprite.spriteName = "Common02_Btn_Green";
                }
                if (this.reinforcementButtonCollider != null)
                {
                    this.reinforcementButtonCollider.enabled = true;
                }
                if (this.reinforcementButtonLabel != null)
                {
                    this.reinforcementButtonLabel.color = Color.white;
                }
                if (this.buttonLabel != null)
                {
                    this.buttonLabel.effectColor = this.defaultReinforcementButtonLabelEffectColor;
                }
            }
            else
            {
                if (this.reinforcementButtonSprite != null)
                {
                    this.reinforcementButtonSprite.spriteName = "Common02_Btn_Gray";
                }
                if (this.reinforcementButtonCollider != null)
                {
                    this.reinforcementButtonCollider.enabled = false;
                }
                if (this.reinforcementButtonLabel != null)
                {
                    this.reinforcementButtonLabel.color = ConstValue.DEACTIVE_BUTTON_LABEL;
                }
                if (this.buttonLabel != null)
                {
                    this.buttonLabel.effectColor = ConstValue.DEACTIVE_BUTTON_LABEL;
                }
            }
            break;
        }
        }
    }