Vote[] overallVotes = new Vote[5];//TODO: make dynamic on numberOfRounds (instantiated when roomReady button pressed) //reset var function void clearGameVars() { showReset = false; playerScores = new int[7]; players = new PlayerClass[7]; playerNames = new string[7]; PlayerClass.VoteChoice[,] playerVotes = new PlayerClass.VoteChoice[7, 5];//this has to change if number of rounds changes roundResults = new Vote[5];//this has to change if number of rounds changes currAffilPoints = 0; numberOfPlayers = 0; currentRound = 0; seeVoteScores = false; overallVotes = new Vote[5]; inRoom = false; roomReady = false; chatInput = ""; messages.Clear(); numberOfReadyPlayers = 0; thisPlayerReady = false; affiliation = null; anotherscroller = Vector2.zero; deck = null; groupACards.Clear(); groupBCards.Clear(); host = null; isHost = false; musicSet = false; ourVote = PlayerClass.VoteChoice.ABSTAIN; //should always start abstaining.... overallVotes = new Vote[5]; victimListString = ""; playerVoteHistoryVerticalDisplacement = 0; roomName = "myRoom"; roomScroller = Vector2.zero; scroller = Vector2.zero; scrollPos = Vector2.zero; timeLeft = 15.0f; timerEnabled = false; victimGroupB.Clear(); victimGroupA.Clear(); victimHistoryScroller = Vector2.zero; votesReceived = 0; loginSuccessful = false; }
//Show the game user interface void gameWindowFunction(int WindowID) { GUI.skin.label.fontSize = mediumStyle.fontSize; //Timer if (timeLeft > 0) { GUI.Label(new Rect(5 * Screen.width / 100, 5 * Screen.height / 100, Screen.width / 6, Screen.height / 12), timeLeft.ToString("00")); } else { GUI.Label(new Rect(5 * Screen.width / 100, 5 * Screen.height / 100, Screen.width / 6, Screen.height / 12), "00"); } //Voting Buttons GUI.color = Color.white; if (ourVote == PlayerClass.VoteChoice.A) GUI.color = Color.green; if (GUI.Button(new Rect(5 * Screen.width / 100, 20 * Screen.height / 100, Screen.width / 6, Screen.height / 12), "Kill A")) { ourVote = PlayerClass.VoteChoice.A; } GUI.color = Color.white; if (ourVote == PlayerClass.VoteChoice.B) GUI.color = Color.green; if (GUI.Button(new Rect(5 * Screen.width / 100, 35 * Screen.height / 100, Screen.width / 6, Screen.height / 12), "Kill B")) { ourVote = PlayerClass.VoteChoice.B; } GUI.color = Color.white; //Score Table GUI.Label(new Rect(25 * Screen.width / 100, 5 * Screen.height / 100, Screen.width / 5, Screen.height / 12), "Player"); GUI.Label(new Rect(50 * Screen.width / 100, 5 * Screen.height / 100, Screen.width / 5, Screen.height / 12), "Score"); GUILayout.BeginArea(new Rect(25 * Screen.width / 100, 14 * Screen.height / 100, 40 * Screen.width / 100, 23 * Screen.height / 100)); scroller = GUILayout.BeginScrollView(scroller); for (int i = 0; i < numberOfPlayers; i++) { GUILayout.BeginHorizontal(); GUILayout.Label(playerNames[i]); GUILayout.Label(playerScores[i].ToString()); GUILayout.EndHorizontal(); //GUI.Label(new Rect(1 * Screen.width / 100, (i * 9) * Screen.height / 100, Screen.width / 5, Screen.height / 12), playerNames[i]); //GUI.Label(new Rect(25 * Screen.width / 100, (i * 9) * Screen.height / 100, Screen.width / 5, Screen.height / 12), playerScores[i].ToString()); } GUILayout.EndScrollView(); GUILayout.EndArea(); if (GUI.Button(new Rect(30 * Screen.width / 100, 38 * Screen.height / 100, Screen.width / 5, Screen.height / 12), "Results")) { seeVoteScores = true; } //Chat functionality GUI.SetNextControlName("");//used to be empty string GUILayout.BeginArea(new Rect(70 * Screen.width / 100, 5* Screen.height / 100, 25* Screen.width/100, 43* Screen.height / 100)); //Show scroll list of chat messages scrollPos = GUILayout.BeginScrollView(scrollPos); GUI.color = Color.white;//text color for (int i = messages.Count - 1; i >= 0; i--) { GUILayout.Label(messages[i], mediumStyle); } GUILayout.EndScrollView(); GUI.color = Color.white; //Chat input GUILayout.BeginHorizontal(); GUI.SetNextControlName("ChatField"); chatInput = GUILayout.TextField(chatInput, GUILayout.MinWidth(200)); //when you hit "enter" while typing in the chat box, it sends the message if (Event.current.type == EventType.keyDown && Event.current.character == '\n') { if (GUI.GetNameOfFocusedControl() == "ChatField") { SendChat(PhotonTargets.All); lastUnfocusTime = Time.time;//used to attach a timestamp to every message GUI.FocusControl("");//used to be empty string GUI.UnfocusWindow(); } else {//Fred has NO IDEA what this does if (lastUnfocusTime < Time.time - 0.1f) { GUI.FocusControl("ChatField"); } } } // if (GUILayout.Button("SEND", GUILayout.Height(17))) //SendChat(PhotonTargets.All); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndArea(); }
public void draw2MoreCards() { ourVote = PlayerClass.VoteChoice.ABSTAIN; drawVictimPair(0,true); //Debug.Log("current number of cards in each group is " + victimGroupA.Count); //restartTimer(); }