#ifdef WORKBENCH modded class SCR_RespawnSystemComponent { override void UpdateLoadingPlaceholder(float dt) { super.UpdateLoadingPlaceholder(dt); if (ERR_AdminMenu.GetOpenMenu() && m_wLoadingPlaceholder) m_wLoadingPlaceholder.SetVisible(false); } } modded class ERR_GameMode { protected override void StartScenario() {} protected override void EOnInit(IEntity owner) { super.EOnInit(owner); if (SCR_Global.IsEditMode() || !Replication.IsServer()) return; GetGame().GetCallqueue().CallLater(ERR_ContentReviewBegin, 5000, false); } protected void ERR_ContentReviewBegin() { PrintFormat("ERR CONTENT: controller=%1",GetGame().GetPlayerController()!=null); ERR_AdminMenu.Open(); } } modded class ERR_AdminMenu { protected int m_ContentReviewStage; protected float m_ContentReviewAt; protected string m_ContentReviewItem; protected string m_ContentReviewVehicle; protected string m_ContentReviewAddon="58d0fb3206b6f859"; override void OnMenuOpen() { super.OnMenuOpen(); GetGame().GetCallqueue().CallLater(ERR_ContentReviewTick,1000,true); } override void OnMenuClose() { GetGame().GetCallqueue().Remove(ERR_ContentReviewTick); super.OnMenuClose(); } void ERR_ContentReviewFail(string reason) { Print("ERR SMOKE FAIL: content menu "+reason,LogLevel.ERROR); GetGame().GetCallqueue().Remove(ERR_ContentReviewTick); } void ERR_ContentReviewTick() { float now=GetGame().GetWorld().GetWorldTime(); if(!m_Ready || now disabledPool={ERR_CivilianTraffic.CarPrefab(0)}; if(!ERR_VehicleSelection.Choose(disabledPool).IsEmpty()){ERR_ContentReviewFail("disabled mod still permits traffic candidate");return;} SubmitItems("items mod "+m_ContentReviewAddon+" 1");m_ContentReviewStage=5;return; } if(m_ContentReviewStage==5) { if(!prefs.ModEnabled(m_ContentReviewAddon)||prefs.Enabled(m_ContentReviewAddon,m_ContentReviewItem)){ERR_ContentReviewFail("master restore lost item choice");return;} SCR_EditBoxComponent.GetEditBoxComponent("ItemsSearch",GetRootWidget()).SetValue("err_no_such_item_9387");BrowseItems(0);m_ContentReviewStage=6;return; } if(m_ContentReviewStage==6) { if(!m_ItemRows.IsEmpty()){ERR_ContentReviewFail("search stale rows");return;} Print("ERR SMOKE PASS: real menu item disable, master mod restoration and empty search"); PrintFormat("ERR CONTENT VEHICLE INDEX: %1",m_VehicleMods.Find(m_ContentReviewAddon)); ShowPage(ERR_AdminPage.WEIGHTS); SubmitItems("items list "+m_ContentReviewAddon+" 0");m_ContentReviewStage=10;return; } if(m_ContentReviewStage==10) { ShowPage(ERR_AdminPage.ALLOWED_ITEMS);m_ContentReviewStage=11;return; } if(m_ContentReviewStage==11) { if(!m_ItemRows.IsEmpty()){ERR_ContentReviewFail("search lost after advanced page");return;} Print("ERR SMOKE PASS: item search restored after visiting advanced weights"); OpenVehicleAddon(m_ContentReviewAddon);m_ContentReviewStage=7;return; } if(m_ContentReviewStage==7) { SCR_ComboBoxComponent enabledFilter=SCR_ComboBoxComponent.GetComboBoxComponent("VehiclesFilter",GetRootWidget()); if(enabledFilter.GetCurrentIndex()!=1){enabledFilter.SetCurrentItem(1,false,false,false);BrowseVehicles(0);return;} if(m_VehicleRows.IsEmpty())return; if(!ERR_ProbeNavigation(ERR_AdminPage.VEHICLE_POOL)){ERR_ContentReviewFail("vehicle navigation");return;} foreach(string key,Widget row:m_VehicleRows){m_ContentReviewVehicle=key;OnVehicleRowButton(SCR_ButtonTextComponent.GetButtonText("Disable",row));break;} System.MakeScreenshot("$logs:content-vehicles");m_ContentReviewStage=8;return; } if(m_ContentReviewStage==8) { if(prefs.VehicleRole(m_ContentReviewAddon,m_ContentReviewVehicle,0)!=0){ERR_ContentReviewFail("vehicle disable");return;} ERR_ServerAddonItems vehicles=GetGame().ERR_ServerVehicles().Find(m_ContentReviewAddon); foreach(ERR_ServerItem vehicle:vehicles.Items) if(ERR_TerrainCatalog.Key(vehicle.Prefab)==m_ContentReviewVehicle) { array pool={vehicle.Prefab}; if(ERR_VehicleSelection.RoleAllowed(pool[0],0)){ERR_ContentReviewFail("disabled vehicle still selected");return;} } ERR_ItemPreferences reloaded=new ERR_ItemPreferences(); if(reloaded.VehicleRole(m_ContentReviewAddon,m_ContentReviewVehicle,0)!=0||reloaded.Enabled(m_ContentReviewAddon,m_ContentReviewItem)||!reloaded.ModEnabled(m_ContentReviewAddon)){ERR_ContentReviewFail("saved configuration reload");return;} SCR_ComboBoxComponent.GetComboBoxComponent("VehiclesFilter",GetRootWidget()).SetCurrentItem(2,false,false,false);BrowseVehicles(0);m_ContentReviewStage=9;return; } if(m_ContentReviewStage==12) { SCR_ComboBoxComponent.GetComboBoxComponent("VehiclesMod",GetRootWidget()).SetCurrentItem(m_VehicleMods.Find("2528466de220d91c"),false,false,false); SCR_ComboBoxComponent.GetComboBoxComponent("VehiclesRole",GetRootWidget()).SetCurrentItem(2,false,false,false); SCR_ComboBoxComponent.GetComboBoxComponent("VehiclesFilter",GetRootWidget()).SetCurrentItem(0,false,false,false); SCR_EditBoxComponent.GetEditBoxComponent("VehiclesSearch",GetRootWidget()).SetValue("RoleTestCar"); ShowPage(ERR_AdminPage.VEHICLE_POOL);BrowseVehicles(0);m_ContentReviewStage=13;return; } if(m_ContentReviewStage==13) { Widget row=m_VehicleRows.Get("f001c0de00000001"); if(!row||!VehicleSelectionReady()||m_ShownVehicleRole!=2){ERR_ContentReviewFail("role browser selected wrong result");return;} OnVehicleRowButton(SCR_ButtonTextComponent.GetButtonText("Enable",row));m_ContentReviewStage=14;return; } if(m_ContentReviewStage==14) { if(!GetGame().ERR_ServerVehicles().Allowed(ERR_VehicleRolePhysicalProbe.Car(),2)||GetGame().ERR_ServerVehicles().Allowed(ERR_VehicleRolePhysicalProbe.Car(),0)){ERR_ContentReviewFail("per-use enabling through menu");return;} SCR_ComboBoxComponent.GetComboBoxComponent("VehiclesRole",GetRootWidget()).SetCurrentItem(3,false,false,false); if(VehicleSelectionReady()){ERR_ContentReviewFail("stale role buttons accepted");return;} BrowseVehicles(0);m_ContentReviewStage=15;return; } if(m_ContentReviewStage==15) { ERR_ItemPreferences reloadRoles=new ERR_ItemPreferences(); if(m_ShownVehicleRole!=3||reloadRoles.VehicleRole("2528466de220d91c","f001c0de00000001",2)!=1||reloadRoles.VehicleRole("2528466de220d91c","f001c0de00000001",3)!=-1){ERR_ContentReviewFail("independent roles/save reload");return;} Print("ERR SMOKE PASS: real menu assigns a discovered vehicle to patrols, preserves independent uses, blocks stale role actions and reloads saved assignments"); SubmitItems("vehicles role 2528466de220d91c 2 f001c0de00000001 0");m_ContentReviewStage=16;return; } if(m_ContentReviewStage==16) { ERR_VehicleRolePhysicalProbe.Begin();GetGame().GetCallqueue().Remove(ERR_ContentReviewTick);return; } if(m_ContentReviewStage==9) { if(m_VehicleRows.IsEmpty()){ERR_ContentReviewFail("disabled vehicle filter");return;} Print("ERR SMOKE PASS: vehicle disable, filtered list and persisted preferences reload"); for(int page=0;page Units = {}; static ref array Starts = {}; static float Began; static bool Failed; static ResourceName Car() { return "{F001C0DE00000001}Prefabs/Vehicles/ERR_RoleTestCar.et"; } static ResourceName Escort() { return "{F001C0DE00000002}Prefabs/Vehicles/ERR_RoleTestEscort.et"; } static ResourceName Truck() { return "{F001C0DE00000003}Prefabs/Vehicles/ERR_RoleTestTruck.et"; } static void Fail(string message) { Failed = true; Print("ERR SMOKE FAIL: vehicle roles " + message, LogLevel.ERROR); GetGame().GetCallqueue().Remove(Tick); } static void Begin() { ERR_GameMode mode = ERR_GameMode.Get(); ERR_ServerVehicleCatalog catalog = GetGame().ERR_ServerVehicles(); ERR_ItemPreferences preferences = GetGame().ERR_ItemSelections(); string addon = "2528466de220d91c"; array prefabs = {Car(), Escort(), Truck()}; array roles = {2, 3, 4}; ERR_ConvoyService convoy = new ERR_ConvoyService(mode, null); ERR_HunterService hunterService = new ERR_HunterService(mode, null); for (int i = 0; i < 3; i++) { ResourceName prefab = prefabs[i]; int role = roles[i]; string key = ERR_TerrainCatalog.Key(prefab); PrintFormat("ERR ROLE FOUND: %1 contains=%2 capable=%3 sources=%4",prefab,catalog.Contains(addon,key),catalog.Capable(key,role),SCR_AddonTool.GetResourceAddons(prefab)); Resource inspected=Resource.Load(prefab);IEntitySource source=SCR_BaseContainerTools.FindEntitySource(inspected); if(source)for(int c=0;c agents={};unit.Group.GetAgents(agents); foreach(AIAgent agent:agents){agent.SetPermanentLOD(0);agent.ActivateAI();} vector target,angles;vector transform[4];unit.Entity.GetTransform(transform); if(!ERR_SupplyConvoySystem.ApproachDirected(Starts[i]+transform[2]*150,target,angles)){movedAll=false;continue;} unit.Waypoint=AIWaypoint.Cast(ERR_Actors.Spawn(ERR_Resources.MoveWaypoint(),target)); if(!unit.Waypoint){Fail("move waypoint");return;} ERR_GameMode.Get().Own(unit.Waypoint);unit.Group.AddWaypoint(unit.Waypoint);unit.Registered=true; } float distance=vector.DistanceXZ(Starts[i],unit.Entity.GetOrigin()); if(distance<20)movedAll=false; if(now-Began>120000){Fail("driving timeout role="+i.ToString()+" distance="+distance.ToString());return;} } if(!movedAll)return; Print("ERR SMOKE PASS: newly discovered patrol, escort and supply vehicles physically driven more than20m with production crews"); Print("ERR SMOKE COMPLETE: vehicle roles discovery assignments native crews and driving"); GetGame().GetCallqueue().Remove(Tick); } } #endif