public void Initialize() { if (NiceMissManager.modActive) { objectmanager.noteDidStartJumpEvent += Objectmanager_noteDidStartJumpEvent; objectmanager.noteWasCutEvent += Objectmanager_noteWasCutEvent; objectmanager.noteWasMissedEvent += Objectmanager_noteWasMissedEvent; } missColor = PluginConfig.Instance.Mode == PluginConfig.ModeEnum.Hitscore ? PluginConfig.Instance.HitscoreColors.Find(x => x.type == HitscoreColor.TypeEnum.Miss) : null; }
private void MoveEntryDown() { if (selectedIndex < PluginConfig.Instance.HitscoreColors.Count - 1) { int tmpIndex = selectedIndex + 1; HitscoreColor tmp = PluginConfig.Instance.HitscoreColors[tmpIndex]; PluginConfig.Instance.HitscoreColors[tmpIndex] = PluginConfig.Instance.HitscoreColors[selectedIndex]; PluginConfig.Instance.HitscoreColors[selectedIndex] = tmp; UpdateTable(); customListTableData.tableView.SelectCellWithIdx(tmpIndex); HitscoreSelect(customListTableData.tableView, tmpIndex); } }
public void ShowModal(Transform parent) { hitscoreColor = new HitscoreColor(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(type))); UpdateSliderRange(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(notUseMiss))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(min))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(max))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(color))); Parse(parent); parserParams.EmitEvent("closeModal"); parserParams.EmitEvent("openModal"); }
private void OnEntryAdded(HitscoreColor entryToAdd) { if (entryToAdd.type == HitscoreColor.TypeEnum.Miss) { entryToAdd.max = 0; } int duplicateEntryIndex = PluginConfig.Instance.HitscoreColors.FindIndex(x => x.max == entryToAdd.max && x.type == entryToAdd.type); if (duplicateEntryIndex != -1) { PluginConfig.Instance.HitscoreColors[duplicateEntryIndex] = entryToAdd; } else { PluginConfig.Instance.HitscoreColors.Add(entryToAdd); } PluginConfig.Instance.Changed(); }