public override void Draw(CustomSpriteBatch g)
        {
            g.Draw(sprBackground, Vector2.Zero, Color.White);
            g.Draw(sprActivePlayerIcon, new Vector2(570, 11), Color.White);
            foreach (InteractiveButton ActiveButton in ArrayMenuButton)
            {
                ActiveButton.Draw(g);
            }

            if (OnlineCommunicationClient != null)
            {
                ChatHelper.DrawChat(g, sprTabChat, fntText, OnlineCommunicationClient.Chat, ChatInput);
            }

            MissionScrollbar.Draw(g);

            g.DrawString(fntText, Room.RoomName, new Vector2(68, 7), Color.White);

            g.DrawStringMiddleAligned(fntText, CurrentMissionName, new Vector2(170, 114), Color.White);
            g.DrawStringMiddleAligned(fntText, CurrentMissionDescription, new Vector2(170, 270), Color.White);
            if (sprCurrentMissionImage != null)
            {
                g.Draw(sprCurrentMissionImage, new Vector2(57, 139), Color.White);
            }

            for (int P = 0; P < Room.ListRoomPlayer.Count; ++P)
            {
                int DrawX = 678;
                int DrawY = 310 + P * 64;

                DrawPlayerBox(g, DrawX, DrawY, Room.ListRoomPlayer[P], true);
            }

            for (int M = MissionInfoStartIndex, i = 0; M < ListMissionInfo.Count && i < 4; ++M, ++i)
            {
                QuestButton.Draw(g, new Vector2(405, 140 + i * 64), Color.White);
                g.DrawString(fntText, (M + 1).ToString().PadLeft(2, '0'), new Vector2(395, 120 + i * 64), Color.FromNonPremultiplied(0, 255, 0, 255));
                g.DrawString(fntText, "1", new Vector2(485, 120 + i * 64), Color.White);
                g.DrawString(fntText, ListMissionInfo[M].MissionName, new Vector2(328, 145 + i * 64), Color.FromNonPremultiplied(0, 255, 0, 255));

                Rectangle QuestButtonCollisionBox = new Rectangle(405 - (int)QuestButton.Origin.X,
                                                                  140 - (int)QuestButton.Origin.Y + i * 64,
                                                                  QuestButton.SpriteWidth,
                                                                  QuestButton.SpriteHeight);

                if (QuestButtonCollisionBox.Contains(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y))
                {
                    PlayerInfoOutline.Draw(g, new Vector2(405, 140 + i * 64), Color.White);
                }
            }
        }
        private void DrawAmmoPicker(SpriteBatch spriteBatch, EndlessAmmoPlayer modPlayer, ref string mouseText, ref Item hoverItem)
        {
            Main.HidePlayerCraftingMenu = true;

            int   dx         = LeftX;
            Color titleColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor);
            Point mousePoint = new Point(Main.mouseX, Main.mouseY);

            Main.LocalPlayer.mouseInterface = true;
            Color locked = new Color(187, 187, 187, 187);

            float stringScale = 0.75f;
            float gap         = 8;

            List <AmmoData> ammoData       = new List <AmmoData>();
            float           widestAmmoName = 0;
            float           stringHeight   = Main.fontMouseText.LineSpacing;

            foreach (Item ammoItem in DataContainer.AmmoItems)
            {
                if (ammoItem.ammo != AmmoPicker)
                {
                    continue;
                }

                bool     unlocked = modPlayer.HasEndlessAmmoItemUnlocked(ammoItem.type);
                int      count    = modPlayer.CountItemsInInventory(ammoItem.type);
                AmmoData data     = new AmmoData(ammoItem, unlocked, count, UNLOCK_AMOUNT);
                ammoData.Add(data);

                widestAmmoName = Math.Max(
                    widestAmmoName,
                    Math.Max(
                        Main.fontMouseText.MeasureString(ammoItem.Name).X,
                        Main.fontMouseText.MeasureString(data.UnlockString).X
                        )
                    );
            }

            Vector2 stringLeftAlignedVertCenter = new Vector2(0, stringHeight / 2);

            widestAmmoName *= stringScale;
            stringHeight   *= stringScale;

            float lineHeight = stringHeight * 0.6f;

            foreach (EndlessAmmoType ammoType in DataContainer.EndlessAmmoTypes)
            {
                if (ammoType.Type == AmmoPicker)
                {
                    ChatManager.DrawColorCodedString(spriteBatch, Main.fontMouseText, ammoType.Title, new Vector2(dx, 84f), titleColor, 0, Vector2.Zero, Vector2.One * 0.75f);
                    break;
                }
            }

            float unit         = 56 * Main.inventoryScale;
            Rect  dropdownRect = new Rect(
                dx,
                105f,
                unit + widestAmmoName + gap,
                Main.inventoryScale * (52 + (56 * Math.Min(3, ammoData.Count - 1)))
                );

            // float scrollMin = 0;
            float scrollTop = (float)(ScrollPosition.GetValue() * unit);
            // float scrollMax = (ammoData.Count - 4) * unit;

            float scrollbarWidth = 20 * Main.inventoryScale;
            bool  drawScrollbar  = ammoData.Count > 4;

            if (drawScrollbar)
            {
                dropdownRect.Width += scrollbarWidth + 4;
            }

            ScalableItemSlot.DrawPanel(spriteBatch, dropdownRect, Main.inventoryScale);

            if (drawScrollbar)
            {
                Rect scrollbarRect = new Rect(dropdownRect.Right - scrollbarWidth - 4, dropdownRect.Y + 4, scrollbarWidth, dropdownRect.Height - 8);

                float offsetHeight = dropdownRect.Height;
                float scrollHeight = Main.inventoryScale * (52 + (56 * (ammoData.Count - 1)));
                Scrollbar.Draw(spriteBatch, scrollbarRect, offsetHeight, scrollHeight, scrollTop, Main.inventoryBack, Main.inventoryScale);

                MaskDrawTo(spriteBatch,
                           1 + (int)(Main.UIScale * dropdownRect.X),
                           1 + (int)(Main.UIScale * dropdownRect.Y),
                           ((int)(Main.UIScale * dropdownRect.Width)) - 2,
                           ((int)(Main.UIScale * dropdownRect.Height)) - 2
                           );
            }

            Rect itemRect = new Rect(dx, 105 - scrollTop, 52, 52);

            itemRect.Dimensions *= Main.inventoryScale;

            Rect textRect = new Rect(itemRect.Position, unit + widestAmmoName, 52);

            textRect.Dimensions *= Main.inventoryScale;

            for (int i = 0; i < ammoData.Count; i++)
            {
                if (itemRect.Bottom < dropdownRect.Y)
                {
                    itemRect.Y += unit;
                    textRect.Y += unit;
                    continue;
                }

                if (itemRect.Y > dropdownRect.Bottom)
                {
                    break;
                }

                AmmoData ammo = ammoData[i];
                ScalableItemSlot.DrawItem(spriteBatch, itemRect, ammo.Item, Main.inventoryBack, Main.inventoryScale);

                Vector2 position = itemRect.ClonePosition();
                position.X += unit;
                position.Y += unit / 2 + 2;

                if (ammo.Unlocked)
                {
                    ChatManager.DrawColorCodedStringWithShadow(
                        spriteBatch,
                        Main.fontMouseText,
                        ammo.Item.Name,
                        position,
                        Color.White,
                        0f,
                        stringLeftAlignedVertCenter,
                        Vector2.One * stringScale
                        );
                }
                else
                {
                    position.Y -= lineHeight / 2;
                    ChatManager.DrawColorCodedStringWithShadow(
                        spriteBatch,
                        Main.fontMouseText,
                        ammo.Item.Name,
                        position,
                        ammo.CanUnlock ? UnlockColor : locked,
                        0f,
                        stringLeftAlignedVertCenter,
                        Vector2.One * stringScale
                        );

                    position.Y += lineHeight;
                    ChatManager.DrawColorCodedStringWithShadow(
                        spriteBatch,
                        Main.fontMouseText,
                        ammo.UnlockString,
                        position,
                        ammo.CanUnlock ? Color.White : locked,
                        0f,
                        stringLeftAlignedVertCenter,
                        Vector2.One * stringScale
                        );
                }

                if (textRect.Contains(mousePoint))
                {
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        if (ammo.Unlocked)
                        {
                            if (modPlayer.SelectUnlockedAmmo(ammo.Item.type))
                            {
                                Main.PlaySound(SoundID.Grab);
                            }

                            AmmoPicker = AmmoID.None;
                            break;
                        }

                        if (ammo.CanUnlock && !itemRect.Contains(mousePoint))
                        {
                            if (modPlayer.UnlockEndlessAmmo(ammo.Item.type))
                            {
                                Main.PlaySound(SoundID.Grab);
                            }

                            AmmoPicker = AmmoID.None;
                            break;
                        }
                    }

                    if (itemRect.Contains(mousePoint))
                    {
                        hoverItem = ammo.Item;
                    }
                    else if (ammo.Unlocked)
                    {
                        mouseText = string.Format("Select {0}", ammo.Item.Name);
                    }
                    else if (ammo.CanUnlock)
                    {
                        mouseText = string.Format("Unlock {0}", ammo.Item.Name);
                    }
                    else
                    {
                        mouseText = string.Format("Unlock {0} ({1})", ammo.Item.Name, ammo.UnlockString);
                    }
                }

                itemRect.Y += unit;
                textRect.Y += unit;
            }

            if (AmmoPicker != AmmoID.None && !dropdownRect.Contains(mousePoint) && Main.mouseLeft && Main.mouseLeftRelease)
            {
                Main.PlaySound(SoundID.MenuClose);
                AmmoPicker = AmmoID.None;
            }
            else if (PlayerInput.ScrollWheelDeltaForUI != 0)
            {
                int delta         = PlayerInput.ScrollWheelDeltaForUI < 0 ? 1 : -1;
                int currentTarget = (int)ScrollPosition.Target;
                int newTarget     = Math.Max(0, Math.Min(ammoData.Count - 4, delta + currentTarget));

                if (currentTarget != newTarget)
                {
                    Main.PlaySound(SoundID.MenuTick);
                    ScrollPosition.SetValue(newTarget);
                }

                PlayerInput.ScrollWheelDeltaForUI = 0;
            }

            ResetMask(spriteBatch);
        }