コード例 #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()
コード例 #2
0
 public void RemoveHint(BaseHint hint)
 {
     appliedHints.Remove(hint);
     tree.Reorder(initialOrder);
     foreach (BaseHint h in appliedHints)
     {
         tree.Reorder(h.GetOrderIds());
     }
 }
コード例 #3
0
        }   // end of DegviceReset()

        public void Activate(BaseHint curHint, bool useBackgroundThumbnail, bool useRtCoords)
        {
            this.curHint = curHint;

            if (curHint == null)
            {
                return;
            }

            if (state != States.Active)
            {
                this.useBackgroundThumbnail = useBackgroundThumbnail;
                this.useRtCoords            = useRtCoords;

                // Do stack handling here.  If we do it in the update object we have no
                // clue which order things get pushed and popped and madness ensues.
                CommandStack.Push(commandMap);

                state = States.Active;

                // Get the current scene thumbnail.  If we're using this from the main menu (options)
                // then use the title screen image instead.
                if (InGame.inGame.State == InGame.States.Inactive)
                {
                    thumbnail = BokuGame.bokuGame.mainMenu.BackgroundTexture;
                }
                else
                {
                    thumbnail = InGame.inGame.SmallThumbNail;
                }

                // Tell InGame we're using the thumbnail so no need to do full render.
                prevRenderWorldAsThumbnail = InGame.inGame.RenderWorldAsThumbnail;
                if (!prevRenderWorldAsThumbnail)
                {
                    InGame.inGame.RenderWorldAsThumbnail = true;
                }
                Time.Paused = true;

                HelpOverlay.Push(@"ScrollableModalHint");

                // Get text string.
                blob = new TextBlob(UI2D.Shared.GetGameFont20, curHint.ModalText, textWidth);

                topLine    = 0;
                textOffset = 0;

                PreRender(); // Set up text rendering for first frame.
            }
        }                    // end of Activate
コード例 #4
0
        }                    // end of Activate

        public void Deactivate()
        {
            if (state != States.Inactive)
            {
                // Do stack handling here.  If we do it in the update object we have no
                // clue which order things get pushed and popped and madness ensues.
                CommandStack.Pop(commandMap);

                state = States.Inactive;

                HelpOverlay.Pop();

                // Turn off thumbnail rendering if needed.
                if (!prevRenderWorldAsThumbnail)
                {
                    InGame.inGame.RenderWorldAsThumbnail = false;
                }
                Time.Paused = false;

                curHint = null;
            }
        }
コード例 #5
0
 public void ApplyHint(BaseHint hint)
 {
     appliedHints.Add(hint);
     tree.Reorder(hint.GetOrderIds());
 }