mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'chatclose' into 'master'
Improved netgame chat input eating See merge request kart-krew-dev/ring-racers!40
This commit is contained in:
		
						commit
						6fcfd452aa
					
				
					 7 changed files with 14 additions and 4 deletions
				
			
		|  | @ -2247,7 +2247,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic | |||
| #ifdef HAVE_THREADS | ||||
| 			I_lock_mutex(&k_menu_mutex); | ||||
| #endif | ||||
| 			M_UpdateMenuCMD(0, true); | ||||
| 			M_UpdateMenuCMD(0, true, false); | ||||
| 
 | ||||
| 			if (cl_mode == CL_CONFIRMCONNECT) | ||||
| 			{ | ||||
|  |  | |||
|  | @ -343,7 +343,7 @@ void D_ProcessEvents(boolean callresponders) | |||
| 	// Update menu CMD
 | ||||
| 	for (i = 0; i < MAXSPLITSCREENPLAYERS; i++) | ||||
| 	{ | ||||
| 		M_UpdateMenuCMD(i, false); | ||||
| 		M_UpdateMenuCMD(i, false, chat_keydown); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1413,6 +1413,7 @@ boolean G_Responder(event_t *ev) | |||
| 		if (HU_Responder(ev)) | ||||
| 		{ | ||||
| 			hu_keystrokes = true; | ||||
| 			chat_keydown = true; | ||||
| 			return true; // chat ate the event
 | ||||
| 		} | ||||
| 	} | ||||
|  | @ -1522,6 +1523,7 @@ boolean G_Responder(event_t *ev) | |||
| 			return true; | ||||
| 
 | ||||
| 		case ev_keyup: | ||||
| 			chat_keydown = false; // prevents repeat inputs from inputs made with chat open
 | ||||
| 			return false; // always let key up events filter down
 | ||||
| 
 | ||||
| 		case ev_mouse: | ||||
|  |  | |||
|  | @ -85,6 +85,7 @@ patch_t *frameslash;	// framerate stuff. Used in screen.c | |||
| 
 | ||||
| static player_t *plr; | ||||
| boolean hu_keystrokes; // :)
 | ||||
| boolean chat_keydown; | ||||
| boolean chat_on; // entering a chat message?
 | ||||
| boolean g_voicepushtotalk_on; // holding PTT?
 | ||||
| static char w_chat[HU_MAXMSGLEN + 1]; | ||||
|  |  | |||
|  | @ -124,6 +124,9 @@ typedef enum | |||
| // some functions
 | ||||
| void HU_AddChatText(const char *text, boolean playsound); | ||||
| 
 | ||||
| // set true when key is pressed while chat is open
 | ||||
| extern boolean chat_keydown; | ||||
| 
 | ||||
| // set true when entering a chat message
 | ||||
| extern boolean chat_on; | ||||
| 
 | ||||
|  |  | |||
|  | @ -748,7 +748,7 @@ void M_SetMenuDelay(UINT8 i); | |||
| 
 | ||||
| void M_SortServerList(void); | ||||
| 
 | ||||
| void M_UpdateMenuCMD(UINT8 i, boolean bailrequired); | ||||
| void M_UpdateMenuCMD(UINT8 i, boolean bailrequired, boolean chat_open); | ||||
| boolean M_Responder(event_t *ev); | ||||
| boolean M_MenuButtonPressed(UINT8 pid, UINT32 bt); | ||||
| boolean M_MenuButtonHeld(UINT8 pid, UINT32 bt); | ||||
|  |  | |||
|  | @ -1084,7 +1084,7 @@ void M_SetMenuDelay(UINT8 i) | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| void M_UpdateMenuCMD(UINT8 i, boolean bailrequired) | ||||
| void M_UpdateMenuCMD(UINT8 i, boolean bailrequired, boolean chat_open) | ||||
| { | ||||
| 	UINT8 mp = max(1, setup_numplayers); | ||||
| 
 | ||||
|  | @ -1097,6 +1097,10 @@ void M_UpdateMenuCMD(UINT8 i, boolean bailrequired) | |||
| 	menucmd[i].buttonsHeld = menucmd[i].buttons; | ||||
| 	menucmd[i].buttons = 0; | ||||
| 
 | ||||
| 	// Eat inputs made when chat is open
 | ||||
| 	if (chat_open) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (G_PlayerInputDown(i, gc_screenshot,    mp)) { menucmd[i].buttons |= MBT_SCREENSHOT; } | ||||
| 	if (G_PlayerInputDown(i, gc_startmovie,    mp)) { menucmd[i].buttons |= MBT_STARTMOVIE; } | ||||
| 	if (G_PlayerInputDown(i, gc_startlossless, mp)) { menucmd[i].buttons |= MBT_STARTLOSSLESS; } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Eidolon
						Eidolon