Esempio n. 1
0
 public void SelectItem()
 {
     if (currentMode == State.CHAR)
     {
         prompt.Show3Options("What do you want to do?", "TAKE", "STORE", "CANCEL", true);
         currentMode = State.MENU;
     }
     else if (currentMode == State.MENU)
     {
         MyPrompt.Result res = prompt.Click(true);
         if (res == MyPrompt.Result.OK1)
         {
             currentMode = State.TAKE;
             convoy.SetupStorage();
             convoyView.SetActive(true);
             inventoryView.SetActive(true);
             charListView.SetActive(false);
             ShowItemInfo();
         }
         else if (res == MyPrompt.Result.OK2)
         {
             currentMode = State.STORE;
             GenerateInventoryList();
             ShowItemInfo();
         }
         else
         {
             currentMode = State.CHAR;
         }
     }
     else if (currentMode == State.TAKE)
     {
         TakeItem();
     }
     else if (currentMode == State.STORE)
     {
         StoreItem();
     }
 }
Esempio n. 2
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();
        }
    }