Shtoyan 2 years ago
parent
commit
92bbaef9c4
  1. 10
      config/AcediaMaps.ini
  2. 1
      sources/AcediaLauncherMut.uc
  3. 9
      sources/StartUp.uc
  4. 40
      sources/VotingHandlerAdapter.uc

10
config/AcediaMaps.ini

@ -1,3 +1,7 @@
[defaultHard MapList] [default MapList]
autoEnable=true
[defaultHOE MapList] map="KF-BioticsLab"
map="KF-Farm"
map="KF-Manor"
map="KF-Offices"
map="KF-WestLondon"

1
sources/AcediaLauncherMut.uc

@ -45,6 +45,7 @@ simulated function PreBeginPlay()
} }
if (votingAdapter != none) { if (votingAdapter != none) {
votingAdapter.InjectIntoVotingHandler(); votingAdapter.InjectIntoVotingHandler();
votingAdapter.TrySetupMapList();
} }
SetupMutatorSignals(); SetupMutatorSignals();
} }

9
sources/StartUp.uc

@ -50,7 +50,6 @@ private function InitializeServer()
{ {
local int i; local int i;
local GameMode currentGameMode; local GameMode currentGameMode;
local MapList_Feature mapListFeature;
local array<Packages.FeatureConfigPair> availableFeatures; local array<Packages.FeatureConfigPair> availableFeatures;
if (class'Packages'.default.clientside) { if (class'Packages'.default.clientside) {
@ -80,11 +79,6 @@ private function InitializeServer()
} }
} }
EnableFeatures(availableFeatures); EnableFeatures(availableFeatures);
mapListFeature = MapList_Feature(class'MapList_Feature'.static.GetEnabledInstance());
if (mapListFeature != none) {
warn("aaaaaaaa");
}
} }
// Checks whether Acedia has left garbage after the previous map. // Checks whether Acedia has left garbage after the previous map.
@ -131,6 +125,9 @@ public function array<Packages.FeatureConfigPair> GetAutoConfigurationInfo()
local array<Packages.FeatureConfigPair> result; local array<Packages.FeatureConfigPair> result;
availableFeatures = _.environment.GetAvailableFeatures(); availableFeatures = _.environment.GetAvailableFeatures();
// We only have a single feature, so instead of adding our own manifest, simply add it here
class'MapList_Feature'.static.LoadConfigs();
availableFeatures[availableFeatures.length] = class'MapList_Feature';
for (i = 0; i < availableFeatures.length; i += 1) for (i = 0; i < availableFeatures.length; i += 1)
{ {
autoConfig = availableFeatures[i].static.GetAutoEnabledConfig(); autoConfig = availableFeatures[i].static.GetAutoEnabledConfig();

40
sources/VotingHandlerAdapter.uc

@ -139,6 +139,46 @@ public final function InjectIntoVotingHandler()
votingHandler.gameConfig = newVotingHandlerConfig; 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( private function VotingHandler.MapVoteGameConfig BuildVotingHandlerConfig(
GameMode gameMode) GameMode gameMode)
{ {

Loading…
Cancel
Save