Exemplo n.º 1
0
 private void RecvGemSysTakeoffRes(short state, GemSysTakeoffRes msg = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (msg != null)
     {
         this.equipSlots[msg.type - EquipLibType.ELT.Weapon, msg.hole - 1].typeId = 0;
         this.equipSlots[msg.type - EquipLibType.ELT.Weapon, msg.hole - 1].id     = 0L;
         GemUI gemUI = UIManagerControl.Instance.GetUIIfExist("GemUI") as GemUI;
         if (gemUI != null)
         {
             gemUI.RefreshEquipSlot(msg.hole - 1, 0);
         }
         GemSingleUI gemSingleUI = UIManagerControl.Instance.GetUIIfExist("GemSingleUI") as GemSingleUI;
         if (gemSingleUI != null)
         {
             gemSingleUI.Show(false);
         }
         EventDispatcher.Broadcast(EventNames.EquipDetailedShouldCheckBadge);
         EventDispatcher.Broadcast <int>(EventNames.UpdateEquipPosGemData, (int)msg.type);
         this.CheckCanShowWearingGemPromoteWay();
     }
 }
Exemplo n.º 2
0
    private void OnClickBtnCompose(GameObject go)
    {
        if (!GemGlobal.IsGemEnoughLv(this.rootTypeId))
        {
            string text = string.Format(GameDataUtils.GetChineseContent(621005, false), new object[0]);
            UIManagerControl.Instance.ShowToastText(text, 2f, 2f);
            return;
        }
        if (!this.IsEnoughGemToCompose(this.rootTypeId))
        {
            int    gemLv    = GemGlobal.GetGemLv(this.branchTypeId);
            string gemColor = GemGlobal.GetGemColor(this.branchTypeId);
            string text2    = string.Format(GameDataUtils.GetChineseContent(621008, false), gemLv, gemColor);
            UIManagerControl.Instance.ShowToastText(text2, 2f, 2f);
            return;
        }
        int arg_B7_0 = (!this.IsComposeGemtoSlot(this.rootTypeId)) ? 0 : GemUI.instance.slotCurr;

        GemManager.Instance.SendGemSysCompositeReq(this.rootTypeId, 1);
        if (this.IsComposeGemtoSlot(this.rootTypeId))
        {
            GemSingleUI gemSingleUI = UIManagerControl.Instance.GetUIIfExist("GemSingleUI") as GemSingleUI;
            if (gemSingleUI != null)
            {
                gemSingleUI.Show(false);
            }
            this.Show(false);
        }
    }
Exemplo n.º 3
0
    private void CloseUI()
    {
        GemSingleUI gemSingleUI = UIManagerControl.Instance.GetUIIfExist("GemSingleUI") as GemSingleUI;

        if (gemSingleUI != null)
        {
            gemSingleUI.Show(false);
        }
        this.Show(false);
    }
Exemplo n.º 4
0
    protected override void OnClickMaskAction()
    {
        GemSingleUI gemSingleUI = UIManagerControl.Instance.GetUIIfExist("GemSingleUI") as GemSingleUI;

        if (gemSingleUI != null)
        {
            gemSingleUI.Show(false);
        }
        this.Show(false);
    }
Exemplo n.º 5
0
    private void OnClickBtnSlot(GameObject sender)
    {
        string text = sender.get_name().Substring(4);

        this.slotCurr = int.Parse(text);
        if (!this.IsSlotUnlocked(this.slotCurr))
        {
            this.SlotLock();
            return;
        }
        this.typeIdCurr = this.GetCurrTypeId(this.slotCurr);
        this.typeIdNext = GemGlobal.GetNextGemItemId(this.typeIdCurr);
        if (this.typeIdCurr == 0)
        {
            GemSelectUI gemSelectUI = UIManagerControl.Instance.OpenUI("GemSelectUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as GemSelectUI;
            gemSelectUI.Init((int)this.equipCurr, this.slotCurr);
        }
        else
        {
            GemSingleUI gemSingleUI = UIManagerControl.Instance.OpenUI("GemSingleUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as GemSingleUI;
        }
    }
Exemplo n.º 6
0
    private void SetItemIcons(int itemId)
    {
        this.rootTypeId   = itemId;
        this.branchTypeId = GemGlobal.GetNeedId(itemId);
        bool enabled = GemUI.instance.typeIdNext != this.rootTypeId;

        this.btnGrids[0].get_transform().GetComponent <Animator>().set_enabled(enabled);
        this.btnGrids[0].get_transform().set_localScale(Vector3.get_one());
        GemSingleUI gemSingleUI = UIManagerControl.Instance.GetUIIfExist("GemSingleUI") as GemSingleUI;

        if (gemSingleUI != null)
        {
            gemSingleUI.SetOneGem(itemId);
        }
        if (GemGlobal.IsActiveOneKeyCompose(GemUI.instance.equipCurr, GemUI.instance.slotCurr, this.rootTypeId))
        {
            this.btnCompose.get_transform().set_localPosition(this.btnCompose.get_transform().get_localPosition().AssignX(-92.2f));
            this.btnOneKeyCompose.set_enabled(true);
            this.btnOneKeyCompose.get_gameObject().SetActive(true);
            this.btnOneKeyCompose.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnOneKeyCompose);
            List <MaterialGem> oneKeyComposeGems = GemGlobal.GetOneKeyComposeGems(GemUI.instance.equipCurr, GemUI.instance.slotCurr, this.rootTypeId);
            if (oneKeyComposeGems != null)
            {
                Text component         = base.FindTransform("btnOneKeyCompose").FindChild("texCostVal").GetComponent <Text>();
                int  oneKeyComposeCost = GemGlobal.GetOneKeyComposeCost(oneKeyComposeGems, this.rootTypeId);
                component.set_text("x" + oneKeyComposeCost);
                this.SetCostActive("btnOneKeyCompose", true, oneKeyComposeCost);
            }
            else
            {
                this.SetCostActive("btnOneKeyCompose", false, 0);
            }
        }
        else
        {
            this.btnCompose.get_transform().set_localPosition(this.btnCompose.get_transform().get_localPosition().AssignXZero());
            this.btnOneKeyCompose.set_enabled(false);
            this.btnOneKeyCompose.get_gameObject().SetActive(false);
        }
        this.SetScroll(GemUI.instance.typeIdNext, itemId);
        this.SetOneItemIcon(0, this.rootTypeId);
        this.SetOneItemIcon(1, this.branchTypeId);
        Text component2 = base.FindTransform("btnCompose").FindChild("texCostVal").GetComponent <Text>();
        int  amount     = GemGlobal.GetAmount(itemId);

        component2.set_text("x" + amount);
        this.SetCostActive("btnCompose", true, amount);
        int         num            = 0;
        List <long> materailGemIds = this.GetMaterailGemIds(itemId, ref num);
        Transform   transform      = this.btnGrids[1].get_transform().Find("texPercent");
        int         composeAmount  = GemGlobal.GetComposeAmount(itemId);
        string      text           = (materailGemIds.get_Count() < composeAmount) ? "<color=#ff0000>" : "<color=#00ff00>";

        transform.GetComponent <Text>().set_text(string.Concat(new object[]
        {
            text,
            num,
            "</color>/",
            composeAmount
        }));
    }