|
|
|
@ -139,6 +139,46 @@ public final function InjectIntoVotingHandler()
|
|
|
|
|
votingHandler.gameConfig = newVotingHandlerConfig; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function TrySetupMapList() { |
|
|
|
|
local MapList_Feature mapListFeature; |
|
|
|
|
local Text currentConfigName; |
|
|
|
|
local MapList currentConfig; |
|
|
|
|
|
|
|
|
|
warn(">>>>>>>> START!"); |
|
|
|
|
mapListFeature = MapList_Feature(class'MapList_Feature'.static.GetEnabledInstance()); |
|
|
|
|
currentConfigName = mapListFeature.GetCurrentConfig(); |
|
|
|
|
currentConfig = MapList(class'MapList'.static.GetConfigInstance(currentConfigName)); |
|
|
|
|
|
|
|
|
|
ReplaceHandlerMaps(XVotingHandler(votingHandlerReference.Get()), currentConfig.map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function ReplaceHandlerMaps(XVotingHandler votingHandler, array<string> maps) { |
|
|
|
|
local int i; |
|
|
|
|
local VotingHandler.MapVoteMapList nextRecord; |
|
|
|
|
local array<VotingHandler.MapVoteMapList> recordArray; |
|
|
|
|
|
|
|
|
|
if (votingHandler == none) { |
|
|
|
|
warn("votingHandler is none!"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (maps.length == 0) { |
|
|
|
|
warn("maps.length is 0!"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
recordArray = votingHandler.mapList; |
|
|
|
|
warn(">>> recordArray.length =" $ recordArray.length); |
|
|
|
|
|
|
|
|
|
recordArray.length = maps.length; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < maps.length; i += 1) { |
|
|
|
|
nextRecord.mapName = maps[i]; |
|
|
|
|
recordArray[recordArray.length] = nextRecord; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
votingHandler.mapList = recordArray; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private function VotingHandler.MapVoteGameConfig BuildVotingHandlerConfig( |
|
|
|
|
GameMode gameMode) |
|
|
|
|
{ |
|
|
|
|