Ejemplo n.º 1
0
        public virtual void Func_50031_b(string par1Str)
        {
            string s  = "";
            string s1 = ChatAllowedCharacters.Func_52019_a(par1Str);
            int    i  = Field_50042_o >= Field_50048_p ? Field_50048_p : Field_50042_o;
            int    j  = Field_50042_o >= Field_50048_p ? Field_50042_o : Field_50048_p;
            int    k  = MaxStringLength - Text.Length - (i - Field_50048_p);
            int    l  = 0;

            if (Text.Length > 0)
            {
                s = (new StringBuilder()).Append(s).Append(Text.Substring(0, i)).ToString();
            }

            if (k < s1.Length)
            {
                s = (new StringBuilder()).Append(s).Append(s1.Substring(0, k)).ToString();
                l = k;
            }
            else
            {
                s = (new StringBuilder()).Append(s).Append(s1).ToString();
                l = s1.Length;
            }

            if (Text.Length > 0 && j < Text.Length)
            {
                s = (new StringBuilder()).Append(s).Append(Text.Substring(j)).ToString();
            }

            Text = s;
            Func_50023_d((i - Field_50048_p) + l);
        }
Ejemplo n.º 2
0
        public virtual bool Func_50037_a(int par1, int par2)
        {
            if (!Field_50043_m || !IsFocused)
            {
                return(false);
            }

            switch (par1)
            {
            case 1:
                Func_50038_e();
                Func_50032_g(0);
                return(true);

            case 3:
                GuiScreen.WriteToClipboard(Func_50039_c());
                return(true);

            case 22:
                Func_50031_b(GuiScreen.GetClipboardString());
                return(true);

            case 24:
                GuiScreen.WriteToClipboard(Func_50039_c());
                Func_50031_b("");
                return(true);
            }

            switch (par2)
            {
            case 203:
                if (GuiScreen.Func_50049_m())
                {
                    if (GuiScreen.Func_50051_l())
                    {
                        Func_50032_g(Func_50024_a(-1, Func_50036_k()));
                    }
                    else
                    {
                        Func_50032_g(Func_50036_k() - 1);
                    }
                }
                else if (GuiScreen.Func_50051_l())
                {
                    Func_50030_e(Func_50028_c(-1));
                }
                else
                {
                    Func_50023_d(-1);
                }

                return(true);

            case 205:
                if (GuiScreen.Func_50049_m())
                {
                    if (GuiScreen.Func_50051_l())
                    {
                        Func_50032_g(Func_50024_a(1, Func_50036_k()));
                    }
                    else
                    {
                        Func_50032_g(Func_50036_k() + 1);
                    }
                }
                else if (GuiScreen.Func_50051_l())
                {
                    Func_50030_e(Func_50028_c(1));
                }
                else
                {
                    Func_50023_d(1);
                }

                return(true);

            case 14:
                if (GuiScreen.Func_50051_l())
                {
                    Func_50021_a(-1);
                }
                else
                {
                    Func_50020_b(-1);
                }

                return(true);

            case 211:
                if (GuiScreen.Func_50051_l())
                {
                    Func_50021_a(1);
                }
                else
                {
                    Func_50020_b(1);
                }

                return(true);

            case 199:
                if (GuiScreen.Func_50049_m())
                {
                    Func_50032_g(0);
                }
                else
                {
                    Func_50034_d();
                }

                return(true);

            case 207:
                if (GuiScreen.Func_50049_m())
                {
                    Func_50032_g(Text.Length);
                }
                else
                {
                    Func_50038_e();
                }

                return(true);
            }

            if (ChatAllowedCharacters.IsAllowedCharacter((char)par1))
            {
                Func_50031_b(((char)par1).ToString());
                return(true);
            }
            else
            {
                return(false);
            }
        }