// Token: 0x060010BE RID: 4286 private void UpdateRelicViewHUDState(CollectibleEntityView view) { // MOD: remove artifact views that are moved off the map if (view.Entity.GetComponent(10).Position2D.X > Fixed64.FromInt(100000)) { this.DespawnAndRemoveRelicView(view.Entity, view); return; } // MOD SimStateFrame currentSimFrame = ShipbreakersMain.CurrentSimFrame; if (currentSimFrame == null) { return; } RelicState relicState = currentSimFrame.FindObject <RelicState>(view.Entity); if (relicState == null) { return; } CollectibleState collectibleState = currentSimFrame.FindObject <CollectibleState>(view.Entity); if (collectibleState == null) { return; } DetectionState visibility = relicState.Visibility; if (ReplayPanelController.RevealAll || SimController.sSpectatorModeEnabled) { visibility = DetectionState.Sensed; } bool flag = relicState.HasTimer && relicState.TimerDirection == TimerDirection.Countup && !relicState.TimerCompleted; if (collectibleState.AvailableForCollection) { this.UpdateRelicDefaultIconSprite(view, visibility, flag); } else { this.UpdateRelicAttachedIconSprite(view, DetectionState.Sensed, false); } this.UpdateRelicIconTrackOnScreenEdge(view, !flag); bool flag2 = view.ShouldShowIcon(); view.ShowIcon(flag2); if (!flag2 && this.mShowingTooltipForEntity != Entity.None && this.mShowingTooltipForEntity == view.Entity) { this.mShowingTooltipForEntity = Entity.None; UISystem.HideTooltip(); } }
// Token: 0x06000C52 RID: 3154 RVA: 0x00056C8C File Offset: 0x00054E8C private void OnUnitSelectionChanged(IList <Entity> selection, SimStateFrame atFrame) { if (selection.Count > 0 && this.mInterfaceController.LeadUnit.IsValid()) { NGUITools.SetActiveSelf(this.mSettings.InformationPanelContainer, true); this.PopulatePanelForUnit(this.mInterfaceController.LeadUnit); return; } this.mSelectedEntity = Entity.None; NGUITools.SetActiveSelf(this.mSettings.InformationPanelContainer, false); }
// Token: 0x06001491 RID: 5265 RVA: 0x00083F90 File Offset: 0x00082190 private void UpdateUnitHUDState(UnitView view) { if (view.PresentationControlOnly) { if (view.SensorView != null) { view.SensorView.Enabled = false; } view.UnderlayActive = false; view.AltitudeIndicatorActive = false; return; } SimStateFrame currentSimFrame = ShipbreakersMain.CurrentSimFrame; if (currentSimFrame == null) { return; } UnitState nonInterpolatedTickState = view.NonInterpolatedTickState; if (nonInterpolatedTickState == null || nonInterpolatedTickState.IsDocked) { return; } CommanderRelationship relationship = this.mInteractionProvider.GetRelationship(this.mCommanderManager.LocalCommanderID, nonInterpolatedTickState.OwnerCommander); bool flag = relationship != CommanderRelationship.Self; bool flag2 = relationship == CommanderRelationship.Enemy; DetectionState detectionState = nonInterpolatedTickState.Visibility; if (ReplayPanelController.RevealAll || SimController.sSpectatorModeEnabled) { detectionState = DetectionState.Sensed; } bool flag3 = detectionState == DetectionState.Sensed; bool sTacticalOverlayEnabled = TacticalOverlayController.sTacticalOverlayEnabled; bool underlayActive = Cursor.visible && (view.Selected || view.IsHovered) && sTacticalOverlayEnabled && !this.mSensorsActive && flag3; view.UnderlayActive = underlayActive; bool altitudeIndicatorActive = (view.Selected || this.mSensorsActive || sTacticalOverlayEnabled) && flag3; view.AltitudeIndicatorActive = altitudeIndicatorActive; if (view.SensorView != null) { // MOD bool enabled = !view.IsDriverDead && flag3 && (!flag || !flag2 || (ShipbreakersMain.ReplayMode == ReplayMode.ReplayingGame || mCommanderManager.GetCommanderFromID(mCommanderManager.LocalCommanderID).CommanderAttributes.Name == "SPECTATOR") && MapModManager.EnableEnemySensors); // Check if the player is spectating view.SensorView.IsFriendly = (relationship == CommanderRelationship.Self || relationship == CommanderRelationship.Ally); //MOD view.SensorView.Enabled = enabled; view.SensorView.Mode = (this.mSensorsActive ? UnitSensorView.SensorMode.SensorsView : UnitSensorView.SensorMode.GameView); } view.ForceIconOnlyMode = (this.mSensorsActive && view.ViewAttrs.LODTunings.ForceIconOnlyInSensors); UnitIconController iconControllerForView = this.GetIconControllerForView(view); if (iconControllerForView != null) { iconControllerForView.UpdateIconVisibilityAndSize(currentSimFrame); } }
// Token: 0x06000C56 RID: 3158 RVA: 0x0000A4FA File Offset: 0x000086FA private void OnNewStateFrame(SimStateFrame newFrame) { this.UpdateDynamicDataForUnit(this.mSelectedEntity); }
// Token: 0x06000C54 RID: 3156 RVA: 0x00056D54 File Offset: 0x00054F54 private void PopulatePanelForUnit(Entity entity) { string typeName = entity.GetTypeName(); if (string.IsNullOrEmpty(typeName)) { return; } UnitHUDAttributes entityTypeAttributes = ShipbreakersMain.GetEntityTypeAttributes <UnitHUDAttributes>(typeName); if (entityTypeAttributes == null) { Log.Error(Log.Channel.UI, "Unable to get HUD attributes for entity {0}", new object[] { entity.ToFriendlyString() }); } this.mSettings.UnitNameLabel.text = this.mSettings.UnitNameLocID.TokenFormat(new object[] { (entityTypeAttributes == null) ? typeName : entityTypeAttributes.UnitLocalizedNameStringID }, this.mLocMan); if (this.mSettings.UnitIcon != null) { this.mSettings.UnitIcon.spriteName = ((entityTypeAttributes == null) ? string.Empty : entityTypeAttributes.IconSettings.UnitInfoPanelIconName); } else { Log.Warn(Log.Channel.UI, "Unit Icon is missing from the info panel.", new object[0]); } if (this.mSettings.UnitShortDescriptionValueLabel != null) { this.mLastExperienceState = null; this.mSettings.UnitShortDescriptionValueLabel.text = this.mSettings.UnitNameLocID.TokenFormat(new object[] { (entityTypeAttributes == null) ? string.Empty : entityTypeAttributes.UnitLocalizedShortDescriptionStringID }, this.mLocMan); } else { Log.Warn(Log.Channel.UI, "ShortDescription Value Label is missing from the info panel.", new object[0]); } if (this.mSettings.UnitHealthBar != null && this.mInteractionProvider != null && this.mInteractionProvider != null) { SimStateFrame currentSimFrame = ShipbreakersMain.CurrentSimFrame; UnitState unitState = currentSimFrame.FindObject <UnitState>(entity); CommanderRelationship relationship = this.mInteractionProvider.GetRelationship(unitState.OwnerCommander, this.mCommanderManager.LocalCommanderID); if (relationship != CommanderRelationship.Ally) { if (relationship != CommanderRelationship.Enemy) { this.mSettings.UnitHealthBar.foregroundWidget.color = this.mUnitInteractionAttributes.PlayerIconColours.SelectedColour; } else { this.mSettings.UnitHealthBar.foregroundWidget.color = this.mUnitInteractionAttributes.EnemyIconColours.SelectedColour; } } else { this.mSettings.UnitHealthBar.foregroundWidget.color = this.mUnitInteractionAttributes.AllyIconColours.SelectedColour; } } if (this.mSettings.UnitLongDescriptionValueLabel != null) { this.mSettings.UnitLongDescriptionValueLabel.text = this.mSettings.UnitNameLocID.TokenFormat(new object[] { (entityTypeAttributes == null) ? string.Empty : entityTypeAttributes.UnitLocalizedLongDescriptionStringID }, this.mLocMan); } else { Log.Warn(Log.Channel.UI, "LongDescription Value Label is missing from the info panel.", new object[0]); } this.mSelectedEntity = entity; this.UpdateDynamicDataForUnit(entity); }