コード例 #1
0
        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();
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
ファイル: SettingsMenu.cs プロジェクト: MeepsKitten/NotReaper
 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();
 }
コード例 #4
0
        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();
        }
コード例 #5
0
ファイル: UISettings.cs プロジェクト: MeepsKitten/NotReaper
    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!"));
    }