コード例 #1
0
 // Token: 0x0600016E RID: 366 RVA: 0x0000F864 File Offset: 0x0000DA64
 private void Start()
 {
     MiscComponent.Instance = this;
     new Thread(new ThreadStart(DrawUtilities.Min)).Start();
     HotkeyComponent.ActionDict.Add("_VFToggle", delegate
     {
         MiscOptions.VehicleFly = !MiscOptions.VehicleFly;
     });
     HotkeyComponent.ActionDict.Add("_ToggleSilent", delegate
     {
         RaycastOptions.Enabled = !RaycastOptions.Enabled;
     });
     HotkeyComponent.ActionDict.Add("_ToggleAimbot", delegate
     {
         AimbotOptions.Enabled = !AimbotOptions.Enabled;
     });
     HotkeyComponent.ActionDict.Add("_ToggleFreecam", delegate
     {
         MiscOptions.Freecam = !MiscOptions.Freecam;
     });
     HotkeyComponent.ActionDict.Add("_PanicButton", delegate
     {
         MiscOptions.PanicMode = !MiscOptions.PanicMode;
         if (MiscOptions.PanicMode)
         {
             MenuComponent.IsInMenu = false;
             PlayerCoroutines.DisableAllVisuals();
             return;
         }
         PlayerCoroutines.EnableAllVisuals();
     });
     HotkeyComponent.ActionDict.Add("_AutoPickup", delegate
     {
         ItemOptions.AutoItemPickup = !ItemOptions.AutoItemPickup;
     });
     HotkeyComponent.ActionDict.Add("_ToggleSlowFall", delegate
     {
         MiscOptions.SlowFall = !MiscOptions.SlowFall;
     });
     SkinsUtilities.RefreshEconInfo();
 }
コード例 #2
0
        // Token: 0x060001EE RID: 494 RVA: 0x00004708 File Offset: 0x00002908
        public static IEnumerator TakeScreenshot()
        {
            Player       player  = Player.player;
            SteamChannel channel = player.channel;

            if (Time.realtimeSinceStartup - PlayerCoroutines.LastSpy >= 0.5f && !PlayerCoroutines.IsSpying)
            {
                PlayerCoroutines.IsSpying = true;
                PlayerCoroutines.LastSpy  = Time.realtimeSinceStartup;
                if (!MiscOptions.PanicMode)
                {
                    PlayerCoroutines.DisableAllVisuals();
                }
                yield return(new WaitForEndOfFrame());

                yield return(new WaitForEndOfFrame());

                Texture2D texture2D = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false)
                {
                    name      = "Screenshot_Raw",
                    hideFlags = HideFlags.HideAndDontSave
                };
                texture2D.ReadPixels(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), 0, 0, false);
                Texture2D texture2D2 = new Texture2D(640, 480, TextureFormat.RGB24, false)
                {
                    name      = "Screenshot_Final",
                    hideFlags = HideFlags.HideAndDontSave
                };
                Color[] pixels = texture2D.GetPixels();
                Color[] array  = new Color[texture2D2.width * texture2D2.height];
                float   num    = (float)texture2D.width / (float)texture2D2.width;
                float   num2   = (float)texture2D.height / (float)texture2D2.height;
                for (int i = 0; i < texture2D2.height; i++)
                {
                    int num3 = (int)((float)i * num2) * texture2D.width;
                    int num4 = i * texture2D2.width;
                    for (int j = 0; j < texture2D2.width; j++)
                    {
                        int num5 = (int)((float)j * num);
                        array[num4 + j] = pixels[num3 + num5];
                    }
                }
                texture2D2.SetPixels(array);
                byte[] array2 = texture2D2.EncodeToJPG(33);
                if (array2.Length < 35000)
                {
                    channel.longBinaryData = true;
                    channel.openWrite();
                    channel.write(array2);
                    channel.closeWrite("tellScreenshotRelay", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_CHUNK_BUFFER);
                    channel.longBinaryData = false;
                }
                PlayerCoroutines.IsSpying = false;
                if (!MiscOptions.PanicMode)
                {
                    PlayerCoroutines.EnableAllVisuals();
                }
                if (MiscOptions.AlertOnSpy && !MiscOptions.PanicMode)
                {
                    Player.player.StartCoroutine(PlayerCoroutines.ScreenShotMessageCoroutine());
                }
                yield break;
            }
            yield break;
        }