mirror of
https://github.com/dualshock-tools/dualshock-tools.github.io.git
synced 2026-07-16 05:34:11 +03:00
Show not-genuin-sony-controller message also for DS5 when calibration can't be started
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
import { sleep, la } from './utils.js';
|
||||
import { l } from './translations.js'
|
||||
|
||||
const NOT_GENUINE_SONY_CONTROLLER_MSG = "Your device might not be a genuine Sony controller. If it is not a clone then please report this issue.";
|
||||
|
||||
/**
|
||||
* Controller Manager - Manages the current controller instance and provides unified interface
|
||||
*/
|
||||
@@ -211,7 +213,7 @@ class ControllerManager {
|
||||
async calibrateSticksBegin() {
|
||||
const res = await this.currentController.calibrateSticksBegin();
|
||||
if (!res.ok) {
|
||||
throw new Error(`${l("Stick calibration failed")}. ${res.error?.message}`, { cause: res.error });
|
||||
throw new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG), { cause: res.error });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +247,7 @@ class ControllerManager {
|
||||
async calibrateRangeBegin() {
|
||||
const res = await this.currentController.calibrateRangeBegin();
|
||||
if (!res.ok) {
|
||||
throw new Error(`${l("Stick calibration failed")}. ${res.error?.message}`, { cause: res.error });
|
||||
throw new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG), { cause: res.error });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ import {
|
||||
} from '../utils.js';
|
||||
import { l } from '../translations.js';
|
||||
|
||||
const NOT_GENUINE_SONY_CONTROLLER_MSG = "Your device might not be a genuine Sony controller. If it is not a clone then please report this issue.";
|
||||
|
||||
// DS4 Button mapping configuration
|
||||
const DS4_BUTTON_MAP = [
|
||||
{ name: 'up', byte: 4, mask: 0x0 }, // Dpad handled separately
|
||||
@@ -256,7 +254,7 @@ class DS4Controller extends BaseController {
|
||||
la("ds4_calibrate_range_begin_failed", {"d1": d1, "d2": d2});
|
||||
return {
|
||||
ok: false,
|
||||
error: new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG)),
|
||||
error: new Error(`Stick range calibration begin failed: ${d1}, ${d2}`),
|
||||
code: 1, d1, d2
|
||||
};
|
||||
}
|
||||
@@ -304,7 +302,7 @@ class DS4Controller extends BaseController {
|
||||
la("ds4_calibrate_sticks_begin_failed", {"d1": d1, "d2": d2});
|
||||
return {
|
||||
ok: false,
|
||||
error: new Error(l(NOT_GENUINE_SONY_CONTROLLER_MSG)),
|
||||
error: new Error(`Stick center calibration begin failed: ${d1}, ${d2}`),
|
||||
code: 1, d1, d2,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user