Esempio n. 1
0
    private void stashWindow(int windowid)
    {
        GUI.Box(new Rect(5, 5, 200, 25), "Stash");                      //Title

        if (GUI.Button(new Rect(210, 5, 30, 25), "X"))                  //Close Button
        {
            CloseStashWindow();
            //return;
        }


        PageNum = GUI.SelectionGrid(new Rect(5, 35, 240, 25), PageNum, selStrings, 5);

        int cnt = 0 + (PageNum * 25);

        for (int x = 0; x < 5; x++)
        {
            for (int y = 0; y < 5; y++)
            {
                if (cnt <= player.Stash.Count - 1)
                {
                    if (player.Stash[cnt] != null)
                    {
                        if (GUI.Button(new Rect(5 + (y * 45), 65 + (x * 45), 40, 40),
                                       new GUIContent(player.Stash[cnt].Icon,
                                                      string.Format("Stash{0}", cnt)
                                                      ),
                                       player.Stash[cnt].Rarity.ToString()))
                        {
                            if (Event.current.button == 1)
                            {
                                openedStash.MoveFromBankToPlayer(cnt);
                                MyGUI._toolTip = "";
                                return;
                            }
                        }

                        string stackInfo = player.Stash[cnt].MaxStacks > 1 ? player.Stash[cnt].CurStacks.ToString() : string.Empty;
                        GUI.Box(new Rect(5 + (y * 45), 65 + (x * 45), 40, 40), stackInfo, "StackOverlay");
                        string moreInfo = player.Stash[cnt].ItemType == ItemEquipType.Weapon ? "+" + (player.Stash[cnt] as Weapon).Enchants : string.Empty;
                        GUI.Box(new Rect(5 + (y * 45), 65 + (x * 45), 40, 40), moreInfo, "ItemInfoOverlay");
                    }
                }
                else
                {
                    GUI.Box(new Rect(5 + (y * 45), 65 + (x * 45), 40, 40), "");
                }
                cnt++;
            }
        }

        GUI.DragWindow(new Rect(0, 0, 10000, 20));
        GUIHandler.SetToolTip();
        GUI.BringWindowToFront(0);
    }