public override void AfterStart()
 {
     if (!HighlightsController.IsHighlightsInitialized)
     {
         HighlightsController.HighlightTypes = new List <HighlightsController.HighlightType>()
         {
             new HighlightsController.HighlightType("hlid_killing_spree", "Killing Spree", "grpid_incidents", -2010, 3000, 0.25f, float.MaxValue, true),
             new HighlightsController.HighlightType("hlid_high_ranged_shot_difficulty", "Sharpshooter", "grpid_incidents", -5000, 3000, 0.25f, float.MaxValue, true),
             new HighlightsController.HighlightType("hlid_archer_salvo_kills", "Death from Above", "grpid_incidents", -5004, 3000, 0.5f, 150f, false),
             new HighlightsController.HighlightType("hlid_couched_lance_against_mounted_opponent", "Lance A Lot", "grpid_incidents", -5000, 3000, 0.25f, float.MaxValue, true),
             new HighlightsController.HighlightType("hlid_cavalry_charge_first_impact", "Cavalry Charge First Impact", "grpid_incidents", -5000, 5000, 0.25f, float.MaxValue, false),
             new HighlightsController.HighlightType("hlid_headshot_kill", "Headshot!", "grpid_incidents", -5000, 3000, 0.25f, 150f, true),
             new HighlightsController.HighlightType("hlid_burning_ammunition_kill", "Burn Baby", "grpid_incidents", -5000, 3000, 0.25f, 100f, true),
             new HighlightsController.HighlightType("hlid_throwing_weapon_kill_against_charging_enemy", "Throwing Weapon Kill Against Charging Enemy", "grpid_incidents", -5000, 3000, 0.25f, 150f, true)
         };
         Highlights.Initialize();
         foreach (HighlightsController.HighlightType highlightType in HighlightsController.HighlightTypes)
         {
             Highlights.AddHighlight(highlightType.Id, highlightType.Description);
         }
         HighlightsController.IsHighlightsInitialized = true;
     }
     foreach (string highlightGroupId in this._highlightGroupIds)
     {
         Highlights.OpenGroup(highlightGroupId);
     }
     this._highlightSaveQueue    = new List <HighlightsController.Highlight>();
     this._playerKillTimes       = new List <float>();
     this._archerSalvoKillTimes  = new List <float>();
     this._cavalryChargeHitTimes = new List <float>();
     this._savedHighlightGroups  = new List <string>();
 }
Esempio n. 2
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);
        }
Esempio n. 3
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.");
        }
Esempio n. 4
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);
    }
Esempio n. 5
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);
        }