Exemple #1
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            _spriteCategory = UIResourceManager.SpriteData.SpriteCategories["ui_options"];
            _spriteCategory.Load(UIResourceManager.ResourceContext, UIResourceManager.UIResourceDepot);
            _optionsVm  = new OptionsVM(true, false, OnKeyBindRequest);
            _dataSource = new CustomOptionsViewModel(_optionsVm)
            {
                ModOptions = new CustomOptionCategoryViewModel(_optionsVm, "ModOptions".Localized(),
                                                               OptionsStore.GetRegisteredForGui()
                                                               .SelectMany(store => GenerateOptionDataViewModels(store.GetKnownOptions())))
            };
            _gauntletLayer = new GauntletLayer(4000);
            _gauntletMovie = _gauntletLayer.LoadMovie("CustomOptions", _dataSource);
            _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            _gauntletLayer.InputRestrictions.SetInputRestrictions();
            _gauntletLayer.IsFocusLayer = true;
            _keyBindingPopup            = new KeybindingPopup(SetHotKey, this);
            AddLayer(_gauntletLayer);
            ScreenManager.TrySetFocus(_gauntletLayer);
        }
Exemple #2
0
 public override int CompareTo(OptionsStore other)
 => throw new NotImplementedException();
 public OptionNamespace([NotNull] OptionsStore options, [CanBeNull] string ns)
 {
     _options  = options;
     Namespace = ns;
 }
Exemple #4
0
 protected Option([NotNull] OptionsStore store, [CanBeNull] string ns, [NotNull] string name)
 {
     Store     = store;
     Namespace = ns;
     Name      = name;
 }
 public override bool Equals(OptionsStore other)
 => other is OptionsFile file && Equals(file);
 public StringOption([NotNull] OptionsStore store, [CanBeNull] string ns, [NotNull] string name) : base(store, ns, name)
 {
 }