コード例 #1
0
        private void Awake()
        {
            TypeConverterSupporter.Init();
            DontDestroyOnLoad(this);
            Logger = base.Logger;
            Settings.Init(Config);
            RuntimeConfig.Init();
            HarmonyPatches.Init();

            var Lib = new ModHelper.ModHelper(GUID, "YanLib");

            Lib.SettingUI = new Container()
            {
                Group =
                {
                    Direction = Direction.Horizontal,
                    Spacing   = 3
                },
                Element  = { PreferredSize = { 0, 50 } },
                Children =
                {
                    new TaiwuLabel()
                    {
                        Text = "事件的选项快捷键"
                    },
                    new TaiwuToggle()
                    {
                        Text           = Settings.ChoiceHotkey.Value ? "开" : "关",
                        isOn           = Settings.ChoiceHotkey.Value,
                        onValueChanged = (bool value, Toggle tg) =>
                        {
                            tg.Text = value ? "开" : "关";
                            Settings.ChoiceHotkey.Value = value;
                        },
                        Element    = { PreferredSize = { 50 } },
                        TipTitle   = "事件的选项快捷键",
                        TipContant = "开启后,选项前九个将会允许用快捷键选择",
                    }
                }
            };
        }