public void Paste(string ToPaste) { string[] strArray = (Engine.m_Text + ToPaste.Replace("\r\n", "\n")).Split(new char[] { '\n' }); int length = strArray.Length; for (int i = 0; i < length; i++) { strArray[i] = strArray[i].Trim(); if (i < (length - 1)) { Engine.commandEntered(strArray[i]); } else { Engine.m_Text = strArray[i]; Renderer.SetText(strArray[i]); } } }
public void Say(string Text) { Engine.m_SayMacro = true; Engine.commandEntered(Engine.Encode(Text)); Engine.m_SayMacro = false; }
public void Display_KeyPress(object sender, KeyPressEventArgs e) { if (Engine.m_EventOk) { if (Gumps.KeyDown(e.KeyChar)) { e.Handled = true; } else { e.Handled = true; if (e.KeyChar == '\x001b') { if (Engine.TargetHandler != null) { Engine.TargetHandler.OnCancel(TargetCancelType.UserCancel); Engine.TargetHandler = null; return; } if (Engine.Prompt != null) { Engine.Prompt.OnCancel(PromptCancelType.UserCancel); Engine.Prompt = null; return; } } if (!Engine.m_Locked) { if (e.KeyChar == '\b') { if (Engine.m_Text.Length > 0) { Engine.m_Text = Engine.m_Text.Substring(0, Engine.m_Text.Length - 1); Renderer.SetText(Engine.m_Text); } } else if (e.KeyChar == '\r') { Engine.commandEntered(Engine.Encode(Engine.m_Text)); Engine.m_Text = ""; Renderer.SetText(""); } else if (e.KeyChar < ' ') { e.Handled = false; e.Handled = true; } else { int num; string input = Engine.m_Text + e.KeyChar; string text = Engine.Encode(input) + "_"; Mobile player = World.Player; if (((player != null) && player.OpenedStatus) && (player.StatusBar == null)) { num = Engine.GameWidth - 0x2e; } else { num = Engine.GameWidth - 4; } if (Engine.GetUniFont(3).GetStringWidth(text) < num) { Engine.m_Text = input; Renderer.SetText(input); } } } } } }