コード例 #1
0
        }   // end of Init()

        public static void Update(bool allowNewHints)
        {
            if (!XmlOptionsData.ShowHints)
            {
                return;
            }

            // Don't bother to update hints if we've already got an active one.
            if (activeHint == null && allowNewHints)
            {
                for (int i = 0; i < hints.Count; i++)
                {
                    if (!hints[i].Disabled)
                    {
                        if (hints[i].Update())
                        {
                            activeHint = hints[i];
                            break;
                        }
                    }
                }

                // Did we activate one?
                if (activeHint != null)
                {
                    // If so, kick off the toast display.
                    ToastManager.ShowToast(activeHint.ToastText, activeHint.ModalText != null);
                }
            }

            // Update the displays.
            if (activeHint != null)
            {
                if (ToastManager.Update())
                {
                    if (activeHint.ModalText != null && allowNewHints)
                    {
                        modalHint.Activate(activeHint, true, useRtCoords: false);
                        if (modalHint.Overflow)
                        {
                            // Set up scrollable display instead.
                            modalHint.Deactivate();
                            scrollableModalHint.Activate(activeHint, true, useRtCoords: false);
                        }
                    }
                }
            }

            // Update modal displays.
            modalHint.Update(camera);
            scrollableModalHint.Update(camera);

            // If none of the displays are active, be sure activeHint is also null.
            if (!ToastManager.Active && !modalHint.Active && !scrollableModalHint.Active)
            {
                activeHint = null;
            }
        }   // end of Update()