Beispiel #1
0
    private void SetupChipIcons(int attachedLength, GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Manage slotStatus)
    {
        int num = 0;

        if (slotStatus != null)
        {
            num = slotStatus.slotNum + slotStatus.extraSlotNum - attachedLength;
        }
        for (int i = 0; i < this.chipSlots.Length; i++)
        {
            if (i < attachedLength)
            {
                this.chipSlots[i].spriteName = "Chip_Slot_ON";
                this.chipSlots[i].color      = Color.white;
            }
            else
            {
                this.chipSlots[i].spriteName = "Chip_Slot_OFF";
                if (num > 0)
                {
                    this.chipSlots[i].color = Color.white;
                }
                else
                {
                    this.chipSlots[i].color = Color.gray;
                }
                num--;
            }
        }
    }
    protected virtual void SetSelectedCharChg(MonsterData monsterData)
    {
        int[] chipIdList = monsterData.GetChipEquip().GetChipIdList();
        GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Manage slotStatus = monsterData.GetChipEquip().GetSlotStatus();
        int maxSlotNum = 0;

        if (slotStatus != null)
        {
            maxSlotNum = slotStatus.maxSlotNum + slotStatus.maxExtraSlotNum;
        }
        this.chipBaseSelect.SetSelectedCharChg(chipIdList, true, maxSlotNum);
    }
Beispiel #3
0
    public void SetSelectedCharChg(MonsterData monsterData)
    {
        GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Manage slotStatus = monsterData.GetChipEquip().GetSlotStatus();
        int num = 0;

        if (slotStatus == null)
        {
            this.myMaxChipSlot = 0;
            this.SetNumber(0, this.myMaxChipSlot);
            if (this.chipCells != null)
            {
                for (int i = 0; i < this.chipCells.Length; i++)
                {
                    NGUITools.SetActiveSelf(this.chipCells[i].gameObject, false);
                }
            }
            this.SetNoChipMessage(true);
        }
        else
        {
            this.myMaxChipSlot = slotStatus.maxSlotNum + slotStatus.maxExtraSlotNum;
            if (this.myMaxChipSlot != 5 && this.myMaxChipSlot != 10)
            {
                global::Debug.LogErrorFormat("スロット数がありえない. myMaxChipSlot:{0} [{1}, {2}]", new object[]
                {
                    this.myMaxChipSlot,
                    slotStatus.maxSlotNum,
                    slotStatus.maxExtraSlotNum
                });
                this.myMaxChipSlot = 10;
            }
            if (monsterData.GetSlotEquip() != null)
            {
                num = monsterData.GetSlotEquip().Length;
            }
            this.SetNoChipMessage(num == 0);
            this.SetupChipCells(monsterData.GetSlotEquip());
            this.SetupChipSlotsAndCells();
            this.SetNumber(num, this.myMaxChipSlot);
            this.SetupChipIcons(num, monsterData.GetChipEquip().GetSlotStatus());
        }
    }
    private ChipSphereIconButton.Parameter CreateParameter(int myGrowStep, int myArousal, int buttonNo)
    {
        int type = 0;

        CMD_ChipSphere.MenuType menuType = CMD_ChipSphere.MenuType.Empty;
        string chipName   = string.Empty;
        string chipDetail = string.Empty;
        int    userChipId = 0;
        int    itemCount  = 0;

        GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Manage slotStatus = CMD_ChipSphere.DataChg.GetChipEquip().GetSlotStatus();
        int num = slotStatus.maxSlotNum + slotStatus.extraSlotNum;

        if (buttonNo == 1)
        {
            if (MonsterGrowStepData.IsRipeScope(myGrowStep) || MonsterGrowStepData.IsPerfectScope(myGrowStep) || MonsterGrowStepData.IsUltimateScope(myGrowStep))
            {
                menuType = CMD_ChipSphere.MenuType.Empty;
            }
            else
            {
                menuType = CMD_ChipSphere.MenuType.NotYet;
                string growStepName = MonsterGrowStepData.GetGrowStepName(5.ToString());
                chipName = growStepName;
                string @string = StringMaster.GetString("ChipInstallingEvolutionInfo");
                chipDetail = string.Format(@string, growStepName);
            }
        }
        else if (buttonNo == 2)
        {
            if (MonsterGrowStepData.IsPerfectScope(myGrowStep) || MonsterGrowStepData.IsUltimateScope(myGrowStep))
            {
                menuType = CMD_ChipSphere.MenuType.Empty;
            }
            else
            {
                menuType = CMD_ChipSphere.MenuType.NotYet;
                string growStepName2 = MonsterGrowStepData.GetGrowStepName(6.ToString());
                chipName = growStepName2;
                string string2 = StringMaster.GetString("ChipInstallingEvolutionInfo");
                chipDetail = string.Format(string2, growStepName2);
            }
        }
        else if (buttonNo == 3)
        {
            if (MonsterGrowStepData.IsUltimateScope(myGrowStep))
            {
                menuType = CMD_ChipSphere.MenuType.Empty;
            }
            else
            {
                menuType = CMD_ChipSphere.MenuType.NotYet;
                string growStepName3 = MonsterGrowStepData.GetGrowStepName(7.ToString());
                chipName = growStepName3;
                string string3 = StringMaster.GetString("ChipInstallingEvolutionInfo");
                chipDetail = string.Format(string3, growStepName3);
                this.chipSphereLines.OpenMiddleToLeftUp(ChipSphereLines.LineType.None);
            }
        }
        else if (buttonNo == 4)
        {
            if (myArousal >= 2)
            {
                menuType = CMD_ChipSphere.MenuType.Empty;
            }
            else
            {
                menuType = CMD_ChipSphere.MenuType.NotYet;
                string string4 = StringMaster.GetString("CharaStatus-23");
                chipName   = string.Format("{0}{1}", string4, 2);
                chipDetail = string4;
                this.chipSphereLines.OpenMiddleToRightDown(ChipSphereLines.LineType.None);
            }
        }
        else if (buttonNo == 5)
        {
            if (myArousal >= 4)
            {
                menuType = CMD_ChipSphere.MenuType.Empty;
            }
            else
            {
                menuType = CMD_ChipSphere.MenuType.NotYet;
                string string5 = StringMaster.GetString("CharaStatus-23");
                chipName   = string.Format("{0}{1}", string5, 4);
                chipDetail = string5;
                this.chipSphereLines.OpenMiddleToRightUp(ChipSphereLines.LineType.None);
            }
        }
        else if (buttonNo >= 6)
        {
            type      = 1;
            itemCount = ConstValue.CHIP_EXTEND_SLOT_NEEDS[buttonNo - 6];
            if (buttonNo <= num)
            {
                menuType = CMD_ChipSphere.MenuType.Empty;
            }
            else
            {
                menuType = CMD_ChipSphere.MenuType.Extendable;
            }
        }
        if (CMD_ChipSphere.DataChg.GetSlotEquip() == null)
        {
            global::Debug.Log("装着はありません.");
        }
        else
        {
            foreach (GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Equip equip in CMD_ChipSphere.DataChg.GetSlotEquip())
            {
                int num2 = ChipTools.ConvertToButtonNo(equip);
                if (buttonNo == num2)
                {
                    menuType   = CMD_ChipSphere.MenuType.Detail;
                    userChipId = equip.userChipId;
                    break;
                }
            }
        }
        return(new ChipSphereIconButton.Parameter
        {
            type = type,
            buttonNo = buttonNo,
            menuType = menuType,
            itemCount = itemCount,
            chipName = chipName,
            chipDetail = chipDetail,
            userChipId = userChipId
        });
    }
    private void SetupChipButtons()
    {
        GameObject original = Resources.Load <GameObject>("UICommon/Parts/Parts_Sphere_CHIP");

        this.chipSphereIconButtons = new ChipSphereIconButton[this.chipButtonsPositions.Length];
        DepthController component  = this.sphereRoot.GetComponent <DepthController>();
        int             depth      = this.sphereRoot.GetComponent <UIWidget>().depth;
        int             myGrowStep = CMD_ChipSphere.DataChg.monsterMG.growStep.ToInt32();
        int             arousal    = CMD_ChipSphere.DataChg.monsterM.GetArousal();

        this.myMaxChipSlot = 5;
        int num = 0;

        if (CMD_ChipSphere.DataChg.GetChipEquip().GetSlotStatus() == null)
        {
            global::Debug.LogError("DataChg.GetSlotStatus() == null");
        }
        else
        {
            GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Manage slotStatus = CMD_ChipSphere.DataChg.GetChipEquip().GetSlotStatus();
            global::Debug.LogFormat("無料:{0}/{1}, 課金:{2}/{3}", new object[]
            {
                slotStatus.slotNum,
                slotStatus.maxSlotNum,
                slotStatus.extraSlotNum,
                slotStatus.maxExtraSlotNum
            });
            num = slotStatus.extraSlotNum;
            this.myMaxChipSlot = slotStatus.maxSlotNum + slotStatus.maxExtraSlotNum;
            if (this.myMaxChipSlot != 5 && this.myMaxChipSlot != 10)
            {
                global::Debug.LogErrorFormat("スロット数がありえない. myMaxChipSlot:{0} [{1}, {2}]", new object[]
                {
                    this.myMaxChipSlot,
                    slotStatus.maxSlotNum,
                    slotStatus.maxExtraSlotNum
                });
                this.myMaxChipSlot = 10;
            }
        }
        for (int i = 0; i < this.myMaxChipSlot; i++)
        {
            Transform transform = UnityEngine.Object.Instantiate <GameObject>(original).transform;
            transform.name = string.Format("Parts_Sphere_CHIP_{0}", i + 1);
            ChipSphereIconButton component2 = transform.GetComponent <ChipSphereIconButton>();
            component.AddWidgetDepth(transform, depth);
            component2.cmdChipSphere = this;
            transform.SetParent(this.sphereRoot);
            transform.localScale    = Vector3.one;
            transform.localPosition = this.chipButtonsPositions[i];
            int num2 = i + 1;
            ChipSphereIconButton.Parameter parameter = this.CreateParameter(myGrowStep, arousal, num2);
            component2.SetupChip(parameter);
            component2.RefreshItemCountColor(this.extraPatchCount);
            component2.SetUnChoose();
            this.chipSphereIconButtons[i] = component2;
            if (num2 >= 6)
            {
                if (num >= 0)
                {
                    this.chipSphereIconButtons[num2 - 1].SetChipColor(true);
                }
                else
                {
                    this.chipSphereIconButtons[num2 - 1].SetChipColor(false);
                }
                num--;
            }
        }
        this.RefreshYellowLines();
        this.RefreshStatus();
        this.chipSphereIconButtons[0].OnTouch();
    }