Esempio n. 1
0
        public static void MaximizeInterface(string interfaceName)
        {
            PrimaryInterface primaryInterface = null;

            if (mInterfaceLookup.TryGetValue(interfaceName, out primaryInterface))
            {
                primaryInterface.Maximize();
            }
        }
Esempio n. 2
0
        public static void NeedsPlayerAttention(string interfaceName)
        {
            PrimaryInterface activatedInterface = null;

            if (mInterfaceLookup.TryGetValue(interfaceName, out activatedInterface))
            {
                activatedInterface.GetPlayerAttention = true;
                //Player.Get.AvatarActions.ReceiveAction (AvatarAction.InterfaceGetAttention);
            }
        }
Esempio n. 3
0
        public static bool WantsPlayerAttention(string interfaceName)
        {
            PrimaryInterface activatedInterface = null;

            if (mInterfaceLookup.TryGetValue(interfaceName, out activatedInterface))
            {
                return(activatedInterface.GetPlayerAttention);
            }
            return(false);
        }
Esempio n. 4
0
        public static bool IsMaximized(string interfaceName)
        {
            PrimaryInterface activatedInterface = null;

            if (mInterfaceLookup.TryGetValue(interfaceName, out activatedInterface))
            {
                return(activatedInterface.Maximized);
            }
            return(false);
        }
Esempio n. 5
0
        public static void MaximizeInterface(string interfaceName, string functionName)
        {
            PrimaryInterface primaryInterface = null;

            if (mInterfaceLookup.TryGetValue(interfaceName, out primaryInterface))
            {
                primaryInterface.Maximize();
                primaryInterface.SendMessage(functionName, SendMessageOptions.DontRequireReceiver);
            }
        }
Esempio n. 6
0
 public static void MinimizeAllBut(string interfaceName)
 {
     for (int i = 0; i < GUIManager.Get.PrimaryInterfaces.Count; i++)
     {
         PrimaryInterface primaryInterface = GUIManager.Get.PrimaryInterfaces[i] as PrimaryInterface;
         if (primaryInterface.Name != interfaceName && primaryInterface.Maximized)
         {
             primaryInterface.Minimize();
         }
     }
 }
Esempio n. 7
0
 public void InterfaceMaximizeOrMinimize( )
 {
     if (PrimaryInterface.IsMaximized("Map"))
     {
         TargetOffset = -1.0f;
     }
     else
     {
         TargetOffset = 0.0f;
     }
 }
Esempio n. 8
0
 public void RegionLoad( )
 {
     if (PrimaryInterface.IsMaximized("Map"))
     {
         TargetOffset = -1.0f;
     }
     else
     {
         TargetOffset = 0.0f;
     }
 }
Esempio n. 9
0
 public static bool MinimizeAll()
 {
     for (int i = 0; i < GUIManager.Get.PrimaryInterfaces.Count; i++)
     {
         PrimaryInterface primaryInterface = GUIManager.Get.PrimaryInterfaces[i] as PrimaryInterface;
         if (!primaryInterface.Minimize())
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 10
0
        public override void PushEditObjectToNGUIObject()
        {
            //the start menu automatically un-pauses a manual pause
            //a little weird but it feels right in game
            GUIManager.ManuallyPaused = false;

            if (Profile.Get.Current.HasLastPlayedGame)
            {
                EditObject.EnableContinueButton = true;
            }
            else
            {
                EditObject.EnableContinueButton = false;
            }
            EditObject.EnableOptionsButton = true;
            EditObject.EnableQuitButton    = true;
            EditObject.EnableSaveButton    = false;

            GameManager.SetState(EditObject.EnterGameState);

            PrimaryInterface.MinimizeAll();

            //since we're pulling up the start menu, which will cause a pause
            //WHY NOT CALL THE GC?
            System.GC.Collect();

            if (!Profile.Get.CurrentPreferences.HideDialogs.Contains("HideAllFocusUpdates") && !Profile.Get.CurrentPreferences.HideDialogs.Contains(GameManager.FocusOnSubject))
            {
                GameObject editor = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.Dialog("NGUIThisWeekFocusDialog"));
            }

                        #if UNITY_EDITOR
            VRMode = VRManager.VRMode | VRManager.VRTestingMode;
                        #else
            VRMode = VRManager.VRMode;
                        #endif
            RefreshChangeLog();
            RefreshButtons();

            //now see if the edit object asked for any clicks or tabs
            if (EditObject.ClickedOptions)
            {
                if (!string.IsNullOrEmpty(EditObject.TabSelection))
                {
                    GUIOptionsDialog optionsDialog = OnClickOptionsButton();
                    optionsDialog.Tabs.DefaultPanel = EditObject.TabSelection;
                    optionsDialog.Tabs.SetSelection(EditObject.TabSelection);
                }
            }
        }
Esempio n. 11
0
        public static void MaximizeInterface(string interfaceName, string functionName, GameObject sendToItem)
        {
            PrimaryInterface primaryInterface = null;

            if (mInterfaceLookup.TryGetValue(interfaceName, out primaryInterface))
            {
                primaryInterface.Maximize();
                primaryInterface.SendMessage(functionName, sendToItem, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                Debug.Log("Couldn't find interface " + interfaceName);
            }
        }
Esempio n. 12
0
        public void Update()
        {
            SurroundingsStatesIcon.transform.localPosition = Vector3.Lerp(SurroundingsStatesIcon.transform.localPosition, TargetStateOffset, (float)WorldClock.RTDeltaTime);

            TemperatureSprite.transform.localPosition = Vector3.Lerp(TemperatureSprite.transform.localPosition, TargetTempOffset, 0.125f);
            TemperatureSpriteFreezing.alpha           = Mathf.Lerp(TemperatureSpriteFreezing.alpha, FreezingSpriteTargetAlpha, 0.125f);
            //burning alpha alternates
            if (BurningSpriteTargetAlpha > 0f)
            {
                TemperatureSpriteBurning2.alpha = Mathf.Abs(Mathf.Sin(Time.time)) * BurningSpriteTargetAlpha;
                TemperatureSpriteBurning1.alpha = BurningSpriteTargetAlpha - TemperatureSpriteBurning2.alpha;
            }
            else
            {
                TemperatureSpriteBurning2.alpha = Mathf.Lerp(TemperatureSpriteBurning2.alpha, BurningSpriteTargetAlpha, 0.125f);
                TemperatureSpriteBurning1.alpha = Mathf.Lerp(TemperatureSpriteBurning1.alpha, BurningSpriteTargetAlpha, 0.125f);
            }

            if (DisplayInfo)
            {
                if (UICamera.hoveredObject != CurrentInfoTarget)
                {
                    DisplayInfo = false;
                }
                if (InfoSpriteShadow.alpha < 1f)
                {
                    InfoSpriteShadow.alpha = Mathf.Lerp(InfoSpriteShadow.alpha, 1f, 0.25f);
                    if (InfoSpriteShadow.alpha > 0.99f)
                    {
                        InfoSpriteShadow.alpha = 1f;
                    }
                }
                //make sure the info doesn't overlay an icon
                float yOffset = 0f;
                for (int i = 0; i < StatusMeters.Count; i++)
                {
                    yOffset = Mathf.Max(StatusMeters[i].SymptomOffset, yOffset);
                }
                mInfoOffset.y            = yOffset + 50f;
                mInfoOffset.x            = CurrentInfoTargetXOffset + 50f;
                InfoOffset.localPosition = mInfoOffset;
            }
            else
            {
                if (InfoSpriteShadow.alpha > 0f)
                {
                    InfoSpriteShadow.alpha = Mathf.Lerp(InfoSpriteShadow.alpha, 0f, 0.25f);
                    if (InfoSpriteShadow.alpha < 0.01f)
                    {
                        InfoSpriteShadow.alpha = 0f;
                    }
                }
            }
            InfoLabel.alpha            = InfoSpriteShadow.alpha;
            InfoSpriteBackground.alpha = InfoSpriteShadow.alpha;

            base.Update();

            if (!GameManager.Is(FGameState.InGame | FGameState.GamePaused) ||
                !Player.Local.HasSpawned ||
                PrimaryInterface.IsMaximized("WorldMap") ||
                PrimaryInterface.IsMaximized("Conversation"))
            {
                if (MainPanel.enabled)
                {
                    MainPanel.enabled = false;
                    for (int i = 0; i < MasterAnchors.Count; i++)
                    {
                        MasterAnchors[i].relativeOffset = mHiddenAnchorOffset;
                    }
                    TemperatureClipPanel.enabled = false;
                    SurroundingsPanel.enabled    = false;
                }
                return;
            }
            else
            {
                if (!MainPanel.enabled)
                {
                    MainPanel.enabled            = true;
                    TemperatureClipPanel.enabled = true;
                    SurroundingsPanel.enabled    = true;
                    for (int i = 0; i < MasterAnchors.Count; i++)
                    {
                        MasterAnchors[i].relativeOffset = Vector2.zero;
                    }
                }
                                                                #if UNITY_EDITOR
                if (VRManager.VRMode | VRManager.VRTestingMode)
                {
                                                                #else
                if (VRManager.VRMode)
                {
                                                                #endif
                    for (int i = 0; i < MasterAnchors.Count; i++)
                    {
                        //mark this to skip interface objects
                        VRModeHidden = ((GUIInventoryInterface.Get.Maximized && !GUIInventoryInterface.Get.VRFocusOnTabs) || GUILogInterface.Get.Maximized);
                        if (VRModeHidden)
                        {
                            MasterAnchors[i].relativeOffset = Vector2.Lerp(MasterAnchors[i].relativeOffset, AnchorVROffsetHidden, 0.25f);
                        }
                        else if (!GUIManager.Get.HasActiveInterface)
                        {
                            MasterAnchors[i].relativeOffset = Vector2.Lerp(MasterAnchors[i].relativeOffset, AnchorVROffsetVisibleMinimized, 0.25f);
                        }
                        else
                        {
                            MasterAnchors[i].relativeOffset = Vector2.Lerp(MasterAnchors[i].relativeOffset, AnchorVROffsetVisible, 0.25f);
                        }
                    }
                }
            }

            if (!mInitialized)
            {
                return;
            }

            //clear out expired skills in use and set positions
            int positionInList = 0;
            for (int i = SkillsInUse.Count - 1; i >= 0; i--)
            {
                if (SkillsInUse[i] == null)
                {
                    //it should be invisible now
                    SkillsInUse.RemoveAt(i);
                }
                else
                {
                    SkillsInUse[i].PositionInList = positionInList;
                    positionInList++;
                }
            }

            if (mRefreshSkillsInUse)
            {
                mRefreshSkillsInUse = false;
                RefreshSkillsInUse();
            }

            mUpdateSurroundings++;
            if (mUpdateSurroundings < 30)
            {
                return;
            }
            mUpdateSurroundings = 0;

            switch (Player.Local.Status.LatestTemperatureExposure)
            {
            case TemperatureRange.A_DeadlyCold:
                TargetTempOffset          = TempOffsetMin;
                FreezingSpriteTargetAlpha = 1f;
                BurningSpriteTargetAlpha  = 0f;
                break;

            case TemperatureRange.B_Cold:
            default:
                TargetTempOffset          = TempOffsetMin;
                FreezingSpriteTargetAlpha = 0f;
                BurningSpriteTargetAlpha  = 0f;
                break;

            case TemperatureRange.C_Warm:
                TargetTempOffset          = Vector3.zero;
                FreezingSpriteTargetAlpha = 0f;
                BurningSpriteTargetAlpha  = 0f;
                break;

            case TemperatureRange.D_Hot:
                TargetTempOffset          = TempOffsetMax;
                FreezingSpriteTargetAlpha = 0f;
                BurningSpriteTargetAlpha  = 0f;
                break;

            case TemperatureRange.E_DeadlyHot:
                TargetTempOffset          = TempOffsetMax;
                FreezingSpriteTargetAlpha = 0f;
                BurningSpriteTargetAlpha  = 1f;
                break;
            }

            if (Player.Local.Surroundings.IsUnderground)
            {
                TargetStateOffset = StateOffsetUnderground;
            }
            else if (Player.Local.Surroundings.IsInSafeLocation)
            {
                TargetStateOffset = StateOffsetInSafeStructure;
            }
            else if (Player.Local.Surroundings.IsInsideStructure)
            {
                TargetStateOffset = StateOffsetInStructure;
            }
            else if (Player.Local.Surroundings.IsInCivilization)
            {
                TargetStateOffset = StateOffsetInCivilization;
            }
            else
            {
                TargetStateOffset = StateOffsetInWild;
            }
        }
Esempio n. 13
0
 public void OnClickCraftNow()
 {
     PrimaryInterface.MaximizeInterface("Inventory", "CraftBlueprint", mSelectedObject.Name);
 }