Skip to content

Fix toolbar shifting when inventory has items - #7

Merged
jacob-keller merged 1 commit into
mainfrom
jk-fix-shift-with-items
Jul 27, 2026
Merged

Fix toolbar shifting when inventory has items#7
jacob-keller merged 1 commit into
mainfrom
jk-fix-shift-with-items

Conversation

@jacob-keller

Copy link
Copy Markdown
Owner

The Farmer_shiftToolbar_Prefix function intercepts the toolbar shifting
logic to allow configuring how many rows are shifted. This function
checks many conditions to decide when to execute, including whether the
inventory has items in it.

Checking the number of actual items is incorrect, as it prevents
shifting the toolbar when there are any items. We could invert the check
to only execute if there is at least one item. Instead, just remove this
check and shift regardless of whether there are items in the inventory.

Fixes #5

Signed-off-by: Jacob Keller jacob.keller@gmail.com

This comment was marked as outdated.

The Farmer_shiftToolbar_Prefix function intercepts the toolbar shifting
logic to allow configuring how many rows are shifted. This function
checks many conditions to decide when to execute, including whether the
inventory has items in it.

Checking the number of actual items is incorrect, as it prevents
shifting the toolbar when there are any items. We could invert the check
to only execute if there is at least one item. Instead, just remove this
check and shift regardless of whether there are items in the inventory.

While at it, split the conditions over multiple lines, and re-arrange
the order so that we check __instance.Items for null prior to attempting
to access it, as reported by Copilot.

Fixes #5

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jacob-keller
jacob-keller merged commit 5466360 into main Jul 27, 2026
1 check passed
@jacob-keller
jacob-keller deleted the jk-fix-shift-with-items branch July 27, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rows to shift config is ignored

2 participants