Lobby Enhancement Mod 4.6 (11-26-11)

The purpose of this mod is to give modders a way to add custom options, custom AIs, custom unit restrictions, and custom tooltips to the game lobby without canceling each others work out.

This mod also enhances the game lobby with the following features:

Team randomization.
Team setup based on map location.
Map randomization.
Disable all mods button.
Enhanced mod manager color scheme.
Fill open slots with selected AIs.
Support for mod manager compatible handicap mod.

When you join or create a game a message will be broadcast into the lobby stating what AIs you have installed so the host can make sure that everyone has the same AIs and versions. It can also serve as a reminder in case you forget to turn your AI mods off when you join a game that is not using custom AIs.

Mod Manager color codes:
Green (GPG) = Mod is active and can be toggled
Black (GPG) = Mod is inactive and can be toggled
Yellow (New LEM) = Mod is active and cannot be toggled
Red outline (New LEM) = Mod is inactive and cannot be toggled

######################
#     More info:     #
######################

For more infotmation, or to leave feedback, visit my forum thread:
http://forums.gaspowered.com/viewtopic.php?t=33944

######################
#   Release Notes:   #
######################

0.1-0.3:
initial releases

0.4:
Added support for custom lobby options and a button to fill all open, empty slots with an AI.

0.5:
Added support for custom unit restrictions.

0.6:
Added option to randomly assign teams.
Fixed a bug where the "Add _ AIs" options would not show in skirmish.
Fixed a bug where if you left the lobby and came back there would be no AIs listed in the "Add _ AIs" dropdown. 

0.7:
Team randomization should be fixed.

0.8:
Fixed the "Add _ AI" option. 

0.9:
Add _ AI should now be fixed for skirmish as well.

1.0:
Added some more things to make it more obvious that LEM is active and what version.

1.1:
Version 1.1 is like the light version (UI only), except it has support for the new Handicap Plugin.

1.2:
Mod Manager now has a disable all button.
Game Lobby and Game Options screens have a random map button. (based loosely on Moritz's code)

1.3:
Mods in the Mod Manager are now sorted by name.
Code based on Gilbot-X's work.

1.4:
When adding AIs to the game they will automatically be assigned a random faction.

1.5:
The handicap plugin can only be enabled or disabled my going to the mod manager from the main menu, not from the lobby.

1.6:
Added new mod manager color coding.

1.7:
Fixes the MAINMENU_009# bug for US language versions.

1.8:
Fixes a bug that can occur when switching the handicap mod on/off between games.

1.9:
There is now a message in the lobby when a random map is chosen.

2.0:
*Not released*

2.0b:
Fixed the MAINMENU_009# bug for French, Spanish, and Italian.

2.1:
Fixes a crash bug.

2.1b:
Fixes another potential bug when playing with someone that does not have LEM installed.

2.2:
Added some more options for unit cap.

2.3:
Changed the "Randomize" button to "Setup Teams".
Added 2 new options to the Setup Teams dropdown: L/R (Left vs Right) and T/B (Top vs Bottom). These options will not appear if spawn is set to random.
Fixed the new unit cap options. 

2.4:
Fixed L/R and T/B options. 

2.5:
Map select screen will now indicate whether or not the map has FA AI markers. 

2.6:
Code cleanup pass.
Commented code.
Fixed Team Setup dropdown resetting to 2.
Fixed code for T/B and L/R to speed it up.
Added tooltips to all the new stuff.
Reverted random faction option.

2.7:
Edited Map List function to take advantage of the continue statement to hopefully speed things up.
Added filter to map selection screen for AI Markers.
Renamed "FA Markers" to "AI Markers".

2.8:
Added button to remove all AIs.

2.9:
Added Clear AIs button to skirmish menu.
Fix for potential bug if a map has no markers at all.

3.0:
Clear AIs button will now be diabled when everyone is ready.
Fix for map missing save file.

3.1:
Another fix for map missing save file.

3.2:
A better fix for map missing save file.

3.3:
IsScenarioPlayable() will now fail gracefully if the maps _scenario file is bad.

3.4:
LEM will output version info when an observer joins.

3.5:
Random Map button in lobby will now be hidden until you enter the Game Options screen.
Random Map button in Game Options will now select a random map without kicking you out to the Lobby.
Unit Restrictions are now saved between games.

3.5b:
Clicking Random Map in the Game Options window will output text to the lobby again.
Fix for loading custom lobby stuff from mods.

3.6:
New indicator lights to show players LEM status.

3.7:
Fix for indicators when player switches from observer to player.

3.8:
Added missing tooltips for new unit caps.
The Setup Teams button will now be disabled when all players are marked ready.
Buttons will no longer be disabled in all AI games.

3.8b:
Buttons will no longer be disabled in all AI games, really.

3.8c:
Fix for disabled Launch button.

3.8d:
Re-release.

3.9:
Added right-click menu to player slots.

3.9b:
Bug fix.

3.9c:
Another bug-fix.

3.9d:
Bug fix for right-click menus.

4.0:
Mod Manager will sort active mods to the top.
Fix for missing tooltip for green indicator.
Typing '/lem' in the lobby chat box will display the LEM data for every player (usable by host only).

4.1:
Added save and load buttons to Mod Manager.
Added a warning when starting a game in Sandbox mode.

4.2:
Attempt to fix blank lobby issue.

4.3:
Added 30 min No Rush option.
Map Select screen will show No Rush radius.
Sandbox popup will only show if there are 2 or more players.

4.4:
Removed 30 min No Rush option.

4.6
Updated for Steam version of FA.