private void Start() { NRSettings.OnLoad(() => { var img = transform.GetComponent <Image>(); SpriteRenderer sr = GetComponent <SpriteRenderer>(); TextMeshProUGUI text = GetComponent <TextMeshProUGUI>(); Color newColor = GenerateColorForType(type); if (img) { img.color = newColor; } else if (sr) { sr.color = newColor; } else if (text) { text.color = newColor; } }); }
public void OnResetButton() { if (confirmationOfDestructiveActionRequired) { ColorBlock colors = resetButton.colors; colors.normalColor = ErrorColor; resetButton.colors = colors; resetButton.GetComponentInChildren <TextMeshProUGUI> ().text = "Click again to confirm\n(there is no way to undo this)"; confirmationOfDestructiveActionRequired = false; } else { NRSettings.config.snaps = deafultSnaps; HorizontalSnapSelector.elements = deafultSnaps; ChainbuilderIntervalSelector.elements = deafultSnaps; NRSettings.SaveSettingsJson(); confirmationOfDestructiveActionRequired = true; ColorBlock colors = resetButton.colors; colors.normalColor = Color.white; resetButton.colors = colors; resetButton.GetComponentInChildren <TextMeshProUGUI> ().text = "Reset snap presets"; CloseWindow(); } }
public void RemoveSnap(int snap) { Debug.Log("1/" + snap); int indexseek = 0; int desiredIndex = -1; foreach (string element in HorizontalSnapSelector.elements) { if (element == ("1/" + snap)) { desiredIndex = indexseek; break; } ++indexseek; } if (desiredIndex != -1) { HorizontalSnapSelector.elements.RemoveAt(desiredIndex); mode = SnapEditorMode.addMode; SetConfirmButtonInfo(); } ChainbuilderIntervalSelector.elements = HorizontalSnapSelector.elements; NRSettings.config.snaps = HorizontalSnapSelector.elements; NRSettings.SaveSettingsJson(); }
void Start() { Vector3 defaultPos; defaultPos.x = 0; defaultPos.y = 0; defaultPos.z = -10.0f; window.GetComponent <RectTransform> ().localPosition = defaultPos; window.GetComponent <CanvasGroup> ().alpha = 0.0f; window.SetActive(false); ResetColor(); NRSettings.OnLoad(loadSavedSnaps); }
public void ApplyValues() { NRSettings.config.useDiscordRichPresence = richPresence.isOn; NRSettings.config.clearCacheOnStartup = clearCacheOnStartup.isOn; NRSettings.config.enableTraceLines = enableTraceLines.isOn; NRSettings.config.enableDualines = enableDualines.isOn; NRSettings.config.useAutoZOffsetWith360 = useAutoZOffsetWith360.isOn; NRSettings.config.useBouncyAnimations = useBouncyAnimations.isOn; NRSettings.config.playNoteSoundsWhileScrolling = playNoteSoundsWhileScrolling.isOn; NRSettings.config.autoSongVolume = autoSongVolume.isOn; NRSettings.config.leftColor = LeftHand.color; NRSettings.config.rightColor = RightHand.color; NRSettings.config.savedMapperName = savedMapperField.text; NRSettings.config.optimizeInvisibleTargets = optimizeInvisibleTargets.isOn; NRSettings.config.backups = autoSave.isOn; WarningText.SetActive(true); NRSettings.SaveSettingsJson(); }
private void AdjustSnapArray(int snap) { if (mode == SnapEditorMode.addMode) { HorizontalSnapSelector.elements.Add("1/" + snap); HorizontalSnapSelector.elements.Sort(delegate(string l, string r) { return(l.Substring(2).PadLeft(3, '0').CompareTo(r.Substring(2).PadLeft(3, '0'))); }); } else if (mode == SnapEditorMode.subtractMode) { RemoveSnap(snap); } ChainbuilderIntervalSelector.elements = HorizontalSnapSelector.elements; NRSettings.config.snaps = HorizontalSnapSelector.elements; NRSettings.SaveSettingsJson(); }
private void Start() { NRSettings.OnLoad(() => { var img = transform.GetComponent <Image>(); if (img) { Color newColor; if (type == NRThemeableType.Left) { newColor = NRSettings.config.leftColor; } else if (type == NRThemeableType.Right) { newColor = NRSettings.config.rightColor; } else { newColor = NRSettings.config.selectedHighlightColor; } float h, s, v; Color.RGBToHSV(newColor, out h, out s, out v); h += hueModifier; s += saturationModifier; v += valueModifier; newColor = Color.HSVToRGB(h, s, v); img.color = new Color(newColor.r, newColor.g, newColor.b, alpha); } }); }
private void Start() { InputManager.LoadHotkeys(); NRSettings.OnLoad(SetUserColors); }
private void Start() { NRSettings.OnLoad(() => { UpdateUI(); }); }
public void ExportAsCues() { //Pick folder //string prevDir = PlayerPrefs.GetString("recentDirCues", ""); string diff; switch (DifficultyManager.I.loadedIndex) { case 0: diff = "Expert"; break; case 1: diff = "Advanced"; break; case 2: diff = "Standard"; break; default: diff = "Easy"; break; } string fileName = Path.GetFileName(Timeline.audicaFile.filepath)?.Replace(".audica", ""); fileName = fileName + "_NRExport-" + diff + ".cues"; string path; if (!String.IsNullOrEmpty(NRSettings.config.cuesSavePath)) { path = Path.Combine(NRSettings.config.cuesSavePath, fileName); } else { path = StandaloneFileBrowser.SaveFilePanel("Find community_maps/maps folder in Audica folder", Path.Combine(Application.dataPath, @"../"), fileName, "cues"); if (String.IsNullOrEmpty(path)) { return; } NRSettings.config.cuesSavePath = Path.GetDirectoryName(path); NRSettings.SaveSettingsJson(); } //Ensure all chains are generated List <TargetData> nonGeneratedNotes = new List <TargetData>(); foreach (Target note in Timeline.instance.notes) { if (note.data.behavior == TargetBehavior.NR_Pathbuilder && note.data.pathBuilderData.createdNotes == false) { nonGeneratedNotes.Add(note.data); } } foreach (var data in nonGeneratedNotes) { ChainBuilder.GenerateChainNotes(data); } CueFile export = new CueFile(); export.cues = new List <Cue>(); export.NRCueData = new NRCueData(); foreach (Target target in Timeline.orderedNotes) { if (target.data.beatLength == 0) { target.data.beatLength = Constants.SixteenthNoteDuration; } if (target.data.behavior == TargetBehavior.Metronome) { continue; } var cue = NotePosCalc.ToCue(target, Timeline.offset); if (target.data.behavior == TargetBehavior.NR_Pathbuilder) { export.NRCueData.pathBuilderNoteCues.Add(cue); export.NRCueData.pathBuilderNoteData.Add(target.data.pathBuilderData); continue; } export.cues.Add(cue); } File.WriteAllText(path, JsonUtility.ToJson(export)); NotificationShower.Queue(new NRNotification("Saved cues!")); }
public void RegenConfig() { NRSettings.LoadSettingsJson(true); }