Move the Quick Test button

This commit is contained in:
Mathias Malmqvist
2025-09-23 23:01:19 +02:00
committed by dualshock-tools
parent b3712a24c2
commit 53fd91fdb3
4 changed files with 32 additions and 20 deletions

View File

@@ -137,11 +137,17 @@
</div>
<br>
<div class="my-3 text-center mx-3" id="controller-svg-container">
<div class="d-flex justify-content-end">
<button type="button" class="btn btn-outline-primary ds-btn ds-i18n mb-3" onclick="show_quick_test_modal()" id="quick-test-btn">
<i class="fas fa-vial" id="quick-test-icon"></i>&nbsp;&nbsp;
<span id="quick-test-text">Quick Test</span>
</button>
</div>
<div class="text-center mx-3" id="controller-svg-container">
<!-- DualSense 5 Controller SVG loaded from template -->
<div id="controller-svg-placeholder"></div>
</div>
<br>
</div>
<div class="col-md-6 col-sm-12" style="min-width: 330px;">
@@ -150,10 +156,6 @@
<button type="button" class="btn btn-primary ds-btn ds-i18n" onclick="calibrate_range()">Calibrate stick range</button>
<button type="button" class="btn btn-primary ds-btn" onclick="ds5_finetune()" id="ds5finetune"><span class="ds-i18n">Finetune stick calibration</span> <i id="ds-i18n">(beta)</i></button>
<button id="btnmcs" type="button" class="btn btn-outline-secondary ds-btn ds-i18n" onclick="auto_calibrate_stick_centers()">Fast calibrate stick center (OLD)</button>
<button type="button" class="btn btn-info ds-btn ds-i18n" onclick="show_quick_test_modal()" id="quick-test-btn" style="display: none;">
<i class="fas fa-vial" id="quick-test-icon"></i>&nbsp;&nbsp;
<span id="quick-test-text">Quick Test</span>
</button>
<hr>
<button id="savechanges" type="button" class="btn btn-success ds-btn ds-i18n" onclick="flash_all_changes()" id="resetBtn">Save changes permanently</button>
<button type="button" class="btn btn-danger ds-btn ds-i18n" onclick="reboot_controller()" id="resetBtn">Reboot controller</button>

View File

@@ -314,8 +314,8 @@ class DS5Controller extends BaseController {
{ key: l("FW Type"), value: "0x" + dec2hex(fwtype), cat: "fw", isExtra: true },
{ key: l("FW Series"), value: "0x" + dec2hex(swseries), cat: "fw", isExtra: true },
{ key: l("HW Model"), value: "0x" + dec2hex32(hwinfo), cat: "hw", isExtra: true },
{ key: l("FW Version"), value: "0x" + dec2hex32(fwversion), cat: "fw" },
{ key: l("FW Update"), value: "0x" + dec2hex(updversion), cat: "fw" },
{ key: l("FW Version"), value: "0x" + dec2hex32(fwversion), cat: "fw", isExtra: true },
{ key: l("FW Update"), value: "0x" + dec2hex(updversion), cat: "fw", isExtra: true },
{ key: l("FW Update Info"), value: "0x" + dec2hex8(unk), cat: "fw", isExtra: true },
{ key: l("SBL FW Version"), value: "0x" + dec2hex32(fwversion1), cat: "fw", isExtra: true },
{ key: l("Venom FW Version"), value: "0x" + dec2hex32(fwversion2), cat: "fw", isExtra: true },
@@ -334,7 +334,7 @@ class DS5Controller extends BaseController {
const nv = await this.queryNvStatus();
const bd_addr = await this.getBdAddr();
infoItems.push({ key: l("Bluetooth Address"), value: bd_addr, cat: "hw" });
infoItems.push({ key: l("Bluetooth Address"), value: bd_addr, cat: "hw", isExtra: true });
const pending_reboot = (nv?.status === 'pending_reboot');

View File

@@ -101,13 +101,13 @@ export class QuickTestModal {
const allTestsCompleted = this._areAllTestsCompleted();
if (activeTest === 'buttons') {
$instructionsText.html(this.l('Test all buttons, or long-press <kbd>Square</kbd> to Pass and <kbd>Cross</kbd> to Fail'));
$instructionsText.html(this.l('Test all buttons, or long-press <kbd>Square</kbd> to Pass and <kbd>Cross</kbd> to Fail, or <kbd>Circle</kbd> to skip.'));
} else if (activeTest) {
$instructionsText.html(this.l('Press <kbd>Square</kbd> to Pass or <kbd>Cross</kbd> to Fail'));
$instructionsText.html(this.l('Press <kbd>Square</kbd> to Pass, <kbd>Cross</kbd> to Fail, or <kbd>Circle</kbd> to skip.'));
} else if (allTestsCompleted) {
$instructionsText.html(this.l('Press <kbd>Circle</kbd> to close, or <kbd>Square</kbd> to start over'));
} else {
$instructionsText.html(this.l('Press <kbd>Square</kbd> to begin'));
$instructionsText.html(this.l('Press <kbd>Square</kbd> to begin or <kbd>Circle</kbd> to close'));
}
}
@@ -688,7 +688,15 @@ export class QuickTestModal {
} else if (changes.triangle === true) {
handleButtonPress(() => this._moveToPreviousTest());
} else if (changes.circle === true) {
handleButtonPress(() => bootstrap.Modal.getOrCreateInstance('#quickTestModal').hide());
handleButtonPress(() => {
if (activeTest) {
// Skip the current test by expanding the next one
this._expandNextTest(activeTest);
} else {
// Close the modal if no test is active
bootstrap.Modal.getOrCreateInstance('#quickTestModal').hide();
}
});
}
}
@@ -707,7 +715,7 @@ export class QuickTestModal {
*/
_trackButtonPresses(changes) {
BUTTONS.forEach(button => {
const handleLongpress = ['cross', 'square', 'triangle'].includes(button);
const handleLongpress = ['cross', 'square', 'triangle', 'circle'].includes(button);
if (changes[button] === true) {
// Button pressed - increment count and show dark blue infill
this.state.buttonPressCount[button]++;
@@ -796,6 +804,8 @@ export class QuickTestModal {
this.markTestResult('buttons', false);
} else if (button === 'triangle') {
this._moveToPreviousTest();
} else if (button === 'circle') {
this._expandNextTest(activeTest);
}
}
@@ -913,8 +923,8 @@ function destroyCurrentInstance() {
export function updateQuickTestButtonVisibility(controller) {
const $button = $('#quick-test-btn');
const model = controller?.getModel();
const supported = (controller?.isConnected() && (model === "DS5" || model === "DS5_Edge"));
$button.css('display', supported ? 'block' : 'none');
const supported = (controller?.isConnected() && (model === "DS5" /* || model === "DS5_Edge" */));
$button.toggleClass('disabled', !supported);
}
/**

View File

@@ -7,7 +7,7 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p class="ds-i18n mb-3">Run through these tests to verify your controller's functionality. Click on each test to expand and follow the instructions.</p>
<p class="ds-i18n mb-3">Run through these tests to verify your controller's functionality.</p>
<div class="alert alert-info mb-4" id="quick-test-instructions">
<i class="fas fa-gamepad me-2"></i>
<span class="ds-i18n" id="quick-test-instructions-text">Press <kbd>Square</kbd> to begin</span>
@@ -31,7 +31,7 @@
<p class="ds-i18n"><strong>Instructions:</strong> Wiggle the USB cable to see if the controller disconnects.</p>
<div class="alert alert-warning mb-3">
<i class="fas fa-exclamation-triangle me-2"></i>
<span class="ds-i18n">Be gentle avoid damage.</span>
<span class="ds-i18n">Be gentle to avoid damage.</span>
</div>
<div class="d-flex gap-2 mt-3">
<button type="button" class="btn btn-success" id="usb-pass-btn" onclick="markTestResult('usb', true)">
@@ -59,7 +59,7 @@
<div id="buttons-test-collapse" class="accordion-collapse collapse" data-bs-parent="#quickTestAccordion">
<div class="accordion-body">
<p class="ds-i18n">This test checks all controller buttons by requiring you to press each button three times.</p>
<p class="ds-i18n"><strong>Instructions:</strong> Press each button on the controller three times. Buttons will change from light blue to dark blue to green as you press them.</p>
<p class="ds-i18n"><strong>Instructions:</strong> Press each button until they turn green.</p>
<div class="d-flex justify-content-center mb-3">
<div style="width: 80%; max-width: 400px;" id="quick-test-controller-svg-placeholder">
@@ -69,7 +69,7 @@
<div class="alert alert-info mb-3">
<i class="fas fa-info-circle me-2"></i>
<span class="ds-i18n">The test will automatically pass when all buttons turn green (pressed 3 times each).</span>
<span class="ds-i18n">The test will automatically pass when all buttons have turned green.</span>
</div>
<div class="d-flex gap-2 mt-3">