using UnityEngine;
using Unity.Collections;
using System.Collections;

namespace NBF.Setting
{
    [Sort(1)]
    public class FullScreenModeSetting : MultiOption<FullScreenMode>
    {
        public override string Name => "FullScreenMode";
        public override string Group => SettingsDef.Group.Graphic;
        public override string Tab => SettingsDef.Tab.Graphic;
        protected override int DefaultValue => (int)FullScreenMode.ExclusiveFullScreen;

        protected override void OnInitialize()
        {
            AddOption(nameof(FullScreenMode.ExclusiveFullScreen), FullScreenMode.ExclusiveFullScreen);
            AddOption(nameof(FullScreenMode.Windowed), FullScreenMode.Windowed);
            AddOption(nameof(FullScreenMode.FullScreenWindow), FullScreenMode.FullScreenWindow);
            AddOption(nameof(FullScreenMode.MaximizedWindow), FullScreenMode.MaximizedWindow);
        }

        protected override void OnApply()
        {
            Screen.fullScreenMode = GetSelectedOption();
            if (Screen.fullScreenMode == FullScreenMode.ExclusiveFullScreen)
            {
                Screen.fullScreen = true;
            }

            var nmsl = KeyCode.Alpha0;

            Debug.Log($"FullScreenMode: {Screen.fullScreenMode} value: {GetSelectedOption()}");
        }
    }
}