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

UTV2004c.utvInputPage


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
//-----------------------------------------------------------
//
//-----------------------------------------------------------
class utvInputPage extends ut2k3guIPage;

var string TypedStr;
var bool bIgnoreKeys;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    super.InitComponent(MyController, MyOwner);

    bIgnoreKeys = true;
    TypedStr = "";
}

function bool MyOnDraw (Canvas canvas)
{
    local PlayerController pc;

    pc = PlayerOwner();

    if ((pc != none) && (pc.myhud != none)) {
        pc.myhud.DrawTypingPrompt (Canvas, "UTVSAY " $ TypedStr);
    }
    else {
        Log ("utv: Current player has no hud, closing chat");
        Controller.CloseMenu ();
        return true;
    }

    return true;
}

function bool MyOnKeyType(out byte Key, optional string Unicode)
{
    if (bIgnoreKeys)
        return true;

    if (Key >= 0x20) {
        if (Unicode != "")
            TypedStr = TypedStr $ Unicode;
        else
            TypedStr = TypedStr $ Chr (Key);
        return true;
    }

    return false;
}

function bool MyOnKeyEvent(out byte Key, out byte Action, float delta)
{
    if (Action == 1) {  //press
        bIgnoreKeys = false;
    }
    if (Key == 0x1b) {  //escape
        Controller.CloseMenu ();
        return true;
    }
    else if (Action != 1) {
        return false;
    }
    else if (Key == 0x0d) { //enter
        if (TypedStr != "") {
            class'utvReplication'.default.ChatString = TypedStr;
        }
        Controller.CloseMenu ();

        return true;
    }
    else if (Key == 0x08 || Key == 0x25) {  //backspace, left
        if (Len (TypedStr) > 0)
            TypedStr = Left (TypedStr, Len (TypedStr) - 1);
        return true;
    }

    return false;
}

defaultproperties
{
     bRenderWorld=Wahr
     bRequire640x480=Falsch
     bAllowedAsLast=Wahr
     OnDraw=utvInputPage.MyOnDraw
     OnKeyType=utvInputPage.MyOnKeyType
     OnKeyEvent=utvInputPage.MyOnKeyEvent
}

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