Don't Starve Together

Don't Starve Together

Simple Controller (*Gamepad Optimization)
 This topic has been pinned, so it's probably important
烎 '  [developer] Feb 11 @ 10:12am
关于这个mod "Craft Pot [DS, ROG, SW, DST]",如果你订阅了该模组,务必看一下!!!
前几年我就发现了它有一段与手柄相关的代码, 由于没有返回值,会导致出现BUG, 具体为打开物品栏时在其它操作中导致物品栏关闭时,偶尔会导致游戏静音以及无法操作大部分功能, 还有使用鼠标操作导致点击物品栏物品时人物也跟着跑的问题;
解决办法删除以下代码即可(也可以关闭手柄进游戏后再启用手柄解决):
AddClassPostConstruct("screens/playerhud", function(inst)
if TheInput:ControllerAttached() then
--local old_open_controller_inventory = inst.OpenControllerInventory
--[[inst.OpenControllerInventory = function(self)
if not inst.controls.foodcrafting:IsOpen() then
old_open_controller_inventory(self)
end
end]]

local old_on_control = inst.OnControl
inst.OnControl = function(self, control, down, ...)
old_on_control(self, control, down, ...)
if inst.controls.foodcrafting:IsOpen() then
inst.controls.foodcrafting:OnControl(control, down)
end
-- 这一段代码没有返回值, 非常容易导致bug.
-- there is no return of a boolean value, which can easily cause bugs.
end
end

end)
这一段代码在modmain.lua的第225行左右, 文件路径应该是 "steamapps\workshop\content\322330\727774324"
Last edited by 烎 '; Feb 11 @ 10:50am