javisar/ONI-Modloader-Mods

Export Daily Reports broken after CS-442712-D update

Opened this issue · 0 comments

Bug Description

Upon report export completion, the dialog box notifying that the export is complete is missing the OK button. There is no way to dismiss the dialog box and resume the gameplay.

Expected Behavior

I expect to be able to click OK to dismiss the info dialog and carry on with my game.

Current Behavior

Instead I am stuck on the export confirmation dialog, and cannot return to the game.

Steps to Reproduce

  1. Launch a game that has daily reports (has reached further than cycle 1).
  2. Access the main menu, select Options, and click on the Export Daily Reports button.
  3. The mod successfully exports the general and power reports to disk.
  4. The mod then displays a dialog box stating that the export was successfully.
  5. This dialog has no close/OK buttons, and cannot be dismissed with the Esc key.
  6. Thus, it is impossible to return to game play, and the whole game must be closed from the OS (Windows 10)

Possible Solution

After looking at the source code of the mod, and inspecting the game code, I have found that adding:

infoDialogScreen.AddDefaultOK(true);

to the dialog box setup in the mod fixes the issue. Apparently the default is to have neither OK nor Cancel buttons on an infoDialogScreen. This would obviously have to be done in the exception handlers, as well as the successful export infoDialogScreens.

Screenshots

Environment

  • OS: Windows 10
  • ONI Version: CS-442712-D
  • ONI-Modloader Version: BuiltIn

Additional context

The mod was working fine on AP-420700-D.

Output log

Relevant Code

To fix the issue, replace this:

infoDialogScreen.Show();

With this:

infoDialogScreen.AddDefaultOK(true); 
infoDialogScreen.Show();

in all places using infoDialogScreen. The 'true' parameter is "bool escapeCloses", which is false by default. It seems handy to set this to true though.