33using RemoteTech . SimpleTypes ;
44using UnityEngine ;
55using KSP . UI ;
6- using KSP . UI . Screens . Flight ;
76using KSP . Localization ;
87
98namespace RemoteTech . UI
@@ -17,7 +16,7 @@ public class TimeWarpDecorator
1716 /// <summary>
1817 /// Image for position access
1918 /// </summary>
20- private UnityEngine . UI . Image mTimewarpImage ;
19+ private UnityEngine . RectTransform mTimewarpTransform ;
2120 /// <summary>
2221 /// Delay-Text style
2322 /// </summary>
@@ -115,11 +114,11 @@ public TimeWarpDecorator()
115114 GameObject go = GameObject . Find ( "TimeQuadrant" ) ;
116115 if ( go )
117116 {
118- mTimewarpImage = go . GetComponent < UnityEngine . UI . Image > ( ) ;
117+ mTimewarpTransform = go . GetComponent < UnityEngine . RectTransform > ( ) ;
119118 }
120119
121120 // objects on this scene?
122- if ( mTimewarpImage == null || TimeWarp . fetch == null )
121+ if ( mTimewarpTransform == null || TimeWarp . fetch == null )
123122 {
124123 return ;
125124 }
@@ -138,17 +137,21 @@ public TimeWarpDecorator()
138137 public void Draw ( )
139138 {
140139 // no drawing without timewarp object
141- if ( mTimewarpImage == null )
140+ if ( mTimewarpTransform == null )
142141 return ;
143142
144- // no drawing with in-flight action group panel is opened
143+ // no drawing if in-flight action group panel is opened
145144 if ( ActionGroupsFlightController . Instance != null && ActionGroupsFlightController . Instance . IsOpen )
146145 return ;
147146
148- Vector2 timeWarpImageScreenCoord = UIMainCamera . Camera . WorldToScreenPoint ( mTimewarpImage . rectTransform . position ) ;
147+ // no drawing if in-flight construction panel is opened
148+ if ( EVAConstructionModeController . Instance != null && EVAConstructionModeController . Instance . IsOpen )
149+ return ;
150+
151+ Vector2 timeWarpImageScreenCoord = UIMainCamera . Camera . WorldToScreenPoint ( mTimewarpTransform . position ) ;
149152
150153 float scale = GameSettings . UI_SCALE_TIME * GameSettings . UI_SCALE ;
151- float topLeftTotimeQuadrant = Screen . height - ( timeWarpImageScreenCoord . y - ( mTimewarpImage . preferredHeight * scale ) ) ;
154+ float topLeftTotimeQuadrant = Screen . height - ( timeWarpImageScreenCoord . y - ( mTimewarpTransform . rect . height * scale ) ) ;
152155 float texBackgroundHeight = ( mTexBackground . height * 0.7f ) * scale ;
153156 float texBackgroundWidth = ( mTexBackground . width * 0.8111f ) * scale ;
154157
0 commit comments