private static void direct_menu() { audio_perplayer = utils.make_slider(main_menu_utils, delegate(float v) { var sp = utils.get_quick_menu().get_selected_player(); if (sp.field_Private_APIUser_0 == null) { return; } var uspeaker = sp.GetComponentInChildren <USpeaker>(); if (uspeaker == null) { return; } uspeaker.SpeakerVolume = v; audio_level = v; audio_perplayer.text = " Audio level (" + String.Format("{0:0.##}", uspeaker.SpeakerVolume) + ")"; }, -3, 2, " Audio level (" + String.Format("{0:0.##}", 1) + ")", audio_level, 1, 0, 350); var tp_to_user = btn_utils.create_btn(false, ButtonType.Default, "Teleport", "Tps you to user selected", Color.white, Color.red, -3, 3, main_menu_utils.transform, new Action(() => { var SelectedPlayer = utils.get_quick_menu().get_selected_player(); VRCPlayer.field_Internal_Static_VRCPlayer_0.transform.position = SelectedPlayer.transform.position; }), new Action(() => { })); var direct_favplus = btn_utils.create_btn(false, ButtonType.Default, "Add to Fav+", "Adds the persons avatar to Fav+ silently", Color.white, Color.red, -2, 3, main_menu_utils.transform, new Action(() => { favplus.save_direct_to_favplus(); }), new Action(() => { })); var pubavatar_show = btn_utils.create_btn(false, ButtonType.Default, "Show public avatars", "Attempts to show all public avatars made by the selected user", Color.white, Color.red, -1, 3, main_menu_utils.transform, new Action(() => { if (Time.time > last_apicall) { last_apicall = Time.time + 60; var found_player = utils.get_quick_menu().get_selected_player(); if (found_player == null) { return; } if (found_player.get_api() == null) { return; } pubavatar.update_public_user_list(found_player.get_api().id); MelonModLogger.Log("pub users for usr: "******"Function is still on cooldown!", "Please wait " + Math.Floor(sec_left) + " seconds before trying again!"); } }), new Action(() => { })); var dynbones_toggle = btn_utils.create_btn(false, ButtonType.Default, "Add dynamic bones", "Attempt to add all dynamic bones by the user", Color.white, Color.red, 0, 3, main_menu_utils.transform, new Action(() => { var found_player = utils.get_quick_menu().get_selected_player(); if (found_player == null) { return; } if (found_player.get_api() == null) { return; } dynbones.remove(found_player.field_Internal_VRCPlayer_0.prop_ApiAvatar_0.id); dynbones.tracker(found_player.field_Internal_VRCPlayer_0.prop_ApiAvatar_0.id, found_player.field_Internal_VRCPlayer_0.gameObject, found_player.field_Internal_VRCPlayer_0.prop_VRCPlayerApi_0.displayName); dynbones.remove(VRCPlayer.field_Internal_Static_VRCPlayer_0.prop_ApiAvatar_0.id); dynbones.tracker(VRCPlayer.field_Internal_Static_VRCPlayer_0.prop_ApiAvatar_0.id, VRCPlayer.field_Internal_Static_VRCPlayer_0.gameObject, VRCPlayer.field_Internal_Static_VRCPlayer_0.prop_VRCPlayerApi_0.displayName); }), new Action(() => { })); // new row 2 var send_message_to_user = btn_utils.create_btn(false, ButtonType.Default, "Send message", "Sends a custom invite message to select user", Color.white, Color.red, -3, 2, main_menu_utils.transform, new Action(() => { if (Time.time > last_msg_apicall) { last_msg_apicall = Time.time + 30; var found_player = utils.get_quick_menu().get_selected_player(); if (found_player == null || found_player.field_Private_APIUser_0 == null) { return; } in_input_shit = true; menu.input_text("Enter the text to send", "A message to send to the target", new Action <string>((a) => { in_input_shit = false; VRCWebSocketsManager.field_Private_Static_VRCWebSocketsManager_0.field_Private_Api_0.PostOffice.Send(Invite.Create(found_player.field_Private_APIUser_0.id, "", new Location("", new Transmtn.DTO.Instance("", found_player.field_Private_APIUser_0.id, "", "", "", false)), a)); })); } else { in_input_shit = false; var sec_left = last_msg_apicall - Time.time; error_type_poput("Function is still on cooldown!", "Please wait " + Math.Floor(sec_left) + " seconds before trying again!"); } }), new Action(() => { })); // add to the real menu toggle for the sub utils menu var utils_menu_toggle = btn_utils.create_btn(false, ButtonType.Default, "User-options", "Shows user options from useful_mod", Color.white, Color.green, 0, 0, utils.get_quick_menu().transform.Find("UserInteractMenu"), new Action(() => { var o = utils.get_quick_menu().transform.Find("UserInteractMenu"); o.gameObject.SetActive(false); main_menu_utils.SetActive(true); utils_menu_active = true; }), new Action(() => { }), 1); }
public static void send_msg_to_social() { var ff = GameObject.Find("Screens").transform.Find("UserInfo"); var userInfo = ff.transform.GetComponentInChildren <VRC.UI.PageUserInfo>(); MelonModLogger.Log("user selected " + userInfo.displayName + " id " + userInfo.user.id); if (Time.time > hashmod.last_msg_apicall) { hashmod.last_msg_apicall = Time.time + 30; hashmod.in_input_shit = true; menu.input_text("Enter the text to send", "A message to send to the target", new Action <string>((a) => { hashmod.in_input_shit = false; VRCWebSocketsManager.field_Private_Static_VRCWebSocketsManager_0.field_Private_Api_0.PostOffice.Send(Invite.Create(userInfo.user.id, "", new Location("", new Transmtn.DTO.Instance("", userInfo.user.id, "", "", "", false)), a)); })); } else { hashmod.in_input_shit = false; var sec_left = hashmod.last_msg_apicall - Time.time; hashmod.error_type_poput("Function is still on cooldown!", "Please wait " + Math.Floor(sec_left) + " seconds before trying again!"); } }
public override void VRChat_OnUiManagerInit() { var shortcutmenu = utils.get_quick_menu().transform.Find("ShortcutMenu"); var screensmenu = GameObject.Find("Screens").transform.Find("UserInfo"); if (!setup_userinfo_button && screensmenu != null && utils.get_quick_menu().transform.Find("ShortcutMenu/BuildNumText") != null) { setup_userinfo_button = true; /*setup of stuff*/ pubavatar.setup_user_avatars_list(); favplus.setup_fav_plus(); /*clones*/ var back_button = screensmenu.transform.Find("BackButton"); var clone_button = UnityEngine.Object.Instantiate <GameObject>(back_button.gameObject); var clone_button_getasset = UnityEngine.Object.Instantiate <GameObject>(back_button.gameObject); var clone_button_clonepub = UnityEngine.Object.Instantiate <GameObject>(back_button.gameObject); var clone_button_clone_favplus = UnityEngine.Object.Instantiate <GameObject>(back_button.gameObject); var clone_button_clone_msg = UnityEngine.Object.Instantiate <GameObject>(back_button.gameObject); var clone_button_clone = UnityEngine.Object.Instantiate <GameObject>(utils.get_interact_menu().cloneAvatarButton.gameObject); clone_button.gameObject.name = "Teleport"; clone_button.transform.localPosition -= new Vector3(250, 0, 0); clone_button.GetComponentInChildren <UnityEngine.UI.Text>().text = $"Teleport"; clone_button.GetComponentInChildren <UnityEngine.UI.Button>().onClick = new UnityEngine.UI.Button.ButtonClickedEvent(); clone_button.GetComponentInChildren <UnityEngine.UI.Button>().onClick.AddListener(new Action(() => { social.do_tp_to_social(); })); clone_button_getasset.gameObject.name = $"Log asset"; clone_button_getasset.transform.localPosition -= new Vector3(500, 0, 0); clone_button_getasset.GetComponentInChildren <UnityEngine.UI.Text>().text = $"Log asset"; clone_button_getasset.GetComponentInChildren <UnityEngine.UI.Button>().onClick = new UnityEngine.UI.Button.ButtonClickedEvent(); clone_button_getasset.GetComponentInChildren <UnityEngine.UI.Button>().onClick.AddListener(new Action(() => { var menu = GameObject.Find("Screens").transform.Find("UserInfo"); var userInfo = menu.transform.GetComponentInChildren <VRC.UI.PageUserInfo>(); var found_player = utils.get_player(userInfo.user.id); if (found_player == null) { MelonModLogger.Log("player could not be found id " + userInfo.user.id); return; } MelonModLogger.Log("Asset for user " + userInfo.user.displayName + " -> " + found_player.field_Private_VRCAvatarManager_0.field_Private_ApiAvatar_0.assetUrl); MelonModLogger.Log("Avatar ID: " + found_player.field_Private_VRCAvatarManager_0.field_Private_ApiAvatar_0.id); MelonModLogger.Log("User ID: " + userInfo.user.id); })); clone_button_clonepub.gameObject.name = $"Clone 2"; clone_button_clonepub.transform.localPosition -= new Vector3(750, 0, 0); clone_button_clonepub.GetComponentInChildren <UnityEngine.UI.Text>().text = $"Clone"; clone_button_clonepub.GetComponentInChildren <UnityEngine.UI.Button>().onClick = new UnityEngine.UI.Button.ButtonClickedEvent(); clone_button_clonepub.GetComponentInChildren <UnityEngine.UI.Button>().onClick.AddListener(new Action(() => { social.do_clone_to_social(); })); clone_button_clone_favplus.gameObject.name = $"Clone F+"; clone_button_clone_favplus.transform.localPosition -= new Vector3(1000, 0, 0); clone_button_clone_favplus.GetComponentInChildren <UnityEngine.UI.Text>().text = $"Add Fav+"; clone_button_clone_favplus.GetComponentInChildren <UnityEngine.UI.Button>().onClick = new UnityEngine.UI.Button.ButtonClickedEvent(); clone_button_clone_favplus.GetComponentInChildren <UnityEngine.UI.Button>().onClick.AddListener(new Action(() => { favplus.save_social_to_favplus(); })); clone_button_clone_msg.gameObject.name = $"MSG invite"; clone_button_clone_msg.transform.localPosition -= new Vector3(1250, 0, 0); clone_button_clone_msg.GetComponentInChildren <UnityEngine.UI.Text>().text = $"Send msg"; clone_button_clone_msg.GetComponentInChildren <UnityEngine.UI.Text>().fontSize -= 8; clone_button_clone_msg.GetComponentInChildren <UnityEngine.UI.Button>().onClick = new UnityEngine.UI.Button.ButtonClickedEvent(); clone_button_clone_msg.GetComponentInChildren <UnityEngine.UI.Button>().onClick.AddListener(new Action(() => { var ff = GameObject.Find("Screens").transform.Find("UserInfo"); var userInfo = ff.transform.GetComponentInChildren <VRC.UI.PageUserInfo>(); MelonModLogger.Log("user selected " + userInfo.displayName + " id " + userInfo.user.id); if (Time.time > last_msg_apicall) { last_msg_apicall = Time.time + 30; in_input_shit = true; menu.input_text("Enter the text to send", "A message to send to the target", new Action <string>((a) => { in_input_shit = false; VRCWebSocketsManager.field_Private_Static_VRCWebSocketsManager_0.field_Private_Api_0.PostOffice.Send(Invite.Create(userInfo.user.id, "", new Location("", new Transmtn.DTO.Instance("", userInfo.user.id, "", "", "", false)), a)); })); } else { in_input_shit = false; var sec_left = last_msg_apicall - Time.time; error_type_poput("Function is still on cooldown!", "Please wait " + Math.Floor(sec_left) + " seconds before trying again!"); } })); clone_button.transform.SetParent(screensmenu, false); clone_button_getasset.transform.SetParent(screensmenu, false); clone_button_clonepub.transform.SetParent(screensmenu, false); clone_button_clone_favplus.transform.SetParent(screensmenu, false); clone_button_clone_msg.transform.SetParent(screensmenu, false); } if (shortcutmenu != null && setup_button == false) { setup_button = true; main_menu_mod = menu.make_blank_page("sub_menu"); main_menu_page2_mod = menu.make_blank_page("sub_menu_2"); main_menu_utils = menu.make_blank_page("sub_menu_3"); //menu entrance var menubutton = btn_utils.create_btn(false, ButtonType.Default, "Open menu", "Opens the mod menu", Color.white, Color.red, -4, 3, shortcutmenu, new Action(() => { sub_menu_open = true; main_menu_mod.SetActive(true); shortcutmenu.gameObject.SetActive(false); }), new Action(() => { })); //menu-menu entrance var submenubutton = btn_utils.create_btn(false, ButtonType.Default, "Next page", "Next page of the mod", Color.white, Color.red, -4, 3, main_menu_mod.transform, new Action(() => { sub_menu_open = false; sub_sub_menu_open = true; main_menu_mod.SetActive(false); main_menu_page2_mod.SetActive(true); shortcutmenu.gameObject.SetActive(false); }), new Action(() => { })); main_menu(); direct_menu(); //menu 2 slider_fov_txt = utils.make_slider(main_menu_page2_mod, delegate(float v) { fov_cam = v; slider_fov_txt.text = " Cam FOV (" + String.Format("{0:0.##}", v) + ")"; }, -3, 4, " Cam FOV (" + String.Format("{0:0.##}", fov_cam) + ")", fov_cam, 100, 60, 350); slider_flyspeed_txt = utils.make_slider(main_menu_page2_mod, delegate(float v) { flying_speed = v; slider_flyspeed_txt.text = " Fly-speed (" + String.Format("{0:0.##}", v) + ")"; }, -1, 4, " Fly-speed (" + String.Format("{0:0.##}", flying_speed) + ")", flying_speed, 18, 1, 350); slider_runspeed_txt = utils.make_slider(main_menu_page2_mod, delegate(float v) { run_speed = v; slider_runspeed_txt.text = " Run-speed (" + String.Format("{0:0.##}", v) + ")"; }, -3, 3, " Run-speed (" + String.Format("{0:0.##}", run_speed) + ")", run_speed, 24, 4, 200); slider_walkspeed_txt = utils.make_slider(main_menu_page2_mod, delegate(float v) { walk_speed = v; slider_walkspeed_txt.text = " Walk-speed (" + String.Format("{0:0.##}", v) + ")"; }, -1, 3, " Walk-speed (" + String.Format("{0:0.##}", walk_speed) + ")", walk_speed, 20, 2, 200); var add_by_id = btn_utils.create_btn(false, ButtonType.Default, "Add avatar to Fav+ by avatar ID", "Opens a dialog to add a avatar with just the avatar ID", Color.white, Color.red, -3, 1, main_menu_page2_mod.transform, new Action(() => { menu.input_text("Enter the avatar ID (avtr_...)", "Confirm", new Action <string>((a) => { if (!a.Contains("avtr_")) { MelonModLogger.Log("Invalid avatar id!"); return; } var model = new ApiAvatar(); model.id = a; model.Get(DelegateSupport.ConvertDelegate <Il2CppSystem.Action <ApiContainer> > (new Action <ApiContainer> (delegate(ApiContainer t) { MelonModLogger.Log("Found avatar with name:" + model.name); MelonModLogger.Log("Avatar status is: " + model.releaseStatus); MelonModLogger.Log("Avatar asset URL: " + model.assetUrl); if (model.releaseStatus.Contains("public")) { //add to list avatar_utils.add_to_list(model); avatar_utils.update_list(avatar_config.avatar_list.Select(x => x.avatar_ident), hashmod.fav_list.listing_avatars); MelonModLogger.Log("Attempted to add model to fav+"); } else { MelonModLogger.Log("Avatar is private, can not add to Fav+!"); } }))); })); }), new Action(() => { })); var rainbow_nameborder_friends = btn_utils.create_btn(rainbow_friend_nameborder, ButtonType.Toggle, "RBG friend border", "Enables a rainbow effect for friends name borders", Color.white, Color.red, -3, 0, main_menu_page2_mod.transform, new Action(() => { rainbow_friend_nameborder = true; }), new Action(() => { rainbow_friend_nameborder = false; //and reset colors var users = utils.get_all_player(); if (users == null) { return; } for (var i = 0; i < users.Count; i++) { var obj = users[i]; if (obj == null) { continue; } if (obj.field_Private_APIUser_0 == null) { continue; } if (utils.is_friend(obj) == false) { continue; } obj.field_Private_VRCPlayerApi_0.SetNamePlateColor(new Color(1f, 1f, 0f)); } })); var antishader = btn_utils.create_btn(anti_crasher_shader, ButtonType.Toggle, "Anti-shader", "Attempts to remove possibly toxic shaders", Color.white, Color.red, -2, 0, main_menu_page2_mod.transform, new Action(() => { anti_crasher_shader = true; }), new Action(() => { anti_crasher_shader = false; shader_menu.reset_all(); })); var antishader_fetched_list = btn_utils.create_btn(should_use_fetched_list, ButtonType.Toggle, "Anti-shader Fetched", "Will enable anti-shader to use a server hosted list of shaders as well", Color.white, Color.red, -1, 0, main_menu_page2_mod.transform, new Action(() => { should_use_fetched_list = true; }), new Action(() => { should_use_fetched_list = false; })); var pub_avatars_by_user_id = btn_utils.create_btn(false, ButtonType.Default, "Show public avatars by user ID", "Opens a dialog to look for the users public avatsr (Input a userid)", Color.white, Color.red, -2, 1, main_menu_page2_mod.transform, new Action(() => { if (Time.time > last_apicall) { last_apicall = Time.time + 60; menu.input_text("Enter the User ID (usr_...)", "Confirm", new Action <string>((a) => { if (!a.Contains("usr_")) { MelonModLogger.Log("Invalid user id!"); return; } pubavatar.update_public_user_list(a); MelonModLogger.Log("Check the avatar page to see public-avats by this author!"); VRCUiManager.prop_VRCUiManager_0.Method_Public_Boolean_1(); })); } else { var sec_left = last_apicall - Time.time; error_type_poput("Function is still on cooldown!", "Please wait " + Math.Floor(sec_left) + " seconds before trying again!"); } }), new Action(() => { })); var resetdynbones = btn_utils.create_btn(false, ButtonType.Default, "Reset dynamic bone cache", "Forces dyn bones to re-apply colliders", Color.white, Color.red, -1, 1, main_menu_page2_mod.transform, new Action(() => { foreach (var a in dynbones.map) { dynbones.remove(a.Key); } }), new Action(() => { })); Application.targetFrameRate = max_fps; } }
public static bool send_message(string msg, string id) { if (VRCWebSocketsManager.field_Private_Static_VRCWebSocketsManager_0 == null || VRCWebSocketsManager.field_Private_Static_VRCWebSocketsManager_0.field_Private_Api_0 == null) { return(false); } VRCWebSocketsManager.field_Private_Static_VRCWebSocketsManager_0.field_Private_Api_0.PostOffice.Send(Invite.Create(id, "", new Location("", new Transmtn.DTO.Instance("", id, "", "", "", false)), msg)); return(true); }