#6719 closed defect (fixed)
SCUMM: In-game help missing line of text on 2nd help screen
Reported by: | BenCastricum | Owned by: | bluegr |
---|---|---|---|
Priority: | normal | Component: | Engine: SCUMM |
Version: | Keywords: | ||
Cc: | Game: |
Description
The SCUMM engine in-game help is missing a line of text. It seems it has disappeared since v1.5 of ScummVM. Two screenshots attached (one of a v1.4 and one of v1.7 of ScummVM) both from the official win32 distribution.
Ticket imported from: bugs/6719.
Attachments (3)
Change History (11)
by , 10 years ago
comment:1 by , 10 years ago
Summary: | SCUMM in-game help missing line of text on 2nd help screen → SCUMM: In-game help missing line of text on 2nd help screen |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
The code for this "in-game help" for SCUMM engine games is found in: https://github.com/scummvm/scummvm/blob/master/engines/scumm/help.cpp
comment:4 by , 10 years ago
specifically the line: https://github.com/scummvm/scummvm/blob/master/engines/scumm/help.cpp#L110 is the responsible code.
However, none of the code in this file has been changed between v1.5 and v1.6.
I suspect the cause will be a change in the GUI or font common code as the font is notably different between the screenshots.
comment:5 by , 10 years ago
Ah... This code is where the strings for this dialog are setup, but the actual display of the dialog is here: https://github.com/scummvm/scummvm/blob/master/engines/scumm/dialogs.cpp#L304
This again has no likely relevant changes, but a change in StaticTextWidget may be the cause. A simple fix would be to reduce HELP_NUM_LINES to 14: https://github.com/scummvm/scummvm/blob/master/engines/scumm/help.h#L31
However, this could break again in future if there is an issue with the reflow / overflow of contents detection for these dialogs...
by , 10 years ago
Attachment: | help-v1.8-patched.png added |
---|
comment:6 by , 10 years ago
The cause of this is the use of a larger font since 1.4. https://github.com/scummvm/scummvm/blob/master/engines/scumm/dialogs.cpp#L307 get's the lineheight. This used to be 14, but is now 15.
Possible solutions to this are : - Remove the recalculation of _numLines at dialogs.cpp:315. The height of the widget is 220, 220/15=14,66666667 which gets rounded down to 14. While it used to be 220/14=15,71428571 which is rounded to 15 lines. Removing the calculation will cause the default of 15 (HELP_NUM_LINES) being used. A screenshot is attached of how that will look (on Win7) - Change the formula, since it looks like 15 lines easily fit in this widget it might need an update. - Remove one of the empty lines (ADD_LINE) from the help.cpp:103 making the help fit in 14 lines. - Change the font to one with a height of 14 again.
comment:7 by , 10 years ago
Ben has submitted a fix for this as a Pull Request here: https://github.com/scummvm/scummvm/pull/503
Once this fix gets merged, this bug can be closed as fixed.
comment:8 by , 10 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:9 by , 10 years ago
Merged Ben Castricum's pull request. The changes are minimal and fix the help dialog with the new theme. The fix will be available in the next daily version of ScummVM.
Thanks Ben for all the work on this issue! :)
Closing as fixed.
Comparing the images, this is due to the last line "or incorrect game behavior." being hidden off the bottom of the text box i.e. the amount of text is too big for the box in the font used...