public textArea(Process process, zCView view, int height) { this.process = process; this.view = view; fontY = this.view.Font.GetFontY(); fontY = InputHooked.PixelToVirtualY(process, fontY); int lines = height / fontY; zString empty = zString.Create(process, ""); vt = new zCViewText[lines]; for (int i = 0; i < lines; i++) { vt[i] = view.CreateText(0, i * fontY, empty); vt[i].Timed = 0; vt[i].Timer = -1; } empty.Dispose(); Inputenabled = true; InputHooked.receivers.Add(this); }
public void SetSize(int size) { if (size > this.size) { for (int i = this.size; i < size; i++) { zString str = zString.Create(process, ""); int height = (int)(mHeight * 0.1f); int width = (int)(mWidth * 0.05f); zCViewText vt = viewBG.CreateText(0, 0, str); vt.Timed = 0; vt.Timer = -1; vt.PosX = width; vt.PosY = height + i * height; viewTextList.Add(vt); str.Dispose(); } } else if (size < this.size) { zCViewText[] txview = viewTextList.ToArray(); for (int i = size; i < this.size; i++) { txview[i].Timed = 1; txview[i].Timer = 0; viewTextList.Remove(txview[i]); } } this.size = size; }
public void SetSize(int size) { if (size > this.size) { for (int i = this.size; i < size; i++) { zCViewText vt = view.CreateText(0, 0, SpaceText); vt.Timed = 0; vt.Timer = -1; vt.PosX = posX; vt.PosY = posY + i * vt.Font.GetFontY(); textViews.Add(vt); } } if (size < this.size) { for (int i = size; i < this.size; i++) { textViews[i].Timed = 1; textViews[i].Timer = 1; } } this.size = size; }
public Text3DRow addRow(Text3DRow tr) { Process process = Process.ThisProcess(); m_Rows.Add(tr); using (zString str = zString.Create(process, tr.Text)) { tr.GText = m_View.CreateText(0x0000 + m_Rows.Count * 100, 0x0000 + m_View.FontY() * m_Rows.Count, str); tr.GText.Timed = 0; tr.GText.Timer = -1; tr.GText.PosX = 0; tr.GText.PosY = 0; tr.GText.Color.R = tr.Color.R; tr.GText.Color.G = tr.Color.G; tr.GText.Color.B = tr.Color.B; tr.GText.Color.A = tr.Color.A; tr.InsertTime = DateTime.Now.Ticks / 10000; } return(tr); }
private void createText() { Process process = Process.ThisProcess(); zString str = zString.Create(process, this.text); textView = thisView.CreateText(this.position.X, this.position.Y, str); str.Dispose(); textView.Timed = 0; textView.Timer = -1; }
private void createText() { String text = tB.getText(); Process process = Process.ThisProcess(); zString str = zString.Create(process, text); tB.vt = thisView.CreateText(position.X, position.Y, str); str.Dispose(); tB.vt.Timed = 0; tB.vt.Timer = -1; }
public textBox(zCView view, Process process) { this.process = process; this.view = view; zString empty = zString.Create(process, ""); vt = view.CreateText(0, 0, empty); empty.Dispose(); vt.Timed = 0; vt.Timer = -1; Inputenabled = true; InputHooked.receivers.Add(this); }
private void createTextViews(int lines) { if (textarr != null) { foreach (zCViewText vt in textarr) { vt.Timed = 1; vt.Timer = 0; } } textarr = new zCViewText[lines]; for (int i = 0; i < lines; i++) { textarr[i] = thisView.CreateText(this.position.X, this.position.Y + i * (InputHooked.PixelToVirtualY(Process.ThisProcess(), thisView.Font.GetFontY())), emptyString); } }
public void Update() { if (client == null) { return; } if (connectionView == null) { Process process = Process.ThisProcess(); connectionView = zCView.Create(process, 0, 0, 0x2000, 0x2000); zString str = zString.Create(process, "Connection aborted!"); zCViewText vt = connectionView.CreateText(0x950, 0x800, str); str.Dispose(); vt.Color.G = 0; vt.Color.B = 0; vt.Color.R = 255; vt.Color.A = 255; vt.Timed = 0; vt.Timer = -1; } if (!shown && (client.GetLastPing(client.GetSystemAddressFromIndex(0)) > 1000 || client.GetLastPing(client.GetSystemAddressFromIndex(0)) <= -1)) { zCView.GetStartscreen(Process.ThisProcess()).InsertItem(connectionView, 0); shown = true; } else if (shown && (client.GetLastPing(client.GetSystemAddressFromIndex(0)) < 700 && client.GetLastPing(client.GetSystemAddressFromIndex(0)) > -1)) { zCView.GetStartscreen(Process.ThisProcess()).RemoveItem(connectionView); shown = false; } int counter = 0; Packet packet = client.Receive(); while (packet != null) { WinApi.Kernel.Process.SetWindowText(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, "Gothic II - Untold Chapters - " + client.GetLastPing(client.GetSystemAddressFromIndex(0))); switch (packet.data[0]) { case (byte)DefaultMessageIDTypes.ID_CONNECTION_REQUEST_ACCEPTED: isConnected = true; connectionTrys = 0; break; case (byte)DefaultMessageIDTypes.ID_CONNECTION_ATTEMPT_FAILED: logError("Connection Failed!"); isConnected = false; break; case (byte)DefaultMessageIDTypes.ID_ALREADY_CONNECTED: logError("Already Connected!"); break; case (byte)DefaultMessageIDTypes.ID_CONNECTION_BANNED: logError("Client banned!"); break; case (byte)DefaultMessageIDTypes.ID_INVALID_PASSWORD: logError("Wrong password"); break; case (byte)DefaultMessageIDTypes.ID_INCOMPATIBLE_PROTOCOL_VERSION: logError("ID_INCOMPATIBLE_PROTOCOL_VERSION"); break; case (byte)DefaultMessageIDTypes.ID_NO_FREE_INCOMING_CONNECTIONS: logError("ID_NO_FREE_INCOMING_CONNECTIONS"); break; case (byte)DefaultMessageIDTypes.ID_DISCONNECTION_NOTIFICATION: case (byte)DefaultMessageIDTypes.ID_CONNECTION_LOST: isConnected = false; break; case (byte)DefaultMessageIDTypes.ID_USER_PACKET_ENUM: try { receiveBitStream.Reset(); receiveBitStream.Write(packet.data, packet.length); receiveBitStream.IgnoreBytes(2); if ((Player.Hero == null || Player.Hero.ID == 0) && packet.data[1] != (byte)NetworkID.ConnectionMessage) { break; } if (messageListener.ContainsKey(packet.data[1])) { messageListener[packet.data[1]].Read(receiveBitStream, packet, this); } } catch (Exception ex) { zERROR.GetZErr(Process.ThisProcess()).Report(2, 'G', ex.Message + ex.StackTrace, 0, "Client.cs", 0); } break; } client.DeallocatePacket(packet); counter++; if (counter >= 1000) { counter = 0; zERROR.GetZErr(Process.ThisProcess()).Report(2, 'G', "1000 Packete hintereinander", 0, "Client.cs", 0); } packet = client.Receive(); } }