/// <summary> /// Enables the time bar customization. If the customization is already enabled, has no effect. /// </summary> /// <param name="currentDate">The current game date to set as the time bar's initial value.</param> public void Enable(DateTime currentDate) { if (originalWrapper != null) { Log.Warning("Trying to enable the CustomTimeBar multiple times."); return; } customDateTimeWrapper = new RealTimeUIDateTimeWrapper(currentDate); originalWrapper = SetUIDateTimeWrapper(customDateTimeWrapper, true); }
/// <summary> /// Enables the time bar customization. If the customization is already enabled, has no effect. /// </summary> /// <param name="currentDate">The current game date to set as the time bar's initial value.</param> public void Enable(DateTime currentDate) { if (originalWrapper != null) { Log.Warning("Trying to enable the CustomTimeBar multiple times."); return; } customDateTimeWrapper = new RealTimeUIDateTimeWrapper(currentDate); originalWrapper = SetCustomUIDateTimeWrapper(customDateTimeWrapper, enableWrapper: true); SetEventColorUpdater(progressSprite, enableUpdater: true); }
/// <summary> /// Disables the time bar configuration. If the customization is already disabled or was not /// enabled, has no effect. /// </summary> public void Disable() { if (originalWrapper == null) { return; } RemoveAllCityEvents(); SetUIDateTimeWrapper(originalWrapper, false); originalWrapper = null; progressSprite = null; customDateTimeWrapper = null; }
/// <summary> /// Disables the time bar configuration. If the customization is already disabled or was not /// enabled, has no effect. /// </summary> public void Disable() { if (originalWrapper == null) { return; } RemoveAllCityEvents(); SetCustomUIDateTimeWrapper(originalWrapper, enableWrapper: false); SetEventColorUpdater(progressSprite, enableUpdater: false); originalWrapper = null; progressSprite = null; customDateTimeWrapper = null; }