Example #1
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     if (ValueUpdateTimer.Enabled)
     {
         ValueUpdateTimer.Stop();
     }
 }
Example #2
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (e.Button == MouseButtons.Left)
     {
         ValueUpdateStep = e.Location.Y > Height / 2 ? -1m : 1m;
         if (ViewInfo.CalcHitInfo(e.Location).HitTest == EditHitTest.Button)
         {
             ValueUpdateTimer.Start();
         }
     }
 }
Example #3
0
        public bool ShouldUpdateValuesInventory()
        {
            if (ValueUpdateTimer.ElapsedMilliseconds > Settings.ValueLoopTimerMS)
            {
                ValueUpdateTimer.Restart();
                if (Settings.Debug)
                {
                    LogMessage($"{GetCurrentMethod()} ValueUpdateTimer.Restart()", 5, Color.DarkGray);
                }
            }
            else
            {
                return(false);
            }
            // TODO: Get inventory items and not just stash tab items, this will be done at a later date
            try
            {
                if (!Settings.VisibleInventoryValue.Value || !GameController.Game.IngameState.IngameUi.InventoryPanel.IsVisible)
                {
                    if (Settings.Debug)
                    {
                        LogMessage($"{GetCurrentMethod()}.ShouldUpdateValues() Inventory is not visable", 5, Color.DarkGray);
                    }
                    return(false);
                }

                // Dont continue if the stash page isnt even open
                if (GameController.Game.IngameState.IngameUi.InventoryPanel[InventoryIndex.PlayerInventory].VisibleInventoryItems == null)
                {
                    if (Settings.Debug)
                    {
                        LogMessage($"{GetCurrentMethod()}.ShouldUpdateValues() Items == null", 5, Color.DarkGray);
                    }
                    return(false);
                }
            }
            catch (Exception)
            {
                if (Settings.Debug)
                {
                    LogMessage($"{GetCurrentMethod()}.ShouldUpdateValues() Error that i need to f*****g fix", 5, Color.DarkGray);
                }
                return(false);
            }

            if (Settings.Debug)
            {
                LogMessage($"{GetCurrentMethod()}.ShouldUpdateValues() == True", 5, Color.LimeGreen);
            }
            return(true);
        }