Пример #1
0
 internal void ContainsMouse(Point p, Color c)
 {
     if (Position().Contains(p))
     {
         if (!bSelected)
         {
             sc           = c;
             bSelected    = true;
             tu           = new TimingUtility(30, true, StopTimerWhen);
             stepsTaken   = steps - stepsTaken;
             bWasSelected = false;
         }
     }
     else if (bSelected)
     {
         bSelected    = false;
         bWasSelected = true;
         tu           = new TimingUtility(30, true, StopTimerWhen);
         stepsTaken   = steps - stepsTaken;
     }
     else
     {
         bSelected = false;
     }
 }
Пример #2
0
 internal void LoadGameButton()
 {
     if (LoadGameScreen.HasSaveFiles(SaveDataProcessor.saveFolder))
     {
         lgs               = new LoadGameScreen(SaveDataProcessor.saveFolder, this);
         currentScreen     = Screens.load;
         loadGameDataTimer = new TimingUtility(40, false, stopTimer1);
         loadGameDataTimer.SetStepTimer(60, 0);
     }
 }
Пример #3
0
 internal void SwitchLeftRight()
 {
     bCursorFocusRight = !bCursorFocusRight;
     selectedAbility   = null;
     if (selectionTimer == null)
     {
         selectionTimer = new TimingUtility(30, true, StopSelectionTimerWhen);
         selectionTimer.SetStepTimer(40);
     }
 }
 internal TacticalTextPopUp(String s, BaseCharacter p, Vector2 offSet, Point textBoxSize, int steps, UpdateFunc uf = null, DrawFunc df = null)
 {
     if (bInitialize)
     {
         Inititialize();
     }
     text     = s;
     parent   = p;
     location = p.trueMapSize().Location.ToVector2() + offSet;
     textBox  = new Rectangle(location.ToPoint(), textBoxSize);
     timer    = new TimingUtility(16, true, standardTimer);
     timer.SetStepTimer(steps, 0);
     updateFunction = uf;
     drawFunction   = df;
 }
Пример #5
0
        internal void Update(GameTime gt)
        {
            if (bGenerateMatrixRight)
            {
                mRight = Matrix.CreateTranslation(0, scrollOffSetRight, 1);
                bGenerateMatrixRight = false;
            }

            if (bGenerateMatrixLeft)
            {
                mLeft = Matrix.CreateTranslation(0, scrollOffSetLeft, 1);
                bGenerateMatrixLeft = false;
            }

            if (selectionTimer != null)
            {
                selectionTimer.Tick(gt);
            }

            if (GameMenuHandler.selectedCharacterContext.abilityLineupInfo.getSelectedAbility() == this)
            {
                if (!selectionTimer.IsActive() && bBuildup)
                {
                    bBuildup       = false;
                    selectionTimer = new TimingUtility(32, true, StopSelectionTimerWhen);
                    selectionTimer.SetStepTimer(30);
                }
                else if (!selectionTimer.IsActive() && !bBuildup)
                {
                    bBuildup       = true;
                    selectionTimer = new TimingUtility(32, true, StopSelectionTimerWhen);
                    selectionTimer.SetStepTimer(30);
                }
            }
            else if (selectionTimer != null && !selectionTimer.IsActive() && bBuildup)
            {
                selectionTimer = new TimingUtility(8, true, StopSelectionTimerWhen);
                selectionTimer.SetStepTimer(30);
                bBuildup = false;
            }
            else if (selectionTimer != null && !selectionTimer.IsActive() && !bBuildup)
            {
                selectionTimer = null;
                bBuildup       = true;
            }

            parent.abilityIcon.UpdateAnimationForItems(gt);
        }
Пример #6
0
        internal void Update(GameTime gt)
        {
            if (bGenerateMatrix)
            {
                loadTabM        = Matrix.CreateTranslation(0, -vertMOffset, 1);
                bGenerateMatrix = false;
            }

            for (int i = 0; i < portraitFrames.Length; i++)
            {
                portraitFrames[i].Update(gt);
            }

            if (unselectTimer != null)
            {
                unselectTimer.Tick(gt);
                if (!unselectTimer.IsActive())
                {
                    unselectTimer = null;
                }
            }
        }
Пример #7
0
        internal AbilitySelectDescription(BaseCharacter bc, BasicAbility ba, Rectangle screenPos)
        {
            if (bInitialize)
            {
                Initialize();
            }
            parent = ba;
            // GameProcessor.gcDB
            drawOnScreen = screenPos;
            pos          = new Rectangle(new Point(), screenPos.Size);

            render = new RenderTarget2D(Game1.graphics.GraphicsDevice, pos.Width, pos.Height);
            panel  = new TexPanel(guiTex, pos, new Rectangle(90, 679, 64, 2), new Rectangle(90, 745, 64, 2), new Rectangle(88, 681, 2, 64), new Rectangle(154, 681, 2, 64), new Rectangle(88, 679, 2, 2), new Rectangle(154, 679, 2, 2), new Rectangle(88, 745, 2, 2), new Rectangle(154, 745, 2, 2), new Rectangle(90, 681, 64, 64));

            startUpTimer = new TimingUtility(16, true, StartUpTimer);
            startUpTimer.SetStepTimer(startUpStepTimer);

            titleBox       = new Rectangle(offsetPanel, offsetPanel, render.Width - 2 * offsetPanel, titleBoxHeight);
            descriptionBox = new Rectangle(titleBox.Location + new Point(0, titleBoxHeight + offsetBoxes), new Point(render.Width - 2 * offsetPanel));
            aoeBox         = new Rectangle(new Point(0, descriptionBox.Y + descriptionBox.Height + offsetBoxes), new Point(render.Width - 2 * offsetPanel));
            potencyText    = ba.GetEstimatedPotency(bc);
        }
Пример #8
0
        internal void Update(GameTime gt)
        {
            for (int i = 0; i < equippedAbilities.Count; i++)
            {
                equippedAbilities[i].Update(gt);
            }

            for (int i = 0; i < availableAbilities.Count; i++)
            {
                availableAbilities[i].Update(gt);
            }

            if (selectedAbility != null && selectedAbility.asd != null)
            {
                selectedAbility.asd.Update(gt);
            }

            selectionTimer.Tick(gt);
            if (bBuildUp)
            {
                if (!selectionTimer.IsActive())
                {
                    bBuildUp       = false;
                    selectionTimer = new TimingUtility(30, true, StopSelectionTimerWhen);
                    selectionTimer.SetStepTimer(40);
                }
            }
            else
            {
                if (!selectionTimer.IsActive())
                {
                    bBuildUp       = true;
                    selectionTimer = new TimingUtility(30, true, StopSelectionTimerWhen);
                    selectionTimer.SetStepTimer(40);
                }
            }
        }
Пример #9
0
 internal void unSelectTimer()
 {
     unselectTimer = new TimingUtility(16, true, StopSelectionTimerWhen);
     unselectTimer.SetStepTimer(40);
 }
Пример #10
0
        public void Update(GameTime gt)
        {
            if (OptionsMenu.bIsRunning) //copied from gameprocessor
            {
                Utilities.Control.Player.PlayerController.Update(gt);
                OptionsMenu.Update(gt);
                return;
            }

            if (currentScreen == Screens.start)
            {
                if (currentStartScreen != StartScreens.loading)
                {
                    Utilities.Control.Player.PlayerController.Update(gt);
                }
            }
            else
            {
                Utilities.Control.Player.PlayerController.Update(gt);
            }



            switch (currentScreen)
            {
            case Screens.start:
                #region
                switch (currentStartScreen)
                {
                case StartScreens.main:
                    UpdateMain(gt);
                    break;

                case StartScreens.load:
                    break;

                case StartScreens.loading:
                    UpdateLoading(gt);
                    break;

                default:
                    break;
                }
                #endregion
                break;

            case Screens.load:
                #region
                if (lgs != null)
                {
                    lgs.Update(gt);
                }
                if (loadGameDataTimer != null)
                {
                    loadGameDataTimer.Tick(gt);
                    if (!loadGameDataTimer.IsActive())
                    {
                        loadGameDataTimer = null;
                    }
                }
                #endregion
                break;

            default:
                break;
            }
        }
 static internal void Reset()
 {
     bBuildUp = true;
     texTimer = new TimingUtility(16, true, timerEnd);
     texTimer.SetStepTimer(120);
 }
Пример #12
0
 internal void Select()
 {
     GameMenuHandler.selectedCharacterContext.abilityLineupInfo.setSelectedAbility(this);
     selectionTimer = new TimingUtility(32, true, StopSelectionTimerWhen);
     selectionTimer.SetStepTimer(30);
 }