Open natrius opened 3 years ago
Looking into UIni.pas I find starting at line 211:
// WebCam
WebCamID: integer;
WebcamResolution: integer;
WebCamFPS: integer;
WebCamFlip: integer;
WebCamBrightness: integer;
WebCamSaturation: integer;
WebCamHue: integer;
WebCamEffect: integer;
But starting at line 2149:
// WebCam
IniFile.WriteInteger('Webcam', 'ID', WebCamID);
IniFile.WriteString('Webcam', 'Resolution', IWebcamResolution[WebcamResolution]);
IniFile.WriteInteger('Webcam', 'FPS', StrToInt(IWebcamFPS[WebCamFPS]));
IniFile.WriteString('Webcam', 'Flip', IWebcamFlip[WebcamFlip]);
IniFile.WriteString('Webcam', 'Brightness', IWebcamBrightness[WebcamBrightness]);
IniFile.WriteString('Webcam', 'Saturation', IWebcamSaturation[WebcamSaturation]);
IniFile.WriteString('Webcam', 'Hue', IWebcamHue[WebcamHue]);
IniFile.WriteInteger('Webcam', 'Effect', WebcamEffect);
So, the WebcamFlip
in line 2154 is the first where the casing does not match. Could this be the source of the error? I do not know enough about Pascal. I mean it should be case-insenstive, right? But it is a strange coincidence.
It is indeed coincidence, the error is clearly the following line:
WebCamFlip := ReadArrayIndex(IWebcamFlipTranslated, IniFile, 'Webcam', 'Flip', IGNORE_INDEX, 'On');
where it should read IWebcamFlip
instead (without the Translated
). I'll prepare a PR.
Interesting, because it happened just once. The next time it did not happen again, will check again after another restart. Thanks for looking into it @HermannDppes :)
Do you recall whether you changed around themes (or at least opened the corresponding submenu) in the USDX session that threw this error?
I have a repro on a fresh build from the current master.
This will consistently crash. The crash does not occur otherwise as changing a theme is one of the rare instances (maybe the only one?) where the Ini file is read after the initial read, during which the locale is still identical with the English version.
Yes, pretty sure i changed the theme. Was looking at the themes and so on.
Actual behaviour
Tell us what happens
Expected behaviour
No error.
Steps to reproduce
Not reproduceable right now, but a smilar error happened before already.
Details
Provide some additional information: