#include #include #include gui quickchat { __quickchat_materials properties { float flags = immediate( flags ) | GUI_SHOWCURSOR | GUI_NON_FOCUSED_MOUSE_EVENTS | GUI_FULLSCREEN | GUI_USE_MOUSE_PITCH; vec2 cursorSize = 0, 0; float active = false; float inputScale = getCVarFloat( "g_radialMenuMouseSensitivity" ); string bindContext = "radialmenu"; } events { onCVarChanged "g_radialMenuMouseSensitivity" { inputScale = getCVarFloat( "g_radialMenuMouseSensitivity" ); } onCVarChanged "g_radialMenuUseNumberShortcuts" { if( gui.getCVarBool( "g_radialMenuUseNumberShortcuts" ) ) { desktop.flags = immediate( desktop.flags ) | RMF_USE_NUMBER_SHORTCUTS; } else { desktop.flags = immediate( desktop.flags ) & ~RMF_USE_NUMBER_SHORTCUTS; } } onActivate { active = true; playGameSound( "click" ); inputScale = getCVarFloat( "g_radialMenuMouseSensitivity" ); desktop.drawStyle = DS_VERTICAL; if( gui.getCVarBool( "g_radialMenuUseNumberShortcuts" ) ) { desktop.flags = immediate( desktop.flags ) | RMF_USE_NUMBER_SHORTCUTS; } else { desktop.flags = immediate( desktop.flags ) & ~RMF_USE_NUMBER_SHORTCUTS; } inputScale = getCVarFloat( "g_radialMenuMouseSensitivity" ); // globals.gameHud.hideCrosshairInfo = immediate( globals.gameHud.hideCrosshairInfo + 1 ); desktop.clearPageStack(); desktop.clearTransitions( -1, -1 ); desktop.currentItem = -1; desktop.currentPage = -1; desktop.pushPage( 0 ); } onDeactivate { active = false; // globals.gameHud.hideCrosshairInfo = immediate( globals.gameHud.hideCrosshairInfo - 1 ); playGameSound( "click" ); } onPropertyChanged "desktop.currentItem" { if( desktop.currentItem != -1 && desktop.currentPage != -1 && gui.active ) { playGameSound( "click" ); } } onPropertyChanged "player.teamName" { desktop.clear(); postNamedEvent( "initForTeam" ); } onNamedEvent "initForTeam" { desktop.loadFromDef( player.teamName + "_quickchat" ); desktop.pushPage( 0 ); } } windowDef desktop { type radialmenu; __quickchat_drawing _med_text_props properties { rect rect = gui.screenCenter.x - ( 0.5 * rect.w ), gui.screenCenter.y - ( 0.5 * rect.h ), 2 * radius, 2 * radius; float flags = WF_CAPTURE_KEYS; float radius = 48; } events { onCreate { gui.postNamedEvent( "initForTeam" ); } onPagePopped { if( currentPage == -1 ) { gui.deactivate(); } } onKeyDown "mouse1" { postCommand( -1, -1 ); } onKeyDown "escape" "mouse2" { currentPage = -1; currentItem = -1; //ensure onChanged handlers fire popPage(); } onKeyDown "mwheelup" { } onKeyDown "mwheeldown" { } onCommand "setPage" { pushPage( toFloat( getItemData( -1, -1, 0 ) ) ); gui.playGameSound( "accept" ); } onNamedEvent "itemSelected" { gui.deactivate(); } onKeyDown "bind_quickchat" { gui.deactivate(); } onCommand "quickChat" { gui.consoleCommand( "clientQuickChat " + getItemData( -1, -1, 0 ) + _newLine ); postNamedEvent( "itemSelected" ); } onCommand "globalContextChat" { gui.consoleCommand( "clientQuickChat " + getItemData( -1, -1, 0 ) + " " + getItemData( -1, -1, 1 ) + _newLine ); postNamedEvent( "itemSelected" ); } onCommand "command" { gui.consoleCommand( getItemData( -1, -1, 0 ) ); postNamedEvent( "itemSelected" ); } } } }