/// <summary>
        /// Initializes a new instance of the ResultsDialog class.
        /// </summary>
        public ResultsDialog()
        {
            this.InitializeComponent();
            this.tooltip     = new TTLib();
            this.resultsList = new List <Result>();
            ////this.selectedResult = new Result();
            this.item.HeaderText          = Resources.ResultsItem;
            this.containerName.HeaderText = Resources.ResultsContainer;
            this.containerType.HeaderText = Resources.ResultsContainerType;
            this.sack.HeaderText          = Resources.ResultsSack;
            this.quality.HeaderText       = Resources.ResultsQuality;

            if (Settings.Default.EnableNewUI)
            {
                this.DrawCustomBorder = true;
            }
            else
            {
                this.Revert(new Size(821, 459));
            }

            this.FormDesignRatio = 0.0F;             //// (float)this.Height / (float)this.Width;
            ////this.FormMaximumSize = new Size(this.Width * 2, this.Height * 2);
            ////this.FormMinimumSize = new Size(
            ////Convert.ToInt32((float)this.Width * 0.4F),
            ////Convert.ToInt32((float)this.Height * 0.4F));
            this.OriginalFormSize  = this.Size;
            this.OriginalFormScale = 1.0F;
            this.LastFormSize      = this.Size;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the BagButtonBase class.
        /// </summary>
        /// <param name="bagNumber">number of the bag for display</param>
        /// <param name="getToolTip">Tooltip delegate</param>
        /// <param name="tooltip">Tooltip instance</param>
        protected BagButtonBase(int bagNumber, GetToolTip getToolTip, TTLib tooltip)
        {
            this.getToolTip   = getToolTip;
            this.ButtonNumber = bagNumber;
            this.toolTip      = tooltip;

            BackColor = Color.Black;

            MouseEnter += new EventHandler(this.MouseEnterCallback);
            MouseLeave += new EventHandler(this.MouseLeaveCallback);
            Paint      += new PaintEventHandler(this.PaintCallback);

            // Da_FileServer: Some small paint optimizations.
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the ResultsDialog class.
        /// </summary>
        public ResultsDialog()
        {
            this.InitializeComponent();

            #region Apply custom font

            this.resultsDataGridView.ColumnHeadersDefaultCellStyle.Font = Program.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.item.DefaultCellStyle.Font          = Program.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.quality.DefaultCellStyle.Font       = Program.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.containerName.DefaultCellStyle.Font = Program.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.containerType.DefaultCellStyle.Font = Program.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.level.DefaultCellStyle.Font         = Program.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Font = Program.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            #endregion

            this.tooltip     = new TTLib();
            this.resultsList = new List <Result>();
            ////this.selectedResult = new Result();
            this.item.HeaderText          = Resources.ResultsItem;
            this.containerName.HeaderText = Resources.ResultsContainer;
            this.containerType.HeaderText = Resources.ResultsContainerType;
            this.quality.HeaderText       = Resources.ResultsQuality;
            this.level.HeaderText         = Resources.ResultsLevel;

            this.DrawCustomBorder = true;

            this.FormDesignRatio = 0.0F;             //// (float)this.Height / (float)this.Width;
            ////this.FormMaximumSize = new Size(this.Width * 2, this.Height * 2);
            ////this.FormMinimumSize = new Size(
            ////Convert.ToInt32((float)this.Width * 0.4F),
            ////Convert.ToInt32((float)this.Height * 0.4F));
            this.OriginalFormSize  = this.Size;
            this.OriginalFormScale = 1.0F;
            this.LastFormSize      = this.Size;
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the PlayerPanel class.
        /// </summary>
        /// <param name="dragInfo">Instance of the ItemDragInfo</param>
        /// <param name="numberOfBags">Number of bags in this panel</param>
        /// <param name="panel1Size">Main panel size</param>
        /// <param name="panel2Size">Secondary panel size for players who have the additional game sacks</param>
        /// <param name="tooltip">Tooltip instance</param>
        public PlayerPanel(ItemDragInfo dragInfo, int numberOfBags, Size panel1Size, Size panel2Size, TTLib tooltip)
            : base(dragInfo, numberOfBags, panel2Size, tooltip, 2, AutoMoveLocation.Player)
        {
            this.Text           = Resources.PlayerPanelNoPlayer;
            this.NoPlayerString = Resources.PlayerPanelNoPlayer;

            this.Size = new Size(
                ((panel1Size.Width + panel2Size.Width) * Database.DB.ItemUnitSize) + Convert.ToInt32(24.0F * Database.DB.Scale),
                (Math.Max(panel1Size.Height, panel2Size.Height) * Database.DB.ItemUnitSize) + Convert.ToInt32(58.0F * Database.DB.Scale));
            this.TabStop = false;
            this.Font    = new Font(this.Font.Name, this.Font.SizeInPoints * Database.DB.Scale, this.Font.Style);

            int borderPad = Convert.ToInt32(2.0F * Database.DB.Scale);

            this.BagPanelOffset = 1;             // bag panel starts with bag #1
            this.mainSackPanel  = new SackPanel(panel1Size.Width, panel1Size.Height, this.DragInfo, AutoMoveLocation.Player);
            this.mainSackPanel.SetLocation(new Point(borderPad, this.Size.Height - this.mainSackPanel.Size.Height - borderPad));
            this.mainSackPanel.OnNewItemHighlighted    += new EventHandler <SackPanelEventArgs>(this.NewItemHighlightedCallback);
            this.mainSackPanel.OnAutoMoveItem          += new EventHandler <SackPanelEventArgs>(this.AutoMoveItemCallback);
            this.mainSackPanel.OnActivateSearch        += new EventHandler <SackPanelEventArgs>(this.ActivateSearchCallback);
            this.mainSackPanel.OnClearAllItemsSelected += new EventHandler <SackPanelEventArgs>(this.ClearAllItemsSelectedCallback);
            this.mainSackPanel.OnItemSelected          += new EventHandler <SackPanelEventArgs>(this.ItemSelectedCallback);
            this.mainSackPanel.OnResizeForm            += new EventHandler <ResizeEventArgs>(this.ResizeFormCallback);
            this.Controls.Add(this.mainSackPanel);
            this.mainSackPanel.MaxSacks          = 1;
            this.mainSackPanel.SackType          = SackType.Player;
            this.mainSackPanel.IsMainPlayerPanel = true;

            this.BagSackPanel.SetLocation(new Point(this.mainSackPanel.Right + borderPad, this.Size.Height - this.BagSackPanel.Size.Height - borderPad));
            this.BagSackPanel.IsPlayerBagPanel = true;

            // Recalculate the button sizing and placement since we moved the BagSackPanel.
            if (this.BagButtons != null && this.BagButtons.Count > 0)
            {
                float buttonWidth  = (float)Resources.inventorybagup01.Width;
                float buttonHeight = (float)Resources.inventorybagup01.Height;
                float pad          = 2.0F;
                float slotWidth    = buttonWidth + (2.0F * pad);

                // we need to scale down the bag size depending on the # we have
                // but keep room for the autosort button so the buttons only use half of the panel size.
                float scale        = this.GetBagButtonScale(slotWidth, (this.BagButtons.Count * 2));
                float bagSlotWidth = scale * slotWidth;

                int index = 0;
                foreach (BagButtonBase button in this.BagButtons)
                {
                    button.Size = new Size((int)Math.Round(scale * buttonWidth), (int)Math.Round(scale * buttonHeight));
                    float offset = (bagSlotWidth * index) + ((bagSlotWidth - button.Width) / 2.0F);

                    button.Location = new Point(this.BagSackPanel.Location.X + (int)Math.Round(offset), this.BagSackPanel.Location.Y - button.Height);
                    index++;
                }
            }

            // Move the autosort buttons to their place since the panels got moved.
            AutoSortButtons[0].Location = new Point(this.mainSackPanel.Location.X, this.mainSackPanel.Location.Y - AutoSortButtons[0].Height);
            AutoSortButtons[1].Location = new Point(
                this.BagSackPanel.Location.X + this.BagSackPanel.Width - AutoSortButtons[1].Width,
                this.BagSackPanel.Location.Y - AutoSortButtons[1].Height);

            this.BagSackPanel.SackType = SackType.Sack;
        }
Exemple #5
0
        public MainForm()
        {
            Log = Logger.Get(this);
            Log.Info("TQVaultAE Initialization !");

            this.Enabled       = false;
            this.ShowInTaskbar = false;
            this.Opacity       = 0;
            this.Hide();

            this.InitializeComponent();

            this.SetupFormSize();

            #region Apply custom font & scaling

            this.exitButton.Font = FontHelper.GetFontAlbertusMTLight(12F, UIService.UI.Scale);
            ScaleControl(this.exitButton);
            this.characterComboBox.Font = FontHelper.GetFontAlbertusMTLight(13F, UIService.UI.Scale);
            ScaleControl(this.characterComboBox);
            ScaleControl(this.characterLabel);
            ScaleControl(this.itemTextPanel);
            ScaleControl(this.itemText);
            this.vaultListComboBox.Font = FontHelper.GetFontAlbertusMTLight(13F, UIService.UI.Scale);
            ScaleControl(this.vaultListComboBox);
            this.vaultLabel.Font = FontHelper.GetFontAlbertusMTLight(11F, UIService.UI.Scale);
            ScaleControl(this.vaultLabel);
            this.configureButton.Font = FontHelper.GetFontAlbertusMTLight(12F, UIService.UI.Scale);
            ScaleControl(this.configureButton);
            this.customMapText.Font = FontHelper.GetFontAlbertusMT(11.25F, UIService.UI.Scale);
            ScaleControl(this.customMapText);
            this.panelSelectButton.Font = FontHelper.GetFontAlbertusMTLight(12F, UIService.UI.Scale);
            ScaleControl(this.panelSelectButton);
            this.secondaryVaultListComboBox.Font = FontHelper.GetFontAlbertusMTLight(11F, UIService.UI.Scale);
            ScaleControl(this.secondaryVaultListComboBox);
            this.aboutButton.Font = FontHelper.GetFontMicrosoftSansSerif(8.25F, UIService.UI.Scale);
            ScaleControl(this.aboutButton);
            this.titleLabel.Font = FontHelper.GetFontAlbertusMTLight(24F, UIService.UI.Scale);
            ScaleControl(this.titleLabel);
            this.searchButton.Font = FontHelper.GetFontAlbertusMTLight(12F, UIService.UI.Scale);
            ScaleControl(this.searchButton);

            #endregion

            try
            {
                this.tooltip = new TTLib();
            }
            catch (Exception ex)
            {
                Log.Error("Get TTLib fail !", ex);
                MessageBox.Show(Log.FormatException(ex));
                // Handle failure to create to tooltip here
                // VXPlib not registered
                checkVXPlibrary();
                this.tooltip = new TTLib();
            }

            // Changed to a global for versions in tqdebug
            AssemblyName aname = Assembly.GetExecutingAssembly().GetName();
            this.currentVersion = aname.Version.ToString();
            this.Text           = string.Format(CultureInfo.CurrentCulture, "{0} {1}", aname.Name, this.currentVersion);

            if (TQDebug.DebugEnabled)
            {
                // Write this version into the debug file.
                Log.DebugFormat(CultureInfo.InvariantCulture, "Current TQVault Version: {0}", this.currentVersion);
                Log.Debug(string.Empty);
                Log.Debug("Debug Levels");
                Log.DebugFormat(CultureInfo.InvariantCulture, "ARCFileDebugLevel: {0}", TQDebug.ArcFileDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "DatabaseDebugLevel: {0}", TQDebug.DatabaseDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemAttributesDebugLevel: {0}", TQDebug.ItemAttributesDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemDebugLevel: {0}", TQDebug.ItemDebugLevel);
                Log.Debug(string.Empty);
            }


            // Setup localized strings.
            this.characterLabel.Text    = Resources.MainFormLabel1;
            this.vaultLabel.Text        = Resources.MainFormLabel2;
            this.configureButton.Text   = Resources.MainFormBtnConfigure;
            this.exitButton.Text        = Resources.GlobalExit;
            this.panelSelectButton.Text = Resources.MainFormBtnPanelSelect;
            this.Icon = Resources.TQVIcon;
            this.searchButton.Text = Resources.MainFormSearchButtonText;

            // Set up Item strings
            Item.ItemWith           = Resources.ItemWith;
            Item.ItemRelicBonus     = Resources.ItemRelicBonus;
            Item.ItemRelicCompleted = Resources.ItemRelicCompleted;
            Item.ItemQuest          = Resources.ItemQuest;
            Item.ItemSeed           = Resources.ItemSeed;
            Item.ItemIT             = Resources.ItemIT;
            Item.ItemRagnarok       = Resources.ItemRagnarok;
            Item.ItemAtlantis       = Resources.ItemAtlantis;
            Item.ShowSkillLevel     = Config.Settings.Default.ShowSkillLevel;

            if (Config.Settings.Default.NoToolTipDelay)
            {
                this.tooltip.SetNoDelay();
            }

            this.lastDragPoint.X = -1;
            this.dragInfo        = new ItemDragInfo();

            this.CreatePanels();

            // Process the mouse scroll wheel to cycle through the vaults.
            this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel);

            this.splashScreen = new SplashScreenForm();
            this.splashScreen.MaximumValue = 1;
            this.splashScreen.FormClosed  += new FormClosedEventHandler(this.SplashScreenClosed);

            if (Config.Settings.Default.LoadAllFiles)
            {
                this.splashScreen.MaximumValue += LoadAllFilesTotal();
            }

            this.splashScreen.Show();
            this.splashScreen.Update();
        }
Exemple #6
0
        /// <summary>
        /// Initializes a new instance of the VaultPanel class.
        /// </summary>
        /// <param name="dragInfo">Instance of the ItemDragInfo</param>
        /// <param name="numberOfBags">Number of bags in this panel</param>
        /// <param name="panelSize">Main panel size</param>
        /// <param name="tooltip">Tooltip instance</param>
        /// <param name="numberOfAutosortButtons">The number of AutoSort buttons associated with this panel.,</param>
        /// <param name="autoMoveLocation">The automovelocation for this panel.</param>
        public VaultPanel(ItemDragInfo dragInfo, int numberOfBags, Size panelSize, TTLib tooltip, int numberOfAutosortButtons, AutoMoveLocation autoMoveLocation)
        {
            this.DragInfo         = dragInfo;
            this.Tooltip          = tooltip;
            this.AutoMoveLocation = autoMoveLocation;
            this.Text             = Resources.PlayerPanelNoVault;
            this.NoPlayerString   = Resources.PlayerPanelNoVault;
            this.BackColor        = Color.Transparent;
            this.DrawAsGroupBox   = false;

            // Setup the offset to make room for the autosort button
            int autosortOffset = 0;

            if (numberOfAutosortButtons > 0)
            {
                autosortOffset = Convert.ToInt32(27.0F * Database.DB.Scale);
            }

            this.Size = new Size(
                (panelSize.Width * Database.DB.ItemUnitSize) + Convert.ToInt32(10.0F * Database.DB.Scale) + autosortOffset + BorderPad,
                (panelSize.Height * Database.DB.ItemUnitSize) + Convert.ToInt32(56.0F * Database.DB.Scale) + BorderPad);
            this.TabStop = false;
            this.Font    = new Font(this.Font.Name, this.Font.SizeInPoints * Database.DB.Scale, this.Font.Style);

            this.BagPanelOffset = 0;             // bag panel starts with bag #0
            this.BagSackPanel   = new SackPanel(panelSize.Width, panelSize.Height, this.DragInfo, autoMoveLocation);
            this.BagSackPanel.SetLocation(new Point(autosortOffset + BorderPad, this.Size.Height - (this.BagSackPanel.Size.Height + BorderPad)));
            this.BagSackPanel.OnNewItemHighlighted    += new EventHandler <SackPanelEventArgs>(this.NewItemHighlightedCallback);
            this.BagSackPanel.OnAutoMoveItem          += new EventHandler <SackPanelEventArgs>(this.AutoMoveItemCallback);
            this.BagSackPanel.OnActivateSearch        += new EventHandler <SackPanelEventArgs>(this.ActivateSearchCallback);
            this.BagSackPanel.OnItemSelected          += new EventHandler <SackPanelEventArgs>(this.ItemSelectedCallback);
            this.BagSackPanel.OnClearAllItemsSelected += new EventHandler <SackPanelEventArgs>(this.ClearAllItemsSelectedCallback);
            this.BagSackPanel.OnResizeForm            += new EventHandler <ResizeEventArgs>(this.ResizeFormCallback);
            this.Controls.Add(this.BagSackPanel);
            this.BagSackPanel.IsPlayerBagPanel = false;
            this.BagSackPanel.MaxSacks         = numberOfBags;

            // Create the buttons
            this.bagButtons = new Collection <BagButtonBase>();
            this.CreateBagButtons(numberOfBags);

            // Assume it's the trash panel if we are not autosorting it.
            if (numberOfAutosortButtons == 0)
            {
                this.BagSackPanel.SackType = SackType.Trash;
            }
            else
            {
                this.autoSortButtons = new Collection <AutoSortButton>();

                for (int i = 0; i < numberOfAutosortButtons; ++i)
                {
                    this.autoSortButtons.Insert(i, this.CreateAutoSortButton(i));
                    this.Controls.Add(this.autoSortButtons[i]);
                }

                this.BagSackPanel.SackType = SackType.Vault;
            }

            this.contextMenu                   = new ContextMenuStrip();
            this.contextMenu.BackColor         = Color.FromArgb(46, 41, 31);
            this.contextMenu.DropShadowEnabled = true;
            this.contextMenu.Font              = new Font("Albertus MT", 9.0F * Database.DB.Scale);
            this.contextMenu.ForeColor         = Color.FromArgb(200, 200, 200);
            this.contextMenu.Opacity           = 0.80;
            this.contextMenu.ShowImageMargin   = false;
            this.contextMenu.ItemClicked      += new ToolStripItemClickedEventHandler(this.ContextMenuItemClicked);
            this.contextMenu.Renderer          = new CustomProfessionalRenderer();

            this.PropertyChanged += new PropertyChangedEventHandler(this.PropertyChangedCallback);
            this.Paint           += new PaintEventHandler(this.PaintCallback);

            // to avoid flickering use double buffer and to force control to use OnPaint
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
        }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the StashButton class.
 /// </summary>
 /// <param name="bagNumber">number of the bag for display</param>
 /// <param name="getToolTip">Tooltip delegate</param>
 /// <param name="tooltip">Tooltip instance</param>
 public StashButton(int bagNumber, GetToolTip getToolTip, TTLib tooltip) : base(bagNumber, getToolTip, tooltip)
 {
     // Override the default background graphics.
     this.CreateBackgroundGraphics();
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the BagButton class.
 /// </summary>
 /// <param name="bagNumber">number of the bag for display</param>
 /// <param name="getToolTip">Tooltip delegate</param>
 /// <param name="tooltip">Tooltip instance</param>
 public BagButton(int bagNumber, GetToolTip getToolTip, TTLib tooltip) : base(bagNumber, getToolTip, tooltip)
 {
 }
Exemple #9
0
        /// <summary>
        /// Initializes a new instance of the StashPanel class.  Hard coded to 3 stash buttons and no autosort buttons.
        /// </summary>
        /// <param name="dragInfo">ItemDragInfo instance</param>
        /// <param name="panelSize">Size of the panel in cells</param>
        /// <param name="tooltip">ToolTip instance</param>
        public StashPanel(ItemDragInfo dragInfo, Size panelSize, TTLib tooltip) : base(dragInfo, 3, panelSize, tooltip, 0, AutoMoveLocation.Stash)
        {
            this.equipmentPanel = new EquipmentPanel(10, 14, dragInfo, AutoMoveLocation.Stash);

            this.Controls.Add(this.equipmentPanel);
            this.equipmentPanel.OnNewItemHighlighted    += new EventHandler <SackPanelEventArgs>(this.NewItemHighlightedCallback);
            this.equipmentPanel.OnAutoMoveItem          += new EventHandler <SackPanelEventArgs>(this.AutoMoveItemCallback);
            this.equipmentPanel.OnActivateSearch        += new EventHandler <SackPanelEventArgs>(this.ActivateSearchCallback);
            this.equipmentPanel.OnItemSelected          += new EventHandler <SackPanelEventArgs>(this.ItemSelectedCallback);
            this.equipmentPanel.OnClearAllItemsSelected += new EventHandler <SackPanelEventArgs>(this.ClearAllItemsSelectedCallback);
            this.equipmentPanel.OnResizeForm            += new EventHandler <ResizeEventArgs>(this.ResizeFormCallback);

            this.Text           = Resources.StashPanelText;
            this.NoPlayerString = Resources.StashPanelText;
            this.Size           = new Size(
                (panelSize.Width * Database.DB.ItemUnitSize) + Convert.ToInt32(10.0F * Database.DB.Scale) + BorderPad,
                (panelSize.Height * Database.DB.ItemUnitSize) + Convert.ToInt32(60.0F * Database.DB.Scale) + BorderPad);
            this.Paint += new PaintEventHandler(this.PaintCallback);

            this.BagSackPanel.SetLocation(new Point(BorderPad, this.Size.Height - (this.BagSackPanel.Size.Height + BorderPad)));
            this.BagSackPanel.MaxSacks = 1;
            this.BagSackPanel.Anchor   = AnchorStyles.None;

            this.EquipmentBackground = Resources.Equipment_bg_new;
            this.StashBackground     = Resources.caravan_bg;

            // Set up the inital font size
            if (Database.DB.Scale != 1.0F)
            {
                this.Font = new Font(this.Font.Name, this.Font.SizeInPoints * Database.DB.Scale, this.Font.Style);
            }

            this.background = Resources.Equipment_bg_new;

            // Now that the buttons are set we can move the panel
            this.BagSackPanel.SetLocation(new Point(
                                              BorderPad,
                                              this.BagButtons[0].Location.Y + this.BagButtons[0].Size.Height + Database.DB.HalfUnitSize));

            int offsetX = (panelSize.Width - this.equipmentPanel.SackSize.Width) * Database.DB.HalfUnitSize;

            if (offsetX < 0)
            {
                offsetX = 0;
            }

            int offsetY = (panelSize.Height - this.equipmentPanel.SackSize.Height) * Database.DB.HalfUnitSize;

            if (offsetY < 0)
            {
                offsetY = 0;
            }

            this.equipmentPanel.SetLocation(new Point(
                                                BorderPad + offsetX,
                                                this.BagButtons[0].Location.Y + this.BagButtons[0].Size.Height + offsetY));

            this.maxPanelSize = panelSize;

            // Create the background for redrawing now that everything is set.
            this.equipmentPanel.CursorBackgroundImage = this.CreateCursorBackground(this.equipmentPanel);

            this.BagSackPanel.Visible = false;
            this.BagSackPanel.Enabled = false;
        }
Exemple #10
0
        /// <summary>
        /// Initializes a new instance of the StashPanel class.  Hard coded to 4 stash buttons and no autosort buttons.
        /// </summary>
        /// <param name="dragInfo">ItemDragInfo instance</param>
        /// <param name="panelSize">Size of the panel in cells</param>
        /// <param name="tooltip">ToolTip instance</param>
        public StashPanel(ItemDragInfo dragInfo, Size panelSize, TTLib tooltip) : base(dragInfo, 4, panelSize, tooltip, 0, AutoMoveLocation.Stash)
        {
            this.equipmentPanel = new EquipmentPanel(16, 14, dragInfo, AutoMoveLocation.Stash);

            this.Controls.Add(this.equipmentPanel);
            this.equipmentPanel.OnNewItemHighlighted    += new EventHandler <SackPanelEventArgs>(this.NewItemHighlightedCallback);
            this.equipmentPanel.OnAutoMoveItem          += new EventHandler <SackPanelEventArgs>(this.AutoMoveItemCallback);
            this.equipmentPanel.OnActivateSearch        += new EventHandler <SackPanelEventArgs>(this.ActivateSearchCallback);
            this.equipmentPanel.OnItemSelected          += new EventHandler <SackPanelEventArgs>(this.ItemSelectedCallback);
            this.equipmentPanel.OnClearAllItemsSelected += new EventHandler <SackPanelEventArgs>(this.ClearAllItemsSelectedCallback);
            this.equipmentPanel.OnResizeForm            += new EventHandler <ResizeEventArgs>(this.ResizeFormCallback);
            this.equipmentPanel.MouseMove  += new MouseEventHandler(this.StashPanelMouseMove);
            this.equipmentPanel.MouseLeave += new EventHandler(this.StashPanelMouseLeave);
            this.equipmentPanel.MouseClick += new MouseEventHandler(this.StashPanelMouseClick);
            //this.MouseMove += new MouseEventHandler(this.StashPanelMouseMove);
            //this.MouseHover += new MouseEventHandler(this.StashPanelMouseMove);

            this.Text           = Resources.StashPanelText;
            this.NoPlayerString = Resources.StashPanelText;
            this.Size           = new Size(
                (panelSize.Width * UIService.UI.ItemUnitSize) + Convert.ToInt32(10.0F * UIService.UI.Scale) + BorderPad,
                (panelSize.Height * UIService.UI.ItemUnitSize) + Convert.ToInt32(60.0F * UIService.UI.Scale) + BorderPad);
            this.Paint += new PaintEventHandler(this.PaintCallback);

            this.BagSackPanel.SetLocation(new Point(BorderPad, this.Size.Height - (this.BagSackPanel.Size.Height + BorderPad)));
            this.BagSackPanel.MaxSacks = 1;
            this.BagSackPanel.Anchor   = AnchorStyles.None;

            //this.EquipmentBackground = Resources.Equipment_bg_new;
            this.background      = this.EquipmentBackground = Resources.equipment_bg_and_char;
            this.StashBackground = Resources.caravan_bg;

            // Set up the inital font size
            if (UIService.UI.Scale != 1.0F)
            {
                this.Font = new Font(this.Font.FontFamily, this.Font.SizeInPoints * UIService.UI.Scale, this.Font.Style);
            }

            //x and y coordinates passed are normalized values between 0 and 1.0.
            playerInfoDisplay = new PlayerInfoDisplay(Config.Settings.Default, this, this.Font, .83, .14);

            // Now that the buttons are set we can move the panel
            this.BagSackPanel.SetLocation(new Point(
                                              BorderPad,
                                              this.BagButtons[0].Location.Y + this.BagButtons[0].Size.Height + UIService.UI.HalfUnitSize));

            int offsetX = (panelSize.Width - this.equipmentPanel.SackSize.Width) * UIService.UI.HalfUnitSize;

            if (offsetX < 0)
            {
                offsetX = 0;
            }

            int offsetY = (panelSize.Height - this.equipmentPanel.SackSize.Height) * UIService.UI.HalfUnitSize;

            if (offsetY < 0)
            {
                offsetY = 0;
            }

            this.equipmentPanel.SetLocation(new Point(
                                                offsetX,
                                                this.BagButtons[0].Location.Y + this.BagButtons[0].Size.Height + offsetY));

            this.maxPanelSize = panelSize;

            this.BagSackPanel.Visible = false;
            this.BagSackPanel.Enabled = false;
        }