Пример #1
0
    private static void DrawMiscTab()
    {
        GUI.BeginGroup(Groups[4], "");
        GroupBox("Misc", (int)Groups[4].width, (int)Groups[4].height + 10);
        for (int i = 23; i <= 30; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 23) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            if (i == 23)
            {
                GlobalVars.FloatTimers[2] = GUI.HorizontalSlider(new Rect(25 + Size.x, 22 + ((i - 23) * 20), 180 - Size.x, 12), GlobalVars.FloatTimers[2], GlobalVars.MinFloats[i - 19], GlobalVars.MaxFloats[i - 19]);
            }

            if (i == 30)
            {
                if (GUI.Button(new Rect(95, 18 + ((i - 23) * 20), 40, 16), "clear"))
                {
                    FengGameManagerMKII.instance.InternalIgnore.Clear();
                    object[] parameters = new object[] { "<color=#FFFFFF>[</color><b><color=#A5D2FF>sl0wm0d</color></b><color=#FFFFFF>]</color><b><color=#FFD2A5>Ignorelist has been cleared.</color></b>", string.Empty };
                    FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters);
                }
            }
        }
        GUI.EndGroup();
    }
Пример #2
0
    public static void DrawToolTip()
    {
        Vector2 TooltipLength = PanelMain.TextBounds(GlobalVars.ToolTip);

        GUI.DrawTexture(new Rect(UnityEngine.Input.mousePosition.x + 10, UnityEngine.Input.mousePosition.y - 5, TooltipLength.x + 6, TooltipLength.y + 4), ToolTipTex[0]);
        GUI.DrawTexture(new Rect(UnityEngine.Input.mousePosition.x + 11, UnityEngine.Input.mousePosition.y - 4, TooltipLength.x + 4, TooltipLength.y + 2), ToolTipTex[1]);
        GUI.Label(new Rect(UnityEngine.Input.mousePosition.x + 12, UnityEngine.Input.mousePosition.y - 3, TooltipLength.x, TooltipLength.y), GlobalVars.ToolTip /*, ModDrawGUI.FontStyle*/);
    }
Пример #3
0
    private static void GroupBox(string name, int xMax, int yMax)
    {
        Rendering.CustomCanvas.DrawLine(new Vector2(0, 12), new Vector2(10, 12), Color.white);
        Rendering.CustomCanvas.DrawLine(new Vector2(0, 12), new Vector2(0, yMax), Color.white);
        Rendering.CustomCanvas.DrawLine(new Vector2(xMax, 12), new Vector2(xMax, yMax), Color.white);
        Rendering.CustomCanvas.DrawLine(new Vector2(0, yMax), new Vector2(xMax, yMax), Color.white);
        Vector2 strBounds = PanelMain.TextBounds(name);

        Rendering.CustomCanvas.DrawLine(new Vector2(18 + strBounds.x, 12), new Vector2(xMax, 12), Color.white);
        GUI.Label(new Rect(14, 0, strBounds.x, strBounds.y), name, FontStyle);
    }
Пример #4
0
    private static void DrawPlayerTab()
    {
        GUI.BeginGroup(Groups[4], "");
        GroupBox("Player", (int)Groups[4].width, (int)Groups[4].height);
        for (int i = 13; i <= 16; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i]       = GUI.Toggle(new Rect(5, 15 + ((i - 13) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            GlobalVars.Floats[i - 13] = GUI.HorizontalSlider(new Rect(25 + Size.x, 22 + ((i - 13) * 20), 180 - Size.x, 12), GlobalVars.Floats[i - 13], GlobalVars.MinFloats[i - 13], GlobalVars.MaxFloats[i - 13]);
        }
        GUI.EndGroup();

        GUI.BeginGroup(Groups[5], "");
        GroupBox("Autosmite", (int)Groups[5].width, (int)Groups[5].height);
        for (int i = 17; i <= 20; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 17) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
        }
        GUI.EndGroup();
    }
Пример #5
0
    public static void DrawSkinGUI(int WindowID)
    {
        int  Reapply     = GUI.skin.button.fontSize;
        Font ReapplyFont = GUI.skin.button.font;

        GUI.skin.button.font     = GlobalVars.Segoe;
        GUI.skin.button.fontSize = 12;

        GUI.skin.toggle.font     = GlobalVars.Segoe;
        GUI.skin.toggle.fontSize = 12;

        int Additions = 0;

        GUI.DrawTexture(new Rect(0, 0, 400, 300), GlobalVars.sl0wTextures[1]);
        IEnumerator zEnum = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().getPlayers().GetEnumerator();

        DebugScrollPos            = GUI.BeginScrollView(new Rect(9, 45, 218, 235), DebugScrollPos, new Rect(0, 0, 170, (20 * 18) + 4)); // add real number via a loop later  //218 248
        GUI.skin.button.alignment = TextAnchor.MiddleLeft;
        GUI.skin.label.alignment  = TextAnchor.MiddleLeft;
        while (zEnum.MoveNext())
        {
            HERO aHERO = zEnum.Current as HERO;
            if (!aHERO ||
                !aHERO.photonView)
            {
                continue;
            }

            if (!aHERO.photonView.owner.isLocal)
            {
                if (aHERO.bHasSkin && aHERO.skinURL != string.Empty)
                {
                    string Playername = ModDrawOverlay.RemoveTags((string)aHERO.photonView.owner.customProperties[PhotonPlayerProperty.name]);
                    if (GUI.Button(new Rect(4, 25 * (Additions) + 4, 130, 20), Playername))
                    {
                        SelectedHero = aHERO;
                    }
                    Additions++;
                }
            }
        }
        GUI.skin.button.alignment = TextAnchor.MiddleCenter;
        GUI.skin.label.alignment  = TextAnchor.UpperLeft;
        GUI.EndScrollView();

        if (SelectedHero) // 240 90
        {
            string PlayerName = ModDrawOverlay.RemoveTags((string)SelectedHero.photonView.owner.customProperties[PhotonPlayerProperty.name]);

            if (PlayerName.Length > 25)
            {
                PlayerName = PlayerName.Remove(25);
            }

            string  Label       = string.Format("{0}'s Setup", PlayerName);
            Vector2 LabelBounds = PanelMain.TextBounds(Label);
            GUI.Label(new Rect(240, 90, LabelBounds.x, LabelBounds.y), Label, FontStyle);
            GUI.Label(new Rect(250, 105, 100, 20), string.Format("SEX: {0}", (SelectedHero.setup.myCostume.sex == SEX.MALE ? "MALE" : "FEMALE")), FontStyle);
            GUI.Label(new Rect(250, 117, 100, 20), string.Format("EYES: {0}", SelectedHero.setup.myCostume.eye_texture_id), FontStyle);
            GUI.Label(new Rect(250, 129, 100, 20), string.Format("MOUTH: {0}", SelectedHero.setup.myCostume.beard_texture_id), FontStyle);
            GUI.Label(new Rect(250, 141, 100, 20), string.Format("GLASSES: {0}", SelectedHero.setup.myCostume.glass_texture_id), FontStyle);
            GUI.Label(new Rect(250, 153, 100, 20), string.Format("HAIR: {0}", SelectedHero.setup.myCostume.hairInfo.hair), FontStyle);
            GUI.Label(new Rect(250, 165, 100, 20), string.Format("CAPE: {0}", (SelectedHero.setup.myCostume.cape ? "YES" : "NO")), FontStyle);
            GUI.Label(new Rect(250, 177, 100, 20), string.Format("COSTUME: {0}", SelectedHero.setup.myCostume.costumeId), FontStyle);

            if (GUI.Button(new Rect(330, 275, 65, 22), "Dumpskin", PanelMain.changelogstyle))
            {
                string[] Urls     = SelectedHero.skinURL.Split(new char[] { ',' });
                string   FullText = string.Format("Username: {0}\n\n", PlayerName);

                for (int i = 0; i < URLAddons.Length; i++)
                {
                    FullText = string.Format("{0}{1}{2}\n", FullText, URLAddons[i], Urls[i]);
                }


                string folderDir = RemoveSpecialCharacters(PlayerName);
                if (folderDir == string.Empty)
                {
                    folderDir = "DefaultFallback";
                }

                folderDir = string.Format(".\\{0}", folderDir);
                if (!System.IO.Directory.Exists(folderDir))
                {
                    System.IO.Directory.CreateDirectory(folderDir);
                    System.IO.File.WriteAllText(string.Format("{0}\\{1}.txt", folderDir, 1), FullText);
                }
                else
                {
                    int ExistingNum = 1;
                    while (System.IO.File.Exists(string.Format("{0}\\{1}.txt", folderDir, ExistingNum)))
                    {
                        ExistingNum++;
                    }
                    System.IO.File.WriteAllText(string.Format("{0}\\{1}.txt", folderDir, ExistingNum), FullText);
                }
            }

            if (GUI.Button(new Rect(255, 275, 65, 22), "Clone", PanelMain.changelogstyle))
            {
            }


//               if(Event.current.type == EventType.Repaint)
//               {
//                   guiCamera.Render();
//               }

            //GUI.DrawTexture(new Rect(228, 42, 170, 100), renderTexture);
        }
        GUI.skin.toggle.font     = ReapplyFont;
        GUI.skin.toggle.fontSize = Reapply;
        GUI.skin.button.font     = ReapplyFont;
        GUI.skin.button.fontSize = Reapply;

        GUI.DragWindow(new Rect(0, 0, 300, 35));
    }
Пример #6
0
    private static void DrawVisualsTab()
    {
        Texture2D ColorOpt = new Texture2D(1, 1);

        GUI.BeginGroup(Groups[0], "");
        GroupBox("Titans/PT", (int)Groups[0].width, (int)Groups[0].height);
        for (int i = 0; i <= 3; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + (i * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            if (GUI.Button(new Rect(80, 18 + (i * 20), 20, 15), ""))
            {
                GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
            }
            ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
            ColorOpt.Apply();

            GUI.DrawTexture(new Rect(80, 18 + (i * 20), 20, 15), ColorOpt);
        }
        GUI.EndGroup();


        GUI.BeginGroup(Groups[1], "");
        GroupBox("Player", (int)Groups[1].width, (int)Groups[1].height);
        for (int i = 4; i <= 7; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 4) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            if (GUI.Button(new Rect(80, 18 + ((i - 4) * 20), 20, 15), ""))
            {
                GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
            }
            ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
            ColorOpt.Apply();

            GUI.DrawTexture(new Rect(80, 18 + ((i - 4) * 20), 20, 15), ColorOpt);
        }
        GUI.EndGroup();

        GUI.BeginGroup(Groups[2], "");
        GroupBox("Misc", (int)Groups[2].width, (int)Groups[2].height);
        for (int i = 8; i <= 12; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            if (i >= 11)
            {
                GlobalVars.Bools[i] = GUI.Toggle(new Rect(126, 15 + ((i - 11) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
                if (GUI.Button(new Rect(201, 18 + ((i - 11) * 20), 20, 15), ""))
                {
                    GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
                }
                ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
                ColorOpt.Apply();
                GUI.DrawTexture(new Rect(201, 18 + ((i - 11) * 20), 20, 15), ColorOpt);
            }
            else
            {
                GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 8) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
                if (GUI.Button(new Rect(80, 18 + ((i - 8) * 20), 20, 15), ""))
                {
                    GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
                }
                ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
                ColorOpt.Apply();

                GUI.DrawTexture(new Rect(80, 18 + ((i - 8) * 20), 20, 15), ColorOpt);
            }
        }
        GUI.EndGroup();

        GUI.BeginGroup(Groups[3], "");
        GroupBox("Colors", (int)Groups[3].width, (int)Groups[3].height);
        GUI.DrawTexture(new Rect(10, 20, 100, 30), ColorTexture);
        Vector2 PreviewSize = PanelMain.TextBounds("Preview");

        GUI.Label(new Rect(60 - (PreviewSize.x / 2), 32, PreviewSize.x, PreviewSize.y), "Preview", FontStyle);
        ColorFloats[0] = GUI.VerticalSlider(new Rect(20, 60, 12, 150), ColorFloats[0], 1.0f, 0.0f);
        ColorFloats[1] = GUI.VerticalSlider(new Rect(50, 60, 12, 150), ColorFloats[1], 1.0f, 0.0f);
        ColorFloats[2] = GUI.VerticalSlider(new Rect(80, 60, 12, 150), ColorFloats[2], 1.0f, 0.0f);
        ColorTexture.SetPixel(1, 1, new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2], 1.0f));
        ColorTexture.Apply();

        GUI.EndGroup();
    }
Пример #7
0
    public static void DrawMiscOverlay()
    {
        MiscStyle          = new GUIStyle(GUI.skin.label);
        MiscStyle.font     = GlobalVars.Segoe;
        MiscStyle.fontSize = 12;

        // Only reason atm im not just forlooping a single func is beyond me... i think the layering math that way would hurt my hed tho XDDDD
        if (GlobalVars.Bools[8])
        {
            MiscStyle.normal.textColor = GlobalVars.Colors[8];
            string  LocalTime = DateTime.Now.ToString();
            Vector2 TxtBounds = PanelMain.TextBounds(LocalTime);
            GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y, TxtBounds.x, TxtBounds.y), LocalTime, MiscStyle);
        }

        if (GlobalVars.Bools[9])
        {
            MiscStyle.normal.textColor = GlobalVars.Colors[9];
            string  ResolutionString = String.Format("({0}x{1})", Screen.width, Screen.height);
            Vector2 TxtBounds        = PanelMain.TextBounds(ResolutionString);
            GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y -
                               (GlobalVars.Bools[8] ? 18 : 0), TxtBounds.x, TxtBounds.y), ResolutionString, MiscStyle);
        }

        if (GlobalVars.Bools[11])
        {
            MiscStyle.normal.textColor = GlobalVars.Colors[11];
            string  PingString = String.Format("Ping: {0}", PhotonNetwork.GetPing());
            Vector2 TxtBounds  = PanelMain.TextBounds(PingString);
            GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y -
                               (GlobalVars.Bools[8] ? GlobalVars.Bools[9] ? 36 : 18 : GlobalVars.Bools[9] ? 18 : 0),
                               TxtBounds.x, TxtBounds.y), PingString, MiscStyle);
        }

        if (GlobalVars.Bools[10])
        {
            if (sFPS != string.Empty)
            {
                MiscStyle.normal.textColor = GlobalVars.Colors[10];
                Vector2 TxtBounds = PanelMain.TextBounds(sFPS);
                GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y -
                                   (GlobalVars.Bools[8]
                    ?
                                    GlobalVars.Bools[9]
                        ?
                                    GlobalVars.Bools[11]
                            ?
                                    54
                            :
                                    36
                       :
                                    GlobalVars.Bools[11]
                        ?
                                    36
                        :
                                    18
                    :
                                    GlobalVars.Bools[9]
                    ?
                                    GlobalVars.Bools[11]
                        ?
                                    36
                        :
                                    18
                    :
                                    GlobalVars.Bools[11]
                        ?
                                    18
                        :
                                    0
                                   ),
                                   TxtBounds.x, TxtBounds.y), sFPS, MiscStyle);
            }
        }
    }