예제 #1
0
        static void Main(string[] args)
        {
            Dx9Overlay.SetParam("use_window", "1"); // Use the window name to find the process
            Dx9Overlay.SetParam("window", "GTA:SA:MP");

            Dx9Overlay.DestroyAllVisual();

            var label = new TextLabel("Arial", 12, 500, 300, System.Drawing.Color.Red, "Sample Text", shadow: false);

            try
            {
                while (true)
                {
                    Console.WriteLine("Type in new font size:");
                    var newFontSize = int.Parse(Console.ReadLine());

                    label.FontSize = newFontSize;
                }
            }
            finally
            {
                Dx9Overlay.DestroyAllVisual();

                Console.WriteLine("Ran into an error, so all visuals were destroyed. Hit enter to exit this program");
                Console.ReadLine();
            }
        }
        public MainWindow()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            InitializeComponent();

            this.DataContext = new MainWindowViewModel();

            Dx9Overlay.SetParam("use_window", "1"); // Use the window name to find the process
            Dx9Overlay.SetParam("window", "GTA:SA:MP");

            #region Create system tray notification icon
            _notifyIcon = new System.Windows.Forms.NotifyIcon
            {
                Icon    = Properties.Resources.map_icon,
                Visible = true,
                Text    = "Double click me to open the program!"
            };
            _notifyIcon.DoubleClick +=
                delegate
            {
                this.Show();
                this.WindowState = WindowState.Normal;
            };
            var notificationIconContextMenu = new System.Windows.Forms.ContextMenu();
            notificationIconContextMenu.MenuItems.Add("Exit", delegate { this.Close(); });
            _notifyIcon.ContextMenu = notificationIconContextMenu;
            #endregion
        }
예제 #3
0
#pragma warning restore 67

        /// <summary>
        /// draw text to object
        /// </summary>
        /// <param name="to">object process</param>
        /// <param name="message">content message display</param>
        public static void OnCallDrawObjectForName(string to, string message)
        {
            if (IsObjectExistProcess(to))
            {
                _listChat.Items.Add(message);

                Dx9Overlay.SetParam("use_window", "1");                     // Use the window name to find the process
                Dx9Overlay.SetParam("window", GetWindowNameForProcess(to)); // Set the window name
                if (!Initialized)
                {
                    InitializedObjectD3();
                }

                try
                {
                    if (_listChat.Items.Count == 1)
                    {
                        Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                    }
                    else if (_listChat.Items.Count == 2)
                    {
                        Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                        Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                    }
                    else if (_listChat.Items.Count == 3)
                    {
                        Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                        Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                        Dx9Overlay.TextSetString(_overlayText3, _listChat.Items[_listChat.Items.Count - 3].ToString());
                    }
                    else if (_listChat.Items.Count == 4)
                    {
                        Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                        Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                        Dx9Overlay.TextSetString(_overlayText3, _listChat.Items[_listChat.Items.Count - 3].ToString());
                        Dx9Overlay.TextSetString(_overlayText4, _listChat.Items[_listChat.Items.Count - 4].ToString());
                    }
                    else if (_listChat.Items.Count > 5 || _listChat.Items.Count == 5)
                    {
                        Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                        Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                        Dx9Overlay.TextSetString(_overlayText3, _listChat.Items[_listChat.Items.Count - 3].ToString());
                        Dx9Overlay.TextSetString(_overlayText4, _listChat.Items[_listChat.Items.Count - 4].ToString());
                        Dx9Overlay.TextSetString(_overlayText5, _listChat.Items[_listChat.Items.Count - 5].ToString());
                    }
                }
                catch (Exception ex)
                {
                    OnDebugMessageCallBack(ex.StackTrace);
                }
            }
        }
예제 #4
0
        /// <summary>
        /// method draw text chat in league of legends game client
        /// </summary>
        /// <param name="message"></param>
        public static void OnCallDrawLeagueOfLegends(string message)
        {
            if (!IsLeagueOfLegendsProcessOpen())
            {
                return;
            }

            //byte[] bytes = Encoding.Default.GetBytes(message);
            //message = Encoding.UTF8.GetString(bytes);

            //byte[] bytes = Encoding.Default.GetBytes(message);
            //message = Encoding.UTF8.GetString(bytes);


            _listChat.Items.Add(message);

            Dx9Overlay.SetParam("use_window", "1");                         // Use the window name to find the process
            Dx9Overlay.SetParam("window", "League of Legends (TM) Client"); // Set the window name
            //Dx9Overlay.SetParam("window", "Test D3D9 window"); // Set the window name
            if (!Initialized)
            {
                InitializedObjectD3();
            }


            //TemplateUiChatD3 chat = MessagesUi[0];
            try
            {
                //Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count].ToString());
                //Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 1].ToString());
                //Dx9Overlay.TextSetString(_overlayText3, _listChat.Items[_listChat.Items.Count - 2].ToString());
                //Dx9Overlay.TextSetString(_overlayText4, _listChat.Items[_listChat.Items.Count - 4].ToString());
                //Dx9Overlay.TextSetString(_overlayText5, _listChat.Items[_listChat.Items.Count - 5].ToString());
                //for (int i = 0; i < _listChat.Items.Count; i++)
                //{
                Console.Clear();
                if (_listChat.Items.Count == 1)
                {
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count -1].ToString());

                    Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                }

                else if (_listChat.Items.Count == 2)
                {
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 1].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 2].ToString());

                    Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                    Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                }
                else if (_listChat.Items.Count == 3)
                {
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 1].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 2].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 3].ToString());

                    Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                    Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                    Dx9Overlay.TextSetString(_overlayText3, _listChat.Items[_listChat.Items.Count - 3].ToString());
                }
                else if (_listChat.Items.Count == 4)
                {
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 1].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 2].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 3].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 4].ToString());

                    Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                    Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                    Dx9Overlay.TextSetString(_overlayText3, _listChat.Items[_listChat.Items.Count - 3].ToString());
                    Dx9Overlay.TextSetString(_overlayText4, _listChat.Items[_listChat.Items.Count - 4].ToString());
                }
                else if (_listChat.Items.Count > 5 || _listChat.Items.Count == 5)
                {
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 1].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 2].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 3].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 4].ToString());
                    //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 5].ToString());

                    Dx9Overlay.TextSetString(_overlayText1, _listChat.Items[_listChat.Items.Count - 1].ToString());
                    Dx9Overlay.TextSetString(_overlayText2, _listChat.Items[_listChat.Items.Count - 2].ToString());
                    Dx9Overlay.TextSetString(_overlayText3, _listChat.Items[_listChat.Items.Count - 3].ToString());
                    Dx9Overlay.TextSetString(_overlayText4, _listChat.Items[_listChat.Items.Count - 4].ToString());
                    Dx9Overlay.TextSetString(_overlayText5, _listChat.Items[_listChat.Items.Count - 5].ToString());
                }
                //}
                //Console.WriteLine(_listChat.Items[_listChat.Items.Count].ToString());
                //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 1].ToString());
                //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 2].ToString());
                //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 3].ToString());
                //Console.WriteLine(_listChat.Items[_listChat.Items.Count - 4].ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }