Пример #1
0
 public void SelectCharacter()
 {
     if (detailedMode == Mode.LIST)
     {
         detailedMode      = Mode.DETAILED;
         selectedIndex     = supportList.GetEntry().index;
         selectName.text   = supportList.GetEntry().entryName.text;
         selectIcon.sprite = supportList.GetEntry().icon.sprite;
         CreateSupportEntry();
         supportList.ForcePosition(0);
     }
     else if (detailedMode == Mode.DETAILED)
     {
         if (supportList.GetEntry().newLevel.enabled)
         {
             levelupPrompt.ShowYesNoPopup("Increase support level?", true);
             detailedMode = Mode.PROMPT;
         }
     }
     else if (detailedMode == Mode.PROMPT)
     {
         if (levelupPrompt.Click(true) == MyPrompt.Result.OK1)
         {
             //Fixa uppdaterat supportvärde
             Debug.Log("Dum dum daaah!");
         }
         detailedMode = Mode.DETAILED;
     }
 }
Пример #2
0
    private void UpdateFilter()
    {
        WeaponType currentCategory = (WeaponType)categories.GetValue();

        if (currentCategory == WeaponType.C_HEAL)
        {
            entryList.FilterShow(x => { return(x.tuple.itemCategory == ItemCategory.CONSUME); });
        }
        else
        {
            entryList.FilterShow(x => { return(x.tuple.weaponType == currentCategory); });
        }
        UpdateCost();
        entryList.ForcePosition(0);
    }
Пример #3
0
    private void StoreItem()
    {
        ItemListEntry item = itemList.GetEntry();

        if (item == null || string.IsNullOrEmpty(item.tuple.uuid))
        {
            return;
        }

        Debug.Log("Store item");
        int            index = itemList.GetPosition();
        InventoryTuple tuple = characters.GetEntry().invCon.GetTuple(index);

        playerData.items.Add(tuple.StoreData());
        characters.GetEntry().invCon.DropItem(index);

        GenerateInventoryList();
        itemList.ForcePosition(index);
        ShowItemInfo();
    }
Пример #4
0
 /// <summary>
 /// Updates the state of the how to play screen.
 /// </summary>
 /// <param name="active"></param>
 public void UpdateState(bool active)
 {
     optionList.ForcePosition(0);
     optionMenu.SetActive(active);
     explanationField.text = optionList.GetEntry().explanation;
 }
Пример #5
0
 private void Start()
 {
     SetupSaveFiles();
     saveFiles.ForcePosition(0);
     saveFileIndex.value = 0;
 }
Пример #6
0
    public void SelectItem()
    {
        if (promptMode)
        {
            if (restockPrompt.Click(true) == MyPrompt.Result.OK1)
            {
                if (currentMode == MenuState.RECHARGE)
                {
                    RestockItem();
                }
            }
            promptMode = false;
        }
        else if (currentMode == MenuState.MENU)
        {
            currentMode = MenuState.CHARACTER;
            GenerateCharacterList();
            characters.ForcePosition(0);
            ShowCharInfo();
            emptyView.SetActive(false);
            charListView.SetActive(true);
            infoBoxView.SetActive(false);
        }
        else if (currentMode == MenuState.CHARACTER)
        {
            int buttonPos = menuButtons.GetPosition();
            if (buttonPos == 0)
            {
                currentMode = MenuState.RECHARGE;
                GenerateInventoryList();
                restockView.SetActive(true);
            }
            else if (buttonPos == 1)
            {
                currentMode = MenuState.STORE;
                GenerateInventoryList();
                restockView.SetActive(true);
            }
            else if (buttonPos == 2)
            {
                currentMode = MenuState.TAKE;
                convoy.SetupStorage();
                convoyView.SetActive(true);
            }
        }
        else if (currentMode == MenuState.RECHARGE)
        {
            promptMode = true;
            int   charges = 0;
            float cost    = 0;
            CalculateCharge(null, ref cost, ref charges, true);
            if (charges == 0)
            {
                return;
            }

            restockPrompt.ShowYesNoPopup("Restock item?\n" + charges + " / " + Mathf.CeilToInt(cost * charges) + " cost", true);
        }
        else if (currentMode == MenuState.TAKE)
        {
            TakeItem();
        }
        else if (currentMode == MenuState.STORE)
        {
            StoreItem();
        }
    }