public override void Show() { mAntennaFragment = mAntennaFragment ?? new AntennaFragment(mSetAntenna); /// Add callbacks for the onPositionChanged on the AbstractWindow onPositionChanged += mTargetInfos.CalculatePosition; /// Add the showTargetInfo callback to the on mouse over/out event mAntennaFragment.onMouseOverListEntry += showTargetInfo; mAntennaFragment.onMouseOutListEntry += hideTargetInfo; GameEvents.onVesselChange.Add(OnVesselChange); base.Show(); }
public override void Show() { mAntennaFragment = mAntennaFragment ?? new AntennaFragment(mSetAntenna); /// Add callbacks for the onPositionChanged on the AbstractWindow onPositionChanged += mTargetInfos.CalculatePosition; /// Add the showTargetInfo callback to the on mouse over/out event mAntennaFragment.onMouseOverListEntry += showTargetInfo; mAntennaFragment.onMouseOutListEntry += hideTargetInfo; GameEvents.onVesselChange.Add(OnVesselChange); base.Show(); }
public override void Hide() { // also hide the target info popup hideTargetInfo(); if (mAntennaFragment != null) { /// Remove callbacks from the onPositionChanged on the AbstractWindow onPositionChanged -= mTargetInfos.CalculatePosition; /// Remove the showTargetInfo callback from the on mouse over/out event mAntennaFragment.onMouseOverListEntry -= showTargetInfo; mAntennaFragment.onMouseOutListEntry -= hideTargetInfo; mAntennaFragment.Dispose(); mAntennaFragment = null; } GameEvents.onVesselChange.Remove(OnVesselChange); base.Hide(); }
public override void Hide() { // also hide the target info popup hideTargetInfo(); if (mAntennaFragment != null) { /// Remove callbacks from the onPositionChanged on the AbstractWindow onPositionChanged -= mTargetInfos.CalculatePosition; /// Remove the showTargetInfo callback from the on mouse over/out event mAntennaFragment.onMouseOverListEntry -= showTargetInfo; mAntennaFragment.onMouseOutListEntry -= hideTargetInfo; mAntennaFragment.Dispose(); mAntennaFragment = null; } GameEvents.onVesselChange.Remove(OnVesselChange); base.Hide(); }
/// <summary> /// Set a new target to the targetfragment with a targetEntry and an antenna /// </summary> /// <param name="targetEntry">Target from the antenna fragment</param> /// <param name="antenna">current antenna</param> public void SetTarget(AntennaFragment.Entry targetEntry, IAntenna antenna) { target = new Target {TargetEntry = targetEntry, Antenna = antenna}; }
/// <summary> /// Initialize the targetinfoFragment with a targetEntry and an antenna /// </summary> /// <param name="targetEntry">Target from the antenna fragment</param> /// <param name="antenna">current antenna</param> public TargetInfoFragment(AntennaFragment.Entry targetEntry, IAntenna antenna) : this() { SetTarget(targetEntry, antenna); }
/// <summary> /// Set a new target for this targetwindow /// </summary> /// <param name="target">Target from the antenna fragment</param> /// <param name="antenna">current antenna</param> public void SetTarget(AntennaFragment.Entry target,IAntenna antenna) { tif.SetTarget(target, antenna); }