OK, the patch is finally ready. With it, you can define any number of resolutions for main halls, as well as when and how each resolution is displayed. Here it is:
https://dl.dropboxusercontent.com/u/89353583/FreeSpace/Patches/main_hall_enhancement.patchAnd here is a build, based on revision 10842:
https://dl.dropboxusercontent.com/u/89353583/FreeSpace/Patches/main_hall_enhancement_build.zipI have also made a mod (here) that includes two simple main halls for testing this feature, each with its own campaign file:
https://dl.dropboxusercontent.com/u/89353583/FreeSpace/main_hall_test.zipDetails are in the campaign descriptions.
Now, on to the documentation. This feature adds some additional parameters to mainhall.tbl. Below is a sample table showing each of these parameters, with the new ones marked. More details on these are provided below the table.
;file-wide parameter
$Num Resolutions: 1 ;*new*
;main halls start here
$Main Hall
+Name: mymainhall
+Min Resolution: 1024 768 ;*new*
+Min Aspect Ratio: 1.2 ;*new*
+Bitmap: whatever ;pretend that the resolution of this bitmap is 1920x1080, although any resolution is valid
+Mask: whatever-m
+Music: something
+Substitute Music: something-else
+Help Overlay: anything
+Help Overlay Resolution Index: 2 ;*new*
+Zoom To: 1440 1080 ;*new*
;sounds and animations go here
+Font: 2 ;*new*
+Tooltip Padding: 7 ;*new*
+Tooltip Y: 1065 ;not new, but see note
;more main halls go here
#end
(All of the parameters below are optional unless otherwise noted.)
$Num Resolutions:Defines the number of resolutions of each main hall in this file. Other main-hall tables are not affected, so you can have, say, two resolutions in mainhall.tbl and three in extrahalls-hall.tbm without messing up the former table.
If there are multiple resolutions, the game will pick the last one that is valid for the screen resolution and aspect ratio. If none are valid, or only one resolution exists, then the first one is used. This is done per main hall, not globally.
The default value is 2.
+Min Resolution:Defines the minimum valid resolution for this main-hall configuration. Has no effect if this configuration is for the first resolution.
The default value is 0 0 for the first resolution and 1024 600 for subsequent resolutions.
+Min Aspect Ratio:Defines the narrowest valid aspect ratio for this main-hall configuration. The argument is a single floating-point number that is the quotient of width / height. Has no effect if this configuration is for the first resolution.
Because of possible rounding errors, avoid setting this to a value that exactly matches a common aspect ratio (e.g., 1.6 for 16:10). Instead, set it to a slightly lower value (e.g., 1.59).
The default value is 0.0.
+Help Overlay Resolution Index:Sets which overlay resolution to use. (With this patch, help.tbl entries are no longer limited to just two resolutions; they can now have just one, three, or more. See the end of this post for details.)
The default value is 0 for the first main-hall resolution, 1 for the second, 2 for the third, and so on.
+Zoom To:If set, tells the game to zoom in to this area of the main hall, cropping off the edges if necessary. This parameter allows you to make a single main-hall configuration that supports a range of aspect ratios without black bars or stretching.
In the example table above, the background bitmap is 1920x1080, but the zoom area is 1440x1080 (a 4:3 resolution). In this instance, if the screen aspect ratio is narrower than 16:9 but not narrower than 4:3, then the sides are cropped off so that the screen can be filled. If the aspect ratio is narrower than 4:3, then the main hall is still cropped to the 4:3 area, leaving black bars if -stretch_menu is not set. The reverse is also possible; the background could be 1280x960 with the zoom area being 1280x720. One of the main halls in the example mod even combines these examples!
If you do use this parameter, then make sure that all of the doors (or buttons) are inside the zoom area. If you don't, then they may go offscreen, making them impossible to click!
+Font:Defines the font used for the text in this main hall. The number here points to a font entry in fonts.tbl, with 0 pointing to the first one. Does not affect pop-up messages or the F1 overlay.
The default value is 0 (normally font01.vf).
+Tooltip Padding:Defines how much the shading area should extend above the tooltips. Also affects the "Press F1 for help" text at the top.
This was previously hardcoded as two values, one for each resolution: 4 for 640x480 and 7 for 1024x768. These are still used as the default values.
+Tooltip Y:EDIT: This parameter is no longer required in my patch. If it's omitted, then the game will place tooltips at the bottom of the visible main-hall area.This parameter isn't new; in fact, it's been required since retail,
and it still is. However, because main halls can now use resolutions other than 640x480 and 1024x768, and because perhaps only two people other than Volition employees have even looked at it, it deserves attention. The value here tells the game where to place the tooltips, which appear when you hover your mouse over a door. This value works like the Y values of the animations, meaning the tooltips are actually placed on a specific part of the main hall,
not a certain number of pixels from the bottom of the screen! Because of this, you may need to adjust this to suit your main hall's resolution. To get a good value for this parameter, I suggest using the following formula:
height - ((height - zh) / 2) - fh - 4...where:
height = the height of the main hall
zh = the height of the zoom area; if no zoom area is defined, then use the main hall's height instead
fh = the height of the font (9 for font01, 18 for font02, and 11 for font03)
Help.tbl/*-hlp.tbm has also been extended to support more than two resolutions. Two new optional parameters have been added, both of which belong at the beginning of a section, just after the section name. Here they are:
+resolutionsDefines the number of resolutions in this overlay. May be 1 or greater.
If this is set to anything other than 2, then all other parameters in this overlay that normally take two sets of values must now have a set of values for each resolution. For example, if an overlay has four resolutions, then any bracket parameter must have four pairs of values instead of two.
The default value is 2.
+fontDefines the font used for the text in this overlay. The number here points to a font entry in fonts.tbl, with 0 pointing to the first one. Takes one value for each resolution.
The default value for each resolution is 0 (normally font01.vf).
Oh, and this patch allows preload screens to be any resolution and aspect ratio, not just 640x480 and 1024x768. However, the two-resolution limit is still there, and the resolutions are chosen in the same manner as before, with 1024x600 being the minimum for the higher resolution.