Ejemplo n.º 1
0
    public static void OnPickUpLoot(Player player, ItemData.Wearable wearable)
    {
        player.playerRuntimeData.playerStock.Pick(new ItemData.WearableRuntimeData(wearable));
        string info = "Pick up " + string.Join(" ", wearable.ToString().Split('_'));

        UIEventListener.Instance.OnInfomationChange(new UIEventListener.InfomationChangeData(info));
    }
Ejemplo n.º 2
0
 public bool Contains(ItemData.Wearable target)
 {
     foreach (ItemData.WearableRuntimeData item in this.wearableStock)
     {
         if (item.wearable == target)
         {
             return(true);
         }
     }
     return(false);
 }
    protected void OnClickSelectionItem(int index, bool isInit = false)
    {
        if (currentSelection == index && !isInit)
        {
            ConfirmItemSelection();
            return;
        }

        selectionViews.ClearChosen();
        currentSelection = index;
        selectionViews.views[currentSelection].Choose();
        int offset = currentPage * itemsPerPage;

        if (currentSlot == 0)
        {
            if (index + offset >= playerStock.weaponStock.Count)
            {
                title.SetText("");
                content.SetText("");
            }
            else
            {
                ItemData.Weapon item = playerStock.weaponStock[index + offset].weapon;
                title.SetText(UIInventoryState.ParsingTitle(item.ToString()));
                content.SetText(ItemData.WeaponDescription[(int)item]);
            }
        }
        else if (currentSlot == 1 || currentSlot == 2)
        {
            if (index + offset >= playerStock.wearableStock.Count)
            {
                title.SetText("");
                content.SetText("");
            }
            else
            {
                ItemData.Wearable item = playerStock.wearableStock[index + offset].wearable;
                title.SetText(UIInventoryState.ParsingTitle(item.ToString()));
                content.SetText(ItemData.WearableDescription[(int)item]);
            }
        }
    }
    protected void OnClickSlotItem(int index, bool isInit = false)
    {
        if (index == currentSlot && !isInit)
        {
            // repeate click, confirm selection
            ConfirmSlotSelection();
            return;
        }

        // select represented slot
        currentPage = 0;
        DisplaySelectionView(index);
        currentSlot = index;
        slotViews.ClearChosen();
        slotViews.views[currentSlot].Choose();

        // display info
        if (currentSlot == 0)
        {
            ItemData.Weapon item = playerStock.weaponStock[playerSlot.weaponIndex].weapon;
            title.SetText(UIInventoryState.ParsingTitle(item.ToString()));
            content.SetText(ItemData.WeaponDescription[(int)item]);
        }
        else if (currentSlot == 1 && playerSlot.IsWearableInUse(playerStock, playerSlot.wearableOneIndex))
        {
            ItemData.Wearable item = playerStock.wearableStock[playerSlot.wearableOneIndex].wearable;
            title.SetText(UIInventoryState.ParsingTitle(item.ToString()));
            content.SetText(ItemData.WearableDescription[(int)item]);
        }
        else if (currentSlot == 2 && playerSlot.IsWearableInUse(playerStock, playerSlot.wearableTwoIndex))
        {
            ItemData.Wearable item = playerStock.wearableStock[playerSlot.wearableTwoIndex].wearable;
            title.SetText(UIInventoryState.ParsingTitle(item.ToString()));
            content.SetText(ItemData.WearableDescription[(int)item]);
        }
        else
        {
            title.SetText("");
            content.SetText("");
        }
    }
Ejemplo n.º 5
0
 public bool IsWearableEquiped(PlayerStock playerStock, ItemData.Wearable wearable)
 {
     return((wearableOneIndex >= 0 && wearableOneIndex < playerStock.wearableStock.Count && wearable == playerStock.wearableStock[wearableOneIndex].wearable) ||
            (wearableTwoIndex >= 0 && wearableTwoIndex < playerStock.wearableStock.Count && wearable == playerStock.wearableStock[wearableTwoIndex].wearable));
 }
Ejemplo n.º 6
0
 public void CancelWearable(ItemData.Wearable wearable)
 {
 }
Ejemplo n.º 7
0
 public void ApplyWearable(ItemData.Wearable wearable)
 {
 }