Fixed a crash on empty mission options.
This commit is contained in:
committed by
Gustas
parent
446d37b832
commit
387554acbb
@@ -45,6 +45,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
[TranslationReference]
|
[TranslationReference]
|
||||||
const string CantPlayCancel = "dialog-cant-play-video.cancel";
|
const string CantPlayCancel = "dialog-cant-play-video.cancel";
|
||||||
|
|
||||||
|
[TranslationReference]
|
||||||
|
const string NotAvailable = "label-not-available";
|
||||||
|
|
||||||
readonly ModData modData;
|
readonly ModData modData;
|
||||||
readonly Action onStart;
|
readonly Action onStart;
|
||||||
readonly Widget missionDetail;
|
readonly Widget missionDetail;
|
||||||
@@ -379,7 +382,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
var dropdown = dropdownColumns.Dequeue();
|
var dropdown = dropdownColumns.Dequeue();
|
||||||
|
|
||||||
dropdown.GetText = () => option.Values[missionOptions[option.Id]];
|
dropdown.GetText = () =>
|
||||||
|
{
|
||||||
|
if (option.Values.TryGetValue(missionOptions[option.Id], out var value))
|
||||||
|
return value;
|
||||||
|
|
||||||
|
return TranslationProvider.GetString(NotAvailable);
|
||||||
|
};
|
||||||
|
|
||||||
if (option.Description != null)
|
if (option.Description != null)
|
||||||
{
|
{
|
||||||
var (text, desc) = LobbyUtils.SplitOnFirstToken(option.Description);
|
var (text, desc) = LobbyUtils.SplitOnFirstToken(option.Description);
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ options-slot-admin =
|
|||||||
button-general-chat = All
|
button-general-chat = All
|
||||||
button-team-chat = Team
|
button-team-chat = Team
|
||||||
|
|
||||||
## LobbyOptionsLogic
|
## LobbyOptionsLogic, MissionBrowserLogic
|
||||||
label-not-available = Not Available
|
label-not-available = Not Available
|
||||||
|
|
||||||
## LobbyUtils
|
## LobbyUtils
|
||||||
|
|||||||
Reference in New Issue
Block a user