Exemplo n.º 1
0
    public static ItemIcon CreateRemoveButton(Transform parent = null, string event_name = null, int event_data = 0, int toggle_group = -1, bool is_select = false, string name = null)
    {
        ItemIconDetail itemIconDetail = ItemIcon.CreateIcon <ItemIconDetail>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailPrefab, ITEM_ICON_TYPE.NONE, ItemIcon.GetRemoveButtonIconID(), null, parent, ELEMENT_TYPE.MAX, null, -1, event_name, event_data, false, toggle_group, is_select, null, false, 0, 0, false, QUEST_ICON_SIZE_TYPE.DEFAULT, GET_TYPE.PAY);

        itemIconDetail.setupperRemoveBtn.Set(new object[1]
        {
            name
        });
        itemIconDetail.SetFavoriteIcon(false);
        return(itemIconDetail);
    }
Exemplo n.º 2
0
    public static ItemIcon CreateQuestItemIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, QuestSortData quest_item, bool is_show_main_status, Transform parent = null, int num = -1, string name = null, string event_name = null, int event_data = 0, int toggle_group = -1, bool is_select = false, bool is_new = false)
    {
        ItemIconDetail itemIconDetail = ItemIcon.CreateIcon <ItemIconDetail>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailPrefab, icon_type, icon_id, rarity, parent, quest_item.GetEnemyElement(), null, -1, event_name, event_data, is_new, toggle_group, is_select, string.Empty, false, 0, 0, false, QUEST_ICON_SIZE_TYPE.DEFAULT, GET_TYPE.PAY);

        itemIconDetail.setupperQuestItem.Set(new object[2]
        {
            quest_item,
            is_show_main_status
        });
        return(itemIconDetail);
    }
 public void Initialized(ItemIcon _icon, Info info, Action <Transform, Info, bool> load_eff_callback)
 {
     if (!(iconParent == null))
     {
         SetIcon(_icon);
         m_Info          = info;
         loadEffCallback = load_eff_callback;
         SetSpriteRare();
         SetSpriteBreakReward(false);
         isInitialize = true;
     }
 }
 private void onBeatStarted(Signal signal)
 {
     if (!gameIsOver)
     {
         BeatStartedSignal beatStartedSignal = (BeatStartedSignal)signal;
         if (beatStartedSignal.BeatType == BeatType.ROBOT_MOVE)
         {
             ItemIcon newItemIcon = ItemIconPool.Inst.GetRandomItemIcon();
             newItemIcon.Activate(this);
         }
     }
 }
Exemplo n.º 5
0
    public static ItemIcon Instantiate(ItemIcon prefab, ItemBase item, int num)
    {
        ItemIcon obj = Instantiate(prefab) as ItemIcon;

        obj._item = item;
        obj._itemSprite.sprite = item.Icon;
        obj._itemName.text     = item.ItemName;
        obj._itemNumText.text  = num.ToString();
        obj._itemId            = item.ItemId;

        return(obj);
    }
Exemplo n.º 6
0
    }    //end f'n ContainItem(ItemClass)

    /**A function to set the current hotkey's sprite to the corresponding to item [itemToSet], and to set the hotkey's text component to reflect the number of items in the player inventory*/
    public void setHotKeys(ItemClass itemToSet, int numberOfItems)
    {
        item = itemToSet;
        ItemIcon itemIcon = GetComponentInParent <ItemIcon> ();

        gameObject.GetComponent <Image> ().sprite = itemIcon.getItemSpire(itemToSet.m_ItemName);
        string new_text = "" + numberOfItems;

        gameObject.transform.parent.gameObject.GetComponentInChildren <Text> ().text = new_text;

//		Debug.Log(numberOfItems + " of " + itemToSet.m_ItemName.ToString() + " to set to hotkey, with sprite " + gameObject.GetComponent<Image> ().sprite.name);
    }
Exemplo n.º 7
0
    public static ItemIcon CreateMaterialIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, ItemTable.ItemData item_table, bool is_show_main_status, Transform parent = null, int num = -1, string name = null, string event_name = null, int event_data = 0, int toggle_group = -1, bool is_select = false, bool is_new = false)
    {
        ItemIconDetail itemIconDetail = ItemIcon.CreateIcon <ItemIconDetail>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailPrefab, icon_type, icon_id, rarity, parent, ELEMENT_TYPE.MAX, null, -1, event_name, event_data, is_new, toggle_group, is_select, string.Empty, false, item_table.enemyIconID, item_table.enemyIconID2, false, QUEST_ICON_SIZE_TYPE.DEFAULT, GET_TYPE.PAY);

        itemIconDetail.setupperMaterial.Set(new object[3]
        {
            item_table,
            num,
            is_show_main_status
        });
        return(itemIconDetail);
    }
Exemplo n.º 8
0
    public static ItemIcon CreateSmallMaterialIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, Transform parent = null, int num = -1, string name = null, string event_name = null, int event_data = 0, int toggle_group = -1, bool is_select = false, bool is_new = false, int enemy_icon_id = 0, int enemy_icon_id2 = 0, ItemIconDetail.ICON_STATUS icon_status = ItemIconDetail.ICON_STATUS.NONE)
    {
        string icon_under_text = "×" + num.ToString();
        ItemIconDetailSmall itemIconDetailSmall = ItemIcon.CreateIcon <ItemIconDetailSmall>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailSmallPrefab, icon_type, icon_id, rarity, parent, ELEMENT_TYPE.MAX, null, -1, event_name, event_data, is_new, toggle_group, is_select, icon_under_text, false, enemy_icon_id, enemy_icon_id2, false, QUEST_ICON_SIZE_TYPE.DEFAULT, GET_TYPE.PAY);

        itemIconDetailSmall.EquipTypeIconInit(null);
        itemIconDetailSmall.SetEquipIndexSprite(-1);
        itemIconDetailSmall.SetIconStatusSprite(icon_status);
        itemIconDetailSmall.SetupSelectNumberSprite(-1);
        itemIconDetailSmall.SetFavoriteIcon(false);
        return(itemIconDetailSmall);
    }
Exemplo n.º 9
0
 public override void UpdateUI()
 {
     base.UpdateUI();
     if (currentItem != null)
     {
         SetLabelText((Enum)UI.LBL_ITEM_NAME, currentItem.name);
         ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon((REWARD_TYPE)currentItem.type, (uint)currentItem.itemId, GetCtrl(UI.OBJ_ITEM_ICON_ROOT), -1, null, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
         itemIcon.SetEnableCollider(false);
         ResourceLoad.LoadPointIconImageTexture(GetCtrl(UI.TEX_POINT_ICON).GetComponent <UITexture>(), (uint)pointShop.pointShopId);
     }
     SetLabelText((Enum)UI.LBL_CURRENT_CHANGE_NUM, string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 2u), currentNum));
     SetLabelText((Enum)UI.LBL_NEED_POINT, string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 2u), currentItem.needPoint * currentNum));
 }
Exemplo n.º 10
0
    void Start()
    {
        m_PlayerInventory = GetComponentInParent <PlayerInventory> ();
        itemDic           = m_PlayerInventory.m_ItemDictionary;
        m_ItemIcon        = GetComponentInParent <ItemIcon> ();
        itemSlots         = GetComponentsInChildren <ItemSlot> ();
        itemDescription   = GameObject.Find("Description").GetComponent <Text>();
        m_audioSource     = GetComponentInChildren <AudioSource> ();

        GameObject empty_slot_container = GameObject.Find("ItemImage");

        this.m_EmptySlotSprite = empty_slot_container.GetComponent <Image> ().sprite;
    }
Exemplo n.º 11
0
        public void TestSerialization()
        {
            const string Kml =
                @"<ItemIcon xmlns=""http://www.opengis.net/kml/2.2"">
    <state>closed error</state>
    <href>http://www.example.com/</href>
  </ItemIcon>";

            ItemIcon parsed = this.Parse <ItemIcon>(Kml);

            Assert.That(parsed.State, Is.EqualTo(ItemIconStates.Closed | ItemIconStates.Error));
            Assert.That(parsed.Href, Is.EqualTo(new Uri("http://www.example.com")));
        }
    protected void UpdateHappenTarget()
    {
        QuestTable.QuestTableData questData = info.GetQuestData();
        if (questData != null)
        {
            EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)questData.GetMainEnemyID());

            if (enemyData != null)
            {
                ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, enemyData.iconId, null, FindCtrl(targetFrame, UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
            }
        }
    }
Exemplo n.º 13
0
    public static ItemIcon CreateSmithCreateEquipDetailIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, SmithCreateSortData item_data, Transform parent = null, string event_name = null, int event_data = 0, ItemIconDetail.ICON_STATUS icon_status = ItemIconDetail.ICON_STATUS.NONE, bool is_new = false, int toggle_group = -1, bool is_select = false, bool is_equipping = false, GET_TYPE getType = GET_TYPE.PAY)
    {
        SmithCreateItemInfo smithCreateItemInfo = item_data.GetItemData() as SmithCreateItemInfo;
        string icon_under_text = (!smithCreateItemInfo.equipTableData.IsWeapon()) ? smithCreateItemInfo.equipTableData.baseDef.ToString() : smithCreateItemInfo.equipTableData.baseAtk.ToString();
        ItemIconDetailSmall itemIconDetailSmall = ItemIcon.CreateIcon <ItemIconDetailSmall>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailSmallPrefab, icon_type, icon_id, rarity, parent, smithCreateItemInfo.equipTableData.GetTargetElementPriorityToTable(), null, -1, event_name, event_data, is_new, toggle_group, is_select, icon_under_text, is_equipping, 0, 0, false, QUEST_ICON_SIZE_TYPE.DEFAULT, getType);

        itemIconDetailSmall.EquipTypeIconInit(smithCreateItemInfo.equipTableData);
        itemIconDetailSmall.SetEquipIndexSprite(-1);
        itemIconDetailSmall.SetIconStatusSprite(icon_status);
        itemIconDetailSmall.SetupSelectNumberSprite(-1);
        itemIconDetailSmall.SetFavoriteIcon(false);
        return(itemIconDetailSmall);
    }
Exemplo n.º 14
0
        public void TestReflectionGetAndSetFieldValueType()
        {
            var itemIcon = new ItemIcon();

            itemIcon.SetFieldValue("itemIndex", ItemIndex.AlienHead);

            var iIndex   = typeof(ItemIcon).GetField("itemIndex");
            var refIndex = (ItemIndex)iIndex.GetValue(itemIcon);

            var index = itemIcon.GetFieldValue <ItemIndex>("itemIndex");

            Assert.Equal(refIndex, index);
            Assert.Equal(ItemIndex.AlienHead, index);
        }
    public void OnReposition()
    {
        Transform ctrl = GetCtrl(inventoryUI);

        ItemIcon[] icons = ctrl.GetComponentsInChildren <ItemIcon>();
        materialSkillItem.ForEach(delegate(SkillItemInfo material)
        {
            ItemIcon itemIcon = Array.Find(icons, (ItemIcon _icon) => _icon.GetUniqID == material.uniqueID);
            if (itemIcon != null)
            {
                IconSelect(itemIcon, true);
            }
        });
    }
Exemplo n.º 16
0
    private static ItemIcon _CreateSkillDetailIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, SkillItemSortData item_data, bool is_show_main_status, Transform parent = null, string event_name = null, int event_data = 0, ICON_STATUS icon_status = ICON_STATUS.NONE, bool is_new = false, int toggle_group = -1, int select_number = -1, bool is_equipping = false)
    {
        ItemIconDetail itemIconDetail = ItemIcon.CreateIcon <ItemIconDetail>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailPrefab, icon_type, icon_id, rarity, parent, item_data.GetIconElement(), item_data.skillData.tableData.GetEnableEquipType(), -1, event_name, event_data, is_new, toggle_group, select_number > -1, string.Empty, is_equipping, 0, 0, false, QUEST_ICON_SIZE_TYPE.DEFAULT, GET_TYPE.PAY);

        itemIconDetail.setupperSkill.Set(new object[4]
        {
            item_data,
            is_show_main_status,
            select_number,
            icon_status
        });
        itemIconDetail.SetFavoriteIcon(item_data.IsFavorite());
        return(itemIconDetail);
    }
Exemplo n.º 17
0
    void SetItemIconEnable(GameObject itemIcon, bool enable)
    {
        Button   button = itemIcon.GetComponent <Button>();
        ItemIcon ic     = itemIcon.GetComponent <ItemIcon>();

        float opacity = enable ? (ic.m_bLocked ? 0.7f : 1.0f) : 0.5f;
        float scale   = enable ? 2.0f : 1.0f;

        button.enabled = enable;

        // Button color
        {
            ColorBlock cb = button.colors;
            Color      c  = cb.normalColor;
            c.a            = opacity;
            cb.normalColor = c;
            button.colors  = cb;
        }

        // Image color
        {
            Color c = button.image.color;
            c.a = opacity;
            button.image.color = c;
        }

        // Scale
        {
            RectTransform t = itemIcon.GetComponent <RectTransform>();
            t.sizeDelta = scale * m_ItemIconDim;
        }

        // Text
        {
            GameObject label = itemIcon.transform.GetChild(0).gameObject;
            label.SetActive(enable);
        }

        // Lock
        {
            GameObject    keyhole = itemIcon.transform.GetChild(1).gameObject;
            RectTransform t       = keyhole.GetComponent <RectTransform>();
            t.sizeDelta = scale * m_ItemIconLockDim;
        }

        // Price
        {
            itemIcon.transform.GetChild(2).gameObject.SetActive(enable && ic.m_bLocked);
        }
    }
Exemplo n.º 18
0
    private static ItemIcon _CreateSmallSkillDetailIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, SkillItemSortData item_data, Transform parent = null, string event_name = null, int event_data = 0, bool is_new = false, int toggle_group = -1, int select_number = -1, bool is_equipping = false, ItemIconDetail.ICON_STATUS icon_status = ItemIconDetail.ICON_STATUS.NONE)
    {
        //IL_001a: Unknown result type (might be due to invalid IL or missing references)
        string format          = (!item_data.skillData.IsExceeded()) ? "Lv. {0}/{1}" : ("Lv. {0}/" + UIUtility.GetColorText("{1}", ExceedSkillItemTable.color));
        string icon_under_text = string.Format(format, item_data.GetLevel(), item_data.skillData.GetMaxLevel());
        ItemIconDetailSmall itemIconDetailSmall = ItemIcon.CreateIcon <ItemIconDetailSmall>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailSmallPrefab, icon_type, icon_id, rarity, parent, item_data.GetIconElement(), item_data.skillData.tableData.GetEnableEquipType(), -1, event_name, event_data, is_new, toggle_group, select_number > -1, icon_under_text, is_equipping, 0, 0, false, QUEST_ICON_SIZE_TYPE.DEFAULT, GET_TYPE.PAY);

        itemIconDetailSmall.EquipTypeIconInit(null);
        itemIconDetailSmall.SetEquipIndexSprite(-1);
        itemIconDetailSmall.SetIconStatusSprite(icon_status);
        itemIconDetailSmall.SetupSelectNumberSprite(select_number);
        itemIconDetailSmall.SetFavoriteIcon(item_data.IsFavorite());
        return(itemIconDetailSmall);
    }
Exemplo n.º 19
0
 public ItemIcon GetItemIcon(ItemIconPrefab itemIconPrefab)
 {
     foreach (ItemIcon itemIcon in innactiveItemIcons)
     {
         if (itemIcon.GetType() == itemIconPrefab.Prefab.GetType())
         {
             unpool(itemIcon);
             return itemIcon;
         }
     }
     ItemIcon newItemIcon = InstantiateItemIcon(itemIconPrefab);
     activeItemIcons.Add(newItemIcon);
     return newItemIcon;
 }
Exemplo n.º 20
0
    public static ItemIcon CreateSmallListItemIcon(ITEM_ICON_TYPE iconType, EquipItemSortData sortData, Transform parent, bool isNew, int no, GET_TYPE getType)
    {
        EquipItemTable.EquipItemData tableData  = sortData.equipData.tableData;
        EquipItemInfo       equipItemInfo       = sortData.GetItemData() as EquipItemInfo;
        ItemIconDetailSmall itemIconDetailSmall = ItemIcon.CreateIcon <ItemIconDetailSmall>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailSmallPrefab, iconType, tableData.GetIconID(), tableData.rarity, parent, equipItemInfo.GetTargetElementPriorityToTable(), null, -1, string.Empty, 0, isNew, -1, false, "No." + no.ToString("D4"), false, 0, 0, false, QUEST_ICON_SIZE_TYPE.DEFAULT, getType);

        itemIconDetailSmall.EquipTypeIconInit(tableData);
        itemIconDetailSmall.SetEquipIndexSprite(-1);
        itemIconDetailSmall.EquipTypeIconInit(null);
        itemIconDetailSmall.SetIconStatusSprite(ItemIconDetail.ICON_STATUS.NONE);
        itemIconDetailSmall.SetupSelectNumberSprite(-1);
        itemIconDetailSmall.SetFavoriteIcon(false);
        return(itemIconDetailSmall);
    }
    private void UpdateInventory()
    {
        EquipItemTable.EquipItemData[] items = null;
        int start = currentPageIndex * ONE_PAGE_EQUIP_NUM;
        int last  = start + ONE_PAGE_EQUIP_NUM;

        items = GetEquips(start, last);
        if (items != null)
        {
            SetPageNumText((Enum)UI.LBL_PAGE_NOW, currentPageIndex + 1);
            SetDynamicList((Enum)UI.GRD_INVENTORY, string.Empty, items.Length, false, (Func <int, bool>) null, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool isRecycle)
            {
                SetActive(t, true);
                EquipItemTable.EquipItemData equipItemData = items[i];
                EquipItemSortData equipItemSortData        = new EquipItemSortData();
                EquipItemInfo equipItemInfo = new EquipItemInfo();
                equipItemInfo.tableData     = equipItemData;
                equipItemInfo.SetDefaultData();
                equipItemSortData.SetItem(equipItemInfo);
                ITEM_ICON_TYPE iconType = ItemIcon.GetItemIconType(equipItemData.type);
                bool flag = !MonoBehaviourSingleton <AchievementManager> .I.CheckEquipItemCollection(equipItemData);
                if (flag)
                {
                    iconType = ITEM_ICON_TYPE.UNKNOWN;
                }
                bool isNew       = false;
                GET_TYPE getType = GET_TYPE.PAY;
                if (equipItemData != null)
                {
                    getType = equipItemData.getType;
                }
                ItemIcon itemIcon = ItemIconDetailSmall.CreateSmallListItemIcon(iconType, equipItemSortData, t, isNew, start + i + 1, getType);
                if (!flag)
                {
                    itemIcon.button.set_enabled(true);
                    SetEvent(itemIcon._transform, "DETAIL", new object[2]
                    {
                        ItemDetailEquip.CURRENT_SECTION.EQUIP_LIST,
                        equipItemData
                    });
                }
                else
                {
                    itemIcon.button.set_enabled(false);
                    SetEvent(itemIcon._transform, string.Empty, 0);
                }
            });
        }
    }
Exemplo n.º 22
0
 public void SetElementIcon(ELEMENT_TYPE element)
 {
     //IL_0017: Unknown result type (might be due to invalid IL or missing references)
     //IL_0046: Unknown result type (might be due to invalid IL or missing references)
     if (sprElement != null)
     {
         sprElement.get_gameObject().SetActive(false);
         string iconElementSpriteName = ItemIcon.GetIconElementSpriteName(element);
         if (!string.IsNullOrEmpty(iconElementSpriteName))
         {
             sprElement.spriteName = iconElementSpriteName;
             sprElement.get_gameObject().SetActive(true);
         }
     }
 }
Exemplo n.º 23
0
    public void AddEquipToItemsView(Item item)
    {
        GameObject gameObject = DataManager.GetInstance().CreateGameObjectFromAssetsBundle("", "ItemIcon");

        if (gameObject != null)
        {
            gameObject.transform.SetParent(ItemsView.content, false);
            ItemIcon equip = gameObject.GetComponent <ItemIcon>();
            if (equip != null)
            {
                equip.InitData(item, ItemIconType.ChangeEquipPanel);
            }
            Equips.Add(gameObject);
        }
    }
Exemplo n.º 24
0
    protected void SetUpEnemy(EnemyTable.EnemyData field_enemy_table)
    {
        Transform transform = GetTransform();

        SetActive(transform, UI.TEX_FIELD_SUB, false);
        string name = field_enemy_table.name;

        SetLabelText(transform, UI.LBL_FIELD_ENEMY_NAME, name);
        if (field_enemy_table != null)
        {
            int      iconId   = field_enemy_table.iconId;
            ItemIcon itemIcon = ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, iconId, null, FindCtrl(transform, UI.OBJ_ENEMY), field_enemy_table.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
            itemIcon.SetEnableCollider(false);
        }
    }
Exemplo n.º 25
0
    protected override void UpdateInventoryUI()
    {
        SetupEnableInventoryUI();
        bool reset = false;
        int  num   = inventory.datas.Length;

        if (preInventoryDataSize != num)
        {
            reset = true;
            preInventoryDataSize = num;
        }
        SetDynamicList((Enum)inventoryUI, (string)null, num, reset, (Func <int, bool>) delegate(int i)
        {
            SortCompareData sortCompareData2 = inventory.datas[i];
            if (sortCompareData2 == null || !sortCompareData2.IsPriority(inventory.sortSettings.orderTypeAsc))
            {
                return(false);
            }
            SkillItemInfo skillItemInfo2 = sortCompareData2.GetItemData() as SkillItemInfo;
            if (skillItemInfo2 == null)
            {
                return(false);
            }
            if (!skillItemInfo2.IsLevelMax())
            {
                return(true);
            }
            return(skillItemInfo2.IsEnableExceed());
        }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
        {
            SortCompareData sortCompareData = inventory.datas[i];
            if (sortCompareData != null && sortCompareData.IsPriority(inventory.sortSettings.orderTypeAsc))
            {
                SkillItemInfo skillItemInfo = sortCompareData.GetItemData() as SkillItemInfo;
                if (skillItemInfo != null && (!skillItemInfo.IsLevelMax() || skillItemInfo.IsExistNextExceed()))
                {
                    ITEM_ICON_TYPE iconType = sortCompareData.GetIconType();
                    bool is_new             = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, sortCompareData.GetUniqID());
                    bool isShowEnableExceed = skillItemInfo.IsEnableExceed() && skillItemInfo.exceedCnt == 0;
                    bool isValidExceed      = skillItemInfo.IsEnableExceed();
                    ItemIcon itemIcon       = CreateItemIconDetail(iconType, sortCompareData.GetIconID(), sortCompareData.GetRarity(), sortCompareData as SkillItemSortData, base.IsShowMainStatus, t, "SELECT", i, is_new, 100, selectIndex == i, sortCompareData.IsEquipping(), isValidExceed, isShowEnableExceed);
                    itemIcon.SetItemID(sortCompareData.GetTableID());
                    itemIcon.SetButtonColor(inventory.datas[i].IsPriority(inventory.sortSettings.orderTypeAsc), true);
                    SetLongTouch(itemIcon.transform, "DETAIL", i);
                }
            }
        });
    }
Exemplo n.º 26
0
        //Sends the interface of the category PreferredCategories[<category>]
        public static void SendSetWarningsUI(Players.Player player, int category = 0)
        {
            NetworkMenu menu = new NetworkMenu();

            menu.Identifier = "WarningUI";
            menu.Width      = 400;
            menu.Height     = 600;

            Label           label    = new Label("Category: ");
            DropDownNoLabel dropDown = new DropDownNoLabel("Khanx.Warning.categoryDropDown", PreferredCategories);

            //Default dropdown (ALWAYS INCLUDE OR GIVES ERROR)
            menu.LocalStorage.SetAs("Khanx.Warning.categoryDropDown", category);

            //Kenovis: NEEDS JTOKEN
            //JToken jToken = JToken.Parse("Khanx.Warning.ChangeCategory");

            ButtonCallback buttonCallback = new ButtonCallback("Khanx.Warning.ChangeCategory", new LabelData("Change category", UnityEngine.Color.black));

            List <(IItem, int)> horizontalRowItems = new List <(IItem, int)>();

            horizontalRowItems.Add((label, 75));
            horizontalRowItems.Add((dropDown, 125));
            horizontalRowItems.Add((buttonCallback, 125));

            HorizontalRow horizontalRow = new HorizontalRow(horizontalRowItems);

            menu.Items.Add(horizontalRow);
            menu.Items.Add(new EmptySpace(25));

            //Show icon & amount per category
            IEnumerable <ItemTypes.ItemType> itemsInCategory = ItemTypes.NotableTypes.Where(type => type.HasCategory(PreferredCategories[category]));

            Dictionary <ushort, int> warning = warnings.GetValueOrDefault(player.ID, new Dictionary <ushort, int>());

            foreach (ItemTypes.ItemType item in itemsInCategory)
            {
                ItemIcon   icon       = new ItemIcon(item.Name);
                InputField inputField = new InputField("Khanx.Warning." + item.Name + "Field", 50);

                //default value
                menu.LocalStorage.SetAs("Khanx.Warning." + item.Name + "Field", warning.GetValueOrDefault(item.ItemIndex, 0));

                menu.Items.Add(new HorizontalSplit(icon, inputField));
            }

            NetworkMenuManager.SendServerPopup(player, menu);
        }
Exemplo n.º 27
0
    private void InitEnemyItem(int i, Transform t, bool isRecycle, QuestTable.QuestTableData questData)
    {
        EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)questData.GetMainEnemyID());

        if (enemyData != null)
        {
            SetLabelText(t, UI.LBL_ENEMY_LEVEL, StringTable.Format(STRING_CATEGORY.MAIN_STATUS, 1u, arenaData.level));
            SetLabelText(t, UI.LBL_ENEMY_NAME, enemyData.name);
            ItemIcon itemIcon = ItemIcon.Create(ItemIcon.GetItemIconType(questData.questType), enemyData.iconId, questData.rarity, FindCtrl(t, UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
            itemIcon.SetEnableCollider(false);
            SetActive(t, UI.SPR_ELEMENT_ROOT, enemyData.element != ELEMENT_TYPE.MAX);
            SetElementSprite(t, UI.SPR_ELEMENT, (int)enemyData.element);
            SetElementSprite(t, UI.SPR_WEAK_ELEMENT, (int)enemyData.weakElement);
            SetActive(t, UI.STR_NON_WEAK_ELEMENT, enemyData.weakElement == ELEMENT_TYPE.MAX);
        }
    }
Exemplo n.º 28
0
    public static ItemIcon CreateSmallSkillDetailIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, SkillItemSortData item_data, Transform parent = null, string event_name = null, int event_data = 0, bool is_new = false, int toggle_group = -1, bool is_select = false, bool is_equipping = false, bool isValidExceed = false, bool isShowEnableExceed = false)
    {
        ItemIconDetail.ICON_STATUS icon_status = ItemIconDetail.ICON_STATUS.NONE;
        if (isShowEnableExceed)
        {
            icon_status = ItemIconDetail.ICON_STATUS.VALID_EXCEED_0;
        }
        else if (isValidExceed)
        {
            icon_status = ItemIconDetail.ICON_STATUS.VALID_EXCEED;
        }
        ItemIcon itemIcon = _CreateSmallSkillDetailIcon(icon_type, icon_id, rarity, item_data, parent, event_name, event_data, is_new, toggle_group, (!is_select) ? (-1) : 0, is_equipping, icon_status);

        itemIcon.SetFavoriteIcon(item_data.IsFavorite());
        return(itemIcon);
    }
Exemplo n.º 29
0
        public void TestWalkCustomElements()
        {
            const int Count = 10;
            CoordinateCollection coordinates = new CoordinateCollection();
            for (int i = 0; i < Count; ++i)
            {
                coordinates.Add(new Vector());
            }
            Assert.That(ElementWalker.Walk(coordinates).Count(), Is.EqualTo(1));

            // This class uses a private class deriving from ICustomElement as a child
            // Make sure it's not included.
            ItemIcon icon = new ItemIcon();
            icon.State = ItemIconStates.Open | ItemIconStates.Error;
            Assert.That(ElementWalker.Walk(icon).Count(), Is.EqualTo(1));
        }
Exemplo n.º 30
0
    public void OnDrop(PointerEventData eventData)
    {
        if (!InventoryUI.instance.itemOnPointer)
        {
            ItemIcon droppedItem = eventData.pointerDrag.GetComponent <ItemIcon>();

            if (droppedItem.chestItem)
            {
                ChestInventoryManager.instance.Remove(droppedItem.mySlot.slotIndex);
            }
            else
            {
                Inventory.instance.Remove(droppedItem.mySlot.slotIndex);
            }
        }
    }
Exemplo n.º 31
0
 public ListStyle(listItemTypeEnum listItemType, Color bgColor, ItemIcon[] itemIcons)
 {
     this.listItemType = listItemType;
     this.bgColor = bgColor;
     this.itemIcons = itemIcons;
 }
Exemplo n.º 32
0
 public ListStyle(ItemIcon[] itemIcons)
 {
     this.itemIcons = itemIcons;
 }
Exemplo n.º 33
0
 public ListStyle(ItemIcon itemIcon)
 {
     this.itemIcons = new ItemIcon[] { itemIcon };
 }