public void InterfaceMaximizeOrMinimize( ) { if (PrimaryInterface.IsMaximized("Map")) { TargetOffset = -1.0f; } else { TargetOffset = 0.0f; } }
public void RegionLoad( ) { if (PrimaryInterface.IsMaximized("Map")) { TargetOffset = -1.0f; } else { TargetOffset = 0.0f; } }
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; } }