4 static void LogScenariosConfPaths(
int maxWorkshopScenarios = 500)
6 array<ResourceName> officialScenarioResourceNames =
GetGame().GetDefaultGameConfigs();
7 array<MissionWorkshopItem> missionWorkshopItems = {};
9 WorkshopApi workshopAPI =
GetGame().GetBackendApi().GetWorkshop();
11 workshopAPI.GetPageScenarios(missionWorkshopItems, 0, maxWorkshopScenarios);
13 Print(
"--------------------------------------------------");
14 if (!officialScenarioResourceNames)
16 Print(
"could not get official scenarios conf paths", LogLevel.WARNING);
21 BaseContainer container;
24 PrintFormat(
"Official scenarios (%1 entries)", officialScenarioResourceNames.Count());
25 Print(
"--------------------------------------------------");
26 foreach (ResourceName officialScenarioResourceName : officialScenarioResourceNames)
28 missionHeader = SCR_ConfigHelperT<SCR_MissionHeader>.GetConfigObject(officialScenarioResourceName);
31 missionName = missionHeader.m_sName;
36 resource = Resource.Load(officialScenarioResourceName);
37 if (resource.IsValid())
39 container = resource.GetResource().ToBaseContainer();
41 container.Get(
"m_sName", missionName);
45 if (missionName.Contains(
"#"))
46 missionName = WidgetManager.Translate(missionName);
48 PrintFormat(
"%1 (%2)", officialScenarioResourceName, missionName);
52 Print(
"--------------------------------------------------");
56 Print(
"could not get Workshop API to read mod scenarios conf paths", LogLevel.WARNING);
57 Print(
"--------------------------------------------------");
61 int workshopCount = missionWorkshopItems.Count() - officialScenarioResourceNames.Count();
62 if (workshopCount < 1)
65 PrintFormat(
"Workshop scenarios (%1 entries)", workshopCount);
66 Print(
"--------------------------------------------------");
67 foreach (MissionWorkshopItem mission : missionWorkshopItems)
70 if (mission.GetOwner())
73 Print(
"--------------------------------------------------");