Пример #1
0
        // Performs all the necessary setup for the Highlights feature. It includes
        // creating the SDK, configuring all the highlights needed for the game, requesting
        // permissions and opening all highlight groups that would be used in the session.
        void SetupHighlights()
        {
            // Create Highlights SDK
            Highlights.HighlightScope[] RequiredScopes = new Highlights.HighlightScope[3] {
                Highlights.HighlightScope.Highlights,
                Highlights.HighlightScope.HighlightsRecordVideo,
                Highlights.HighlightScope.HighlightsRecordScreenshot
            };
            System.String AppName = "Tanks";
            if (Highlights.CreateHighlightsSDK(AppName, RequiredScopes) != Highlights.ReturnCode.SUCCESS)
            {
                Debug.LogError("Failed to initialize highlights");
                return;
            }

            // Request Permissions
            Highlights.RequestPermissions();

            // Configure Highlights
            Highlights.HighlightDefinition[] highlightDefinitions = new Highlights.HighlightDefinition[3];
            highlightDefinitions[0].Id                   = "HURT_ME_PLENTY";
            highlightDefinitions[0].HighlightTags        = Highlights.HighlightType.Achievement;
            highlightDefinitions[0].Significance         = Highlights.HighlightSignificance.Good;
            highlightDefinitions[0].UserDefaultInterest  = true;
            highlightDefinitions[0].NameTranslationTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Hurt Me Plenty"),
            };
            highlightDefinitions[1].Id                   = "KABOOM";
            highlightDefinitions[1].HighlightTags        = Highlights.HighlightType.Incident;
            highlightDefinitions[1].Significance         = Highlights.HighlightSignificance.Good;
            highlightDefinitions[1].UserDefaultInterest  = true;
            highlightDefinitions[1].NameTranslationTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Kaboom!"),
            };
            highlightDefinitions[2].Id                   = "HEAVY_DUTY_TRAVELER";
            highlightDefinitions[2].HighlightTags        = Highlights.HighlightType.Achievement;
            highlightDefinitions[2].Significance         = Highlights.HighlightSignificance.Good;
            highlightDefinitions[2].UserDefaultInterest  = true;
            highlightDefinitions[2].NameTranslationTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Heavy Duty Traveler"),
            };
            Highlights.ConfigureHighlights(highlightDefinitions);

            // Open Groups
            Highlights.OpenGroupParams ogp1 = new Highlights.OpenGroupParams();
            ogp1.Id = "SHOT_HIGHLIGHT_GROUP";
            ogp1.GroupDescriptionTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Shot Highlight Group"),
            };
            Highlights.OpenGroup(ogp1);

            Highlights.OpenGroupParams ogp2 = new Highlights.OpenGroupParams();
            ogp2.Id = "MISC_GROUP";
            ogp2.GroupDescriptionTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Misc Group"),
            };
            Highlights.OpenGroup(ogp2);
        }
Пример #2
0
        public void Init(Config config, IPALogger logger, Zenjector zenjector)
        {
            Instance        = this;
            Log             = logger;
            CurrentSettings = config.Generated <Settings>();

            Highlights.HighlightScope[] requiredScopes = new
                                                         Highlights.HighlightScope[2]
            {
                Highlights.HighlightScope.Highlights,
                Highlights.HighlightScope.HighlightsRecordVideo,
            };

            var status = Highlights.CreateHighlightsSDK("SaberHighlight", requiredScopes);

            if (status != Highlights.ReturnCode.SUCCESS)
            {
                Log.Critical($"Failed to initialize highlights! ({status})");
                Highlights.UpdateLog();
                return;
            }

            Highlights.RequestPermissions(Highlight.LogCallback);

            Highlights.HighlightDefinition[] highlightDefinitions = new Highlights.HighlightDefinition[1];

            highlightDefinitions[0].Id            = "MAP_PLAY";
            highlightDefinitions[0].HighlightTags = Highlights.HighlightType.Achievement;

            highlightDefinitions[0].Significance = Highlights.HighlightSignificance.Good;

            highlightDefinitions[0].UserDefaultInterest  = true;
            highlightDefinitions[0].NameTranslationTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Map play"),
            };

            Highlights.ConfigureHighlights(highlightDefinitions, "en-US", Highlight.LogCallback);

            Highlights.OpenGroupParams ogp1 = new Highlights.OpenGroupParams();
            ogp1.Id = "MAP_PLAY_GROUP";
            ogp1.GroupDescriptionTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Map play group"),
            };

            Highlights.OpenGroup(ogp1, Highlight.LogCallback);

            zenjector.Install <Installer>(Location.Player);

            Log.Info("Loaded.");
        }
Пример #3
0
    public void SetupHightlight()
    {
        Highlights.HighlightScope[] RequiredScopes = new Highlights.HighlightScope[3]
        {
            Highlights.HighlightScope.Highlights,
            Highlights.HighlightScope.HighlightsRecordVideo,
            Highlights.HighlightScope.HighlightsRecordScreenshot,
        };

        System.String AppName = "DCT";
        if (Highlights.CreateHighlightsSDK(AppName, RequiredScopes) != Highlights.ReturnCode.SUCCESS)
        {
            Debug.LogError("Failed to initialize highlights");
            return;
        }

        Highlights.HighlightDefinition[] hlDefinitions = new Highlights.HighlightDefinition[1];
        hlDefinitions[0].Id                   = "Record";
        hlDefinitions[0].HighlightTags        = Highlights.HighlightType.Achievement;
        hlDefinitions[0].Significance         = Highlights.HighlightSignificance.Good;
        hlDefinitions[0].UserDefaultInterest  = true;
        hlDefinitions[0].NameTranslationTable = new Highlights.TranslationEntry[]
        {
            new Highlights.TranslationEntry("en-US", "Record"),
            new Highlights.TranslationEntry("ko-KR", "녹화")
        };

        Highlights.ConfigureHighlights(hlDefinitions, "ko-KR", Highlights.DefaultConfigureCallback);
        Highlights.GetUserSettings(Highlights.DefaultGetUserSettingsCallback);
        Highlights.RequestPermissions(Highlights.DefaultRequestPermissionsCallback);

        Highlights.OpenGroupParams param = new Highlights.OpenGroupParams();
        param.Id = "Recorded_Group";
        param.GroupDescriptionTable = new Highlights.TranslationEntry[]
        {
            new Highlights.TranslationEntry("en-US", "Recorded"),
            new Highlights.TranslationEntry("ko-KR", "DCT녹화")
        };
        Highlights.OpenGroup(param, Highlights.DefaultOpenGroupCallback);
    }
Пример #4
0
        // Performs all the necessary setup for the Highlights feature. It includes
        // creating the SDK, configuring all the highlights needed for the game, requesting
        // permissions and opening all highlight groups that would be used in the session.
        void SetupHighlights()
        {
            // Log message handler. Must be called before CreateHighlightsSDK.
            Highlights.AttachLogListener(Highlights.DefaultLogListener);

            // Create Highlights SDK
            Highlights.HighlightScope[] RequiredScopes = new Highlights.HighlightScope[3]
            {
                Highlights.HighlightScope.Highlights,
                Highlights.HighlightScope.HighlightsRecordVideo,
                Highlights.HighlightScope.HighlightsRecordScreenshot
            };
            System.String AppName = "Tanks";
            if (Highlights.CreateHighlightsSDK(AppName, RequiredScopes) != Highlights.ReturnCode.SUCCESS)
            {
                Debug.LogError("Failed to initialize Highlights");
                return;
            }

            int x = Highlights.PeekCallbackId();

            // Request Permissions
            Highlights.RequestPermissions(Highlights.DefaultRequestPermissionsCallback);

            // Configure Highlights
            Highlights.HighlightDefinition[] HighlightDefinitions = new Highlights.HighlightDefinition[3];

            HighlightDefinitions[0].Id                   = "HURT_ME_PLENTY";
            HighlightDefinitions[0].HighlightTags        = Highlights.HighlightType.Achievement;
            HighlightDefinitions[0].Significance         = Highlights.HighlightSignificance.Good;
            HighlightDefinitions[0].UserDefaultInterest  = true;
            HighlightDefinitions[0].NameTranslationTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Hurt me plenty"),
            };

            HighlightDefinitions[1].Id                   = "KABOOM";
            HighlightDefinitions[1].HighlightTags        = Highlights.HighlightType.Incident;
            HighlightDefinitions[1].Significance         = Highlights.HighlightSignificance.Good;
            HighlightDefinitions[1].UserDefaultInterest  = true;
            HighlightDefinitions[1].NameTranslationTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Kaboom!"),
            };

            HighlightDefinitions[2].Id                   = "HEAVY_DUTY_TRAVELER";
            HighlightDefinitions[2].HighlightTags        = Highlights.HighlightType.Achievement;
            HighlightDefinitions[2].Significance         = Highlights.HighlightSignificance.Good;
            HighlightDefinitions[2].UserDefaultInterest  = true;
            HighlightDefinitions[2].NameTranslationTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Heavy duty traveler"),
            };

            Highlights.ConfigureHighlights(HighlightDefinitions, "en-US", Highlights.DefaultConfigureCallback);

            // Open Groups
            Highlights.OpenGroupParams Ogp1 = new Highlights.OpenGroupParams();
            Ogp1.Id = "SHOT_HIGHLIGHT_GROUP";
            Ogp1.GroupDescriptionTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Shot highlight group"),
            };
            Highlights.OpenGroup(Ogp1, Highlights.DefaultOpenGroupCallback);

            Highlights.OpenGroupParams Ogp2 = new Highlights.OpenGroupParams();
            Ogp2.Id = "MISC_GROUP";
            Ogp2.GroupDescriptionTable = new Highlights.TranslationEntry[]
            {
                new Highlights.TranslationEntry("en-US", "Misc group"),
            };
            Highlights.OpenGroup(Ogp2, Highlights.DefaultOpenGroupCallback);
        }