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

UnrealShare.UnrealLongMenu


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
//=============================================================================
// UnrealLongMenu
//
// The long "green" UnrealI menus.
//=============================================================================
class UnrealLongMenu extends UnrealMenu;

// All long menus use this green background.
function DrawBackGround(canvas Canvas, bool bNoLogo)
{
    local int StartX, i, num;

    Canvas.DrawColor.r = 255;
    Canvas.DrawColor.g = 255;
    Canvas.DrawColor.b = 255;   
    Canvas.bNoSmooth = True;    

    StartX = 0.5 * Canvas.ClipX - 128;
    Canvas.Style = 1;
    Canvas.SetPos(StartX,0);
    Canvas.DrawIcon(texture'Menu2', 1.0);
    
    num = int(Canvas.ClipY/256) + 1;
    StartX = 0.5 * Canvas.ClipX - 128;
    for ( i=1; i<=num; i++ )
    {
        Canvas.SetPos(StartX,256*i);
        Canvas.DrawIcon(texture'Menu2', 1.0);
    }
    
    if ( bNoLogo )
        Return;
    
    Canvas.Style = 3;   
    StartX = 0.5 * Canvas.ClipX - 128;  
    Canvas.SetPos(StartX,Canvas.ClipY-58);  
    Canvas.DrawTile( Texture'MenuBarrier', 256, 64, 0, 0, 256, 64 );
    StartX = 0.5 * Canvas.ClipX - 128;
    Canvas.Style = 2;   
    Canvas.SetPos(StartX,Canvas.ClipY-52);
    Canvas.DrawIcon(texture'Logo2', 1.0);   
    Canvas.Style = 1;
}

// All long menus use this "help panel."  A small area at the bottom
// of the menu describing the currently selected option.
function DrawHelpPanel(canvas Canvas, int StartY, int XClip)
{
    local int OldXClip, OldYClip;
    local int StartX;

    if ( Canvas.ClipY < 92 + StartY )
        return;

    StartX = 0.5 * Canvas.ClipX - 128;
    StartY = Canvas.ClipY - 92;
    OldXClip = Canvas.ClipX;
    OldYClip = Canvas.ClipY;

    Canvas.bCenter = false;
    Canvas.Font = Canvas.MedFont;
    Canvas.SetOrigin(StartX + 18, StartY);
    Canvas.SetClip(XClip,128);
    Canvas.SetPos(0,0);
    Canvas.Style = 1;
    SetFontBrightness(Canvas, true);    
    if ( Selection < 20 )
        Canvas.DrawText(HelpMessage[Selection], False); 
    SetFontBrightness(Canvas, false);
    Canvas.SetOrigin(0, 0);
    Canvas.SetClip(OldXClip,OldYClip); 
}

// Each menu provides its own implementation of DrawMenu.
function DrawMenu(canvas Canvas)
{
    local int StartX, StartY, Spacing;
    
    Spacing = Clamp(0.1 * Canvas.ClipY, 32, 48);
    StartX = Max(8, 0.5 * Canvas.ClipX - 160);
    StartY = Max(4, 0.5 * (Canvas.ClipY - 5 * Spacing - 128));
    Canvas.Font = Canvas.LargeFont;

    // draw text
    Canvas.SetPos(StartX, StartY );
    Canvas.DrawText("NOT YET IMPLEMENTED", False);

    // Draw help panel
    DrawHelpPanel(Canvas, StartY + 5 * Spacing, 228);
}

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: za 22-4-2006 13:27:48.000 - Creation time: za 22-4-2006 13:29:33.015 - Created with UnCodeX