Don't Starve Together

Don't Starve Together

Beefalo keybind
ul_708 Feb 2, 2024 @ 3:56pm
[Bug+patch] pressing keybind triggers even in crafting menu
Currently, if the keybind (for example R) is pressed in the crafting menu search bar, the mod will still try to mount/dismount the beefalo. Ideally, this should be context dependent and only trigger when nothing is open.

Here is a patch file (code adapted from Beefalo Status Widget's implementation) that fixes this bug. Please apply it and update the mod!
diff --git a/modmain.lua b/modmain.lua index 5aa1bd1..2c97f1b 100644 --- a/modmain.lua +++ b/modmain.lua @@ -2,7 +2,9 @@ local beefalo = GetModConfigData("key") local feed = GetModConfigData("feed") local function IsInGameplay() - return G.ThePlayer ~= nil and G.TheFrontEnd:GetActiveScreen().name == "HUD" + return G.ThePlayer ~= nil and G.TheFrontEnd:GetActiveScreen().name == "HUD" + and not G.ThePlayer.HUD:IsCraftingOpen() + and not G.ThePlayer.HUD:HasInputFocus() end local function FindBeefalo() local beefalo = nil
Last edited by ul_708; Feb 2, 2024 @ 8:20pm