private void UpdateLocalUserConfigSlot() { foreach (User user in World.AllUsers) { string user_id = user.UserID; bool value = false; if (!users_config_space.TryReadValue <bool>(user_id, out value)) { DynamicValueVariable <bool> new_val = users_config_space.Slot.AttachComponent <DynamicValueVariable <bool> >(); new_val.VariableName.Value = user_id.Substring(2).Replace("-", " "); if (user == World.LocalUser && record_local_user) { new_val.Value.Value = true; } else { new_val.Value.Value = false; } users_config_space.RegisterDynamicValue <bool>(user_id.Substring(2).Replace("-", " "), new_val); } } }
//private void OpenErrorPage(string error) //{ // UIBuilder uiBuilder = this.SwapPanel(NeosSwapCanvasPanel.Slide.Left, 0.5f); // uiBuilder.VerticalLayout(4f, 0.0f, new Alignment?()); // uiBuilder.Style.PreferredHeight = 32f; // uiBuilder.Style.MinHeight = 32f; // uiBuilder.Style.FlexibleHeight = 100f; // LocaleString text1 = (LocaleString)error; // uiBuilder.Text(in text1, true, new Alignment?(), true, (string)null); // uiBuilder.Style.FlexibleHeight = -1f; // LocaleString text2 = "CameraControl.OBS.ReturnToConnect".AsLocaleKey((string)null, true, (Dictionary<string, IField>)null); // uiBuilder.Button(in text2, new ButtonEventHandler(this.OnReturnToConnect)); //} public void LinkUISlot() { UniLog.Log("Linking UI slot"); //Slot slot = UISlot.Duplicate(); Slot slot = UISlot ?? _uiTemplateRefField.Target.Reference.Target; UniLog.Log(slot); DynamicVariableSpace space = slot.FindSpace("UIVariables"); if (space == null) { return; } UniLog.Log("Found dynamic variable space"); ////Recording checkbox //Checkbox recording_checkbox; //space.TryReadValue<Checkbox>("recording_checkbox", out recording_checkbox); //this._recordUserCheckbox.Target = recording_checkbox; ////Data submission checkbox //Checkbox public_checkbox; //space.TryReadValue<Checkbox>("public_checkbox", out public_checkbox); //this._publicDomainCheckbox.Target = public_checkbox; //Recording time Text recording_time_text; space.TryReadValue <Text>("recording_time_text", out recording_time_text); this._recordingTime.Target = recording_time_text; //Animation checkbox Checkbox animation_checkbox; space.TryReadValue <Checkbox>("animation_checkbox", out animation_checkbox); this._animationsCheckbox.Target = animation_checkbox; //Generate Bvh checkbox Checkbox generate_bvh_checkbox; space.TryReadValue <Checkbox>("generate_bvh_checkbox", out generate_bvh_checkbox); this._generateBvhCheckbox.Target = generate_bvh_checkbox; //Record voices checkbox Checkbox record_voices_checkbox; space.TryReadValue <Checkbox>("record_voices_checkbox", out record_voices_checkbox); this._recordVoicesCheckbox.Target = record_voices_checkbox; #if NOHL //Record voices checkbox Checkbox record_hearing_checkbox; space.TryReadValue <Checkbox>("record_hearing_checkbox", out record_hearing_checkbox); this._recordHearingCheckbox.Target = record_hearing_checkbox; #endif #if NOHL //Video checkbox Checkbox video_checkbox; space.TryReadValue <Checkbox>("video_checkbox", out video_checkbox); this._videoCheckbox.Target = video_checkbox; #endif //Record button Button record_button; space.TryReadValue <Button>("record_button", out record_button); this._recordButton.Target = record_button; //Recording index TextField recording_index; space.TryReadValue <TextField>("recording_index", out recording_index); this._recordIndexField.Target = recording_index; //Voices checkbox Checkbox voices_checkbox; space.TryReadValue <Checkbox>("voices_checkbox", out voices_checkbox); this._voicesCheckbox.Target = voices_checkbox; //Hearing checkbox Checkbox hearing_checkbox; space.TryReadValue <Checkbox>("hearing_checkbox", out hearing_checkbox); this._hearingCheckbox.Target = hearing_checkbox; //External source checkbox Checkbox external_source_checkbox; space.TryReadValue <Checkbox>("external_source_checkbox", out external_source_checkbox); this._externalSourceCheckbox.Target = external_source_checkbox; //Animation checkbox2 Checkbox animation_checkbox2; space.TryReadValue <Checkbox>("animation_checkbox2", out animation_checkbox2); this._animationsCheckbox2.Target = animation_checkbox2; //Generate Bvh checkbox Checkbox generate_bvh_checkbox2; space.TryReadValue <Checkbox>("generate_bvh_checkbox2", out generate_bvh_checkbox2); this._generateBvhCheckbox2.Target = generate_bvh_checkbox2; //Avatar ref ReferenceField <Slot> avatar_ref_field; space.TryReadValue <ReferenceField <Slot> >("avatar_ref_field", out avatar_ref_field); this._avatarRefField.Target = avatar_ref_field; //Play button Button play_button; space.TryReadValue <Button>("play_button", out play_button); this._playButton.Target = play_button; UniLog.Log("Finished linking UI slot"); }