void UpdateInfoBox() { if (currentlySelected != null) { RoomData data = currentlySelected.GetComponent <RoomData>(); RoomInfoPanel.Enable(); UsernameLabel.Text = data.Game.name; MapTypeLabel.Text = "Map 1"; GameModeLabel.Text = "Showdown"; if (data.Game.playerCount < data.Game.maxPlayers) { OpenLabel.Text = "Open"; OpenLabel.Color = new Color32(0, 255, 0, 255); JoinButton.Enable(); JoinButton.Click += new MouseEventHandler(JoinButton_Click); } else { OpenLabel.Text = "Closed"; OpenLabel.Color = new Color32(255, 0, 0, 255); JoinButton.Disable(); } } else { RoomInfoPanel.Disable(); } }
void ReleaseDesignerOutlets() { if (ControlButtonsView != null) { ControlButtonsView.Dispose(); ControlButtonsView = null; } if (EndCallButton != null) { EndCallButton.Dispose(); EndCallButton = null; } if (JoinButton != null) { JoinButton.Dispose(); JoinButton = null; } if (MuteButton != null) { MuteButton.Dispose(); MuteButton = null; } if (ErrorLabel != null) { ErrorLabel.Dispose(); ErrorLabel = null; } }
//Register to SkillSwap Website public void JoinStep(SignUpDetails signUpObj) { //Click on Join link to register to the SkillSwap Website JoinLink.Click(); //Enter First Name FirstName.SendKeys(signUpObj.FirstName); //Enter Last Name LastName.SendKeys(signUpObj.LastName); //Enter Email address EmailAddress.SendKeys(signUpObj.EmailAddress); //Enter Password Password.SendKeys(signUpObj.Password); //Enter Confirm Password ConfirmPassword.SendKeys(signUpObj.ConfirmPassword); //Click on Terms and Conditions checkbox TermAndCondition.Click(); //Click on Join button JoinButton.Click(); }
void Start () { m_ContextStack = new Stack<Context>(); Enter(Context.Main); // multiplier m_HostButton = gameObject.AddComponent<HostButton>(); m_JoinButton = gameObject.AddComponent<JoinButton>(); }
private void Awake() { buttonText = GetComponentInChildren <Text>(); join = GameObject.Find("JoinPor"); host = GameObject.Find("host"); //join.SetActive(false); joinOBJ = GameObject.Find("JoinPor").GetComponent <JoinButton>(); }
void Start() { m_ContextStack = new Stack <Context>(); Enter(Context.Main); // multiplier m_HostButton = gameObject.AddComponent <HostButton>(); m_JoinButton = gameObject.AddComponent <JoinButton>(); }
/*************************** Game Lobby ************************************** * initializes the lobby and allows only the exit button and the login button the * be available before connecting to the server. */ public gameLobby() { InitializeComponent(); CreateButton.Hide(); ListGamesButton.Hide(); JoinButton.Hide(); SendButton.Hide(); this.AcceptButton = SendButton; } // end of gameLobby
public void SelectFriend(int index) { JoinButton.SetActive(true); joinButtonText.text = $"Join {SteamFriends.GetFriendPersonaName(steamFriends[index].steamID)}"; selectedFriend = steamFriends[index].steamID; Log("User has selected " + SteamFriends.GetFriendPersonaName(steamFriends[index].steamID)); Networker.SendP2P(steamFriends[index].steamID, new Message_LobbyInfoRequest(), EP2PSend.k_EP2PSendReliable); //Getting lobby info. selectionTF.position = steamFriends[index].transform.position; selectionTF.GetComponent <Image>().color = new Color(0.3529411764705882f, 0.196078431372549f, 0); }
//Function to register new user public void Register() { ExcelLibHelpers.PopulateInCollection(ServiceData.ExcelPath, "SignUp"); //Click Join to sign up for the skill exchange Portal Join.Click(); //Enter the data for First name FirstName.SendKeys(ExcelLibHelpers.ReadData(2, "FirstName")); //Enter the data for Last name LastName.SendKeys(ExcelLibHelpers.ReadData(2, "LastName")); //Enter the data for EmailID Email.SendKeys(ExcelLibHelpers.ReadData(2, "EmailID")); //Enter the data for Password Password.SendKeys(ExcelLibHelpers.ReadData(2, "Password")); //Enter the data for Confirm Password CnfrmPswrd.SendKeys(ExcelLibHelpers.ReadData(2, "ConfirmPassword")); //Check on the terms and conditions check box prior to clicking the Join button TermsCndtnsChkbox.Click(); //Click on the Join button to complete the registration JoinButton.Click(); //Implicit wait for the registeration pop up to be available Wait.wait(2, driver); try { if (FirstTime) { if (PopUp.Text == "Registration Successfull") { TestContext.WriteLine(PopUp.Text); } } else { String EmailValidationMsg = EmailValidation.Text; if (EmailValidationMsg == "This email has already been used to register an account.") { TestContext.WriteLine("The account has already been created with this emailID, Please log in using exisitng account details"); } } } catch (Exception e) { Assert.Fail("Registration failed due to 1 or more errors. Make sure that there isn't an existing account", e.Message); } }
} // end of sendButton /*************************** Login Button ************************************* * Takes the users name they typed in the username textbox and requests a connction * with the server, then logs in to the server enabling the create button, list * games button, and join button. */ private void LoginButton_Click_1(object sender, EventArgs e) { // handle a blank username and don't allow people to have names longer than 16 characters if (textBox3.Text.Trim() == "") { textBox1.Text = "Please enter a Username before logging in"; return; } if (textBox3.Text.Length > 16) { textBox1.Text = "You shall not enter names longer than 16 characters!"; return; } // Username is what was typed into the textbox clientNo = textBox3.Text; try { // Try to connect to the server clientSocket.Connect("18.216.181.228", 13000); // *** Loopback can be uncommented out for testing on local machine *** // just make sure you comment out the IP above //clientSocket.Connect("127.0.0.1", 13000); serverStream = clientSocket.GetStream(); // Send the user name to the server byte[] outStream = System.Text.Encoding.ASCII.GetBytes(textBox3.Text + "|"); serverStream.Write(outStream, 0, outStream.Length); serverStream.Flush(); // Create a new thread top handle the client Thread ctThread = new Thread(getMessage); ctThread.Start(); } catch (Exception ex) { textBox1.AppendText(ex.ToString()); } if (clientSocket.Connected) { // If the client connects successfully, enables button functions LoginButton.Hide(); CreateButton.Show(); ListGamesButton.Show(); JoinButton.Show(); SendButton.Show(); } } // end of LoginButton
void ReleaseDesignerOutlets() { if (ActivityInProgressView != null) { ActivityInProgressView.Dispose(); ActivityInProgressView = null; } if (SDKVersionLabel != null) { SDKVersionLabel.Dispose(); SDKVersionLabel = null; } if (ChannelNameEdit != null) { ChannelNameEdit.Dispose(); ChannelNameEdit = null; } if (ConnectingLabel != null) { ConnectingLabel.Dispose(); ConnectingLabel = null; } if (ConnectionImage != null) { ConnectionImage.Dispose(); ConnectionImage = null; } if (EncryptionKeyEdit != null) { EncryptionKeyEdit.Dispose(); EncryptionKeyEdit = null; } if (JoinButton != null) { JoinButton.Dispose(); JoinButton = null; } if (OpacityLayerView != null) { OpacityLayerView.Dispose(); OpacityLayerView = null; } }
public GroupCell(UITableViewCellStyle style, string cellIdentifier) : base(style, cellIdentifier) { Title = new UILabel( ); Title.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Medium_FontSize); Title.Layer.AnchorPoint = CGPoint.Empty; Title.TextColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor); Title.BackgroundColor = UIColor.Clear; Title.LineBreakMode = UILineBreakMode.TailTruncation; AddSubview(Title); MeetingTime = new UILabel( ); MeetingTime.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Small_FontSize); MeetingTime.Layer.AnchorPoint = CGPoint.Empty; MeetingTime.TextColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor); MeetingTime.BackgroundColor = UIColor.Clear; AddSubview(MeetingTime); Distance = new UILabel( ); Distance.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Small_FontSize); Distance.Layer.AnchorPoint = CGPoint.Empty; Distance.TextColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor); Distance.BackgroundColor = UIColor.Clear; AddSubview(Distance); Filters = new UILabel( ); Filters.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Small_FontSize); Filters.Layer.AnchorPoint = CGPoint.Empty; Filters.TextColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor); Filters.BackgroundColor = UIColor.Clear; AddSubview(Filters); JoinButton = UIButton.FromType(UIButtonType.Custom); JoinButton.TouchUpInside += (object sender, EventArgs e) => { TableSource.RowButtonClicked(RowIndex); }; JoinButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary, PrivateConnectConfig.GroupFinder_Join_IconSize); JoinButton.SetTitle(PrivateConnectConfig.GroupFinder_JoinIcon, UIControlState.Normal); JoinButton.SetTitleColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor), UIControlState.Normal); JoinButton.Layer.AnchorPoint = CGPoint.Empty; JoinButton.BackgroundColor = UIColor.Clear; JoinButton.SizeToFit( ); AddSubview(JoinButton); Seperator = new UIView( ); AddSubview(Seperator); Seperator.Layer.BorderWidth = 1; Seperator.Layer.BorderColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color).CGColor; }
void ReleaseDesignerOutlets() { if (AgoraVersionLabel != null) { AgoraVersionLabel.Dispose(); AgoraVersionLabel = null; } if (ChannelNameEdit != null) { ChannelNameEdit.Dispose(); ChannelNameEdit = null; } if (ConnectingLabel != null) { ConnectingLabel.Dispose(); ConnectingLabel = null; } if (ConnectionImage != null) { ConnectionImage.Dispose(); ConnectionImage = null; } if (EncryptionKeyEdit != null) { EncryptionKeyEdit.Dispose(); EncryptionKeyEdit = null; } if (JoinButton != null) { JoinButton.Dispose(); JoinButton = null; } if (UserNameLabel != null) { UserNameLabel.Dispose(); UserNameLabel = null; } }
public override void _Ready() { GetTree().Connect("network_peer_connected", this, nameof(PlayerConnected)); GetTree().Connect("network_peer_disconnected", this, nameof(PlayerDisconnected)); GetTree().Connect("connected_to_server", this, nameof(ConnectedToServer)); GetTree().Connect("connection_failed", this, nameof(ConnectionFailed)); GetTree().Connect("server_disconnected", this, nameof(ServerDisconnected)); HostButton = (Button)GetNode("MarginContainer/VBoxContainer/HostGameButton"); HostButton.Connect("pressed", this, nameof(HostGame)); JoinButton = (Button)GetNode("MarginContainer/VBoxContainer/JoinGameButton"); JoinButton.Connect("pressed", this, nameof(JoinGame)); LeaveButton = (Button)GetNode("MarginContainer/VBoxContainer/LeaveGameButton"); LeaveButton.Connect("pressed", this, nameof(LeaveGame)); LeaveButton.Disabled = true; AddressText = (TextEdit)GetNode("MarginContainer/VBoxContainer/Address"); NameText = (TextEdit)GetNode("MarginContainer/VBoxContainer/Name"); }
void listItem_Click(dfControl control, dfMouseEventArgs mouseEvent) { if (currentlySelected != null) { currentlySelected.BackgroundColor = new Color32(255, 255, 255, 255); currentlySelected.Find("Selected Indicator").GetComponent <dfSprite>().Hide(); } dfPanel item = control as dfPanel; RoomData data = item.GetComponent <RoomData>(); data.Selected = true; item.BackgroundColor = new Color32(0, 0, 0, 255); currentlySelected = item; currentlySelected.Find("Selected Indicator").GetComponent <dfSprite>().Show(); UpdateInfoBox(); if (data.Game.playerCount < data.Game.maxPlayers) { JoinButton.DoClick(); } }
private void CreateUI() { while (!SceneManager.GetActiveScene().isLoaded) { Debug.Log("Waiting for scene to be loaded"); } Log("Creating Multiplayer UI"); CheckUpToDate(); Transform ScenarioDisplay = null; bool foundDisplay = false; bool foundCampaginDisplay = false; int? campaignDisplayCount = null; Debug.Log("Looping through canvases to find the Scenario Display"); // Get the interactable canvas for (int i = 0; i < GameObject.Find("InteractableCanvas").transform.GetChild(0).childCount; i++) { // Loop through each child to find the Campaign Select Canavas ScenarioDisplay = GameObject.Find("InteractableCanvas").transform.GetChild(0).GetChild(i); if (ScenarioDisplay.name == "CampaignSelector") { foundCampaginDisplay = true; campaignDisplayCount = i; // Get the next page in the campaign selector (The scenario display) ScenarioDisplay = ScenarioDisplay.GetChild(0).GetChild(1); // If the name is ScenarioDisplay, we found it! Breaking out of the for loop to continue on... if (ScenarioDisplay.name == "ScenarioDisplay") { foundDisplay = true; break; } } } Debug.Log($"Found Campaign Display? { foundCampaginDisplay.ToString() }"); if (campaignDisplayCount != null) { Debug.Log($"Found Campaign Display { campaignDisplayCount.ToString() } canvases down."); } Debug.Log($"Found Scenario Display? { foundDisplay.ToString() }"); //Creating the MP button Transform mpButton = Instantiate(ScenarioDisplay.GetChild(10).gameObject, ScenarioDisplay).transform; Log("Multiplayer Button" + mpButton.name); mpButton.gameObject.SetActive(true); mpButton.name = "MPButton"; mpButton.GetComponent <RectTransform>().localPosition = new Vector3(601, -325); mpButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 206.7f); mpButton.GetComponentInChildren <Text>().text = "MP"; mpButton.GetComponent <Image>().color = Color.cyan; mpButton.GetComponent <Button>().onClick = new Button.ButtonClickedEvent(); VRInteractable mpInteractable = mpButton.GetComponent <VRInteractable>(); if (UpToDate) { mpButton.GetComponent <Image>().color = Color.cyan; mpInteractable.interactableName = "Multiplayer"; } else { mpButton.GetComponent <Image>().color = Color.red; mpInteractable.interactableName = "Outdated"; } mpInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); Log("Creating Mp Menu");//Creating Mp Menu GameObject MPMenu = Instantiate(ScenarioDisplay.gameObject, ScenarioDisplay.parent); GameObject ScrollView = null; for (int i = 0; i < MPMenu.transform.childCount; i++) { if (MPMenu.transform.GetChild(i).name != "Scroll View") { Destroy(MPMenu.transform.GetChild(i).gameObject); } else { ScrollView = MPMenu.transform.GetChild(i).gameObject; scrollRect = ScrollView.GetComponent <ScrollRect>(); } } content = ScrollView.transform.GetChild(0).GetChild(0).gameObject; selectionTF = content.transform.GetChild(0); selectionTF.GetComponent <Image>().color = new Color(0, 0, 0, 0); Log("Copying the List from select Campaign for friends"); //Copying the List from select Campaign for friends friendsTemplate = content.transform.GetChild(1).gameObject; buttonHeight = ((RectTransform)friendsTemplate.transform).rect.height; Log("Getting the headers from the campaign display for the join log"); //Getting the headers from the campaign display GameObject lableTemplateHeader = ScenarioDisplay.Find("Title").gameObject; lableVTOLMPHeader = Instantiate(lableTemplateHeader, MPMenu.transform); lableVTOLMPHeader.GetComponent <RectTransform>().localPosition = new Vector3(-200, 320); lableVTOLMPHeader.GetComponentInChildren <Text>().text = "Welcome to VTOL VR Multiplayer!"; lableVTOLMPHeader.GetComponentInChildren <Text>().resizeTextForBestFit = true; lableVTOLMPHeader.GetComponentInChildren <Text>().color = new Color32(252, 183, 34, 255); lableVTOLMPHeader.GetComponentInChildren <Text>().fontSize = 55; lableVTOLMPHeader.SetActive(true); Log("Getting the headers from the campaign display for the join log"); //Getting the headers from the campaign display GameObject lableTemplateIntro = ScenarioDisplay.Find("Title").gameObject; lableVTOLMPIntro = Instantiate(lableTemplateIntro, MPMenu.transform); lableVTOLMPIntro.GetComponent <RectTransform>().localPosition = new Vector3(-200, 200); lableVTOLMPIntro.GetComponent <RectTransform>().sizeDelta = new Vector2(850, 500.3f); if (UpToDate) { lableVTOLMPIntro.GetComponentInChildren <Text>().text = $"Hello and welcome to multiplayer version {ModVersionString.ModVersionNumber}!\n\nThis is an alpha release and very much so a work in progress. Expect bugs!\n\nPlease report any issues at https://vtolvr-mods.com or on the modding discord here: https://discord.gg/pW4rkYf"; } else { lableVTOLMPIntro.GetComponentInChildren <Text>().text = $"Hello and welcome to multiplayer version {ModVersionString.ModVersionNumber}!\n\nThis is an outdated version, please update the mod to be able to play with other players who have higher versions, and while you're at it, expect bugs!\n\nPlease report any issues at https://vtolvr-mods.com or on the modding discord here: https://discord.gg/pW4rkYf"; } //lableVTOLJoinLog.GetComponentInChildren<Text>().resizeTextForBestFit = true; lableVTOLMPIntro.GetComponentInChildren <Text>().color = new Color32(255, 255, 255, 255); lableVTOLMPIntro.GetComponentInChildren <Text>().fontSize = 20; lableVTOLMPIntro.SetActive(true); Log("Getting the headers from the campaign display for the join log"); //Getting the headers from the campaign display GameObject lableTemplateLog = ScenarioDisplay.Find("Title").gameObject; lableVTOLJoinLog = Instantiate(lableTemplateLog, MPMenu.transform); lableVTOLJoinLog.GetComponent <RectTransform>().localPosition = new Vector3(-200, 00); lableVTOLJoinLog.GetComponent <RectTransform>().sizeDelta = new Vector2(850, 300f); lableVTOLJoinLog.GetComponentInChildren <Text>().text = ""; //lableVTOLJoinLog.GetComponentInChildren<Text>().resizeTextForBestFit = true; lableVTOLJoinLog.GetComponentInChildren <Text>().color = new Color32(255, 0, 0, 255); lableVTOLJoinLog.GetComponentInChildren <Text>().fontSize = 20; lableVTOLJoinLog.SetActive(true); contentJoinLog = lableVTOLJoinLog.GetComponentInChildren <Text>(); Log("Getting the headers from the campaign display"); //Getting the headers from the campaign display GameObject lableTemplate = ScenarioDisplay.parent.GetChild(0).GetChild(5).GetChild(0).GetChild(0).GetChild(2).gameObject; lableVTOL = Instantiate(lableTemplate, content.transform); lableVTOL.GetComponentInChildren <Text>().text = "In VTOL VR"; lableVTOL.SetActive(true); Log("Back Button");//Back Button GameObject BackButton = Instantiate(mpButton.gameObject, MPMenu.transform); BackButton.GetComponent <RectTransform>().localPosition = new Vector3(-508, -325); BackButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 256.3f); BackButton.GetComponentInChildren <Text>().text = "Back"; BackButton.GetComponent <Image>().color = Color.red; VRInteractable BackInteractable = BackButton.GetComponent <VRInteractable>(); BackInteractable.interactableName = "Back"; BackInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); BackInteractable.OnInteract.AddListener(delegate { Log("Before Back"); MPMenu.SetActive(false); ScenarioDisplay.gameObject.SetActive(true); }); Log("Host");//Host GameObject HostButton = Instantiate(mpButton.gameObject, MPMenu.transform); HostButton.GetComponent <RectTransform>().localPosition = new Vector3(0, -325); HostButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 256.3f); HostButton.GetComponentInChildren <Text>().text = "Host"; HostButton.GetComponent <Image>().color = Color.green; VRInteractable HostInteractable = HostButton.GetComponent <VRInteractable>(); HostInteractable.interactableName = "Host Game"; HostInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); HostInteractable.OnInteract.AddListener(delegate { Log("Before Host"); Host(); }); Log("Join");//Join JoinButton = Instantiate(mpButton.gameObject, MPMenu.transform); JoinButton.GetComponent <RectTransform>().localPosition = new Vector3(489, -325); JoinButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 256.3f); joinButtonText = JoinButton.GetComponentInChildren <Text>(); joinButtonText.text = "Join"; joinButtonText.resizeTextForBestFit = true; JoinButton.GetComponent <Image>().color = Color.blue; VRInteractable JoinInteractable = JoinButton.GetComponent <VRInteractable>(); JoinInteractable.interactableName = "Join Game"; JoinInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); JoinInteractable.OnInteract.AddListener(delegate { Log("Before Join"); Join(); }); JoinButton.SetActive(false); Log("Lobby Info Text"); GameObject lobbyInfoGO = Instantiate(mpButton.transform.GetChild(0).gameObject, MPMenu.transform); lobbyInfoGO.GetComponent <RectTransform>().localPosition = new Vector3(-168.3f, -30.9f); lobbyInfoGO.GetComponent <RectTransform>().sizeDelta = new Vector2(942.9f, 469.8f); lobbyInfoText = lobbyInfoGO.GetComponent <Text>(); lobbyInfoText.text = "Select a friend or host a lobby."; lobbyInfoText.alignment = TextAnchor.UpperLeft; lobbyInfoText.transform.localRotation = Quaternion.Euler(lobbyInfoText.transform.localRotation.eulerAngles.x + 90, lobbyInfoText.transform.localRotation.y, lobbyInfoText.transform.localRotation.z); Log("Last one"); mpInteractable.OnInteract.AddListener(delegate { Log("Before Opening MP"); RefershFriends(); MPMenu.SetActive(true); ScenarioDisplay.gameObject.SetActive(false); OpenMP(); }); GameObject.Find("InteractableCanvas").GetComponent <VRPointInteractableCanvas>().RefreshInteractables(); Log("Finished"); Log("Refresh");//Host GameObject RefreshButton = Instantiate(mpButton.gameObject, MPMenu.transform); RefreshButton.GetComponent <RectTransform>().localPosition = new Vector3(510, 322); RefreshButton.GetComponent <RectTransform>().sizeDelta = new Vector2(50, 250f); RefreshButton.GetComponentInChildren <Text>().text = "Refresh"; RefreshButton.GetComponent <Image>().color = Color.red; VRInteractable RefreshInteractable = RefreshButton.GetComponent <VRInteractable>(); RefreshInteractable.interactableName = "Refresh Friends"; RefreshInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); RefreshInteractable.OnInteract.AddListener(delegate { Log("Before Host"); RefershFriends(); }); }
public void Create(object masterView, RectangleF frame) { View = PlatformView.Create( ); View.BackgroundColor = ControlStylingConfig.BackgroundColor; View.AddAsSubview(masterView); GroupTitle = PlatformLabel.Create( ); GroupTitle.AddAsSubview(masterView); GroupTitle.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize); GroupTitle.TextColor = ControlStylingConfig.TextField_ActiveTextColor; GroupTitle.TextAlignment = TextAlignment.Center; /*GroupDetailsLayer = PlatformView.Create( ); * GroupDetailsLayer.AddAsSubview( masterView ); * GroupDetailsLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; * GroupDetailsLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; * GroupDetailsLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth;*/ GroupDetails = PlatformLabel.Create( ); GroupDetails.AddAsSubview(masterView); GroupDetails.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); GroupDetails.TextColor = ControlStylingConfig.TextField_ActiveTextColor; // Name Info FirstNameLayer = PlatformView.Create( ); FirstNameLayer.AddAsSubview(masterView); FirstNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; FirstNameLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; FirstNameLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; FirstName = PlatformTextField.Create( ); FirstName.AddAsSubview(masterView); FirstName.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize); FirstName.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; FirstName.Placeholder = ConnectStrings.JoinGroup_FirstNamePlaceholder; FirstName.TextColor = ControlStylingConfig.TextField_ActiveTextColor; FirstName.KeyboardAppearance = KeyboardAppearanceStyle.Dark; FirstName.AutoCapitalizationType = AutoCapitalizationType.Words; FirstName.AutoCorrectionType = AutoCorrectionType.No; LastNameLayer = PlatformView.Create( ); LastNameLayer.AddAsSubview(masterView); LastNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; LastNameLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; LastNameLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; LastName = PlatformTextField.Create( ); LastName.AddAsSubview(masterView); LastName.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize); LastName.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; LastName.Placeholder = ConnectStrings.JoinGroup_LastNamePlaceholder; LastName.TextColor = ControlStylingConfig.TextField_ActiveTextColor; LastName.KeyboardAppearance = KeyboardAppearanceStyle.Dark; LastName.AutoCapitalizationType = AutoCapitalizationType.Words; LastName.AutoCorrectionType = AutoCorrectionType.No; SpouseNameLayer = PlatformView.Create( ); SpouseNameLayer.AddAsSubview(masterView); SpouseNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; SpouseNameLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; SpouseNameLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; SpouseName = PlatformTextField.Create( ); SpouseName.AddAsSubview(masterView); SpouseName.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize); SpouseName.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; SpouseName.Placeholder = ConnectStrings.JoinGroup_SpouseNamePlaceholder; SpouseName.TextColor = ControlStylingConfig.TextField_ActiveTextColor; SpouseName.KeyboardAppearance = KeyboardAppearanceStyle.Dark; SpouseName.AutoCapitalizationType = AutoCapitalizationType.Words; SpouseName.AutoCorrectionType = AutoCorrectionType.No; // Contact Info EmailLayer = PlatformView.Create( ); EmailLayer.AddAsSubview(masterView); EmailLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; EmailLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; EmailLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; Email = PlatformTextField.Create( ); Email.AddAsSubview(masterView); Email.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize); Email.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; Email.Placeholder = ConnectStrings.JoinGroup_EmailPlaceholder; Email.TextColor = ControlStylingConfig.TextField_ActiveTextColor; Email.KeyboardAppearance = KeyboardAppearanceStyle.Dark; Email.AutoCapitalizationType = AutoCapitalizationType.None; Email.AutoCorrectionType = AutoCorrectionType.No; CellPhoneLayer = PlatformView.Create( ); CellPhoneLayer.AddAsSubview(masterView); CellPhoneLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; CellPhoneLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; CellPhoneLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; CellPhone = PlatformTextField.Create( ); CellPhone.AddAsSubview(masterView); CellPhone.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize); CellPhone.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; CellPhone.Placeholder = ConnectStrings.JoinGroup_CellPhonePlaceholder; CellPhone.TextColor = ControlStylingConfig.TextField_ActiveTextColor; CellPhone.KeyboardAppearance = KeyboardAppearanceStyle.Dark; CellPhone.AutoCapitalizationType = AutoCapitalizationType.None; CellPhone.AutoCorrectionType = AutoCorrectionType.No; // Join Button JoinButton = PlatformButton.Create( ); JoinButton.AddAsSubview(masterView); JoinButton.ClickEvent = JoinClicked; JoinButton.BackgroundColor = ControlStylingConfig.Button_BGColor; JoinButton.TextColor = ControlStylingConfig.Button_TextColor; JoinButton.CornerRadius = ControlStylingConfig.Button_CornerRadius; JoinButton.Text = ConnectStrings.JoinGroup_JoinButtonLabel; JoinButton.SizeToFit( ); JoinButton.UserInteractionEnabled = true; // Create our results view overlay ResultView = new UIResultView(masterView, View.Frame, OnResultViewDone); // Create our blocker view BlockerView = new UIBlockerView(masterView, View.Frame); }
private void CreateUI() { Log("Creating Multiplayer UI"); Transform ScenarioDisplay = GameObject.Find("InteractableCanvas").transform.GetChild(0).GetChild(6).GetChild(0).GetChild(1); if (ScenarioDisplay.name != "ScenarioDisplay") { Log($"ScenarioDisplay was wrong ({ScenarioDisplay.name}), trying other method"); ScenarioDisplay = GameObject.Find("InteractableCanvas").transform.GetChild(0).GetChild(7).GetChild(0).GetChild(1); Log($"ScenarioDisplay now == {ScenarioDisplay.name}"); } //Creating the MP button Transform mpButton = Instantiate(ScenarioDisplay.GetChild(6).gameObject, ScenarioDisplay).transform; Log("Multiplayer Button" + mpButton.name); mpButton.gameObject.SetActive(true); mpButton.name = "MPButton"; mpButton.GetComponent <RectTransform>().localPosition = new Vector3(601, -325); mpButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 206.7f); mpButton.GetComponentInChildren <Text>().text = "MP"; mpButton.GetComponent <Image>().color = Color.cyan; mpButton.GetComponent <Button>().onClick = new Button.ButtonClickedEvent(); VRInteractable mpInteractable = mpButton.GetComponent <VRInteractable>(); mpInteractable.interactableName = "Multiplayer"; mpInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); Log("Creating Mp Menu");//Creating Mp Menu GameObject MPMenu = Instantiate(ScenarioDisplay.gameObject, ScenarioDisplay.parent); GameObject ScrollView = null; for (int i = 0; i < MPMenu.transform.childCount; i++) { if (MPMenu.transform.GetChild(i).name != "Scroll View") { Destroy(MPMenu.transform.GetChild(i).gameObject); } else { ScrollView = MPMenu.transform.GetChild(i).gameObject; scrollRect = ScrollView.GetComponent <ScrollRect>(); } } content = ScrollView.transform.GetChild(0).GetChild(0).gameObject; selectionTF = content.transform.GetChild(0); selectionTF.GetComponent <Image>().color = new Color(0, 0, 0, 0); Log("Copying the List from select Campaign for friends");//Copying the List from select Campaign for friends friendsTemplate = content.transform.GetChild(1).gameObject; buttonHeight = ((RectTransform)friendsTemplate.transform).rect.height; Log("Getting the headers from the campaign display"); //Getting the headers from the campaign display GameObject lableTemplate = ScenarioDisplay.parent.GetChild(0).GetChild(5).GetChild(0).GetChild(0).GetChild(2).gameObject; lableVTOL = Instantiate(lableTemplate, content.transform); lableVTOL.GetComponentInChildren <Text>().text = "In VTOL VR"; lableVTOL.SetActive(true); Log("Back Button");//Back Button GameObject BackButton = Instantiate(mpButton.gameObject, MPMenu.transform); BackButton.GetComponent <RectTransform>().localPosition = new Vector3(-508, -325); BackButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 256.3f); BackButton.GetComponentInChildren <Text>().text = "Back"; BackButton.GetComponent <Image>().color = Color.red; VRInteractable BackInteractable = BackButton.GetComponent <VRInteractable>(); BackInteractable.interactableName = "Back"; BackInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); BackInteractable.OnInteract.AddListener(delegate { Log("Before Back"); MPMenu.SetActive(false); ScenarioDisplay.gameObject.SetActive(true); }); Log("Host");//Host GameObject HostButton = Instantiate(mpButton.gameObject, MPMenu.transform); HostButton.GetComponent <RectTransform>().localPosition = new Vector3(0, -325); HostButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 256.3f); HostButton.GetComponentInChildren <Text>().text = "Host"; HostButton.GetComponent <Image>().color = Color.green; VRInteractable HostInteractable = HostButton.GetComponent <VRInteractable>(); HostInteractable.interactableName = "Host Game"; HostInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); HostInteractable.OnInteract.AddListener(delegate { Log("Before Host"); Host(); }); Log("Join");//Join JoinButton = Instantiate(mpButton.gameObject, MPMenu.transform); JoinButton.GetComponent <RectTransform>().localPosition = new Vector3(489, -325); JoinButton.GetComponent <RectTransform>().sizeDelta = new Vector2(70, 256.3f); joinButtonText = JoinButton.GetComponentInChildren <Text>(); joinButtonText.text = "Join"; joinButtonText.resizeTextForBestFit = true; JoinButton.GetComponent <Image>().color = Color.green; VRInteractable JoinInteractable = JoinButton.GetComponent <VRInteractable>(); JoinInteractable.interactableName = "Join Game"; JoinInteractable.OnInteract = new UnityEngine.Events.UnityEvent(); JoinInteractable.OnInteract.AddListener(delegate { Log("Before Join"); Join(); }); JoinButton.SetActive(false); Log("Lobby Info Text"); GameObject lobbyInfoGO = Instantiate(mpButton.transform.GetChild(0).gameObject, MPMenu.transform); lobbyInfoGO.GetComponent <RectTransform>().localPosition = new Vector3(-168.3f, -30.9f); lobbyInfoGO.GetComponent <RectTransform>().sizeDelta = new Vector2(942.9f, 469.8f); lobbyInfoText = lobbyInfoGO.GetComponent <Text>(); lobbyInfoText.text = "Select a friend or host a lobby."; lobbyInfoText.alignment = TextAnchor.UpperLeft; lobbyInfoText.transform.localRotation = Quaternion.Euler(lobbyInfoText.transform.localRotation.eulerAngles.x + 90, lobbyInfoText.transform.localRotation.y, lobbyInfoText.transform.localRotation.z); Log("Last one"); mpInteractable.OnInteract.AddListener(delegate { Log("Before Opening MP"); RefershFriends(); MPMenu.SetActive(true); ScenarioDisplay.gameObject.SetActive(false); OpenMP(); }); GameObject.Find("InteractableCanvas").GetComponent <VRPointInteractableCanvas>().RefreshInteractables(); Log("Finished"); }
void ReleaseDesignerOutlets() { if (JoinContainerView != null) { JoinContainerView.Dispose(); JoinContainerView = null; } if (ChatView != null) { ChatView.Dispose(); ChatView = null; } if (OverlayView != null) { OverlayView.Dispose(); OverlayView = null; } if (JoinButton != null) { JoinButton.Dispose(); JoinButton = null; } if (RoomTextField != null) { RoomTextField.Dispose(); RoomTextField = null; } if (AudioButton != null) { AudioButton.Dispose(); AudioButton = null; } if (ButtonContainerView != null) { ButtonContainerView.Dispose(); ButtonContainerView = null; } if (ButtonContainerViewLeftConstraint != null) { ButtonContainerViewLeftConstraint.Dispose(); ButtonContainerViewLeftConstraint = null; } if (FooterView != null) { FooterView.Dispose(); FooterView = null; } if (FooterViewBottomConstraint != null) { FooterViewBottomConstraint.Dispose(); FooterViewBottomConstraint = null; } if (HangupButton != null) { HangupButton.Dispose(); HangupButton = null; } if (LocalView != null) { LocalView.Dispose(); LocalView = null; } if (LocalViewBottomConstraint != null) { LocalViewBottomConstraint.Dispose(); LocalViewBottomConstraint = null; } if (LocalViewHeightConstraint != null) { LocalViewHeightConstraint.Dispose(); LocalViewHeightConstraint = null; } if (LocalViewRightConstraint != null) { LocalViewRightConstraint.Dispose(); LocalViewRightConstraint = null; } if (LocalViewWidthConstraint != null) { LocalViewWidthConstraint.Dispose(); LocalViewWidthConstraint = null; } if (RemoteView != null) { RemoteView.Dispose(); RemoteView = null; } if (RemoteViewBottomConstraint != null) { RemoteViewBottomConstraint.Dispose(); RemoteViewBottomConstraint = null; } if (RemoteViewLeftConstraint != null) { RemoteViewLeftConstraint.Dispose(); RemoteViewLeftConstraint = null; } if (RemoteViewRightConstraint != null) { RemoteViewRightConstraint.Dispose(); RemoteViewRightConstraint = null; } if (RemoteViewTopConstraint != null) { RemoteViewTopConstraint.Dispose(); RemoteViewTopConstraint = null; } if (UrlLabel != null) { UrlLabel.Dispose(); UrlLabel = null; } if (VideoButton != null) { VideoButton.Dispose(); VideoButton = null; } }
public void RefershFriends() { Log("Refreshing Friends"); int friendsCount = SteamFriends.GetFriendCount(EFriendFlags.k_EFriendFlagImmediate); if (friendsCount == -1) { LogError("Friendcount == -1, user isn't logged into steam"); return; } /* * First we are going to sort the list into four sections * Friends playing vtol vr * Friends in game * Friends online * Friends offline */ CSteamID lastFriendID; List <CSteamID> vtolvrFriends = new List <CSteamID>(); Log("Getting all friends"); for (int i = 0; i < friendsCount; i++) { lastFriendID = SteamFriends.GetFriendByIndex(i, EFriendFlags.k_EFriendFlagImmediate); if (SteamFriends.GetFriendGamePlayed(lastFriendID, out FriendGameInfo_t gameInfo)) { if (gameInfo.m_gameID.AppID().m_AppId == 667970) { //User is in VTOLVR vtolvrFriends.Add(lastFriendID); continue; } } } Log("Adding friends to list"); //Now we want to create the ingame list friendsTemplate.SetActive(true); GameObject lastFriendGO; VRUIListItemTemplate uiListItem; int totalFriends = 0; lableVTOL.transform.localPosition = new Vector3(0, -totalFriends * buttonHeight); for (int i = 0; i < vtolvrFriends.Count; i++) { totalFriends++; lastFriendGO = Instantiate(friendsTemplate, content.transform); steamFriends.Add(new FriendItem(vtolvrFriends[i], lastFriendGO.transform)); lastFriendGO.transform.localPosition = new Vector3(0f, -totalFriends * buttonHeight); uiListItem = lastFriendGO.GetComponent <VRUIListItemTemplate>(); uiListItem.Setup(SteamFriends.GetFriendPersonaName(vtolvrFriends[i]), totalFriends - 1, SelectFriend); uiListItem.labelText.color = Color.green; } Log("Updating Scroll Rect"); scrollRect.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, (2f + steamFriends.Count) * buttonHeight); scrollRect.ClampVertical(); JoinButton.SetActive(false); friendsTemplate.SetActive(false); Log("Refreahing Interactables"); GameObject.Find("InteractableCanvas").GetComponent <VRPointInteractableCanvas>().RefreshInteractables(); Log($"Total Friends:{totalFriends} In VTOLVR:{vtolvrFriends.Count}"); Networker.ResetNetworkUID(); }
public void Create(object masterView, RectangleF frame, OnButtonClick onJoinClicked) { OnButtonClicked = onJoinClicked; View = PlatformView.Create( ); View.BackgroundColor = ControlStylingConfig.BackgroundColor; View.AddAsSubview(masterView); // Group Title GroupTitle = PlatformLabel.Create( ); GroupTitle.AddAsSubview(masterView); GroupTitle.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize); GroupTitle.TextColor = ControlStylingConfig.TextField_ActiveTextColor; GroupTitle.TextAlignment = TextAlignment.Center; // Meeting Time MeetingTime = PlatformLabel.Create( ); MeetingTime.AddAsSubview(masterView); MeetingTime.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); MeetingTime.TextColor = ControlStylingConfig.TextField_ActiveTextColor; MeetingTime.TextAlignment = TextAlignment.Center; // Childcare Provided ChildcareProvided = PlatformLabel.Create( ); ChildcareProvided.AddAsSubview(masterView); ChildcareProvided.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); ChildcareProvided.TextColor = ControlStylingConfig.TextField_ActiveTextColor; ChildcareProvided.TextAlignment = TextAlignment.Center; // Young Adults YoungAdults = PlatformLabel.Create( ); YoungAdults.AddAsSubview(masterView); YoungAdults.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); YoungAdults.TextColor = ControlStylingConfig.TextField_ActiveTextColor; YoungAdults.TextAlignment = TextAlignment.Center; // Family Image and Layer FamilyImageLayer = PlatformView.Create( ); FamilyImageLayer.AddAsSubview(masterView); FamilyImageLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; FamilyImageLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; FamilyImageLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; FamilyImage = PlatformImageView.Create( ); FamilyImage.AddAsSubview(masterView); FamilyImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit; FamilyImage.BackgroundColor = 0; // Group Desc GroupDescLayer = PlatformView.Create( ); GroupDescLayer.AddAsSubview(masterView); GroupDescLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; GroupDescLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; GroupDescLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; GroupDesc = PlatformLabel.Create( ); GroupDesc.AddAsSubview(masterView); GroupDesc.TextAlignment = TextAlignment.Center; GroupDesc.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); GroupDesc.TextColor = ControlStylingConfig.TextField_ActiveTextColor; // Group Desc Header GroupDescHeader = PlatformLabel.Create( ); GroupDescHeader.AddAsSubview(masterView); GroupDescHeader.TextAlignment = TextAlignment.Center; GroupDescHeader.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Medium_FontSize); GroupDescHeader.TextColor = ControlStylingConfig.TextField_ActiveTextColor; GroupDescHeader.Text = ConnectStrings.GroupInfo_AboutGroup; // Childcare Desc ChildDescLayer = PlatformView.Create( ); ChildDescLayer.AddAsSubview(masterView); ChildDescLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; ChildDescLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; ChildDescLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; ChildDesc = PlatformLabel.Create( ); ChildDesc.AddAsSubview(masterView); ChildDesc.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize); ChildDesc.TextColor = ControlStylingConfig.TextField_ActiveTextColor; ChildDesc.TextAlignment = TextAlignment.Center; // Child Desc Header ChildDescHeader = PlatformLabel.Create( ); ChildDescHeader.AddAsSubview(masterView); ChildDescHeader.TextAlignment = TextAlignment.Center; ChildDescHeader.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Medium_FontSize); ChildDescHeader.TextColor = ControlStylingConfig.TextField_ActiveTextColor; ChildDescHeader.Text = ConnectStrings.GroupInfo_AboutChildcare; // Group Image and Layer GroupImageLayer = PlatformView.Create( ); GroupImageLayer.AddAsSubview(masterView); GroupImageLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; GroupImageLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; GroupImageLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; GroupImage = PlatformImageView.Create( ); GroupImage.AddAsSubview(masterView); GroupImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit; GroupImage.BackgroundColor = 0; // Join Button JoinButton = PlatformButton.Create( ); JoinButton.AddAsSubview(masterView); JoinButton.ClickEvent = JoinClicked; JoinButton.BackgroundColor = ControlStylingConfig.Button_BGColor; JoinButton.TextColor = ControlStylingConfig.Button_TextColor; JoinButton.CornerRadius = ControlStylingConfig.Button_CornerRadius; JoinButton.Text = ConnectStrings.JoinGroup_JoinButtonLabel; JoinButton.SizeToFit( ); JoinButton.UserInteractionEnabled = true; // Create our results view overlay ResultView = new UIResultView(masterView, View.Frame, OnResultViewDone); // Create our blocker view BlockerView = new UIBlockerView(masterView, View.Frame); }