Browse Source

Fix game modes' colors not working in KFMapVoteV2

develop
Anton Tarasenko 2 years ago
parent
commit
c8eac38d35
  1. 2
      sources/GameModes/GameMode.uc
  2. 4
      sources/Packages.uc
  3. 15
      sources/VotingHandlerAdapter.uc

2
sources/GameModes/GameMode.uc

@ -140,7 +140,7 @@ public function Text GetAcronym()
return _.text.FromString(string(name)); return _.text.FromString(string(name));
} }
else { else {
return _.text.FromString(acronym); return _.text.FromFormattedString(acronym);
} }
} }

4
sources/Packages.uc

@ -103,13 +103,15 @@ private function InitializeServer()
{ {
votingAdapter = VotingHandlerAdapter( votingAdapter = VotingHandlerAdapter(
_.memory.Allocate(class'VotingHandlerAdapter')); _.memory.Allocate(class'VotingHandlerAdapter'));
votingAdapter.InjectIntoVotingHandler();
currentGameMode = votingAdapter.SetupGameModeAfterTravel(); currentGameMode = votingAdapter.SetupGameModeAfterTravel();
if (currentGameMode != none) { if (currentGameMode != none) {
currentGameMode.UpdateFeatureArray(availableFeatures); currentGameMode.UpdateFeatureArray(availableFeatures);
} }
} }
EnableFeatures(availableFeatures); EnableFeatures(availableFeatures);
if (votingAdapter != none) {
votingAdapter.InjectIntoVotingHandler();
}
} }
// "Finalizer" // "Finalizer"

15
sources/VotingHandlerAdapter.uc

@ -139,12 +139,23 @@ public final function InjectIntoVotingHandler()
private function VotingHandler.MapVoteGameConfig BuildVotingHandlerConfig( private function VotingHandler.MapVoteGameConfig BuildVotingHandlerConfig(
GameMode gameMode) GameMode gameMode)
{ {
local MutableText nextColoredName;
local VotingHandler.MapVoteGameConfig result; local VotingHandler.MapVoteGameConfig result;
result.gameClass = _.text.IntoString(gameMode.GetGameTypeClass()); result.gameClass = _.text.IntoString(gameMode.GetGameTypeClass());
result.gameName = _.text.ToColoredString(gameMode.GetTitle());
result.prefix = _.text.IntoString(gameMode.GetMapPrefix()); result.prefix = _.text.IntoString(gameMode.GetMapPrefix());
result.acronym = _.text.IntoString(gameMode.GetAcronym()); nextColoredName = gameMode
.GetTitle()
.IntoMutableText()
.ChangeDefaultColor(_.color.white);
result.gameName = _.text.IntoColoredString(nextColoredName)
$ _.color.GetColorTag(_.color.White);
nextColoredName = gameMode
.GetAcronym()
.IntoMutableText()
.ChangeDefaultColor(_.color.white);
result.acronym = _.text.IntoColoredString(nextColoredName)
$ _.color.GetColorTag(_.color.White);
result.mutators = BuildMutatorString(gameMode); result.mutators = BuildMutatorString(gameMode);
result.options = BuildOptionsString(gameMode); result.options = BuildOptionsString(gameMode);
return result; return result;

Loading…
Cancel
Save