Пример #1
0
    private void SetMainBar()
    {
        if (_curHp <= 0)
        {
            _mainBar.StopAllCoroutines();
            _mainBar.gameObject.SetActive(false);
            return;
        }

        _mainBar = null;
        _mainBar = _queue.Dequeue();
        _mainBar.InitProgress(true, _curLineCount > 1);
        _mainBar.transform.SetAsLastSibling();

        if (_curLineCount < 1)
        {
            foreach (var bar in _listBars)
            {
                if (_mainBar != bar)
                {
                    bar.StopAllCoroutines();
                    bar.gameObject.SetActive(false);
                }
            }
        }
    }
    public void AddprogressUI(Transform canvasTransform)
    {
        hasUI = true;
        ProgressUI progressUI = Instantiate(progressUIPrefab, Camera.main.WorldToScreenPoint(transform.position), Quaternion.identity, canvasTransform);

        progressUI.gameObject.name = "ProgressUI";
        progressUI.Init(this);
    }
Пример #3
0
 /// <summary>
 ///     Hides the task sequence progress UI dialog
 /// </summary>
 public static void CloseProgressDialog()
 {
     try
     {
         IProgressUI progressUI = new ProgressUI();
         progressUI.CloseProgressDialog();
     }
     catch (Exception)
     {
         // ignored
     }
 }
Пример #4
0
    void FinishedDownloadingFromHost(SendOrReceiveFlag _flag, ulong _serverClientID)
    {
        Debug.Log("Finished downloading files");

        ProgressUI.Hide();

        CloseLobbyScreen();

        Debug.Log("this is where we load the world :)");

        Debug.Log("this is where we load lua :)");

        Debug.Log("this is where we spawn the player object :)");
    }
Пример #5
0
    void RequestDownloads()
    {
        ProgressUI.SetMessage("Downloading files", "Waiting for headers...");
        ProgressUI.Show();

        Debug.Log("Requesting downloads");
        LargeRPC download = new LargeRPC("InitialGameDownload");

        download.ListenForDownload();
        download.OnDownloadComplete += FinishedDownloadingFromHost;
        download.OnProgressUpdated  += UpdateProgressBar;

        CustomMessagingManager.SendNamedMessage("DownloadFilesRequest", NetworkingManager.Singleton.ServerClientId, Stream.Null);
    }
Пример #6
0
    private void Awake()
    {
        GameResourceManager.Instance.Load ("load", "load_resources");
        GameUIManager.Instance.Load ("load", "load_ui");

        GameObject instant = GameResourceManager.Instance.GetSingleUI ("progress_ui");
        if (instant != null) {
            this._progressUI = instant.GetComponent<ProgressUI> ();
            this._progressUI.Initialize ();
            this._progressUI.SetRate (0f);
            this._progressUI.SetEnable (true);
        }

        StartCoroutine (Load ());
    }
Пример #7
0
        /// <summary>
        ///     Show the task sequence dialog. Use null to indicate default values.
        /// </summary>
        public static void ShowTsProgress(string orgName, string tsName, string customTitle, string curAction)
        {
            try
            {
                IProgressUI progressUI = new ProgressUI();
                ITSEnvClass tsEnvVar   = new TSEnvClass();

                orgName     = orgName == null ? tsEnvVar["_SMSTSOrgName"] : orgName;
                tsName      = tsName == null ? tsEnvVar["SMSTSPackageName"] : tsName;
                customTitle = customTitle == null ? tsEnvVar["_SMSTSCustomProgressDialogMessage"] : customTitle;
                curAction   = curAction == null ? tsEnvVar["_SMSTSCurrentActionName"] : curAction;

                uint uStep    = Convert.ToUInt32(tsEnvVar["_SMSTSNextInstructionPointer"]);
                uint uMaxStep = Convert.ToUInt32(tsEnvVar["_SMSTSInstructionTableSize"]);
                progressUI.ShowTSProgress(orgName, tsName, customTitle, curAction, uStep, uMaxStep);
            }
            catch (Exception)
            {
                // ignored
            }
        }
Пример #8
0
        public override void Execute()
        {
            base.Execute();

            //show the ui
            var progressUi = new ProgressUI();

            progressUi.ApplyTheme(Activator.Theme);

            progressUi.Text = "Refreshing Cohort (" + _extractionConfiguration + ")";
            Activator.ShowWindow(progressUi, true);

            var engine = new CohortRefreshEngine(progressUi, _extractionConfiguration);

            Task.Run(

                //run the pipeline in a Thread
                () =>
            {
                progressUi.ShowRunning(true);
                engine.Execute();
            }
                ).ContinueWith(s =>
            {
                progressUi.ShowRunning(false);

                //then on the UI thread
                if (s.IsFaulted)
                {
                    return;
                }

                //issue save and refresh
                if (engine.Request.CohortCreatedIfAny != null)
                {
                    Publish(_extractionConfiguration);
                }
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Пример #9
0
 private void Start()
 {
     Instance = this;
 }
Пример #10
0
        public MainWindow()
        {
            InitializeComponent();
            Things = new ListCollectionView(m_things);
#if DEBUG
            PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Critical;
#endif
            m_recent_files.Add("One", false);
            m_recent_files.Add("Two", false);
            m_recent_files.Add("Three");
            m_recent_files.RecentFileSelected += s => Debug.WriteLine(s);

            ShowColourPicker = Command.Create(this, () =>
            {
                new ColourPickerUI().Show();
            });
            ShowChart = Command.Create(this, () =>
            {
                new ChartUI().Show();
            });
            ShowDiagram = Command.Create(this, () =>
            {
                new DiagramUI().Show();
            });
            ShowDirectionPicker = Command.Create(this, () =>
            {
                var win = new Window
                {
                    Owner = this,
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                };
                win.Content = new DirectionPicker();
                win.ShowDialog();
            });
            ShowDockContainer = Command.Create(this, () =>
            {
                new DockContainerUI().Show();
            });
            ShowJoystick = Command.Create(this, () =>
            {
                new JoystickUI().Show();
            });
            ShowMsgBox = Command.Create(this, () =>
            {
                var msg =
                    "Informative isn't it\nThis is a really really really long message to test the automatic resizing of the dialog window to a desirable aspect ratio. " +
                    "It's intended to be used for displaying error messages that can sometimes be really long. Once I had a message that was so long, it made the message " +
                    "box extend off the screen and you couldn't click the OK button. That was a real pain so that's why I've added this auto aspect ratio fixing thing. " +
                    "Hopefully it'll do the job in all cases and I'll never have to worry about it again...\n Hopefully...";
                var dlg = new MsgBox(this, msg, "Massage Box", MsgBox.EButtons.YesNoCancel, MsgBox.EIcon.Exclamation)
                {
                    ShowAlwaysCheckbox = true
                };
                dlg.ShowDialog();
            });
            ShowListUI = Command.Create(this, () =>
            {
                var dlg = new ListUI(this)
                {
                    Title         = "Listing to the Left",
                    Prompt        = "Select anything you like",
                    SelectionMode = SelectionMode.Multiple,
                    AllowCancel   = false,
                };
                dlg.Items.AddRange(new[] { "One", "Two", "Three", "Phooore, was that you?" });
                if (dlg.ShowDialog() == true)
                {
                    MsgBox.Show(this, $"{string.Join(",", dlg.SelectedItems.Cast<string>())}! Good Choice!", "Result", MsgBox.EButtons.OK);
                }
            });
            ShowLogUI = Command.Create(this, () =>
            {
                var log_ui = new LogControl {
                    LogEntryPattern = new Regex(@"^(?<Tag>.*?)\|(?<Level>.*?)\|(?<Timestamp>.*?)\|(?<Message>.*)", RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled)
                };
                var dlg = new Window {
                    Title = "Log UI", Content = log_ui, ResizeMode = ResizeMode.CanResizeWithGrip
                };
                dlg.Show();
            });
            ShowPatternEditor = Command.Create(this, () =>
            {
                new PatternEditorUI().Show();
            });
            ShowProgressUI = Command.Create(this, () =>
            {
                var dlg = new ProgressUI(this, "Test Progress", "Testicles", System.Drawing.SystemIcons.Exclamation.ToBitmapSource(), CancellationToken.None, (u, _, p) =>
                {
                    for (int i = 0, iend = 100; !u.CancelPending && i != iend; ++i)
                    {
                        p(new ProgressUI.UserState
                        {
                            Description      = $"Testicle: {i / 10}",
                            FractionComplete = 1.0 * i / iend,
                            ProgressBarText  = $"I'm up to {i}/{iend}",
                        });
                        Thread.Sleep(100);
                    }
                })
                {
                    AllowCancel = true
                };

                // Modal
                using (dlg)
                {
                    var res = dlg.ShowDialog(500);
                    if (res == true)
                    {
                        MessageBox.Show("Completed");
                    }
                    if (res == false)
                    {
                        MessageBox.Show("Cancelled");
                    }
                }

                // Non-modal
                //dlg.Show();
            });
            ShowPromptUI = Command.Create(this, () =>
            {
                var dlg = new PromptUI(this)
                {
                    Title     = "Prompting isn't it...",
                    Prompt    = "I'll have what she's having. Really long message\r\nwith new lines in and \r\n other stuff\r\n\r\nEnter a positive number",
                    Value     = "Really long value as well, that hopefully wraps around",
                    Units     = "kgs",
                    Validate  = x => double.TryParse(x, out var v) && v >= 0 ? ValidationResult.ValidResult : new ValidationResult(false, "Enter a positive number"),
                    Image     = (BitmapImage)FindResource("pencil"),
                    MultiLine = true,
                };
                if (dlg.ShowDialog() == true)
                {
                    double.Parse(dlg.Value);
                }
            });
Пример #11
0
 void UpdateProgressBar(float _progress, string _info)
 {
     ProgressUI.SetProgess(_progress);
     ProgressUI.SetInfo(_info);
 }
Пример #12
0
 void Awake()
 {
     Current        = this;
     canvas.enabled = RecorderInternalOptions.StartRecordingOnEnterPlayMode;
 }
Пример #13
0
 void Awake()
 {
     instance = this;
     myRect   = GetComponent <RectTransform> ();
     myRect.transform.localScale = Vector3.zero;
 }
        private void ReportProgress(int page, int totalPages, float stagePercent, string info, PrintProgressStage stage)
        {   // The primary progress update handler...
            switch (stage)
            {
            //
            // If all one wants is a simple, per page progress bar ALL THAT NEEDS BE DONE
            // is to switch on the PrintPage enumeration and present page count information.
            // When doing so, do not forget to change the page from 0-based to 1-based notation.
            // A value of -1 for either value means "not applicable". If one encounters -1,
            // simply ignore the update process for page/NumPages during that encounter.
            //

            //
            // APDFL cannot know how long things will take. So, any desire for an accurate
            // or trivial 0-100% progress bar is a bit of a misnomer. The closest one can
            // come to that sort of thing is to show page-level tracking (e.g., Page X of Y).
            // NONE of the percentage (or page progression) values can ever be equated
            // to any notion of time, remaining or otherwise.
            //
            // Performing simple math like:
            //
            // ((page / totalPages) * 100) * <median page time consumption thus far>
            //
            // ...will NOT accurately predict remaining time.
            //
            // Attempting to provide an estimate of time remaining (when printing or rendering)
            // a PDF is a futile process. Unlike network transmission times for a known quantity,
            // APDFL *cannot know* (and cannot be altered to know) how long the next page will
            // take to process.
            //

            //
            // TIP: When working on a solution that drives commercial digital print devices or
            // a similar high throughput 24/7/365 "keep the planes in the air, not on the ground"
            // environment...
            //
            // Flattening transparent artwork within the (greater) context of printing can be
            // a bad idea.
            //
            // One should investigate structuring the solution so that artwork to be printed
            // is pre-flattened (see FlattenPDF sample) and saved to a completely non-transparent
            // PDF *first* (separately). Then, simply print the pre-flattened (temp) file for
            // best performance. Separating these activities can greatly improve overall solution
            // performance and (printing) predictability.
            //

            case PrintProgressStage.PrintPage:
            {       // Happens twice...
                    // Once just before a page begins. Then again, just after the page ends.
                    // This is the case where one should update Page progress...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                if (state.stagePercent < 1.0)
                {       // Start page...
                    state.what        = ProgressUpdateState.Page;
                    state.pageCurrent = ((page > 1) ? page : 1);
                    state.pageSum     = ((NumPages > 1) ? NumPages : 1);
                    state.pageInfo    = String.Format("Page {0} of {1}", state.pageCurrent, state.pageSum);
                    ProgressUI.ProgressChanged(state);

                    Console.WriteLine(String.Format("Printing {0}.", state.pageInfo));
                }
                else
                {       // End page...
                        // Reset the stage info at page end
                    state.what         = ProgressUpdateState.Stage;
                    state.stageInfo    = @"";
                    state.stagePercent = 0;
                    ProgressUI.ProgressChanged(state);
                }
                break;
            }

            //
            // ALL of the remaining enumeration values are optional.
            // If not interested is presenting stage information to a human,
            // the remaining case block(s) can be omitted entirely.
            //

            case PrintProgressStage.PrintProg_StreamingDocumentResource:
            case PrintProgressStage.PrintProg_StreamingDocumentProcset:
            {       // Downloading a (document level) PostScript dictionary (%%BeginProlog)...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = "Preparing Document";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingDocumentFont:
            case PrintProgressStage.PrintProg_StreamingPageFont:
            {       // Downloading a font (info will contain the font name)...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what = ProgressUpdateState.Stage;
                if (info.Length > 0)
                {
                    state.stageInfo = String.Format("Downloading Font: {0}", info);
                }
                else
                {
                    state.stageInfo = @"Downloading Font";
                }
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageContent:
            {       // Sending miscellaneous, page content...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = @"Streaming Page Content";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageResource:
            {       // Downloading a (page level) PostScript dictionary...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = @"Streaming Page Resource";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageGradient:
            {       // Downloading a gradient...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = @"Streaming Page Gradient";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageImage:
            case PrintProgressStage.PrintProg_StreamingPageImageProgressPercent:
            {       // Downloading raster image data...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = @"Streaming Page Image";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageImageOPI:
            {       // Replacing an OPI proxy (only occurs when client provides additional OPI replacement callbacks)...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = @"Replacing Open Prepress Interface (OPI) Proxy Image";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageSeparation:
            {       // Sending a color separation (plate)...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = @"Streaming Page Separation";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageCSA:
            case PrintProgressStage.PrintProg_StreamingPageCRD:
            {       // (Converting a ICC profile to and) Downloading (PostScript) ColorSpace Array or Color Rendering Dictionary...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = @"Streaming Page Content (CSA/CRD)";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintFlat_EnterInFlattener:     // Start of flattener (0%)
            case PrintProgressStage.PrintFlat_IdentifyingComplexityRegion:
            case PrintProgressStage.PrintFlat_ComputingComplexityRegionClippath:
            case PrintProgressStage.PrintFlat_EnterInPlanarMap:
            case PrintProgressStage.PrintFlat_FlattenAtomicRegions:
            {       // Flattener preparation activities...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = "Flattening...";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintFlat_FindObjectsInvolvedInTransparency:
            {       // (Flattener) Searching for Transparency...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = "Searching for Transparent Art...";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintFlat_TextHeuristics:
            {       // (Flattener) Calculating Text Interactions...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = "Searching for Transparent Text...";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintFlat_RasterizingComplexityRegion:
            {       // (Flattener) Rasterizing...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = "Rasterizing Transparent Art...";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_OnHostTrapBeginPage:
            case PrintProgressStage.PrintProg_BeginStreamingTraps:
            {       // On-Host (not in-RIP) trapping activities...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what         = ProgressUpdateState.Stage;
                state.stageInfo    = "On-Host Trapping";
                state.stagePercent = stagePercent;
                ProgressUI.ProgressChanged(state);

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingPageEpilogue:
            {       // End of page activities (i.e., %%PageTrailer)...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what      = ProgressUpdateState.Stage;
                state.stageInfo = "Finalizing Page";
                for (float i = 0.0F; i <= 1.0F; i += 0.25F)
                {       // Emulate stage progression (when we only get a single call)
                    state.stagePercent = i;
                    ProgressUI.ProgressChanged(state);

                    //
                    // Sleeping here helps with human comprehension
                    // of UI updates but slows printing throughput.
                    //

                    Thread.Sleep(2);
                }

                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);
                break;
            }

            case PrintProgressStage.PrintProg_StreamingDocumentEpilogue:
            {       // End of file activities (i.e., %%Trailer)...
                ProgressUpdateStateBlock state = new ProgressUpdateStateBlock();
                state.what     = ProgressUpdateState.Stage;
                state.pageInfo = "Finalizing Document";
                for (float i = 0.0F; i <= 1.0F; i += 0.25F)
                {       // Eemulate stage progression (when we only get a single call)
                    state.stagePercent = i;
                    ProgressUI.ProgressChanged(state);

                    //
                    // Sleeping here helps with human comprehension
                    // of UI updates but slows printing throughput.
                    //

                    Thread.Sleep(2);
                }


                //
                // Sleeping here helps with human comprehension
                // of UI updates but slows printing throughput.
                //

                Thread.Sleep(10);

                // Conclude the progress UI...
                state.what        = ProgressUpdateState.Page;
                state.stageInfo   = "Printing Complete";
                state.pageCurrent = 0;
                state.pageSum     = 0;
                break;
            }
            }
        }
 public void ReportProgressDone()
 {   // Tell the Print Progress form we're done...
     ProgressUI.ProgressDone();
 }