Skip to content

Instantly share code, notes, and snippets.

@op8867555
Created June 28, 2014 03:41
Show Gist options
  • Save op8867555/75f38b05194141cba42a to your computer and use it in GitHub Desktop.
Save op8867555/75f38b05194141cba42a to your computer and use it in GitHub Desktop.
don't starve ( linux ) xbox 360 controller prompt dirty hack
--- input.lua.bak 2014-06-28 10:13:51.897841317 +0800
+++ input.lua 2014-06-28 11:38:07.049859004 +0800
@@ -295,6 +295,10 @@
if not (nil == intParam) then
text = string.format(text, intParam)
end
+
+ for key, rename in pairs(STRINGS.UI.CONTROLSSCREEN.GENERIC_CONTROLLER_RENAMES) do
+ text = string.gsub(text, key, rename)
+ end
end
--print ("Input Text:" .. tostring(text))
return text;
--- strings.lua.bak 2014-06-28 10:12:30.809987420 +0800
+++ strings.lua 2014-06-28 11:15:50.831400340 +0800
@@ -2171,6 +2171,47 @@
CONTROLSSCREEN=
{
+ -- my
+ GENERIC_CONTROLLER_RENAMES=
+ {
+ -- a, b, x, y
+ ["%(Button 0%)"] = "\127",
+ ["%(Button 1%)"] = "\128",
+
+ ["%(Button 2%)"] = "\129",
+ ["%(Button 3%)"] = "\130",
+
+ -- bumper
+ ["%(Button 4%)"] = "\135",
+ ["%(Button 5%)"] = "\138",
+
+ --start, back
+ ["%(Button 6%)"] = "\132",
+ ["%(Button 7%)"] = "\131",
+
+ -- Directional
+ ["%(DPad %d Up%)" ] = "\142",
+ ["%(DPad %d Down%)" ] = "\139",
+ ["%(DPad %d Left%)" ] = "\140",
+ ["%(DPad %d Right%)"] = "\141",
+
+ -- left thumb
+ ["%(%-X Axis%)"] = "\145",
+ ["%(%+X Axis%)"] = "\146",
+ ["%(%-Y Axis%)"] = "\143",
+ ["%(%+Y Axis%)"] = "\144",
+ --
+ -- triggers
+ ["%(%+Z Axis%)" ] = "\134",
+ ["%(%+Z Rotation%)"] = "\137",
+ -- right thumb
+ ["%(%-X Rotation%)"] = "\149",
+ ["%(%+X Rotation%)"] = "\150",
+ ["%(%-Y Rotation%)"] = "\147",
+ ["%(%+Y Rotation%)"] = "\148",
+ },
+ -- end here
+
-- Must match the Control enum in DontStarveInputHandler.h
-- Must match constants.lua CONTROLS_*
CONTROLS = {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment