(Netplay) Cthulhu88 -

* Netplay Chat menu
* Toggleable bind for chat (bound to ~ [tilde] by default)
This commit is contained in:
twinaphex 2021-11-10 02:41:02 +01:00
parent 174ab373e4
commit cb4028fd3d
8 changed files with 56 additions and 2 deletions

View File

@ -18,6 +18,8 @@
#ifndef __CONFIG_DEF_KEYBINDS_H
#define __CONFIG_DEF_KEYBINDS_H
#include "network/netplay/netplay_protocol.h"
#ifndef IS_SALAMANDER
/* User 1 */
@ -472,6 +474,15 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_NETPLAY_GAME_WATCH, NO_BTN, NO_BTN, 0,
true
},
#if NETPLAY_PROTOCOL_VERSION >= 6
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PLAYER_CHAT, RETROK_UNKNOWN,
RARCH_NETPLAY_PLAYER_CHAT, NO_BTN, NO_BTN, 0,
true
},
#endif
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
@ -1026,6 +1037,15 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_NETPLAY_GAME_WATCH, NO_BTN, NO_BTN, 0,
true
},
#if NETPLAY_PROTOCOL_VERSION >= 6
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PLAYER_CHAT, RETROK_UNKNOWN,
RARCH_NETPLAY_PLAYER_CHAT, NO_BTN, NO_BTN, 0,
true
},
#endif
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
@ -1590,6 +1610,15 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_NETPLAY_GAME_WATCH, NO_BTN, NO_BTN, 0,
true
},
#if NETPLAY_PROTOCOL_VERSION >= 6
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PLAYER_CHAT, RETROK_BACKQUOTE,
RARCH_NETPLAY_PLAYER_CHAT, NO_BTN, NO_BTN, 0,
true
},
#endif
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,

View File

@ -64,6 +64,8 @@
#include "switch_performance_profiles.h"
#endif
#include "network/netplay/netplay_protocol.h"
enum video_driver_enum
{
VIDEO_GL = 0,
@ -335,6 +337,9 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
DECLARE_META_BIND(2, send_debug_info, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO),
DECLARE_META_BIND(2, netplay_host_toggle, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE),
DECLARE_META_BIND(2, netplay_game_watch, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH),
#if NETPLAY_PROTOCOL_VERSION >= 6
DECLARE_META_BIND(2, netplay_player_chat, RARCH_NETPLAY_PLAYER_CHAT, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PLAYER_CHAT),
#endif
DECLARE_META_BIND(2, enable_hotkey, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY),
DECLARE_META_BIND(2, volume_up, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP),
DECLARE_META_BIND(2, volume_down, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN),

View File

@ -102,6 +102,7 @@ enum
RARCH_SEND_DEBUG_INFO,
RARCH_NETPLAY_HOST_TOGGLE,
RARCH_NETPLAY_GAME_WATCH,
RARCH_NETPLAY_PLAYER_CHAT,
RARCH_ENABLE_HOTKEY,
RARCH_VOLUME_UP,
RARCH_VOLUME_DOWN,

View File

@ -2680,6 +2680,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_GAME_WATCH,
"Switches current netplay session between 'play' and 'spectate' modes."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PLAYER_CHAT,
"Netplay Player Chat"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_PLAYER_CHAT,
"Sends a chat message to the current netplay session."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY,
"Hotkey Enable"
@ -10821,6 +10829,10 @@ MSG_HASH(
MSG_NETPLAY_ENTER_PASSWORD,
"Enter netplay server password:"
)
MSG_HASH(
MSG_NETPLAY_ENTER_CHAT,
"Enter netplay chat message:"
)
MSG_HASH(
MSG_DISCORD_CONNECTION_REQUEST,
"Do you want to allow connection from user:"

View File

@ -284,6 +284,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_fps_toggle, ME
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_send_debug_info, MENU_ENUM_SUBLABEL_INPUT_META_SEND_DEBUG_INFO)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_netplay_host_toggle, MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_HOST_TOGGLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_netplay_game_watch, MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_GAME_WATCH)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_netplay_player_chat, MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_PLAYER_CHAT)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_enable_hotkey, MENU_ENUM_SUBLABEL_INPUT_META_ENABLE_HOTKEY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_volume_up, MENU_ENUM_SUBLABEL_INPUT_META_VOLUME_UP)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_volume_down, MENU_ENUM_SUBLABEL_INPUT_META_VOLUME_DOWN)
@ -1860,6 +1861,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case RARCH_NETPLAY_GAME_WATCH:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_netplay_game_watch);
return 0;
case RARCH_NETPLAY_PLAYER_CHAT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_netplay_player_chat);
return 0;
case RARCH_ENABLE_HOTKEY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_enable_hotkey);
return 0;

View File

@ -199,6 +199,7 @@ enum msg_hash_enums
MSG_NETPLAY_ENDIAN_DEPENDENT,
MSG_NETPLAY_PLATFORM_DEPENDENT,
MSG_NETPLAY_ENTER_PASSWORD,
MSG_NETPLAY_ENTER_CHAT,
MSG_NETPLAY_INCORRECT_PASSWORD,
MSG_NETPLAY_SERVER_NAMED_HANGUP,
MSG_NETPLAY_SERVER_HANGUP,
@ -875,6 +876,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PLAYER_CHAT,
MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY,
MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP,
MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN,
@ -932,6 +934,7 @@ enum msg_hash_enums
MENU_ENUM_SUBLABEL_INPUT_META_SEND_DEBUG_INFO,
MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_HOST_TOGGLE,
MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_GAME_WATCH,
MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_PLAYER_CHAT,
MENU_ENUM_SUBLABEL_INPUT_META_ENABLE_HOTKEY,
MENU_ENUM_SUBLABEL_INPUT_META_VOLUME_UP,
MENU_ENUM_SUBLABEL_INPUT_META_VOLUME_DOWN,

View File

@ -34,6 +34,8 @@
#include "../../core.h"
#include "netplay_protocol.h"
#define NETPLAY_HOST_STR_LEN 32
#define NETPLAY_HOST_LONGSTR_LEN 256

View File

@ -28,8 +28,6 @@
#include "../../msg_hash.h"
#include "../../verbosity.h"
#define NETPLAY_PROTOCOL_VERSION 5
#define RARCH_DEFAULT_PORT 55435
#define RARCH_DEFAULT_NICK "Anonymous"