[closes #13] enhanced observer mode additions and cleanup (#45)

* additions and cleanup [skip ci]

* disallow observers to change their faction and team [skip ci]

* disable observer slots from admin control

* when checkboxObserversAllowed is toggled, update correctly

* Also adjusted the labels better

* when scenario is checked, observer mode is disabled and extra slots are
closed

* attempted to add a feature that would allow the admin to change to a
different slot (doesn't work yet)

* graphics still needs some adjustment

* host can not go to a slot > mapInfo.maxPlayers
This commit is contained in:
Andy Alt
2018-02-05 16:01:29 -06:00
committed by GitHub
parent 7caa602e46
commit a8255e5c97
5 changed files with 199 additions and 93 deletions

View File

@@ -1107,6 +1107,10 @@ bool MapPreview::loadMapInfo(string file, MapInfo *mapInfo, string i18nMaxMapPla
mapInfo->size.y = header.height;
mapInfo->players= header.maxFactions;
// hardMaxPlayers is used in menu_state_custom_game, as part of
// enhanced observer mode (issue #13)
mapInfo->hardMaxPlayers = mapInfo->players;
mapInfo->desc = i18nMaxMapPlayersTitle + ": " + intToStr(mapInfo->players) + "\n";
mapInfo->desc += i18nMapSizeTitle + ": " + intToStr(mapInfo->size.x) + " x " + intToStr(mapInfo->size.y);