From 1165d5988633e115b9c0c7190be37b07663fc7b9 Mon Sep 17 00:00:00 2001 From: EliteAsian Date: Thu, 11 May 2023 17:45:08 -0400 Subject: [PATCH] Only show "Sit Out" if more than one player --- Assets/Script/UI/DifficultySelect.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Assets/Script/UI/DifficultySelect.cs b/Assets/Script/UI/DifficultySelect.cs index 3309fc339..6c68cd549 100644 --- a/Assets/Script/UI/DifficultySelect.cs +++ b/Assets/Script/UI/DifficultySelect.cs @@ -226,8 +226,6 @@ private void UpdateInstrument() { var availableInstruments = allInstruments .Where(instrument => MainMenu.Instance.chosenSong.HasInstrument(instrument)).ToList(); - Debug.Log(MainMenu.Instance.chosenSong.AvailableParts); - // Force add pro drums and five lane if (availableInstruments.Contains(Instrument.DRUMS)) { availableInstruments.Add(Instrument.GH_DRUMS); @@ -244,16 +242,25 @@ private void UpdateInstrument() { // Filter out to only allowed instruments availableInstruments.RemoveAll(i => !player.inputStrategy.GetAllowedInstruments().Contains(i)); - optionCount = availableInstruments.Count + 1; + bool showSitOut = availableInstruments.Count <= 0 || PlayerManager.players.Count > 1; + + optionCount = availableInstruments.Count + (showSitOut ? 1 : 0); + if (showSitOut) { + optionCount++; + } // Add to options - var ops = new string[availableInstruments.Count + 1]; + var ops = new string[optionCount]; instruments = new string[availableInstruments.Count]; for (int i = 0; i < instruments.Length; i++) { instruments[i] = availableInstruments[i].ToStringName(); ops[i] = availableInstruments[i].ToLocalizedName(); } - ops[^1] = "Sit Out"; + + // Add sit out (only if there are more than 1 player) + if (showSitOut) { + ops[^1] = "Sit Out"; + } // Set text and sprites for (int i = 0; i < 6; i++) {