Inheritance: MonoBehaviour
Exemplo n.º 1
0
        private void reload()
        {
            var fileBasedIpc = ipc as FileBasedIPC;

            fillFlow.Children = new Drawable[]
            {
                new ActionableInfo
                {
                    Label      = "Current IPC source",
                    ButtonText = "Refresh",
                    Action     = () =>
                    {
                        fileBasedIpc?.LocateStableStorage();
                        reload();
                    },
                    Value       = fileBasedIpc?.Storage?.GetFullPath(string.Empty) ?? "Not found",
                    Failing     = fileBasedIpc?.Storage == null,
                    Description = "The osu!stable installation which is currently being used as a data source. If a source is not found, make sure you have created an empty ipc.txt in your stable cutting-edge installation, and that it is registered as the default osu! install."
                },
                new ActionableInfo
                {
                    Label      = "Current User",
                    ButtonText = "Change Login",
                    Action     = () =>
                    {
                        api.Logout();

                        if (loginOverlay == null)
                        {
                            AddInternal(loginOverlay = new LoginOverlay
                            {
                                Anchor = Anchor.TopRight,
                                Origin = Anchor.TopRight,
                            });
                        }

                        loginOverlay.State.Value = Visibility.Visible;
                    },
                    Value       = api?.LocalUser.Value.Username,
                    Failing     = api?.IsLoggedIn != true,
                    Description = "In order to access the API and display metadata, a login is required."
                },
                new LabelledDropdown <RulesetInfo>
                {
                    Label       = "Ruleset",
                    Description = "Decides what stats are displayed and which ranks are retrieved for players",
                    Items       = rulesets.AvailableRulesets,
                    Current     = LadderInfo.Ruleset,
                },
                resolution = new ResolutionSelector
                {
                    Label      = "Stream area resolution",
                    ButtonText = "Set height",
                    Action     = height =>
                    {
                        windowSize.Value = new Size((int)(height * aspect_ratio / TournamentSceneManager.STREAM_AREA_WIDTH * TournamentSceneManager.REQUIRED_WIDTH), height);
                    }
                },
            };
        }
Exemplo n.º 2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Initialize(property);

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                if (m_MaskedSourceNames == null)
                {
                    m_MaskedSourceNames = EnumHelper.MaskOutEnumNames <ImageSource>((int)m_SupportedSources);
                }
                var index = EnumHelper.GetMaskedIndexFromEnumValue <ImageSource>(m_Source.intValue, (int)m_SupportedSources);
                index = EditorGUILayout.Popup("Object(s) of interest", index, m_MaskedSourceNames);

                if (check.changed)
                {
                    m_Source.intValue = EnumHelper.GetEnumValueFromMaskedIndex <ImageSource>(index, (int)m_SupportedSources);
                }
            }

            var inputType = (ImageSource)m_Source.intValue;

            if ((ImageSource)m_Source.intValue == ImageSource.TaggedCamera)
            {
                ++EditorGUI.indentLevel;
                EditorGUILayout.PropertyField(m_CameraTag, new GUIContent("Tag"));
                --EditorGUI.indentLevel;
            }

            EditorGUILayout.PropertyField(m_AspectRatio, new GUIContent("Aspect Ratio"));
            EditorGUILayout.PropertyField(m_SuperSampling, new GUIContent("Super sampling"));

            var renderSize = m_RenderSize;

            m_RenderSize.intValue = ResolutionSelector.Popup("Rendering resolution", ImageHeight.x4320p_8K, m_RenderSize.intValue);

            if (m_FinalSize.intValue > renderSize.intValue)
            {
                m_FinalSize.intValue = renderSize.intValue;
            }

            m_FinalSize.intValue = ResolutionSelector.Popup("Output Resolution", target.maxSupportedSize, m_FinalSize.intValue);

            if (m_FinalSize.intValue == (int)ImageHeight.Window)
            {
                m_FinalSize.intValue = (int)ImageHeight.x720p_HD;
            }

            if (m_FinalSize.intValue > renderSize.intValue)
            {
                renderSize.intValue = m_FinalSize.intValue;
            }

            EditorGUILayout.PropertyField(m_FlipFinalOutput, new GUIContent("Flip Vertical"));

            if (Options.verboseMode)
            {
                EditorGUILayout.LabelField("Color Space", target.colorSpace.ToString());
            }
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Initialize(property);

            m_RenderSize.intValue = ResolutionSelector.Popup("Output Resolution", target.maxSupportedSize, m_RenderSize.intValue);

            if (m_RenderSize.intValue > (int)ImageHeight.Window)
            {
                EditorGUILayout.PropertyField(m_RenderAspect, new GUIContent("Aspect Ratio"));
            }
        }
        protected void OnEnable()
        {
            if (target == null)
            {
                return;
            }

            var pf = new PropertyFinder <ScreenCaptureInputSettings>(serializedObject);

            m_RenderSize   = pf.Find(w => w.m_OutputSize);
            m_RenderAspect = pf.Find(w => w.m_AspectRatio);

            m_ResSelector = new ResolutionSelector();
        }
        protected void OnEnable()
        {
            if (target == null)
            {
                return;
            }

            var pf = new PropertyFinder <RenderTextureSamplerSettings>(serializedObject);

            m_Source          = pf.Find(w => w.source);
            m_RenderSize      = pf.Find(w => w.m_RenderSize);
            m_AspectRatio     = pf.Find(w => w.m_AspectRatio);
            m_SuperSampling   = pf.Find(w => w.m_SuperSampling);
            m_FinalSize       = pf.Find(w => w.m_OutputSize);
            m_CameraTag       = pf.Find(w => w.m_CameraTag);
            m_FlipFinalOutput = pf.Find(w => w.m_FlipFinalOutput);
            m_ResSelector     = new ResolutionSelector();
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Initialize(property);

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                if (m_MaskedSourceNames == null)
                {
                    m_MaskedSourceNames = EnumHelper.MaskOutEnumNames <ImageSource>((int)m_SupportedSources);
                }

                var index = EnumHelper.GetMaskedIndexFromEnumValue <ImageSource>(m_Source.intValue, (int)m_SupportedSources);
                index = EditorGUILayout.Popup("Source", index, m_MaskedSourceNames);

                if (check.changed)
                {
                    m_Source.intValue = EnumHelper.GetEnumValueFromMaskedIndex <ImageSource>(index, (int)m_SupportedSources);
                }
            }

            var inputType = (ImageSource)m_Source.intValue;

            if ((ImageSource)m_Source.intValue == ImageSource.TaggedCamera)
            {
                ++EditorGUI.indentLevel;
                EditorGUILayout.PropertyField(m_CameraTag, new GUIContent("Tag"));
                --EditorGUI.indentLevel;
            }

            m_RenderSize.intValue = ResolutionSelector.Popup("Output Resolution", target.maxSupportedSize, m_RenderSize.intValue);

            if (m_RenderSize.intValue > (int)ImageHeight.Window)
            {
                EditorGUILayout.PropertyField(m_RenderAspect, new GUIContent("Aspect Ratio"));
            }

            if (inputType == ImageSource.ActiveCamera)
            {
                EditorGUILayout.PropertyField(m_IncludeUI, new GUIContent("Include UI"));
            }

            EditorGUILayout.PropertyField(m_FlipFinalOutput, new GUIContent("Flip Vertical"));
        }
Exemplo n.º 7
0
        protected void OnEnable()
        {
            if (target == null)
            {
                return;
            }


            var pf = new PropertyFinder <CBRenderTextureInputSettings>(serializedObject);

            m_Source    = pf.Find(w => w.source);
            m_CameraTag = pf.Find(w => w.m_CameraTag);

            m_RenderSize      = pf.Find(w => w.m_OutputSize);
            m_RenderAspect    = pf.Find(w => w.m_AspectRatio);
            m_FlipFinalOutput = pf.Find(w => w.m_FlipFinalOutput);
            m_Transparency    = pf.Find(w => w.m_AllowTransparency);
            m_CaptureUI       = pf.Find(w => w.m_CaptureUI);

            m_ResSelector = new ResolutionSelector();
        }