/** * Make dialog mode active, by triggering HandleInput from * your own separate exec function or something. * It will then take over keyboard input, and print out the next * key the player presses. After that, things will go back to 100% normal. * This would be useful for writing your own simple popup dialog routine. * * Reminder: you get a custom input class loaded, by setting InputClass in your PlayerController * http://www.bolthole.com/udk/ *// class M5PlayerInput extends PlayerInput config(M5Game); function HandleInput() { gotostate('DialogInput'); } // Apparently, "Delegates" require global def of this fallback. // This somehow makes this work. function bool InputKey(INT ControllerId, name Key, EInputEvent Event, FLOAT AmountDepressed = 1.f, BOOL bGamepad = FALSE ) { return false; } // see http://udn.epicgames.com/Three/MasteringUnrealScriptStates.html state DialogInput { event BeginState(Name prevstate) { DebugMessagePlayer("Starting DialogInput state"); ResetInput(); } function bool InputKey(INT ControllerId, name Key, EInputEvent Event, FLOAT AmountDepressed = 1.f, BOOL bGamepad = FALSE ) { if(event !=IE_Pressed) { return true; } DebugMessagePlayer("Hey, we gotta da input key!"@Key); GotoState('None'); return true; } event EndState(Name nextstate) { DebugMessagePlayer("Leaving DialogInput state"); } } defaultproperties { OnReceivedNativeInputKey=InputKey // Shhhh... it's MAAAAAAAgick..... }