Ejemplo n.º 1
0
    private void DisplayItem()
    {
        _itemIdList.Clear();
        List <ListDataTypeBase> inDataList = new List <ListDataTypeBase>();

        foreach (FF9ITEM ff9Item in FF9StateSystem.Common.FF9.item)
        {
            if (ff9Item.count > 0)
            {
                _itemIdList.Add(ff9Item.id);
                Boolean           flag = (ff9item._FF9Item_Data[ff9Item.id].type & 1) != 0;
                FieldItemListData fieldItemListData = new FieldItemListData
                {
                    Enable    = flag,
                    ItemId    = ff9Item.id,
                    ItemCount = ff9Item.count
                };
                inDataList.Add(fieldItemListData);
            }
            else if (_usedItemIdList.Contains(ff9Item.id))
            {
                _itemIdList.Add(ff9Item.id);
                FieldItemListData fieldItemListData = new FieldItemListData
                {
                    Enable    = false,
                    ItemId    = ff9Item.id,
                    ItemCount = 0
                };
                inDataList.Add(fieldItemListData);
            }
        }
        if (_itemScrollList.ItemsPool.Count == 0)
        {
            _itemScrollList.PopulateListItemWithData = DisplayItemDetail;
            _itemScrollList.OnRecycleListItemClick  += OnListItemClick;
            _itemScrollList.InitTableView(inDataList, 0);
        }
        else
        {
            _itemScrollList.SetOriginalData(inDataList);
            if (ButtonGroupState.HaveCursorMemorize(ItemGroupButton) || ButtonGroupState.ActiveGroup == ItemArrangeGroupButton)
            {
                return;
            }
            _itemScrollList.JumpToIndex(0, false);
        }
    }
Ejemplo n.º 2
0
    private void DisplayKeyItem()
    {
        _keyItemIdList.Clear();
        for (Int32 id = 0; id < FF9FITEM_RARE_MAX; ++id)
        {
            if (ff9item.FF9Item_IsExistImportant(id))
            {
                _keyItemIdList.Add(id);
            }
        }
        if (_keyItemIdList.Count == 0)
        {
            _keyItemIdList.Add(FF9FITEM_RARE_NONE);
        }
        List <ListDataTypeBase> inDataList = new List <ListDataTypeBase>();

        using (List <Int32> .Enumerator enumerator = _keyItemIdList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                Byte current = (Byte)enumerator.Current;
                FieldKeyItemListData fieldKeyItemListData = new FieldKeyItemListData {
                    KeyItemId = current
                };
                inDataList.Add(fieldKeyItemListData);
            }
        }
        if (_keyItemScrollList.ItemsPool.Count == 0)
        {
            _keyItemScrollList.PopulateListItemWithData = DisplayKeyItemDetail;
            _keyItemScrollList.OnRecycleListItemClick  += OnListItemClick;
            _keyItemScrollList.InitTableView(inDataList, 0);
        }
        else
        {
            _keyItemScrollList.SetOriginalData(inDataList);
            if (ButtonGroupState.HaveCursorMemorize(KeyItemGroupButton))
            {
                return;
            }
            _keyItemScrollList.JumpToIndex(0, false);
        }
    }