11 static protected const ResourceName DIALOGS_CONFIG =
"{F020A20CC93DB3C7}Configs/ContentBrowser/ScenarioDialogs.conf";
54 if (onFavoritesResponse)
65 super.OnMenuOpen(preset);
77 Widget backgroundImageBackend =
GetRootWidget().FindAnyWidget(
"BackgroundImageBackend");
78 if (backgroundImageBackend)
80 SCR_ScenarioBackendImageComponent backendImageComp = SCR_ScenarioBackendImageComponent.Cast(backgroundImageBackend.FindHandler(SCR_ScenarioBackendImageComponent));
86 Widget contentLayoutRoot = GetContentLayoutRoot(
GetRootWidget());
87 if (!contentLayoutRoot)
90 Widget singlePlayerImage = contentLayoutRoot.FindAnyWidget(
"SinglePlayerImageOverlay");
91 Widget multiPlayerImage = contentLayoutRoot.FindAnyWidget(
"MultiPlayerImageOverlay");
92 TextWidget playerCountLabelText = TextWidget.Cast(contentLayoutRoot.FindAnyWidget(
"PlayerCountLabelText"));
94 Widget sourceImageOfficial = contentLayoutRoot.FindAnyWidget(
"SourceImageOfficialOverlay");
95 Widget sourceImageCommunity = contentLayoutRoot.FindAnyWidget(
"SourceImageCommunityOverlay");
96 TextWidget sourceNameTextOfficial = TextWidget.Cast(contentLayoutRoot.FindAnyWidget(
"SourceNameTextOfficial"));
97 TextWidget sourceNameTextCommunity = TextWidget.Cast(contentLayoutRoot.FindAnyWidget(
"SourceNameTextCommunity"));
100 int playerCount =
m_Scenario.GetPlayerCount();
101 bool mp = SCR_ScenarioEntryHelper.IsMultiplayer(
m_Scenario);
102 singlePlayerImage.SetVisible(!mp);
103 multiPlayerImage.SetVisible(mp);
105 playerCountLabelText.SetText(WidgetManager.Translate(
"#AR-Scenario_Players", playerCount.ToString()));
108 bool isSourceAddonValid;
109 WorkshopItem sourceAddon =
m_Scenario.GetOwner();
113 isSourceAddonValid =
true;
114 sourceNameTextCommunity.SetText(sourceAddon.Name());
118 isSourceAddonValid =
false;
121 sourceImageOfficial.SetVisible(!isSourceAddonValid);
122 sourceImageCommunity.SetVisible(isSourceAddonValid);
123 sourceNameTextOfficial.SetVisible(!isSourceAddonValid);
124 sourceNameTextCommunity.SetVisible(isSourceAddonValid);
137 Widget favButton =
m_wRoot.FindAnyWidget(
"FavoriteButton");
158 if (GetButtonTag(button) == SCR_ScenarioEntryHelper.BUTTON_FAVORITE)
161 super.OnButtonPressed(button);
165 bool error = SCR_ScenarioEntryHelper.IsInErrorState(state);
167 switch (m_sLastPressedButtonTag)
169 case SCR_ScenarioEntryHelper.BUTTON_FIND_SERVERS: close = !error;
break;
170 case SCR_ScenarioEntryHelper.BUTTON_HOST: close = !error;
break;
180 super.SetTitle(text);
182 Widget titleFrame =
m_wRoot.FindAnyWidget(
"TitleFrame");
191 scrollComp.AnimationStop();
193 scrollComp.AnimationStart();
203 w = comp.GetRootWidget();
206 w.SetName(buttonPreset.m_sTag);