@@ -88,8 +88,8 @@ simulated function UpdateEventQueue(array<HQEvent> Events, bool bExpand, bool En
8888 }
8989
9090 bIsInStrategyMap = `ScreenStack .IsInStack (class 'UIStrategyMap' );
91-
92- if (Events .Length > 0 && !bIsInStrategyMap || (`HQPRES .StrategyMap2D != none && `HQPRES .StrategyMap2D .m_eUIState != eSMS_Flight ))
91+ // Single Line for Issue #1578 - Allow mods to display the event queue while flying
92+ if (Events .Length > 0 && !bIsInStrategyMap || (`HQPRES .StrategyMap2D != none && ( class 'CHHelpers' . default . bShowEventQueueWhileFlying || `HQPRES .StrategyMap2D .m_eUIState != eSMS_Flight ) ))
9393 {
9494 if ( bIsExpanded )
9595 {
@@ -156,10 +156,15 @@ simulated function UpdateEventQueue(array<HQEvent> Events, bool bExpand, bool En
156156}
157157
158158function RefreshDateTime ()
159- {
159+ {
160160 local TDateTime dateTimeData ;
161- local string Hours , Minutes , Suffix ;
162- local XComGameState_HeadquartersXCom XComHQ ;
161+ local string Hours , Minutes , Suffix ;
162+ local XComGameState_HeadquartersXCom XComHQ ;
163+ // Variables for Issue #1578
164+ local TDateTime UTCTimeData ;
165+ local string UTCHours , UTCMinutes , UTCSuffix ;
166+ local int timeZoneDifference ;
167+ local XComGameState_GeoscapeEntity DestinationEntity ;
163168
164169 if ( `GAME .GetGeoscape () == none ) return ; // stop log spam when in the shell testing.
165170
@@ -170,23 +175,67 @@ function RefreshDateTime()
170175
171176 //When showing time, either through time of day or the clock - always show local time
172177 dateTimeData = `GAME .GetGeoscape ().m_kDateTime ;
173-
174- //Don't adjust to local time while the base is in flight as it looks nicer for the clock to update smoothly
178+ UTCTimeData = dateTimeData ;
175179 XComHQ = XComGameState_HeadquartersXCom (`XCOMHISTORY .GetSingleGameStateObjectForClass (class 'XComGameState_HeadquartersXCom' ));
176- if (!XComHQ .Flying )
180+
181+ // Start Issue #1578
182+ /// HL-Docs: feature:GeoscapeClockOptions; issue:1578; tags:strategy
183+ /// Provide easily adjustable options for display of the Geoscape time by modders, to make the time display more intuitive
184+ /// when the skyranger is flying (in this case, options are: 1. The timezone is only updated when the avenger lands,
185+ /// 2. The timezone is updated only when the skyranger takes off, 3. Display UTC at all times and display the timezone
186+ /// difference on the clock UI.
187+ if (!class 'CHHelpers' .default .bForceUTCAtAllTimes )
188+ {
189+ // Base Game
190+ if (!XComHQ .Flying )
191+ {
192+ class 'X2StrategyGameRulesetDataStructures' .static .GetLocalizedTime (XComHQ .Get2DLocation (), dateTimeData );
193+ }
194+ // Option 1
195+ else if (class 'CHHelpers' .default .bUseSourceTimeZoneWhenFlying )
196+ {
197+ class 'X2StrategyGameRulesetDataStructures' .static .GetLocalizedTime (XComHQ .SourceLocation , dateTimeData );
198+ }
199+ // Option 2
200+ else if (class 'CHHelpers' .default .bUseDestinationTimeZoneWhenFlying )
201+ {
202+ DestinationEntity = XComGameState_GeoscapeEntity (`XCOMHISTORY .GetGameStateForObjectID (XComHQ .SelectedDestination .ObjectID ));
203+ class 'X2StrategyGameRulesetDataStructures' .static .GetLocalizedTime (DestinationEntity .Get2DLocation (), dateTimeData );
204+ }
205+ class 'X2StrategyGameRulesetDataStructures' .static .GetTimeStringSeparated (dateTimeData , Hours , Minutes , Suffix );
206+
207+ MC .BeginFunctionOp ("RefreshDateTime" );
208+ MC .QueueString (class 'X2StrategyGameRulesetDataStructures' .static .GetDateString (dateTimeData ));
209+ //RED: //MC.QueueString(class'UIUtilities_Text'.static.GetColoredText(class'X2StrategyGameRulesetDataStructures'.static.GetTimeString(dateTimeData), eUIState_IsGeoscapePaused));
210+ MC .QueueString (Hours );
211+ MC .QueueString (Minutes );
212+ MC .QueueString (Suffix );
213+ MC .EndOp ();
214+ }
215+ else
177216 {
217+ // Option 3
178218 class 'X2StrategyGameRulesetDataStructures' .static .GetLocalizedTime (XComHQ .Get2DLocation (), dateTimeData );
219+ class 'X2StrategyGameRulesetDataStructures' .static .GetTimeStringSeparated (UTCTimeData , UTCHours , UTCMinutes , UTCSuffix );
220+ timeZoneDifference = class 'X2StrategyGameRulesetDataStructures' .static .GetHour (dateTimeData ) - class 'X2StrategyGameRulesetDataStructures' .static .GetHour (UTCTimeData );
221+
222+ if (timeZoneDifference < -12 )
223+ {
224+ timeZoneDifference += 24 ;
225+ }
226+ else if (timeZoneDifference > 12 )
227+ {
228+ timeZoneDifference -= 24 ;
229+ }
230+
231+ MC .BeginFunctionOp ("RefreshDateTime" );
232+ MC .QueueString (class 'X2StrategyGameRulesetDataStructures' .static .GetDateString (UTCTimeData ));
233+ MC .QueueString (UTCHours );
234+ MC .QueueString (UTCMinutes );
235+ MC .QueueString (timeZoneDifference >=0 ? "+" @ string (timeZoneDifference ) : string (timeZoneDifference ));
236+ MC .EndOp ();
179237 }
180-
181- class 'X2StrategyGameRulesetDataStructures' .static .GetTimeStringSeparated (dateTimeData , Hours , Minutes , Suffix );
182-
183- MC .BeginFunctionOp ("RefreshDateTime" );
184- MC .QueueString (class 'X2StrategyGameRulesetDataStructures' .static .GetDateString (dateTimeData ));
185- //RED: //MC.QueueString(class'UIUtilities_Text'.static.GetColoredText(class'X2StrategyGameRulesetDataStructures'.static.GetTimeString(dateTimeData), eUIState_IsGeoscapePaused));
186- MC .QueueString (Hours );
187- MC .QueueString (Minutes );
188- MC .QueueString (Suffix );
189- MC .EndOp ();
238+ // End Issue #1578
190239}
191240
192241simulated function HideDateTime ()
0 commit comments