Skip to content

Commit

Permalink
Compensate for dualshock4 and dualshock3 differences
Browse files Browse the repository at this point in the history
  • Loading branch information
lunarcloud committed Apr 21, 2016
1 parent f63a0ff commit b404c95
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions gameinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ var gi = {};

/**
* @desc Gets the button text
* @param schemaName name of the button or axisValue
* @param ragdollSymbolsAsWords whether or not to convert Ragdoll's "x □ o △" to "cross square circle triangle"
* @param schemaName name of the button or axisValue
* @param symbolsAsWords whether or not to convert Ragdoll's "x □ o △" to "cross square circle triangle"
*/
gi.Player.prototype.getButtonText = function(schemaName, ragdollSymbolsAsWords)
gi.Player.prototype.getButtonText = function(schemaName, symbolsAsWords)
{
if ( this.schema instanceof gi.Schema.KeyboardAPI )
{
Expand All @@ -159,9 +159,11 @@ var gi = {};
{
var text = this.model.type.schemaNames[schemaName];

if (ragdollSymbolsAsWords !== true) return text;
if (symbolsAsWords !== true) return text;

switch (text) {
case "▶":
return "start";
case "x":
return "cross";
case "o":
Expand Down Expand Up @@ -479,6 +481,18 @@ var gi = {};
r_trigger : "R2"
});

gi.Type.Ragdoll4 = new gi.Type("Ragdoll", new gi.Theme("Ragdoll"), {
menu : "options",
button0 : "x",
button1 : "o",
button2 : "□",
button3 : "△",
l_button : "L1",
r_button : "R1",
l_trigger : "L2",
r_trigger : "R2"
});

gi.Type.Keyboard = new gi.Type("Keyboard", new gi.Theme("QWERTY"));

gi.Type.Keyboard.StandardThemes = {
Expand Down Expand Up @@ -733,7 +747,7 @@ var gi = {};
5,6,7,8
)),
new gi.Model(
gi.Type.Ragdoll,
gi.Type.Ragdoll4,
"ds4",
"Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 05c4)",
"Windows",
Expand All @@ -753,7 +767,7 @@ var gi = {};
)
),
new gi.Model(
gi.Type.Ragdoll,
gi.Type.Ragdoll4,
"ds4",
"054c-05c4-Wireless Controller",
"Windows",
Expand Down Expand Up @@ -934,7 +948,7 @@ var gi = {};
11,12,9,10
)),
new gi.Model(
gi.Type.Ragdoll,
gi.Type.Ragdoll4,
"ds4",
"Sony Computer Entertainment Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 05c4)",
"Linux",
Expand All @@ -956,7 +970,7 @@ var gi = {};
8
)),
new gi.Model(
gi.Type.Ragdoll,
gi.Type.Ragdoll4,
"ds4",
"054c-05c4-Sony Computer Entertainment Wireless Controller",
"Linux",
Expand Down

0 comments on commit b404c95

Please sign in to comment.