Example #1
0
        public UniqueIdError(
            VisualElement container,
            ReportScene scene,
            ReportId report,
            Action <ReportId> onFixId) : base(container)
        {
            _report  = report;
            _onFixId = onFixId;
            _scene   = scene;
            Id       = _report.Id;

            _root = container.Query <VisualElement>(null, "m-unique-id-error").Last();
            _elId = container.Query <TextElement>(null, "m-unique-id-error__text").Last();
            var printText = string.IsNullOrEmpty(_report.Id) ? "null" : _report.Id;

            _elId.text = printText;

            var elName = container.Query <TextElement>(null, "m-unique-id-error__name").Last();

            elName.text = _report.Path;

            container
            .Query <UnityEngine.UIElements.Button>(null, "m-unique-id-error__fix")
            .Last()
            .clicked += FixId;

            container
            .Query <UnityEngine.UIElements.Button>(null, "m-unique-id-error__show")
            .Last()
            .clicked += ShowId;
        }
Example #2
0
        public SceneSearch(VisualElement container, ReportScene report, Action <ReportId> onFixId) : base(container)
        {
            var results = _container.Query <VisualElement>(null, "o-scene-search__results").Last();
            var title   = container.Query <TextElement>(null, "o-scene-search__title").Last();

            title.text = report.Path;

            report.Errors.ForEach((error) => {
                _errors.Add(new UniqueIdError(results, report, error, onFixId));
            });
        }
Example #3
0
        private async Task<bool> TryCycleScene(ReportScene source)
        {
            try
            {   
                obs.SetCurrentScene(source.SceneName);
                logger.LogDebug($"set scene to: {source.SceneName}");
                await Task.Delay(source.DisplayTime);
                return true;
            }
            catch (Exception e)
            {
                logger.LogError(e, $"could not set scene to {source.SceneName}");
            }

            return false;
        }
        private async Task <bool> TryCycleSceneAsync(ReportScene source)
        {
            try
            {
                obs.SetCurrentScene(source.SceneName);
                logger.LogInformation($"set scene to: {source.SceneName}");
                await Task.Delay(source.DisplayTime).ConfigureAwait(false);

                return(true);
            }
            catch (Exception e)
            {
                logger.LogError(e, $"could not set scene to {source.SceneName}");
            }

            return(false);
        }
        private bool TrySetBrowserSourceSegment(List <SourceInfo> sourceList, ReportScene segment)
        {
            var url    = segment.SourceUrl.ToString().Replace("[ID]", context.Current.LoadedReplay.ReplayId.Value.ToString());
            var source = sourceList.Find(si => si.Name.Equals(segment.SourceName, StringComparison.OrdinalIgnoreCase));

            if (source != null)
            {
                try
                {
                    SourceSettings sourceSettings  = obs.GetSourceSettings(source.Name);
                    JObject        browserSettings = sourceSettings.sourceSettings;
                    browserSettings["url"] = url;
                    obs.SetSourceSettings(source.Name, browserSettings);
                    return(true);
                }
                catch (Exception e)
                {
                    logger.LogError(e, $"could not set {segment.SceneName} URL to: {url}");
                }
            }

            return(false);
        }
Example #6
0
        private bool TrySetBrowserSourceSegment(int replayId, OBSWebsocket obs, List<SourceInfo> sourceList, ReportScene segment)
        {
            var url = segment.SourceUrl.Replace("[ID]", replayId.ToString());
            var source = sourceList.Find(si => si.Name.Equals(segment.SourceName, StringComparison.OrdinalIgnoreCase));

            if (source != null)
            {
                try
                {
                    SourceSettings sourceSettings = obs.GetSourceSettings(source.Name);
                    JObject browserSettings = sourceSettings.sourceSettings;
                    browserSettings["url"] = url;
                    obs.SetSourceSettings(source.Name, browserSettings);
                    logger.LogDebug($"set {segment.SceneName} URL to: {url}");
                    return true;
                }
                catch (Exception e)
                {
                    logger.LogError(e, $"could not set {segment.SceneName} URL to: {url}");
                }
            }

            return false;
        }