public DownloadPackageLogic(Widget widget, ModContent.ModDownload download, Action onSuccess) { this.download = download; this.onSuccess = onSuccess; Log.AddChannel("install", "install.log"); panel = widget.Get("PACKAGE_DOWNLOAD_PANEL"); progressBar = panel.Get <ProgressBarWidget>("PROGRESS_BAR"); var statusLabel = panel.Get <LabelWidget>("STATUS_LABEL"); var statusFont = Game.Renderer.Fonts[statusLabel.Font]; var status = new CachedTransform <string, string>(s => WidgetUtils.TruncateText(s, statusLabel.Bounds.Width, statusFont)); statusLabel.GetText = () => status.Update(getStatusText()); var text = "Downloading {0}".F(download.Title); panel.Get <LabelWidget>("TITLE").Text = text; ShowDownloadDialog(); }
public DownloadPackageLogic(ModContent.ModDownload download, Action onSuccess) { this.download = download; this.onSuccess = onSuccess; }