public override void Update(float deltaTime)
        {
            if (!isRunning || GUI.DisableHUD)
            {
                return;
            }

            base.Update(deltaTime);

            CrewManager.Update(deltaTime);

            endRoundButton.Update(deltaTime);

            if (!crewDead)
            {
                if (!CrewManager.GetCharacters().Any(c => !c.IsDead))
                {
                    crewDead = true;
                }
            }
            else
            {
                endTimer -= deltaTime;

                if (endTimer <= 0.0f)
                {
                    EndRound(null, null);
                }
            }
        }
        public override void Update(float deltaTime)
        {
            if (!Visible)
            {
                return;
            }

            wasOpened = false;

            base.Update(deltaTime);

            if (Dropped && PlayerInput.LeftButtonClicked())
            {
                Rectangle listBoxRect = listBox.Rect;
                listBoxRect.Width += 20;
                if (!listBoxRect.Contains(PlayerInput.MousePosition) && !button.Rect.Contains(PlayerInput.MousePosition))
                {
                    Dropped = false;
                }
            }

            button.Update(deltaTime);

            if (Dropped)
            {
                listBox.Update(deltaTime);
            }
        }
Exemple #3
0
        public void Update(float deltaTime)
        {
            EventManager.Update(deltaTime);

            if (GUI.DisableHUD)
            {
                return;
            }

            //guiRoot.Update(deltaTime);
            infoButton.Update(deltaTime);

            if (GameMode != null)
            {
                GameMode.Update(deltaTime);
            }
            if (Mission != null)
            {
                Mission.Update(deltaTime);
            }
            if (infoFrame != null)
            {
                infoFrame.Update(deltaTime);

                if (CrewManager != null && CrewManager.CrewCommander != null && CrewManager.CrewCommander.IsOpen)
                {
                    infoFrame = null;
                }
            }
        }
Exemple #4
0
        public void Update(float deltaTime)
        {
            EventManager.Update(deltaTime);

            if (GUI.DisableHUD)
            {
                return;
            }

            if (GameMain.Client != null)
            {
                if (GameMain.Client.HasPermission(Networking.ClientPermissions.Kick) || GameMain.Client.HasPermission(Networking.ClientPermissions.Ban))
                {
                    //ingameInfoButton.Visible = true;
                    ingameInfoButton.Visible = false;
                }
                else
                {
                    ingameInfoButton.Visible = false;
                }
            }

            //if (GameMain.Server == null) ingameInfoButton.Visible = false;

            //guiRoot.Update(deltaTime);
            infoButton.Update(deltaTime);
            ingameInfoButton.Update(deltaTime);


            if (GameMode != null)
            {
                GameMode.Update(deltaTime);
            }
            if (Mission != null)
            {
                Mission.Update(deltaTime);
            }
            if (infoFrame != null)
            {
                infoFrame.Update(deltaTime);

                if (CrewManager != null && CrewManager.CrewCommander != null && CrewManager.CrewCommander.IsOpen)
                {
                    infoFrame = null;
                }
            }
        }
Exemple #5
0
        public static void Update(float deltaTime, Character character)
        {
            if (drowningBar != null)
            {
                drowningBar.Update(deltaTime);
                if (character.Oxygen < 10.0f)
                {
                    drowningBar.Flash();
                }
            }
            if (healthBar != null)
            {
                healthBar.Update(deltaTime);
            }

            if (cprButton != null && cprButton.Visible)
            {
                cprButton.Update(deltaTime);
            }

            if (suicideButton != null && suicideButton.Visible)
            {
                suicideButton.Update(deltaTime);
            }

            if (damageOverlayTimer > 0.0f)
            {
                damageOverlayTimer -= deltaTime;
            }

            if (!character.IsUnconscious && character.Stun <= 0.0f)
            {
                if (character.Inventory != null)
                {
                    if (!character.LockHands && character.Stun >= -0.1f)
                    {
                        character.Inventory.Update(deltaTime);
                    }

                    for (int i = 0; i < character.Inventory.Items.Length - 1; i++)
                    {
                        var item = character.Inventory.Items[i];
                        if (item == null || CharacterInventory.limbSlots[i] == InvSlotType.Any)
                        {
                            continue;
                        }

                        foreach (ItemComponent ic in item.components)
                        {
                            if (ic.DrawHudWhenEquipped)
                            {
                                ic.UpdateHUD(character);
                            }
                        }
                    }
                }

                if (character.SelectedCharacter != null && character.SelectedCharacter.Inventory != null)
                {
                    character.SelectedCharacter.Inventory.Update(deltaTime);
                }
            }
        }
Exemple #6
0
        public static void Update(float deltaTime, Character character)
        {
            if (!pressureMsgShown)
            {
                float pressureFactor = (character.AnimController.CurrentHull == null) ?
                                       100.0f : Math.Min(character.AnimController.CurrentHull.LethalPressure, 100.0f);
                if (character.PressureProtection > 0.0f)
                {
                    pressureFactor = 0.0f;
                }

                if (pressureFactor > 0.0f)
                {
                    pressureMsgTimer += deltaTime;
                }
                else
                {
                    pressureMsgTimer = 0.0f;
                }
            }

            if (oxygenBar != null)
            {
                oxygenBar.Update(deltaTime);
                if (character.Oxygen < 10.0f)
                {
                    oxygenBar.Flash();
                }
            }
            if (healthBar != null)
            {
                healthBar.Update(deltaTime);
            }

            if (Inventory.SelectedSlot == null)
            {
                if (cprButton != null && cprButton.Visible)
                {
                    cprButton.Update(deltaTime);
                }
                if (grabHoldButton != null && grabHoldButton.Visible)
                {
                    grabHoldButton.Update(deltaTime);
                }
            }

            if (suicideButton != null && suicideButton.Visible)
            {
                suicideButton.Update(deltaTime);
            }

            if (damageOverlayTimer > 0.0f)
            {
                damageOverlayTimer -= deltaTime;
            }

            if (!character.IsUnconscious && character.Stun <= 0.0f)
            {
                if (character.Inventory != null)
                {
                    if (!character.LockHands && character.Stun >= -0.1f)
                    {
                        character.Inventory.Update(deltaTime);
                    }

                    for (int i = 0; i < character.Inventory.Items.Length - 1; i++)
                    {
                        var item = character.Inventory.Items[i];
                        if (item == null || CharacterInventory.limbSlots[i] == InvSlotType.Any)
                        {
                            continue;
                        }

                        foreach (ItemComponent ic in item.components)
                        {
                            if (ic.DrawHudWhenEquipped)
                            {
                                ic.UpdateHUD(character);
                            }
                        }
                    }
                }

                if (character.IsHumanoid && character.SelectedCharacter != null && character.SelectedCharacter.Inventory != null)
                {
                    character.SelectedCharacter.Inventory.Update(deltaTime);
                }

                Inventory.UpdateDragging();
            }
        }