Inventory: honor rebound numeric keys in creative search

Resolve the configured hotbar or offhand binding after the search tab's physical numeric-key gate. Preserve search input and existing hover/cursor restrictions.

Fixes #7134

Co-Authored-By: Codex <[email protected]>
This commit is contained in:
masa-masa-0314andCodex committed 2026-11-02 19:28:28 +08:00
1 parent 185ebe0a68
commit efff801398
1 file changed
+5 -4
+5 -4
View File
@@ -10115,11 +10115,13 @@ impl Game<'_> {
/// key over a slot swaps before the search box sees it.
fn search_tab_hotbar_key(&mut self, code: KeyCode) -> bool {
use horizon_client::creative::{Hover, search_key_swaps};
let hotbar_key = HOTBAR_DIGITS.contains(&code);
let numeric = hotbar_key || NUMERIC_KEYS.contains(&code);
let numeric = HOTBAR_DIGITS.contains(&code) || NUMERIC_KEYS.contains(&code);
if !numeric {
return false;
}
let Some(key) = self.settings.keys.container_hotbar_key(code) else {
return false;
};
let Some(size) = self
.renderer
.as_ref()
@@ -10141,8 +10143,7 @@ impl Game<'_> {
}
Some(_) => Hover::Slot,
};
search_key_swaps(numeric, hotbar_key, hover, self.carried.is_some())
&& self.inventory_hotkey(code)
search_key_swaps(numeric, true, hover, self.carried.is_some()) && self.inventory_hotkey(key)
}
/// Number keys, F and Q over a slot of the open menu: SWAP with a hotbar
/// slot or the off hand, THROW one or the whole stack.