Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

XInterface.IngameChat


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
// ====================================================================
// (C) 2002, Epic Games
// ====================================================================

class IngameChat extends UT2K3GUIPage;

var ExtendedConsole MyConsole;
var GUIEditBox MyEditBox;
var bool bIgnoreChar;
var int OldCMC;
var byte CloseKey;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    local string KeyName;

    Super.InitComponent(MyController, MyOwner);

    MyEditBox = GUIEditBox(Controls[2]);
    MyEditBox.OnKeyEvent = InternalOnKeyEvent;
    MyEditBox.OnKeyType = InternalOnKeyType;
    OnClose = MyOnClose;

    GUIScrollTextBox(Controls[1]).MyScrollText.bNeverFocus=true;

    KeyName = PlayerOwner().ConsoleCommand("BINDINGTOKEY InGameChat");
    if (KeyName != "")
        CloseKey = byte(PlayerOwner().ConsoleCommand("KEYNUMBER"@KeyName));
}

function Clear()
{
    local GUIScrollTextBox MyText;

    MyText =  GUIScrollTextBox(Controls[1]);
    MyText.MyScrollText.SetContent("");
}


event HandleParameters(string Param1, string Param2)
{
    bIgnoreChar = true;
    MyEditBox.SetFocus(none);
    OldCMC = PlayerOwner().MyHud.ConsoleMessageCount;
    PlayerOwner().Myhud.ConsoleMessageCount = 0;
}

function MyOnClose(optional Bool bCanceled)
{
    if (MyConsole!=None)
    {
        MyConsole.ChatMenu = None;
        MyConsole=None;
    }
    PlayerOwner().MyHud.ConsoleMessageCount = OldCMC;
    super.OnClose(bCanceled);
}

function bool InternalOnKeyType(out byte Key, optional string Unicode)
{
    if (bIgnorechar)
    {
        bIgnoreChar=false;
        return true;
    }

    return MyEditBox.InternalOnKeyType(key, Unicode);
}

function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
{
    local string cmd;

    if (key == CloseKey && State == 1)
    {
        Controller.CloseMenu(false);
        return true;
    }

    if (key==0x0d && State==3)
    {
        if ( Left(MyEditBox.TextStr,1)=="/" )
            cmd = right(MyEditBox.TextStr,len(MyEditBox.TextStr)-1);
        else if ( Left(MyEditBox.TextStr,1)=="." )
            cmd = "teamsay"@right(MyEditBox.TextStr,len(MyEditBox.TextStr)-1);
        else
            cmd = "say"@MyEditBox.TextStr;

        PlayerOwner().ConsoleCommand(cmd);
        MyEditBox.TextStr="";
        return true;
    }

    return MyEditBox.InternalOnKeyEvent(key,state,delta);
}

defaultproperties
{
     bRequire640x480=Falsch
     bPersistent=Wahr
     bAllowedAsLast=Wahr
     Begin Object Class=GUIImage Name=ChatBackground
         Image=Texture'InterfaceContent.Menu.SquareBoxA'
         ImageStyle=ISTY_Stretched
         WinHeight=1.000000
         bBoundToParent=Wahr
         bScaleToParent=Wahr
         bNeverFocus=Wahr
     End Object
     Controls(0)=GUIImage'XInterface.IngameChat.ChatBackground'

     Begin Object Class=GUIScrollTextBox Name=chatText
         bNoTeletype=Wahr
         CharDelay=0.002500
         EOLDelay=0.000000
         OnCreateComponent=chatText.InternalOnCreateComponent
         WinTop=0.020000
         WinLeft=0.030000
         WinWidth=0.940000
         WinHeight=0.880000
         bBoundToParent=Wahr
         bScaleToParent=Wahr
         bNeverFocus=Wahr
     End Object
     Controls(1)=GUIScrollTextBox'XInterface.IngameChat.chatText'

     Begin Object Class=GUIEditBox Name=ChatEdit
         StyleName="SquareButton"
         WinTop=0.940000
         bBoundToParent=Wahr
         bScaleToParent=Wahr
         OnActivate=ChatEdit.InternalActivate
         OnDeActivate=ChatEdit.InternalDeactivate
         OnKeyType=ChatEdit.InternalOnKeyType
         OnKeyEvent=ChatEdit.InternalOnKeyEvent
     End Object
     Controls(2)=GUIEditBox'XInterface.IngameChat.ChatEdit'

     WinTop=0.100000
     WinLeft=0.100000
     WinWidth=0.800000
     WinHeight=0.800000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:50.000 - Creation time: Mo 16.4.2007 11:20:48.671 - Created with UnCodeX