Ejemplo n.º 1
0
    public static GameObject ShowItemSmall(Transform parent, int itemId, long count = -1L)
    {
        GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("ItemShowSmall");

        instantiate2Prefab.SetActive(true);
        instantiate2Prefab.get_transform().SetParent(parent);
        instantiate2Prefab.get_transform().set_localScale(Vector3.get_one());
        instantiate2Prefab.get_transform().set_localPosition(Vector3.get_zero());
        instantiate2Prefab.get_transform().set_localEulerAngles(Vector3.get_zero());
        ButtonCustom expr_61 = instantiate2Prefab.GetComponent <ButtonCustom>();

        expr_61.onClickCustom = (ButtonCustom.VoidDelegateObj) Delegate.Combine(expr_61.onClickCustom, delegate(GameObject v)
        {
            ItemTipUIViewModel.ShowItem(itemId, null);
        });
        ResourceManager.SetSprite(instantiate2Prefab.get_transform().FindChild("Icon").GetComponent <Image>(), GameDataUtils.GetIcon(DataReader <Items> .Get(itemId).icon));
        if (count == -1L)
        {
            instantiate2Prefab.get_transform().FindChild("Num").get_gameObject().SetActive(false);
        }
        else
        {
            instantiate2Prefab.get_transform().FindChild("Num").GetComponent <Text>().set_text(count.ToString());
        }
        return(instantiate2Prefab);
    }
Ejemplo n.º 2
0
    private void OnClickLink(DetailInfo detailInfo)
    {
        if (detailInfo == null)
        {
            return;
        }
        if (detailInfo.type == DetailType.DT.Equipment)
        {
            ItemTipUIViewModel.ShowItem(this.m_detailInfo.cfgId, null);
        }
        else if (detailInfo.type == DetailType.DT.Role)
        {
            ChatManager.OnClickRole(this.m_detailInfo.id, this.m_detailInfo.label, base.get_transform(), 0L);
        }
        else if (detailInfo.type == DetailType.DT.UI)
        {
            if (LinkNavigationManager.BroadcastLink(detailInfo.cfgId))
            {
                UIManagerControl.Instance.HideUI("ChatUI");
            }
        }
        else if (detailInfo.type == DetailType.DT.Interface)
        {
            GuangBoLianJie guangBoLianJie = DataReader <GuangBoLianJie> .Get(detailInfo.cfgId);

            if (guangBoLianJie == null)
            {
                return;
            }
            if (guangBoLianJie.@interface == 2)
            {
                this.WorldInviteInterface(detailInfo);
            }
        }
    }
Ejemplo n.º 3
0
    private void OnClickBtnRewardDetail(GameObject sender)
    {
        MonthSignInChildItem item = sender.get_transform().get_parent().GetComponent <MonthSignInChildItem>();

        if (item.state == MonthSignInChildItem.MonthSignInChildItemState.CanSign)
        {
            SignInManager.Instance.SendSignReq(0, item.monthSignCache);
        }
        else if (item.state == MonthSignInChildItem.MonthSignInChildItemState.CanResign)
        {
            string chineseContent = GameDataUtils.GetChineseContent(502212, false);
            string text           = GameDataUtils.GetChineseContent(502213, false);
            text = text.Replace("xx", (item.monthSignCache.resignCost + DataReader <Resign> .Get(SignInManager.Instance.monthSignInfo.repairUsedNum + 1).cost).ToString());
            DialogBoxUIViewModel.Instance.ShowAsOKCancel(chineseContent, text, delegate
            {
            }, delegate
            {
                SignInManager.Instance.SendSignReq(1, item.monthSignCache);
            }, GameDataUtils.GetChineseContent(505113, false), GameDataUtils.GetChineseContent(505114, false), "button_orange_1", "button_yellow_1", null, true, true);
        }
        else if (item.state == MonthSignInChildItem.MonthSignInChildItemState.HaveSign)
        {
            ItemTipUIViewModel.ShowItem(item.monthSignCache.itemId, null);
        }
        else if (item.state == MonthSignInChildItem.MonthSignInChildItemState.None)
        {
            ItemTipUIViewModel.ShowItem(item.monthSignCache.itemId, null);
        }
    }
Ejemplo n.º 4
0
 protected void OnClickItem(GameObject go)
 {
     if (this.unitItemID == 0)
     {
         return;
     }
     if (!DataReader <Items> .Contains(this.unitItemID))
     {
         return;
     }
     ItemTipUIViewModel.ShowItem(this.unitItemID, null);
 }
Ejemplo n.º 5
0
    private void OnClickItem(GameObject go)
    {
        Items item = BackpackManager.Instance.GetItem(this.ItemID);

        if (item == null)
        {
            return;
        }
        if (item.tab == 2 && this.EquipData != null)
        {
            ItemTipUIViewModel.ShowEquipItem(this.ItemID, this.EquipData, null);
            return;
        }
        ItemTipUIViewModel.ShowItem(this.ItemID, null);
    }
Ejemplo n.º 6
0
 private GameObject RefreshReward(GameObject go, int id, int num)
 {
     ResourceManager.SetSprite(go.GetComponent <Image>(), GameDataUtils.GetItemFrame(id));
     ResourceManager.SetSprite(go.get_transform().FindChild("Image").GetComponent <Image>(), GameDataUtils.GetItemIcon(id));
     if (num > 1)
     {
         go.get_transform().FindChild("Text").GetComponent <Text>().set_text(num.ToString());
     }
     go.GetComponent <ButtonCustom>().onClickCustom = delegate(GameObject o)
     {
         ItemTipUIViewModel.ShowItem(id, null);
     };
     go.SetActive(true);
     return(go);
 }
Ejemplo n.º 7
0
    protected virtual void OnClickRewardItem(GameObject go)
    {
        if (DataReader <Items> .Contains(this.m_itemId))
        {
            Items items = DataReader <Items> .Get(this.m_itemId);

            if (items.tab == 2)
            {
                ItemTipUIViewModel.ShowEquipItem(this.m_itemId, this.m_uId, null);
            }
            else
            {
                ItemTipUIViewModel.ShowItem(this.m_itemId, null);
            }
        }
    }
Ejemplo n.º 8
0
    private void OnClickBtnDetal(GameObject go)
    {
        string name = go.get_transform().get_parent().get_name();

        Debug.LogError("OnClickBtnDetal===" + name);
        if (this.itemIdInfoss == null || this.itemIdInfoss.get_Count() < 1)
        {
            return;
        }
        for (int i = 0; i < this.itemIdInfoss.get_Count(); i++)
        {
            if (this.itemIdInfoss.get_Item(i).get_Key() == name)
            {
                ItemTipUIViewModel.ShowItem(this.itemIdInfoss.get_Item(i).get_Value(), null);
            }
        }
    }
Ejemplo n.º 9
0
    private GameObject CreateRewards(int id, long num)
    {
        GameObject go = this.GetUnusedItem();

        if (go == null)
        {
            go = ResourceManager.GetInstantiate2Prefab("TaskRewardItem");
            go.GetComponent <Button>().get_onClick().AddListener(delegate
            {
                int num2 = int.Parse(go.get_name());
                if (num2 != 1)
                {
                    ItemTipUIViewModel.ShowItem(num2, null);
                }
            });
            UGUITools.SetParent(this.mGrid, go, false);
            this.mItems.Add(go);
        }
        go.set_name(id.ToString());
        ResourceManager.SetSprite(go.GetComponent <Image>(), GameDataUtils.GetItemFrame(id));
        ResourceManager.SetSprite(go.get_transform().FindChild("Image").GetComponent <Image>(), GameDataUtils.GetItemIcon(id));
        string text = num.ToString();

        if (id == 1)
        {
            text = AttrUtility.GetExpValueStr(num);
        }
        else if (id == 2)
        {
            text = AttrUtility.GetGoldValueStr(num);
        }
        go.get_transform().FindChild("Text").GetComponent <Text>().set_text(text);
        Items items = DataReader <Items> .Get(id);

        if (items == null || items.step <= 0)
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(false);
        }
        else
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(true);
            go.get_transform().FindChild("ItemStep").FindChild("ItemStepText").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
        go.SetActive(true);
        return(go);
    }
Ejemplo n.º 10
0
    private GameObject CreateRewards(int id, long value)
    {
        GameObject go = this.GetUnusedItem();

        if (go == null)
        {
            go = ResourceManager.GetInstantiate2Prefab("TramcarRewardItem");
            go.GetComponent <Button>().get_onClick().AddListener(delegate
            {
                int num = int.Parse(go.get_name());
                if (num != 1)
                {
                    ItemTipUIViewModel.ShowItem(num, null);
                }
            });
            UGUITools.SetParent(this.mRewardPanel, go, false);
            this.mRewardList.Add(go);
        }
        go.set_name(id.ToString());
        ResourceManager.SetSprite(go.GetComponent <Image>(), GameDataUtils.GetItemFrame(id));
        ResourceManager.SetSprite(go.get_transform().FindChild("Image").GetComponent <Image>(), GameDataUtils.GetItemIcon(id));
        go.get_transform().FindChild("Text").GetComponent <Text>().set_text(Utils.SwitchChineseNumber(value, 1));
        Items items = DataReader <Items> .Get(id);

        if (items == null || items.step <= 0)
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(false);
        }
        else
        {
            go.get_transform().FindChild("ItemStep").get_gameObject().SetActive(true);
            go.get_transform().FindChild("ItemStep").FindChild("ItemStepText").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
        go.SetActive(true);
        return(go);
    }
Ejemplo n.º 11
0
 private void OnClickItem(int itemId)
 {
     ItemTipUIViewModel.ShowItem(itemId, null);
 }
 private void OnClickInstanceRewardItem(GameObject sender)
 {
     ItemTipUIViewModel.ShowItem(int.Parse(sender.get_name()), null);
 }
Ejemplo n.º 13
0
 private void OnClickInstanceDropItem(GameObject sender)
 {
     ItemTipUIViewModel.ShowItem(sender.GetComponent <InstanceDropItem>().equipID, null);
 }
Ejemplo n.º 14
0
 protected void OnClickRewardItem(GameObject go)
 {
     ItemTipUIViewModel.ShowItem(this.mItemId, null);
 }
Ejemplo n.º 15
0
 public void OnClick()
 {
     ItemTipUIViewModel.ShowItem(this.ID, null);
 }
Ejemplo n.º 16
0
    public static void SetItem(GameObject goItem, int itemId, long count = -1L, bool showName = false, Transform ItemTipRoot = null, int depthValue = 2001)
    {
        ButtonCustom expr_1E = goItem.GetComponent <ButtonCustom>();

        expr_1E.onClickCustom = (ButtonCustom.VoidDelegateObj) Delegate.Combine(expr_1E.onClickCustom, delegate(GameObject v)
        {
            ItemTipUIViewModel.ShowItem(itemId, ItemTipRoot);
        });
        Items items = DataReader <Items> .Get(itemId);

        int quality = 1;

        if (items != null)
        {
            quality = items.color;
        }
        ResourceManager.SetSprite(goItem.get_transform().FindChild("ImageBackground").GetComponent <Image>(), ResourceManager.GetCodeSprite(GameDataUtils.GetItemFrameName(quality)));
        if (items != null)
        {
            ResourceManager.SetSprite(goItem.get_transform().FindChild("Icon").GetComponent <Image>(), GameDataUtils.GetIcon(items.icon));
        }
        if (count == -1L)
        {
            goItem.get_transform().FindChild("Num").get_gameObject().SetActive(false);
        }
        else
        {
            goItem.get_transform().FindChild("Num").GetComponent <Text>().set_text(Utils.GetItemNum(itemId, count).ToString());
        }
        if (showName && items != null)
        {
            goItem.get_transform().FindChild("Name").GetComponent <Text>().set_text(GameDataUtils.GetItemName(itemId, false, 0L));
        }
        else
        {
            goItem.get_transform().FindChild("Name").get_gameObject().SetActive(false);
        }
        if (items != null && items.step > 0)
        {
            string text = string.Format(GameDataUtils.GetChineseContent(505023, false), items.step);
            goItem.get_transform().FindChild("EquipStep").get_gameObject().SetActive(true);
            goItem.get_transform().FindChild("EquipStep").FindChild("EquipStepText").GetComponent <Text>().set_text(text);
        }
        else
        {
            goItem.get_transform().FindChild("EquipStep").get_gameObject().SetActive(false);
        }
        if (items == null || items.gogok <= 0)
        {
            goItem.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(false);
        }
        else
        {
            goItem.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(true);
            goItem.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(items.gogok >= 1);
            goItem.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(items.gogok >= 2);
            goItem.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(items.gogok >= 3);
        }
        if (items != null && items.tab == 2 && items.color >= 4)
        {
            int       gogokNum      = 0;
            Transform fxParentTrans = goItem.get_transform().FindChild("Icon");
            EquipGlobal.GetEquipIconFX(items.id, gogokNum, fxParentTrans, "ItemShow", depthValue, false);
            DepthOfUI depthOfUI = goItem.get_transform().FindChild("EquipStep").GetComponent <DepthOfUI>();
            if (depthOfUI == null)
            {
                depthOfUI = goItem.get_transform().FindChild("EquipStep").get_gameObject().AddComponent <DepthOfUI>();
            }
            depthOfUI.SortingOrder = depthValue + 1;
        }
    }
 private void OnClickItem(GameObject go)
 {
     ItemTipUIViewModel.ShowItem(this.item.id, null);
 }
Ejemplo n.º 18
0
 private void OnClickBtnDetal(GameObject go)
 {
     ItemTipUIViewModel.ShowItem(this.IconItemId, null);
 }
Ejemplo n.º 19
0
 private void OnClickSettleItem(GameObject sender)
 {
     ItemTipUIViewModel.ShowItem(sender.GetComponent <ElementInstanceSettleItem>().itemID, null);
 }
 public void OnButtonClick()
 {
     ItemTipUIViewModel.ShowItem(this.ItemId, null);
 }
Ejemplo n.º 21
0
 private void OnClickSignInServerItem(GameObject sender)
 {
     ItemTipUIViewModel.ShowItem(sender.GetComponent <SignInServerItem>().itemIDCache, null);
 }
Ejemplo n.º 22
0
 protected override void Awake()
 {
     base.Awake();
     ItemTipUIViewModel.m_instance = this;
 }