Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

[Suggestion] Auto Paste Clipboard content #30

Open
Rekshot21 opened this issue Dec 27, 2023 · 0 comments
Open

[Suggestion] Auto Paste Clipboard content #30

Rekshot21 opened this issue Dec 27, 2023 · 0 comments

Comments

@Rekshot21
Copy link

Its a bit annoing to select the text, delete it and paste the url, also the ctrl v commands makes the character crouch and opens the emotes wheel. I suggest this simple addition to the code in OnGUI():

public void OnGUI()
        {
            UnityEngine.Cursor.visible = true;
            UnityEngine.Cursor.lockState = CursorLockMode.Confined;
            string clipboardText = "Youtube Boombox";
            if (Clipboard.ContainsText())
            {
                clipboardText = Clipboard.GetText();
            }
            GUI.Box(new Rect(menuX, menuY, menuWidth, menuHeight), clipboardText);
            url = GUI.TextField(new Rect(menuX + 25, menuY + 20, menuWidth - 50, 50), url);

            if (GUI.Button(new Rect(menuX + 25, menuY + 50 + 50, menuWidth - 50, 50), "Play"))
            {
                if (gameObject.TryGetComponent(out BoomboxController controller))
                {
                    controller.DestroyGUI();
                    controller.PlaySong(url);
                }

                UnityEngine.Cursor.visible = false;
                //Cursor.lockState = CursorLockMode.Locked;

                Destroy(this);
            }

            if (GUI.Button(new Rect(menuX + 25, menuY + 50 + 50 + 50, menuWidth - 50, 50), "Close"))
            {

                UnityEngine.Cursor.visible = false;
                //Cursor.lockState = CursorLockMode.Locked;

                if (gameObject.TryGetComponent(out BoomboxController controller))
                {
                    controller.DestroyGUI();
                }

                Destroy(this);
            }
        }

IMPORTANT NOTE: I didnt test it yet

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant