Esempio n. 1
0
    public override void UpdateUI()
    {
        SetInputSubmitEvent((Enum)UI.IPT_POST, new EventDelegate(delegate
        {
            OnTouchPost();
        }));
        SetActive((Enum)UI.OBJ_TARGET, true);
        SetActive((Enum)UI.OBJ_OWNER, false);
        SetInputValue((Enum)UI.IPT_POST, base.sectionData.GetText("TEXT_HELP"));
        SetInputLabel((Enum)UI.IPT_POST, base.sectionData.GetText("TEXT_HELP"));
        SetLabelText((Enum)UI.LBL_USER_NAME, MonoBehaviourSingleton <UserInfoManager> .I.userInfo.name);
        SetLabelText((Enum)UI.LBL_MATERIAL_NAME, data.GetName());
        SetLabelText(UI.LBL_QUATITY, data.GetNum());
        SetLabelText(UI.LBL_DONATE_NUM, data.GetNum());
        SetLabelText(UI.LBL_DONATE_MAX, needNum);
        SetButtonEnabled((Enum)UI.BTN_GIFT, false);
        SetSliderValue((Enum)UI.SLD_PROGRESS, (float)data.GetNum() / (float)needNum);
        Transform ctrl = GetCtrl(UI.OBJ_MATERIAL_ICON);
        Item      item = new Item();

        item.uniqId = "0";
        item.itemId = (int)data.GetTableID();
        item.num    = data.GetNum();
        ItemInfo     item2        = ItemInfo.CreateItemInfo(item);
        ItemSortData itemSortData = new ItemSortData();

        itemSortData.SetItem(item2);
        SetItemIcon(ctrl, itemSortData, ctrl);
    }
    public override void UpdateUI()
    {
        string key = "TEXT_SELL";

        SetLabelText((Enum)UI.LBL_CAPTION, base.sectionData.GetText(key));
        SetLabelText((Enum)UI.STR_TITLE_U, base.sectionData.GetText(key));
        SetLabelText((Enum)UI.STR_TITLE_D, base.sectionData.GetText(key));
        string key2 = "TEXT_SELL_NUM";

        SetLabelText((Enum)UI.STR_SALE_NUM, base.sectionData.GetText(key2));
        SetProgressInt((Enum)UI.SLD_SALE_NUM, 1, 1, data.GetNum(), (EventDelegate.Callback)OnChagenSlider);
        SetLabelText((Enum)UI.LBL_ITEM_NUM, data.GetNum().ToString());
        SetLabelText((Enum)UI.LBL_MONEY, string.Format("{0, 8:#,0}", MonoBehaviourSingleton <UserInfoManager> .I.userStatus.money));
    }
Esempio n. 3
0
 public override void Initialize()
 {
     object[] array = GameSection.GetEventData() as object[];
     m_data      = (array[0] as SortCompareData);
     m_nowEmpty  = (int)array[1];
     m_nowSelect = (int)array[2];
     if (m_nowEmpty + m_nowSelect >= m_data.GetNum())
     {
         m_maxNum = m_data.GetNum();
     }
     else
     {
         m_maxNum = m_nowEmpty + m_nowSelect;
     }
     base.Initialize();
 }
 public void OnQuery_YES()
 {
     if (num >= item.GetNum())
     {
         GameSection.ChangeEvent("CLOSE_DETAIL", null);
     }
     if (item is ItemSortData)
     {
         GameSection.StayEvent();
         SendItem(delegate(bool b)
         {
             GameSection.ResumeEvent(b, null);
         });
     }
     else if (item is EquipItemSortData)
     {
         GameSection.StayEvent();
         sellConfirm(delegate(bool b)
         {
             if (!b)
             {
                 Debug.LogWarning((object)"sellConfirm = false");
                 GameSection.ResumeEvent(false, null);
             }
             else
             {
                 GameSection.ChangeStayEvent("NON_STACK_SELL", null);
                 SendEquip(new List <string>
                 {
                     item.GetUniqID().ToString()
                 }, delegate(bool is_success)
                 {
                     GameSection.ResumeEvent(is_success, null);
                 });
             }
         });
     }
     else if (item is SkillItemSortData)
     {
         GameSection.ChangeEvent("NON_STACK_SELL", null);
         List <string> list = new List <string>();
         list.Add(item.GetUniqID().ToString());
         GameSection.StayEvent();
         SendSkill(list, delegate(bool b)
         {
             GameSection.ResumeEvent(b, null);
         });
     }
     else if (item is AbilityItemSortData)
     {
         GameSection.StayEvent();
         List <string> list2 = new List <string>();
         list2.Add(item.GetUniqID().ToString());
         SendAbilityItem(list2, delegate(bool is_success)
         {
             GameSection.ResumeEvent(is_success, null);
         });
     }
 }
 protected override bool IsRequiredIconGrayOut(SortCompareData _data)
 {
     if (_data.GetNum() == 0)
     {
         return(true);
     }
     if (_data.IsFavorite())
     {
         return(true);
     }
     if (_data.IsEquipping() && tab == TAB_MODE.EQUIP)
     {
         return(true);
     }
     return(false);
 }
    public void OnQuery_ItemDetailLithographSellIncludeRareConfirm_YES()
    {
        List <string> list  = new List <string>();
        List <int>    list2 = new List <int>();

        list.Add(item.GetUniqID().ToString());
        list2.Add(num);
        if (num >= item.GetNum())
        {
            GameSection.ChangeEvent("CLOSE_DETAIL", null);
        }
        GameSection.StayEvent();
        MonoBehaviourSingleton <ItemExchangeManager> .I.SendInventorySellItem(list, list2, delegate(bool is_success)
        {
            GameSection.ResumeEvent(is_success, null);
        });
    }
    public override void UpdateUI()
    {
        ItemInfo itemInfo = data.GetItemData() as ItemInfo;

        SetActive((Enum)UI.STR_SELL, data.CanSale());
        SetActive((Enum)UI.BTN_DETAIL_SELL, data.CanSale() && MonoBehaviourSingleton <ItemExchangeManager> .I.IsExchangeScene());
        SetLabelText((Enum)UI.LBL_NAME, data.GetName());
        SetLabelText((Enum)UI.LBL_HAVE_NUM, data.GetNum().ToString());
        SetLabelText((Enum)UI.LBL_DESCRIPTION, itemInfo.tableData.text);
        SetLabelText((Enum)UI.LBL_SELL, data.GetSalePrice().ToString());
        int num  = 0;
        int num2 = 0;

        num  = itemInfo.tableData.enemyIconID;
        num2 = itemInfo.tableData.enemyIconID2;
        GET_TYPE getType = data.GetGetType();

        ItemIcon.Create(data.GetIconType(), data.GetIconID(), data.GetRarity(), GetCtrl(UI.OBJ_ICON_ROOT), data.GetIconElement(), data.GetIconMagiEnableType(), -1, null, 0, false, -1, false, null, false, num, num2, false, getType);
    }
Esempio n. 8
0
    protected virtual int GetTargetIconNum(SortCompareData[] sell_data_ary, int i)
    {
        SortCompareData sortCompareData = sell_data_ary[i];

        return(sortCompareData.GetNum());
    }
Esempio n. 9
0
    private ItemIcon CreateItemIcon(SortCompareData dropItem, Transform o, string event_name, int i)
    {
        ITEM_ICON_TYPE iTEM_ICON_TYPE        = ITEM_ICON_TYPE.NONE;
        RARITY_TYPE?   rarity                = null;
        ELEMENT_TYPE   element               = ELEMENT_TYPE.MAX;
        EQUIPMENT_TYPE?magi_enable_icon_type = null;
        int            icon_id               = -1;
        int            num = -1;

        if (dropItem != null)
        {
            iTEM_ICON_TYPE        = dropItem.GetIconType();
            icon_id               = dropItem.GetIconID();
            rarity                = dropItem.GetRarity();
            element               = dropItem.GetIconElement();
            magi_enable_icon_type = dropItem.GetIconMagiEnableType();
            num = dropItem.GetNum();
            if (num == 1)
            {
                num = -1;
            }
        }
        bool is_new = false;

        switch (iTEM_ICON_TYPE)
        {
        case ITEM_ICON_TYPE.ITEM:
        case ITEM_ICON_TYPE.QUEST_ITEM:
        {
            ulong uniqID = dropItem.GetUniqID();
            if (uniqID != 0L)
            {
                is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iTEM_ICON_TYPE, dropItem.GetUniqID());
            }
            break;
        }

        default:
            is_new = true;
            break;

        case ITEM_ICON_TYPE.NONE:
            break;
        }
        int enemy_icon_id  = 0;
        int enemy_icon_id2 = 0;

        if (iTEM_ICON_TYPE == ITEM_ICON_TYPE.ITEM)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(dropItem.GetTableID());

            enemy_icon_id  = itemData.enemyIconID;
            enemy_icon_id2 = itemData.enemyIconID2;
        }
        ItemIcon itemIcon = null;

        if (dropItem.GetIconType() == ITEM_ICON_TYPE.QUEST_ITEM)
        {
            ItemIcon.ItemIconCreateParam itemIconCreateParam = new ItemIcon.ItemIconCreateParam();
            itemIconCreateParam.icon_type = dropItem.GetIconType();
            itemIconCreateParam.icon_id   = dropItem.GetIconID();
            itemIconCreateParam.rarity    = dropItem.GetRarity();
            itemIconCreateParam.parent    = o;
            itemIconCreateParam.element   = dropItem.GetIconElement();
            itemIconCreateParam.magi_enable_equip_type = dropItem.GetIconMagiEnableType();
            itemIconCreateParam.num               = dropItem.GetNum();
            itemIconCreateParam.enemy_icon_id     = enemy_icon_id;
            itemIconCreateParam.enemy_icon_id2    = enemy_icon_id2;
            itemIconCreateParam.questIconSizeType = ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_LIST;
            itemIcon = ItemIcon.Create(itemIconCreateParam);
        }
        else
        {
            GET_TYPE getType = dropItem.GetGetType();
            itemIcon = ItemIcon.Create(iTEM_ICON_TYPE, icon_id, rarity, o, element, magi_enable_icon_type, num, event_name, i, is_new, -1, false, null, false, enemy_icon_id, enemy_icon_id2, false, getType);
        }
        itemIcon.SetRewardBG(true);
        itemIcon.SetRewardCategoryInfo(dropItem.GetCategory());
        Transform ctrl = GetCtrl(UI.PNL_MATERIAL_INFO);

        MaterialInfoButton.Set(itemIcon.transform, material_info_t, dropItem.GetMaterialType(), dropItem.GetTableID(), base.sectionData.sectionName, ctrl);
        return(itemIcon);
    }
Esempio n. 10
0
        public override ItemIcon CreateIcon(object[] data)
        {
            SortCompareData sortCompareData = data[0] as SortCompareData;
            Transform       parent          = data[1] as Transform;
            int             event_data      = (int)data[2];
            bool            is_new          = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(ITEM_ICON_TYPE.ITEM, sortCompareData.GetUniqID());

            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(sortCompareData.GetTableID());

            ItemStorageTop.SHOW_INVENTORY_MODE sHOW_INVENTORY_MODE = (ItemStorageTop.SHOW_INVENTORY_MODE)(int) data[3];
            if (sHOW_INVENTORY_MODE != ItemStorageTop.SHOW_INVENTORY_MODE.SMALL)
            {
                return(ItemIconDetail.CreateMaterialIcon(sortCompareData.GetIconType(), sortCompareData.GetIconID(), sortCompareData.GetRarity(), itemData, sHOW_INVENTORY_MODE == ItemStorageTop.SHOW_INVENTORY_MODE.MAIN_STATUS, parent, sortCompareData.GetNum(), sortCompareData.GetName(), "SELECT", event_data, -1, false, is_new));
            }
            return(ItemIconDetailSmall.CreateSmallMaterialIcon(sortCompareData.GetIconType(), sortCompareData.GetIconID(), sortCompareData.GetRarity(), parent, sortCompareData.GetNum(), sortCompareData.GetName(), "SELECT", event_data, -1, false, is_new, 0, 0, ItemIconDetail.ICON_STATUS.NONE));
        }