private static EaseInSubMenu CreateHotkeysSubMenu(EverestModule everestModule, TextMenu menu) { return(new EaseInSubMenu("Hotkeys".ToDialogText(), false).Apply(subMenu => { subMenu.Add(new TextMenu.Button(Dialog.Clean("options_keyconfig")).Pressed(() => { subMenu.Focused = false; KeyboardConfigUI keyboardConfig; if (CreateKeyboardConfigUi != null) { keyboardConfig = (KeyboardConfigUI)CreateKeyboardConfigUi.Invoke(everestModule, new object[] { menu }); } else { keyboardConfig = new ModuleSettingsKeyboardConfigUI(everestModule); } keyboardConfig.OnClose = () => { subMenu.Focused = true; }; Engine.Scene.Add(keyboardConfig); Engine.Scene.OnEndOfFrame += () => Engine.Scene.Entities.UpdateLists(); })); subMenu.Add(new TextMenu.Button(Dialog.Clean("options_btnconfig")).Pressed(() => { subMenu.Focused = false; ButtonConfigUI buttonConfig; if (CreateButtonConfigUI != null) { buttonConfig = (ButtonConfigUI)CreateButtonConfigUI.Invoke(everestModule, new object[] { menu }); } else { buttonConfig = new ModuleSettingsButtonConfigUI(everestModule); } buttonConfig.OnClose = () => { subMenu.Focused = true; }; Engine.Scene.Add(buttonConfig); Engine.Scene.OnEndOfFrame += () => Engine.Scene.Entities.UpdateLists(); })); }).Apply(subMenu => hotkeysSubMenu = subMenu)); }
private static void CreateOptions(EverestModule everestModule, TextMenu menu, bool inGame) { options = new List <TextMenu.Item> { HitboxTweak.CreateSubMenu(menu, inGame), SimplifiedGraphicsFeature.CreateSubMenu(), InfoHud.CreateSubMenu(), new TextMenuExt.SubMenu("Round Values".ToDialogText(), false).Apply(subMenu => { subMenu.Add(new TextMenu.OnOff("Round Position".ToDialogText(), Settings.RoundPosition).Change(value => Settings.RoundPosition = value)); subMenu.Add(new TextMenu.OnOff("Round Speed".ToDialogText(), Settings.RoundSpeed).Change(value => Settings.RoundSpeed = value)); subMenu.Add(new TextMenu.OnOff("Round Velocity".ToDialogText(), Settings.RoundVelocity).Change(value => Settings.RoundVelocity = value)); subMenu.Add(new TextMenu.OnOff("Round Custom Info".ToDialogText(), Settings.RoundCustomInfo).Change(value => Settings.RoundCustomInfo = value)); }), new TextMenuExt.SubMenu("Relaunch Required".ToDialogText(), false).Apply(subMenu => { subMenu.Add(new TextMenu.OnOff("Launch Studio At Boot".ToDialogText(), Settings.LaunchStudioAtBoot).Change(value => Settings.LaunchStudioAtBoot = value)); subMenu.Add(new TextMenu.OnOff("Auto Extract New Studio".ToDialogText(), Settings.AutoExtractNewStudio).Change(value => Settings.AutoExtractNewStudio = value)); // TODO need some guys who know Linux to make it actually work // subMenu.Add(new TextMenu.OnOff("Unix RTC".ToDialogText(), Settings.UnixRtc).Change(value => Settings.UnixRtc = value)); }), new TextMenuExt.SubMenu("More Options".ToDialogText(), false).Apply(subMenu => { subMenu.Add(new TextMenu.OnOff("Center Camera".ToDialogText(), Settings.CenterCamera).Change(value => Settings.CenterCamera = value)); subMenu.Add(new TextMenu.OnOff("Pause After Load State".ToDialogText(), Settings.PauseAfterLoadState).Change(value => Settings.PauseAfterLoadState = value)); subMenu.Add(new TextMenu.OnOff("Restore Settings".ToDialogText(), Settings.RestoreSettings).Change(value => Settings.RestoreSettings = value)); subMenu.Add( new TextMenu.OnOff("Disable Achievements".ToDialogText(), Settings.DisableAchievements).Change(value => Settings.DisableAchievements = value)); subMenu.Add(new TextMenu.OnOff("Mod 9D Lighting".ToDialogText(), Settings.Mod9DLighting).Change(value => Settings.Mod9DLighting = value)); }), new TextMenu.Button(Dialog.Clean("options_keyconfig")).Pressed(() => { menu.Focused = false; Entity keyboardConfig; if (CreateKeyboardConfigUi != null) { keyboardConfig = CreateKeyboardConfigUi.Invoke(everestModule, new object[] { menu }) as Entity; } else { keyboardConfig = new ModuleSettingsKeyboardConfigUI(everestModule) { OnClose = () => menu.Focused = true }; } Engine.Scene.Add(keyboardConfig); Engine.Scene.OnEndOfFrame += () => Engine.Scene.Entities.UpdateLists(); }).Apply(item => keyConfigButton = item) }; }
private static void CreateOptions(EverestModule everestModule, TextMenu menu, bool inGame) { options = new List <TextMenu.Item> { new TextMenuExt.SubMenu("Show Hitboxes".ToDialogText(), false).Apply(subMenu => { showHitboxesSubmenu = subMenu; subMenu.Add(new TextMenu.OnOff("Enabled".ToDialogText(), Settings.ShowHitboxes).Change(value => Settings.ShowHitboxes = value)); subMenu.Add(new TextMenu.Option <ActualCollideHitboxTypes>("Actual Collide Hitboxes".ToDialogText()).Apply(option => { Array enumValues = Enum.GetValues(typeof(ActualCollideHitboxTypes)); foreach (ActualCollideHitboxTypes 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("Hide Trigger Hitboxes".ToDialogText(), Settings.HideTriggerHitboxes).Change(value => Settings.HideTriggerHitboxes = 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.CreateSolidTilesHitboxColorButton(menu, inGame)); }), SimplifiedGraphicsFeature.CreateSimplifiedGraphicsOption(), new TextMenuExt.SubMenu("Relaunch Required".ToDialogText(), false).Apply(subMenu => { subMenu.Add(new TextMenu.OnOff("Launch Studio At Boot".ToDialogText(), Settings.LaunchStudioAtBoot).Change(value => Settings.LaunchStudioAtBoot = value)); subMenu.Add(new TextMenu.OnOff("Auto Extract New Studio".ToDialogText(), Settings.AutoExtractNewStudio).Change(value => Settings.AutoExtractNewStudio = value)); subMenu.Add(new TextMenu.OnOff("Unix RTC".ToDialogText(), Settings.UnixRtc).Change(value => Settings.UnixRtc = value)); }), new TextMenuExt.SubMenu("More Options".ToDialogText(), false).Apply(subMenu => { subMenu.Add(new TextMenu.OnOff("Center Camera".ToDialogText(), Settings.CenterCamera).Change(value => Settings.CenterCamera = value)); subMenu.Add(new TextMenu.OnOff("Round Position".ToDialogText(), Settings.RoundPosition).Change(value => Settings.RoundPosition = value)); subMenu.Add(new TextMenu.Option <InfoPositions>("Info HUD".ToDialogText()).Apply(option => { Array enumValues = Enum.GetValues(typeof(InfoPositions)); foreach (InfoPositions value in enumValues) { option.Add(value.ToString().SpacedPascalCase(), value, value.Equals(Settings.InfoHud)); } option.Change(value => Settings.InfoHud = value); })); subMenu.Add(new TextMenu.OnOff("Pause After Load State".ToDialogText(), Settings.PauseAfterLoadState).Change(value => Settings.PauseAfterLoadState = value)); subMenu.Add(new TextMenu.OnOff("Restore Settings".ToDialogText(), Settings.RestoreSettings).Change(value => Settings.RestoreSettings = value)); subMenu.Add( new TextMenu.OnOff("Disable Achievements".ToDialogText(), Settings.DisableAchievements).Change(value => Settings.DisableAchievements = value)); subMenu.Add(new TextMenu.OnOff("Mod 9D Lighting".ToDialogText(), Settings.Mod9DLighting).Change(value => Settings.Mod9DLighting = value)); }), new TextMenu.Button(Dialog.Clean("options_keyconfig")).Pressed(() => { menu.Focused = false; Entity keyboardConfig; if (CreateKeyboardConfigUi != null) { keyboardConfig = CreateKeyboardConfigUi.Invoke(everestModule, new object[] { menu }) as Entity; } else { keyboardConfig = new ModuleSettingsKeyboardConfigUI(everestModule) { OnClose = () => menu.Focused = true }; } Engine.Scene.Add(keyboardConfig); Engine.Scene.OnEndOfFrame += () => Engine.Scene.Entities.UpdateLists(); }).Apply(item => keyConfigButton = item) }; }