add empty line after standard options
Rationale:
When a mod adds a custom option menu, it adds a space before it, like this:
```
AddOptionMenu OptionsMenu
{
StaticText ""
Submenu "$MYTITLE", MyOptions
}
```
to prevent custom option menu being in the same block as the last entries in the
standard options list. It's okay.
But when more than one such mod is loaded, each one of them adds a space before
their option menu entry, and Options Menu becomes unnecessary bloated.
This simple edit allows mods to not add a space, still be separated from
standard options.
This commit is contained in:
parent
f16c09badb
commit
d6396e79fb
2 changed files with 14 additions and 0 deletions
|
|
@ -385,6 +385,7 @@ OptionMenu "OptionsMenu" protected
|
|||
SafeCommand "$OPTMNU_DEFAULTS", "reset2defaults"
|
||||
SafeCommand "$OPTMNU_RESETTOSAVED", "reset2saved"
|
||||
Command "$OPTMNU_CONSOLE", "menuconsole"
|
||||
StaticText " "
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -106,6 +106,19 @@ class OptionMenu : Menu
|
|||
mParentMenu = parent;
|
||||
mDesc = desc;
|
||||
DontDim = desc.mDontDim;
|
||||
|
||||
let last = mDesc.mItems[mDesc.mItems.size() - 1];
|
||||
bool lastIsText = (last is "OptionMenuItemStaticText");
|
||||
if (lastIsText)
|
||||
{
|
||||
String text = last.mLabel;
|
||||
bool lastIsSpace = (text == "" || text == " ");
|
||||
if (lastIsSpace)
|
||||
{
|
||||
mDesc.mItems.Pop();
|
||||
}
|
||||
}
|
||||
|
||||
if (mDesc != NULL && mDesc.mSelectedItem == -1) mDesc.mSelectedItem = FirstSelectable();
|
||||
mDesc.CalcIndent();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue