Example #1
0
        public void initButton(int btnXLocation, int btnYLocation, String btnText, String btnToolTip, Nullable <Color> btnBackgroundColor = null, Nullable <Color> btnTextColor = null, Nullable <Color> backbtnBackgroundColor = null, Nullable <Color> backbtnTextColor = null)
        {
            Transform menu = UnityEngine.Object.Instantiate(QuickMenuStuff.GetQuickMenuInstance().transform.Find("CameraMenu"), QuickMenuStuff.GetQuickMenuInstance().transform);

            menuName  = "CustomMenu" + btnQMLoc + "_" + btnXLocation + "_" + btnYLocation;
            menu.name = menuName;

            mainButton = new QMSingleButton(btnQMLoc, btnXLocation, btnYLocation, btnText, new Action(() => { QuickMenuStuff.ShowQuickmenuPage(menuName); }), btnToolTip, btnBackgroundColor, btnTextColor);

            IEnumerator enumerator = menu.transform.GetEnumerator();

            while (enumerator.MoveNext())
            {
                Il2CppSystem.Object obj     = enumerator.Current;
                Transform           btnEnum = obj.Cast <Transform>();
                if (btnEnum != null)
                {
                    UnityEngine.Object.Destroy(btnEnum.gameObject);
                }
            }

            if (backbtnTextColor == null)
            {
                backbtnTextColor = Color.yellow;
            }
            backButton = new QMSingleButton(this, 4, 2, "Back", new Action(() => { QuickMenuStuff.ShowQuickmenuPage(btnQMLoc); }), "Go Back", backbtnBackgroundColor, backbtnTextColor);
        }
Example #2
0
        public void initButton(int btnXLocation, int btnYLocation, String btnText, String btnToolTip, Color?btnBackgroundColor = null, Color?btnTextColor = null, Color?backbtnBackgroundColor = null, Color?backbtnTextColor = null)
        {
            btnType = "NestedButton";

            Transform menu = UnityEngine.Object.Instantiate <Transform>(QMStuff.NestedMenuTemplate(), QMStuff.GetQuickMenuInstance().transform);

            menuName  = QMButtonAPI.identifier + btnQMLoc + "_" + btnXLocation + "_" + btnYLocation;
            menu.name = menuName;

            mainButton = new QMSingleButton(btnQMLoc, btnXLocation, btnYLocation, btnText, () => { QMStuff.ShowQuickmenuPage(menuName); }, btnToolTip, btnBackgroundColor, btnTextColor);

            Il2CppSystem.Collections.IEnumerator enumerator = menu.transform.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Il2CppSystem.Object obj     = enumerator.Current;
                Transform           btnEnum = obj.Cast <Transform>();
                if (btnEnum != null)
                {
                    UnityEngine.Object.Destroy(btnEnum.gameObject);
                }
            }

            if (backbtnTextColor == null)
            {
                backbtnTextColor = Color.yellow;
            }
            QMButtonAPI.allNestedButtons.Add(this);
            backButton = new QMSingleButton(this, 5, 2, "Back", () => { QMStuff.ShowQuickmenuPage(btnQMLoc); }, "Go Back", backbtnBackgroundColor, backbtnTextColor);
        }
Example #3
0
 private static bool UIListPatch(VRCUiContentButton __0, Il2CppSystem.Object __1)
 {
     if (__1.Cast <ApiAvatar>().releaseStatus == "public")
     {
         __0.transform.Find("TitleText").GetComponent <Text>().color = Color.green;
     }
     else
     {
         __0.transform.Find("TitleText").GetComponent <Text>().color = Color.red;
     }
     return(true);
 }
Example #4
0
 public void ClearButtons()
 {
     Il2CppSystem.Collections.IEnumerator enumerator = CachedMenu.transform.GetEnumerator();
     while (enumerator.MoveNext())
     {
         Il2CppSystem.Object obj     = enumerator.Current;
         Transform           btnEnum = obj.Cast <Transform>();
         if (btnEnum != null)
         {
             UnityEngine.Object.Destroy(btnEnum.gameObject);
         }
     }
 }
Example #5
0
        private static void SetPickerContentFromApiModelPatch(ref VRCUiContentButton __0, ref Il2CppSystem.Object __1)
        {
            APIUser user    = __1.Cast <APIUser>();
            var     apiUser = PlayerWrappers.CachedApiUsers.Find(x => x.id == user.id) ?? user;

            if (Enabled.Value)
            {
                __0.field_Public_Text_0.color = GetTrustColor(apiUser);
            }
            else
            {
                __0.field_Public_Text_0.color = new Color(0.4139273f, 0.8854161f, 0.9705882f);
            }
        }
Example #6
0
        public static void ClearPage(string pagename)
        {
            QuickMenu quickmenu     = GetQuickMenuInstance();
            Transform pageTransform = quickmenu?.transform.Find(pagename);

            Il2CppSystem.Collections.IEnumerator enumerator = pageTransform.transform.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Il2CppSystem.Object obj     = enumerator.Current;
                Transform           btnEnum = obj.Cast <Transform>();
                if (btnEnum != null)
                {
                    UnityEngine.Object.Destroy(btnEnum.gameObject);
                }
            }
        }
Example #7
0
 private static bool ButtonPatch(VRCUiContentButton __0, Il2CppSystem.Object __1)
 {
     try
     {
         APIUser oof = __1.Cast <APIUser>();
         if (oof.tags.Contains("admin_moderator"))
         {
             __0.field_Public_Text_0.color = UnityEngine.Color.red;
         }
         else if (oof.tags.Contains("system_legend"))
         {
             __0.field_Public_Text_0.color = new Color(1f, 1f, 1f);
         }
         else if (oof.tags.Contains("system_trust_legend"))
         {
             __0.field_Public_Text_0.color = new Color(1f, 1f, 0f);
         }
         else if (oof.tags.Contains("system_trust_veteran"))
         {
             __0.field_Public_Text_0.color = new Color(0.5f, 0.25f, 0.9f);
         }
         else if (oof.tags.Contains("system_trust_trusted"))
         {
             __0.field_Public_Text_0.color = new Color(1, 0.48f, 0);
         }
         else if (oof.tags.Contains("system_trust_known"))
         {
             __0.field_Public_Text_0.color = new Color(0.17f, 0.81f, 0.36f);
         }
         else if (oof.tags.Contains("system_trust_basic"))
         {
             __0.field_Public_Text_0.color = new Color(0.09f, 0.47f, 1f);
         }
         else
         {
             __0.field_Public_Text_0.color = UnityEngine.Color.grey;
         }
     }
     catch
     {
         //oof
     }
     return(true);
 }
Example #8
0
        public void initButton(int btnXLocation, int btnYLocation, bool btnHalf, string btnText, string btnToolTip, System.Action action = null, Color?btnBackgroundColor = null, Color?btnTextColor = null, Color?backbtnBackgroundColor = null, Color?backbtnTextColor = null)
        {
            btnType = "NestedButton";

            Transform menu = Object.Instantiate <Transform>(QMStuff.NestedMenuTemplate(), QMStuff.GetQuickMenuInstance().transform);

            menuName  = "PureMOD" + btnQMLoc + "_" + btnXLocation + "_" + btnYLocation;
            menu.name = menuName;

            mainButton = new ButtonAPI.SingleButton(btnQMLoc, btnXLocation, btnYLocation, btnHalf, btnText, btnToolTip, delegate()
            {
                if (action != null)
                {
                    action.Invoke();
                }
                QMStuff.ShowQuickmenuPage(menuName);
            }, btnBackgroundColor, btnTextColor);

            Il2CppSystem.Collections.IEnumerator enumerator = menu.transform.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Il2CppSystem.Object obj     = enumerator.Current;
                Transform           btnEnum = obj.Cast <Transform>();
                if (btnEnum != null)
                {
                    Object.Destroy(btnEnum.gameObject);
                }
            }

            if (backbtnTextColor == null)
            {
                backbtnTextColor = Color.yellow;
            }
            backButton = new ButtonAPI.SingleButton(menuName, 5, 5, true, "Back", "Go Back", delegate()
            {
                QMStuff.ShowQuickmenuPage(btnQMLoc);
            }, backbtnTextColor, backbtnBackgroundColor);
        }
Example #9
0
        private IEnumerator InitButtonNew(string Name, string base64image, string ImageURL, byte[] imagebytes)
        {
            menuName = QMButtonAPI.identifier + "_Custom_Menu_" + Name;
            while (MonoBehaviourPublicObCoGaCoObCoObCoUnique.prop_MonoBehaviourPublicObCoGaCoObCoObCoUnique_0 == null || MonoBehaviourPublicObCoGaCoObCoObCoUnique.prop_MonoBehaviourPublicObCoGaCoObCoObCoUnique_0.field_Public_ArrayOf_GameObject_0 == null)
            {
                yield return(null);
            }
            byte[] imagedata = null;
            if (base64image != null && ImageURL == null && imagebytes == null)
            {
                imagedata = Convert.FromBase64String(base64image);
            }
            else if (ImageURL != null && base64image == null && imagebytes == null)
            {
                WebClient wc = new WebClient();
                imagedata = wc.DownloadData(ImageURL);
            }
            else if (imagebytes != null && ImageURL == null && base64image == null)
            {
                imagedata = imagebytes;
            }
            else
            {
                MelonLoader.MelonLogger.Error("Well Shit someone is dumb");
                yield break;
            }
            Texture2D icontexture = new Texture2D(2, 2, TextureFormat.ARGB32, false);

            ImageConversion.LoadImage(icontexture, imagedata);


            Transform menu = UnityEngine.Object.Instantiate <Transform>(QMStuff.NestedMenuTemplate(), QMStuff.GetQuickMenuInstance().transform);

            menu.name = menuName;

            var TabButton = GameObject.Instantiate(GameObject.Find("UserInterface/QuickMenu/QuickModeTabs/NotificationsTab"), GameObject.Find("UserInterface/QuickMenu/QuickModeTabs").transform);

            TabButton.name = QMButtonAPI.identifier + "_" + Name;

            GameObject.Destroy(TabButton.transform.Find("Badge"));

            TabButton.GetComponent <Button>().onClick = new Button.ButtonClickedEvent();
            TabButton.GetComponent <Button>().onClick.AddListener((Action) delegate()
            {
                QMStuff.ShowQuickmenuPage(menuName);
            });

            TabButton.transform.Find("Icon").GetComponent <Image>().sprite   = new Sprite();
            TabButton.transform.Find("Icon").GetComponent <Image>().material = new Material(TabButton.transform.Find("Icon").GetComponent <Image>().material)
            {
                mainTexture = icontexture
            };
            Il2CppSystem.Collections.IEnumerator enumerator = menu.transform.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Il2CppSystem.Object obj     = enumerator.Current;
                Transform           btnEnum = obj.Cast <Transform>();
                if (btnEnum != null)
                {
                    UnityEngine.Object.Destroy(btnEnum.gameObject);
                }
            }
            QMButtonAPI.allNestedButtons.Add(this);
            backButton = new QMSingleButton(this, 5, 2, "Back", () => { QMStuff.ShowQuickmenuPage("ShortcutMenu"); }, "Go Back", Color.cyan, Color.yellow);
            yield break;
        }
Example #10
0
            public UserInfoExtensionsAPIUser(Il2CppSystem.Object jsonObject)
            {
                if (jsonObject == null)
                {
                    return;
                }

                Il2CppSystem.Collections.Generic.Dictionary <string, Il2CppSystem.Object> jsonDictionary = jsonObject.Cast <Il2CppSystem.Collections.Generic.Dictionary <string, Il2CppSystem.Object> >();
                if (jsonDictionary.ContainsKey("id"))
                {
                    Id = jsonDictionary.get_Item("id").ToString();
                }

                if (jsonDictionary.ContainsKey("date_joined"))
                {
                    DateJoined = jsonDictionary.get_Item("date_joined").ToString();
                }
            }
Example #11
0
 public void AddSystem(SystemTypes Type, Il2CppSystem.Object IType)
 {
     Systems.Add(Type, IType.Cast <ISystemType>());
 }