//============================================================================= // APUBrowserConsole. //============================================================================= class APUBrowserConsole expands UBrowserConsole; // Called by the engine when a key, mouse, or joystick button is pressed // or released, or any analog axis movement is processed. event bool KeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ) { if( Action!=IST_Press ) { return false; } else if( Key==IK_Tilde ) { if( ConsoleDest==0.0 ) { if (bLocked) return true; bQuickKeyEnable = True; LaunchUWindow(); if(!bShowConsole) ShowConsole(); return true; } else GotoState(''); return true; } else return false; } //****************************************************************** simulated function DrawSingleView( Canvas C ) { local string TypingPrompt; local int I, J; local float XL, YL; local string ShortMessages[4]; local int ExtraSpace; // Console is hidden; display single-line view. C.SetOrigin(0.0, 0.0); // Ask the HUD to deal with messages. if ( Viewport.Actor.myHUD != None ) if ( Viewport.Actor.myHUD.DisplayMessages(C) ) return; // If the HUD doesn't deal with messages, use the default behavior if (!Viewport.Actor.bShowMenu) { if ( bTyping ) { TypingPrompt = "(>"@TypedStr$"_"; C.Font = C.MedFont; C.StrLen( TypingPrompt, XL, YL ); C.SetPos( 2, FrameY - ConsoleLines - YL - 1 ); C.DrawText( TypingPrompt, false ); } } if ( TextLines > 0 && (!Viewport.Actor.bShowMenu || Viewport.Actor.bShowScores) ) { J = TopLine; I = 0; while ((I < 4) && (J >= 0)) { if ((MsgText[J] != "") && (MsgTick[J] > 0.0)) { ShortMessages[I] = MsgPlayer[J]$":"@MsgText[J]; I++; } J--; } J = 0; C.Font = C.MedFont; for ( I = 0; I < 4; I++ ) { if (ShortMessages[3 - I] != "") { C.SetPos(4, 2 + (10 * J) + (10 * ExtraSpace)); C.StrLen( ShortMessages[3 - I], XL, YL ); C.DrawText( ShortMessages[3 - I], false ); if ( YL == 18.0 ) ExtraSpace++; J++; } } } } defaultproperties { }