diff --git a/Assets/UdonSharp/GameManager.cs b/Assets/UdonSharp/GameManager.cs index f67f4d0..2cc163f 100644 --- a/Assets/UdonSharp/GameManager.cs +++ b/Assets/UdonSharp/GameManager.cs @@ -9,7 +9,6 @@ using VRC.SDKBase; using VRC.SDK3.StringLoading; using TMPro; using VRC.SDK3.Components; -using HarmonyLib; public enum QuestionType @@ -132,7 +131,7 @@ public class GameManager : UdonSharpBehaviour _QuestionCorrectResponse = (int)_CurrentQuestion["Correct Response"].Number; _Answer.text = Choices[_QuestionCorrectResponse].ToString(); - DisableInteractive = false; + EnableInteraction("Reveal Choices"); } private void MultipleChoiceRevealChoices() @@ -178,7 +177,7 @@ public class GameManager : UdonSharpBehaviour NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)PlayerPodiums[i], NetworkEventTarget.All, "SetCardChoices", ChoiceStrings, ChoiceOrder); } - DisableInteractive = false; + EnableInteraction("Lock Answers"); } private void MultipleChoiceLockAnswers() @@ -202,10 +201,10 @@ public class GameManager : UdonSharpBehaviour } } - DisableInteractive = false; + EnableInteraction("Reveal Answers And Assign Points"); } - private void MultipleChoiceConfirmAnswers() + private void MultipleChoiceRevealAnswersAndAssignPoints() { _InfoHeader.text = "ANSWER REVEALED"; @@ -214,7 +213,7 @@ public class GameManager : UdonSharpBehaviour NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)PlayerPodiums[i], NetworkEventTarget.All, "VerifyResponse", _QuestionCorrectResponse); } - DisableInteractive = false; + EnableInteraction("Next Question"); } @@ -233,9 +232,9 @@ public class GameManager : UdonSharpBehaviour _QuestionCorrectResponse = (int)_CurrentQuestion["Correct Response"].Number; _QuestionStage = 0; - ResetInfoCard("Next Question"); + ResetInfoCard(); - DisableInteractive = false; + EnableInteraction("Show Next Question"); } private void ResetInfoCard(string Header = "") @@ -327,7 +326,7 @@ public class GameManager : UdonSharpBehaviour private void AdvanceQuestion() { // Disable interaction until we unlock it again later. - DisableInteractive = true; + DisableInteraction(); _QuestionStage++; @@ -350,11 +349,11 @@ public class GameManager : UdonSharpBehaviour { switch(_QuestionStage) { - case 1: NewMultipleChoiceQuestion(); break; - case 2: MultipleChoiceRevealChoices(); break; - case 3: MultipleChoiceLockAnswers(); break; - case 4: MultipleChoiceConfirmAnswers(); break; - case 5: AdvanceToNextQuestion(); break; + case 1: NewMultipleChoiceQuestion(); break; + case 2: MultipleChoiceRevealChoices(); break; + case 3: MultipleChoiceLockAnswers(); break; + case 4: MultipleChoiceRevealAnswersAndAssignPoints(); break; + case 5: AdvanceToNextQuestion(); break; default: return; } } @@ -395,10 +394,29 @@ public class GameManager : UdonSharpBehaviour public override void OnPickupUseDown() { - if (DisableInteractive) { return; } + if (IsInteractionDisabled()) { return; } AdvanceQuestion(); base.OnPickupUseDown(); } + + private void EnableInteraction(string InteractionText = "Advance") + { + DisableInteractive = false; + VRCPickup Pickup = GetComponent(); + if (Pickup != null) + { + Pickup.InteractionText = InteractionText; + } + } + private void DisableInteraction() + { + DisableInteractive = true; + } + + private bool IsInteractionDisabled() + { + return DisableInteractive; + } }