#RequireContext CMapEditorPlugin #Include "TimeLib" as TimeLib #Include "TextLib" as TL Text getManialink() { return """ """; } main() { declare Integer End = -1; declare Integer Phase = 0; declare Integer oldPhase = 0; ManialinkText = getManialink(); yield; declare PhaseLabel <=> ManialinkPage.GetFirstChild("phase") as CMlLabel; declare TimeLabel <=> ManialinkPage.GetFirstChild("time") as CMlLabel; while(True) { yield; foreach (Event in PendingEvents) { if (Event.Type == CMapEditorPluginEvent::Type::LayerCustomEvent) { if (Event.CustomEventType == "Start") { Phase = 1; } } } if (oldPhase != Phase) { oldPhase = Phase; switch(Phase) { case 1: { PhaseLabel.Value = "Build Phase"; End = Now + 15 * 60 * 1000; } case 2: { PhaseLabel.Value = "Validation Phase"; End = Now + 5 * 60 * 1000; } case 3: { PhaseLabel.Value = "Save Map!"; TimeLabel.Value = "Now"; End = -1; } } } if (Phase == 3) { EditMode = CMapEditorPlugin::EditMode::FreeLook; } if (End != -1) { declare Delta = End - Now; TimeLabel.Value = (Delta/1000/60)^" Min "^ (Delta/1000)%60^" Sec"; if (Delta < 0.) { Phase += 1; } } } }