public void CreateMenu(TextMenu menu, bool inGame) { currentPreset = 0; enabledText = new TextMenu.OnOff(Dialog.Clean("MODOPTIONS_HYPERLINE_ENABLED"), Settings.Enabled).Change(EnabledToggled); allowMapHairText = new TextMenu.OnOff(Dialog.Clean("MODOPTIONS_HYPERLINE_ALLOWMAPHAIR"), Settings.AllowMapHairColors).Change(v => Settings.AllowMapHairColors = v); maddyCrownText = new TextMenu.OnOff("Maddy Crown Support:", Settings.DoMaddyCrown).Change(v => { Settings.DoMaddyCrown = v; }); doFeatherColorText = new TextMenu.OnOff("Do Feather Color", Settings.DoFeatherColor).Change(v => { Settings.DoFeatherColor = v; }); doDashFlashText = new TextMenu.OnOff("Do Dash Flash", Settings.DoDashFlash).Change(v => { Settings.DoDashFlash = v; }); menu.Add(enabledText); menu.Add(allowMapHairText); menu.Add(maddyCrownText); menu.Add(doFeatherColorText); menu.Add(doDashFlashText); CreatePresetMenu(menu); colorMenus = new List <List <List <TextMenu.Item> > >(); //dashes dashCountMenu = new TextMenuExt.OptionSubMenu("Dashes"); dashCountMenu.SetInitialSelection(lastDash); dashCountMenu.Change(v => { UpdateHairType(v, Settings.hairTypeList[v]); }); for (int counterd = 0; counterd < Hyperline.MAX_DASH_COUNT; counterd++) { int r = counterd; List <TextMenu.Item> Menu = new List <TextMenu.Item>(); TextMenuExt.EnumerableSlider <uint> HairTypeMenu; colorMenus.Add(CreateDashCountMenu(menu, inGame, counterd, out HairTypeMenu)); if (!inGame) { Menu.Add(new TextMenu.Button("Custom Texture: " + Settings.hairTextureSource[counterd]).Pressed(() => { Audio.Play(SFX.ui_main_savefile_rename_start); menu.SceneAs <Overworld>().Goto <OuiModOptionString>().Init <OuiModOptions>(Settings.hairTextureSource[r], v => { Settings.hairTextureSource[r] = v; Settings.LoadCustomTexture(r); }, 12); })); Menu.Add(new TextMenu.Button("Custom Bangs: " + Settings.hairBangsSource[counterd]).Pressed(() => { Audio.Play(SFX.ui_main_savefile_rename_start); menu.SceneAs <Overworld>().Goto <OuiModOptionString>().Init <OuiModOptions>(Settings.hairBangsSource[r], v => { Settings.hairBangsSource[r] = v; Settings.LoadCustomBangs(r); }, 12); })); } Menu.Add(new TextMenu.Slider("Speed:", StringFromInt, HyperlineSettings.MIN_HAIR_SPEED, HyperlineSettings.MAX_HAIR_SPEED, Settings.hairSpeedList[counterd]).Change(v => { SetHairSpeed(r, v); })); Menu.Add(new TextMenu.Slider("Length:", StringFromInt, HyperlineSettings.MIN_HAIR_LENGTH, Settings.HairLengthSoftCap, Settings.hairLengthList[counterd]).Change(v => { SetHairLength(r, v); })); Menu.Add(HairTypeMenu); if (!inGame) { for (int i = 0; i < colorMenus[counterd].Count; i++) { for (int j = 0; j < colorMenus[counterd][i].Count; j++) { Menu.Add(colorMenus[counterd][i][j]); } } } dashCountMenu.Add(counterd.ToString(), Menu); } menu.Add(dashCountMenu); UpdateHairType(lastDash, Settings.hairTypeList[lastDash]); EnabledToggled(Settings.Enabled); }
// ReSharper disable once UnusedMember.Global public void CreateEnabledEntry(TextMenu textMenu, bool inGame) { firstTextMenu = new TextMenu.OnOff(DialogIds.Enabled.DialogClean(), Enabled); firstTextMenu.Change(enabled => { Enabled = enabled; if (enabled) { bool isBeforeMoreOptionsItem = false; foreach (TextMenu.Item item in textMenu.Items) { if (isBeforeMoreOptionsItem) { item.Visible = true; } if (firstTextMenu == item) { isBeforeMoreOptionsItem = true; } if (moreOptionsTextMenu == item) { isBeforeMoreOptionsItem = false; } } } else { bool isSpeedrunToolItem = false; foreach (TextMenu.Item item in textMenu.Items) { if (isSpeedrunToolItem) { item.Visible = false; } if (firstTextMenu == item) { isSpeedrunToolItem = true; } if (lastTextMenu == item) { isSpeedrunToolItem = false; } } } moreOptionsTextMenu.Visible = enabled; }); textMenu.Add(firstTextMenu); }
public void CreateSelectedSkinModEntry(TextMenu menu, bool inGame) { var skinSelectMenu = new TextMenu.Option <string>(Dialog.Clean("SKIN_MOD_HELPER_SETTINGS_SELECTED_SKIN_MOD")); skinSelectMenu.Add(Dialog.Clean("SKIN_MOD_HELPER_SETTINGS_SELECTED_SKIN_MOD_DEFAULT"), SkinModHelperConfig.DEFAULT_SKIN, true); foreach (SkinModHelperConfig config in SkinModHelperModule.skinConfigs.Values) { bool selected = (config.SkinId == SkinModHelperModule.Settings.SelectedSkinMod); skinSelectMenu.Add(Dialog.Clean(config.SkinDialogKey), config.SkinId, selected); } // Set our update action on our complete menu skinSelectMenu.Change(skinId => SkinModHelperModule.UpdateSkin(skinId)); if (inGame) { skinSelectMenu.AddDescription(menu, Dialog.Clean("SKIN_MOD_HELPER_SETTINGS_SELECTED_SKIN_MOD_DESCRIPTION")); } menu.Add(skinSelectMenu); }
protected override void addOptionsToMenu(TextMenu menu, bool inGame, object[] parameters) { //DIE dieEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Die), Settings.Die, true).Change(i => Settings.Die = i); dieVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.DieVoteLimit), i => i.ToString(), 1, 100, Settings.DieVoteLimit, 1).Change(i => Settings.DieVoteLimit = i); menu.Add(dieEnabledOption); menu.Add(dieVoteLimitOption); //BLUR blurEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Blur), Settings.Blur, true).Change(i => Settings.Blur = i); blurVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.BlurVoteLimit), i => i.ToString(), 1, 100, Settings.BlurVoteLimit, 1).Change(i => Settings.BlurVoteLimit = i); menu.Add(blurEnabledOption); menu.Add(blurVoteLimitOption); //BUMP bumpEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Bump), Settings.Bump, true).Change(i => Settings.Bump = i); bumpVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.BumpVoteLimit), i => i.ToString(), 1, 100, Settings.BumpVoteLimit, 1).Change(i => Settings.BumpVoteLimit = i); menu.Add(bumpEnabledOption); menu.Add(bumpVoteLimitOption); //SEEKER seekerEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Seeker), Settings.Seeker, true).Change(i => Settings.Seeker = i); seekerVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.SeekerVoteLimit), i => i.ToString(), 1, 100, Settings.SeekerVoteLimit, 1).Change(i => Settings.SeekerVoteLimit = i); seekerShowSeekerNamesOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.ShowSeekerNames), Settings.ShowSeekerNames, true).Change(i => Settings.ShowSeekerNames = i); menu.Add(seekerEnabledOption); menu.Add(seekerVoteLimitOption); menu.Add(seekerShowSeekerNamesOption); //MIRROR mirrorEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Mirror), Settings.Mirror, true).Change(i => Settings.Mirror = i); mirrorVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.MirrorVoteLimit), i => i.ToString(), 1, 100, Settings.MirrorVoteLimit, 1).Change(i => Settings.MirrorVoteLimit = i); menu.Add(mirrorEnabledOption); menu.Add(mirrorVoteLimitOption); //KEVIN kevinEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Kevin), Settings.Kevin, true).Change(i => Settings.Kevin = i); kevinVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.KevinVoteLimit), i => i.ToString(), 1, 100, Settings.KevinVoteLimit, 1).Change(i => Settings.KevinVoteLimit = i); menu.Add(kevinEnabledOption); menu.Add(kevinVoteLimitOption); //DISABLE GRAB disableGrabEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.DisableGrab), Settings.DisableGrab, true).Change(i => Settings.DisableGrab = i); disableGrabVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.DisableGrabVoteLimit), i => i.ToString(), 1, 100, Settings.DisableGrabVoteLimit, 1).Change(i => Settings.DisableGrabVoteLimit = i); menu.Add(disableGrabEnabledOption); menu.Add(disableGrabVoteLimitOption); //INVISIBLE invisibleEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Invisible), Settings.Invisible, true).Change(i => Settings.Invisible = i); invisibleVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.InvisibleVoteLimit), i => i.ToString(), 1, 100, Settings.InvisibleVoteLimit, 1).Change(i => Settings.InvisibleVoteLimit = i); menu.Add(invisibleEnabledOption); menu.Add(invisibleVoteLimitOption); //INVERT invertEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Invert), Settings.Invert, true).Change(i => Settings.Invert = i); invertVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.InvertVoteLimit), i => i.ToString(), 1, 100, Settings.InvertVoteLimit, 1).Change(i => Settings.InvertVoteLimit = i); menu.Add(invertEnabledOption); menu.Add(invertVoteLimitOption); //LOW FRICTION lowFrictionEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.LowFriction), Settings.LowFriction, true).Change(i => Settings.LowFriction = i); lowFrictionVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.LowFrictionVoteLimit), i => i.ToString(), 1, 100, Settings.LowFrictionVoteLimit, 1).Change(i => Settings.LowFrictionVoteLimit = i); menu.Add(lowFrictionEnabledOption); menu.Add(lowFrictionVoteLimitOption); //OSHIRO oshiroEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Oshiro), Settings.Oshiro, true).Change(i => Settings.Oshiro = i); oshiroVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.OshiroVoteLimit), i => i.ToString(), 1, 100, Settings.OshiroVoteLimit, 1).Change(i => Settings.OshiroVoteLimit = i); menu.Add(oshiroEnabledOption); menu.Add(oshiroVoteLimitOption); //SNOWBALL snowballEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Snowball), Settings.Snowball, true).Change(i => Settings.Snowball = i); snowballVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.SnowballVoteLimit), i => i.ToString(), 1, 100, Settings.SnowballVoteLimit, 1).Change(i => Settings.SnowballVoteLimit = i); snowballShowSnowballNamesOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.ShowSnowballNames), Settings.ShowSnowballNames, true).Change(i => Settings.ShowSnowballNames = i); menu.Add(snowballEnabledOption); menu.Add(snowballVoteLimitOption); menu.Add(snowballShowSnowballNamesOption); //DOUBLE DASH doubleDashEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.DoubleDash), Settings.DoubleDash, true).Change(i => Settings.DoubleDash = i); doubleDashVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.DoubleDashVoteLimit), i => i.ToString(), 1, 100, Settings.DoubleDashVoteLimit, 1).Change(i => Settings.DoubleDashVoteLimit = i); menu.Add(doubleDashEnabledOption); menu.Add(doubleDashVoteLimitOption); //GODMODE godModeEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.GodMode), Settings.GodMode, true).Change(i => Settings.GodMode = i); godModeVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.GodModeVoteLimit), i => i.ToString(), 1, 100, Settings.GodModeVoteLimit, 1).Change(i => Settings.GodModeVoteLimit = i); menu.Add(godModeEnabledOption); menu.Add(godModeVoteLimitOption); //FISH fishEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Fish), Settings.Fish, true).Change(i => Settings.Fish = i); fishVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.FishVoteLimit), i => i.ToString(), 1, 100, Settings.FishVoteLimit, 1).Change(i => Settings.FishVoteLimit = i); menu.Add(fishEnabledOption); menu.Add(fishVoteLimitOption); //WIND windEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Wind), Settings.Wind, true).Change(i => Settings.Wind = i); windVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.WindVoteLimit), i => i.ToString(), 1, 100, Settings.WindVoteLimit, 1).Change(i => Settings.WindVoteLimit = i); menu.Add(windEnabledOption); menu.Add(windVoteLimitOption); //FEATHER featherEnabledOption = new TextMenuExt.OnOff(Dialog.Clean(DialogIds.Feather), Settings.Feather, true).Change(i => Settings.Feather = i); featherVoteLimitOption = new TextMenuExt.Slider(Dialog.Clean(DialogIds.FeatherVoteLimit), i => i.ToString(), 1, 100, Settings.FeatherVoteLimit, 1).Change(i => Settings.FeatherVoteLimit = i); menu.Add(featherEnabledOption); menu.Add(featherVoteLimitOption); }