コード例 #1
0
        public static EaseInSubMenu CreateSubMenu(TextMenu menu, bool inGame)
        {
            subMenuItem = new EaseInSubMenu("Show Hitboxes".ToDialogText(), false).Apply(subMenu => {
                subMenu.Add(new TextMenu.OnOff("Enabled".ToDialogText(), Settings.ShowHitboxes).Change(value => Settings.ShowHitboxes = value));
                subMenu.Add(new TextMenu.OnOff("Show Trigger Hitboxes".ToDialogText(), Settings.ShowTriggerHitboxes).Change(value =>
                                                                                                                            Settings.ShowTriggerHitboxes = value));
                subMenu.Add(new TextMenu.OnOff("Show Unloaded Rooms Hitboxes".ToDialogText(), Settings.ShowUnloadedRoomsHitboxes).Change(value =>
                                                                                                                                         Settings.ShowUnloadedRoomsHitboxes = value));
                subMenu.Add(new TextMenu.Option <ActualCollideHitboxType>("Actual Collide Hitboxes".ToDialogText()).Apply(option => {
                    Array enumValues = Enum.GetValues(typeof(ActualCollideHitboxType));
                    foreach (ActualCollideHitboxType value in enumValues)
                    {
                        option.Add(value.ToString().SpacedPascalCase().ToDialogText(), value, value.Equals(Settings.ShowActualCollideHitboxes));
                    }

                    option.Change(value => Settings.ShowActualCollideHitboxes = value);
                }));
                subMenu.Add(new TextMenu.OnOff("Simplified Hitboxes".ToDialogText(), Settings.SimplifiedHitboxes).Change(value =>
                                                                                                                         Settings.SimplifiedHitboxes = value));
                subMenu.Add(HitboxColor.CreateEntityHitboxColorButton(menu, inGame));
                subMenu.Add(HitboxColor.CreateTriggerHitboxColorButton(menu, inGame));
                subMenu.Add(HitboxColor.CreatePlatformHitboxColorButton(menu, inGame));
            });
            return(subMenuItem);
        }
コード例 #2
0
 public static EaseInSubMenu CreateSubMenu()
 {
     subMenuItem = new EaseInSubMenu("Info HUD".ToDialogText(), false).Apply(subMenu => {
         subMenu.Add(new TextMenu.OnOff("Enabled".ToDialogText(), TasSettings.InfoHud).Change(value => TasSettings.InfoHud     = value));
         subMenu.Add(new TextMenu.OnOff("Info Game".ToDialogText(), TasSettings.InfoGame).Change(value => TasSettings.InfoGame = value));
         subMenu.Add(new TextMenu.OnOff("Info TAS Input".ToDialogText(), TasSettings.InfoTasInput).Change(value =>
                                                                                                          TasSettings.InfoTasInput = value));
         subMenu.Add(new TextMenu.OnOff("Info Subpixel Indicator".ToDialogText(), TasSettings.InfoSubpixelIndicator).Change(value =>
                                                                                                                            TasSettings.InfoSubpixelIndicator = value));
         subMenu.Add(new TextMenuExt.EnumerableSlider <HudOptions>("Info Custom".ToDialogText(), CreateHudOptions(), TasSettings.InfoCustom)
                     .Change(value => TasSettings.InfoCustom = value));
         subMenu.Add(new TextMenu.Button("Info Copy Custom Template".ToDialogText()).Pressed(() =>
                                                                                             TextInput.SetClipboardText(string.IsNullOrEmpty(TasSettings.InfoCustomTemplate) ? "\0" : TasSettings.InfoCustomTemplate)));
         subMenu.Add(new TextMenu.Button("Info Set Custom Template".ToDialogText()).Pressed(() => {
             TasSettings.InfoCustomTemplate = TextInput.GetClipboardText() ?? string.Empty;
             CelesteTasModule.Instance.SaveSettings();
         }));
         subMenu.Add(new TextMenuExt.EnumerableSlider <HudOptions>("Info Watch Entity".ToDialogText(), CreateHudOptions(),
                                                                   TasSettings.InfoWatchEntity).Change(value => TasSettings.InfoWatchEntity = value));
         subMenu.Add(new TextMenuExt.EnumerableSlider <WatchEntityType>("Info Watch Entity Type".ToDialogText(), new[] {
             new KeyValuePair <WatchEntityType, string>(WatchEntityType.Position, "Info Watch Entity Position".ToDialogText()),
             new KeyValuePair <WatchEntityType, string>(WatchEntityType.DeclaredOnly, "Info Watch Entity Declared Only".ToDialogText()),
             new KeyValuePair <WatchEntityType, string>(WatchEntityType.All, "Info Watch Entity All".ToDialogText()),
         }, TasSettings.InfoWatchEntityType).Change(value => TasSettings.InfoWatchEntityType = value));
         subMenu.Add(new TextMenuExt.IntSlider("Info Text Size".ToDialogText(), 5, 20, TasSettings.InfoTextSize).Change(value =>
                                                                                                                        TasSettings.InfoTextSize = value));
         subMenu.Add(new TextMenuExt.IntSlider("Info Subpixel Indicator Size".ToDialogText(), 5, 20, TasSettings.InfoSubpixelIndicatorSize)
                     .Change(value =>
                             TasSettings.InfoSubpixelIndicatorSize = value));
         subMenu.Add(new TextMenuExt.IntSlider("Info Opacity".ToDialogText(), 1, 10, TasSettings.InfoOpacity).Change(value =>
                                                                                                                     TasSettings.InfoOpacity = value));
         subMenu.Add(new TextMenuExt.IntSlider("Info Masked Opacity".ToDialogText(), 0, 10, TasSettings.InfoMaskedOpacity).Change(value =>
                                                                                                                                  TasSettings.InfoMaskedOpacity = value));
     });
     return(subMenuItem);
 }