Ejemplo n.º 1
0
 public void Say(string Text)
 {
     Engine.m_SayMacro = true;
     Engine.commandEntered(Engine.Encode(Text));
     Engine.m_SayMacro = false;
 }
Ejemplo n.º 2
0
 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);
                     }
                 }
             }
         }
     }
 }