raphaelgoulart / ya_inputdisplay

Yet another input display for Clone Hero / YARG
16 stars 3 forks source link

Fix Program Freeze on Gamepad Connect + Correct Window Size Limits #22

Closed SkyJumper409x closed 2 months ago

SkyJumper409x commented 2 months ago

Freeze on Gamepad connect: InputBtns would almost immediately receive a device's Axis inputs upon connect, but, because the device didn't exist during previous Singleton.calibrate() calls, this would result in a LOT of console errors relating to the input device's index not existing in Singleton.calibration, which would be accessed by Singleton.process_axis_input() calls of the InputBtns. To counteract this, Singleton.calibrate() will be run if a new device is detected, which should update Singleton.calibration before any inputs can be received by InputBtns.

Window size limits: This one is a silly oversight of mine. Originally, the Config UI was part of the main Window, instead of floating above in a seperate window. Because of this, the limit on Window size is way larger than it needs to be. It is now set to 250 (InputBtn width ×5). Also, the previous minimum height was 64 as anything lower causes issues with Godot. It is now set to 100, which makes the new minimum Window size neatly fit to the InputBtns.