Partial MatchController that ticks career cup completion progress, runs the career work on a background thread, and saves progress when the revision changes. Also exposes a retry for a specific cup.
using Sandbox;
using Socer;
public sealed partial class MatchController
{
void TickCupWorldCompletion()
{
if(Career==null || MatchTutorialActive || IsRulesPreview)return;
Career.RunBackground??=action=>GameTask.RunInThreadAsync(action);
if(!Career.UpdateCupCompletions())return;
SaveCareer();Revision++;
}
public void RetryCupWorldCompletion(string cupId)
{
if(Career==null || MatchTutorialActive || IsRulesPreview)return;
if(!Career.RetryCupCompletion(cupId))return;
Career.RunBackground??=action=>GameTask.RunInThreadAsync(action);
SaveCareer();Revision++;
}
}