private void SceneLoaded(TCScene scene)
        {
            if (client != null)
            {
                Activity presence = new()
                {
                    Assets = new ActivityAssets
                    {
                        LargeImage = scene.largeImageKey,
                        LargeText  = scene.LargeImageKeyText
                    }
                };

                if (scene.showStartTime)
                {
                    presence.Timestamps = new ActivityTimestamps
                    {
                        Start = TimeHelper.UnixTimeNow()
                    }
                }
                ;

                if (scene.isOnlineScene)
                {
                    presence.Details = TCScenesManager.GetActiveScene().DisplayNameLocalized;
                    presence.State   = "Team Capture";
                }
                else if (scene.isMainMenu)
                {
                    presence.Details = "Main Menu";
                }
                else if (!scene.isMainMenu && !scene.isOnlineScene)
                {
                    presence.Details = "Loading...";
                }
                else
                {
                    Logger.Error("You CANNOT have an online scene and a main menu scene!");
                }

                UpdateActivity(presence);
            }
        }

        #endregion
    }
}
Пример #2
0
		public static ActivityAssets AddSmallText(this ActivityAssets assets, string smallText)
		{
			assets.SmallText = smallText;
			return assets;
		}
Пример #3
0
		public static ActivityAssets AddSmallImage(this ActivityAssets assets, string smallImage)
		{
			assets.SmallImage = smallImage;
			return assets;
		}
Пример #4
0
		public static ActivityAssets AddLargeText(this ActivityAssets assets, string largeText)
		{
			assets.LargeText = largeText;
			return assets;
		}
Пример #5
0
		public static ActivityAssets AddLargeImage(this ActivityAssets assets, string largeImage)
		{
			assets.LargeImage = largeImage;
			return assets;
		}
Пример #6
0
		public static Activity AddAssets(this Activity activity, ActivityAssets value)
		{
			activity.Assets = value;
			return activity;
		}