Resolved merge conflict

This commit is contained in:
Jordy Ruiz 2018-10-28 10:39:50 +01:00
commit b783340a51
8 changed files with 56 additions and 40 deletions

View file

@ -316,8 +316,13 @@ if gen_network_source:
lines += ['\tif(pUnpacker->Error())']
lines += ['\t\tm_pMsgFailedOn = "(unpack error)";']
lines += ['\t']
lines += ['\tif(m_pMsgFailedOn || m_pObjFailedOn)']
lines += ['\tif(m_pMsgFailedOn || m_pObjFailedOn) {']
lines += ['\t\tif(!m_pMsgFailedOn)']
lines += ['\t\t\tm_pMsgFailedOn = "";']
lines += ['\t\tif(!m_pObjFailedOn)']
lines += ['\t\t\tm_pObjFailedOn = "";']
lines += ['\t\treturn 0;']
lines += ['\t}']
lines += ['\tm_pMsgFailedOn = "";']
lines += ['\tm_pObjFailedOn = "";']
lines += ['\treturn m_aMsgData;']

View file

@ -4,6 +4,27 @@
#include <engine/shared/config.h>
#include "binds.h"
const int CBinds::s_aDefaultBindKeys[] = {
KEY_F1, KEY_F2, KEY_TAB, 'u', KEY_F10,
'a', 'd',
KEY_SPACE, KEY_MOUSE_1, KEY_MOUSE_2, KEY_LSHIFT, KEY_RSHIFT, KEY_RIGHT, KEY_LEFT,
'1', '2', '3', '4', '5',
KEY_MOUSE_WHEEL_UP, KEY_MOUSE_WHEEL_DOWN,
't', 'y', 'x',
KEY_F3, KEY_F4,
'r',
};
const char CBinds::s_aaDefaultBindValues[][32] = {
"toggle_local_console", "toggle_remote_console", "+scoreboard", "+show_chat", "screenshot",
"+left", "+right",
"+jump", "+fire", "+hook", "+emote", "+spectate", "spectate_next", "spectate_previous",
"+weapon1", "+weapon2", "+weapon3", "+weapon4", "+weapon5",
"+prevweapon", "+nextweapon",
"chat all", "chat team", "chat whisper",
"vote yes", "vote no",
"ready_change",
};
bool CBinds::CBindsSpecial::OnInput(IInput::CEvent Event)
{
// don't handle invalid events and keys that arn't set to anything
@ -86,40 +107,10 @@ void CBinds::SetDefaults()
{
// set default key bindings
UnbindAll();
Bind(KEY_F1, "toggle_local_console");
Bind(KEY_F2, "toggle_remote_console");
Bind(KEY_TAB, "+scoreboard");
Bind('u', "+show_chat");
Bind(KEY_F10, "screenshot");
Bind('a', "+left");
Bind('d', "+right");
Bind(KEY_SPACE, "+jump");
Bind(KEY_MOUSE_1, "+fire");
Bind(KEY_MOUSE_2, "+hook");
Bind(KEY_LSHIFT, "+emote");
Bind(KEY_RSHIFT, "+spectate");
Bind(KEY_RIGHT, "spectate_next");
Bind(KEY_LEFT, "spectate_previous");
Bind('1', "+weapon1");
Bind('2', "+weapon2");
Bind('3', "+weapon3");
Bind('4', "+weapon4");
Bind('5', "+weapon5");
Bind(KEY_MOUSE_WHEEL_UP, "+prevweapon");
Bind(KEY_MOUSE_WHEEL_DOWN, "+nextweapon");
Bind('t', "chat all");
Bind('y', "chat team");
Bind('x', "chat whisper");
Bind(KEY_F3, "vote yes");
Bind(KEY_F4, "vote no");
Bind('r', "ready_change");
const int count = sizeof(s_aDefaultBindKeys)/sizeof(int);
dbg_assert(count == sizeof(s_aaDefaultBindValues)/32, "the count of bind keys differs from that of bind values!");
for(int i = 0; i < count; i++)
Bind(s_aDefaultBindKeys[i], s_aaDefaultBindValues[i]);
}
void CBinds::OnConsoleInit()
@ -224,6 +215,7 @@ void CBinds::ConfigSaveCallback(IConfig *pConfig, void *pUserData)
{
if(pSelf->m_aaKeyBindings[i][0] == 0)
continue;
str_format(aBuffer, sizeof(aBuffer), "bind %s ", pSelf->Input()->KeyName(i));
// process the string. we need to escape some characters
@ -241,4 +233,15 @@ void CBinds::ConfigSaveCallback(IConfig *pConfig, void *pUserData)
pConfig->WriteLine(aBuffer);
}
for(unsigned j = 0; j < sizeof(s_aDefaultBindKeys)/sizeof(int); j++)
{
const int i = s_aDefaultBindKeys[j];
if(pSelf->m_aaKeyBindings[i][0] == 0)
{
// explicitly unbind keys that were unbound by the user
str_format(aBuffer, sizeof(aBuffer), "unbind %s ", pSelf->Input()->KeyName(i));
pConfig->WriteLine(aBuffer);
}
}
}

View file

@ -39,5 +39,9 @@ public:
virtual void OnConsoleInit();
virtual bool OnInput(IInput::CEvent Event);
private:
static const int s_aDefaultBindKeys[];
static const char s_aaDefaultBindValues[][32];
};
#endif

View file

@ -135,7 +135,7 @@ void CMenus::CBrowserFilter::SetFilter(const CServerFilterInfo *pFilterInfo)
void CMenus::LoadFilters()
{
// read file data into buffer
char *pFilename = "ui_settings.json";
const char *pFilename = "ui_settings.json";
IOHANDLE File = Storage()->OpenFile(pFilename, IOFLAG_READ, IStorage::TYPE_ALL);
if(!File)
return;
@ -2100,8 +2100,7 @@ void CMenus::DoFriendListEntry(CUIRect *pView, CFriendItem *pFriend, const void
{
// delete button
Button.Margin(1.0f, &Button);
static int s_DeleteButton = 0;
if(DoButton_SpriteCleanID(&s_DeleteButton, IMAGE_FRIENDICONS, pFriend->IsClanFriend() ? SPRITE_FRIEND_X_A : SPRITE_FRIEND_X_B, &Button, false))
if(DoButton_SpriteClean(IMAGE_FRIENDICONS, pFriend->IsClanFriend() ? SPRITE_FRIEND_X_A : SPRITE_FRIEND_X_B, &Button))
{
m_pDeleteFriendInfo = pFriend->m_pFriendInfo;
}

View file

@ -1236,7 +1236,6 @@ bool CMenus::DoResolutionList(CUIRect* pRect, CListBoxState* pListBoxState,
void CMenus::RenderSettingsGraphics(CUIRect MainView)
{
char aBuf[128];
bool CheckSettings = false;
static int s_GfxScreenWidth = g_Config.m_GfxScreenWidth;

View file

@ -496,6 +496,10 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker)
{
int GameMsgID = pUnpacker->GetInt();
// check for valid gamemsgid
if(GameMsgID < 0 || GameMsgID >= NUM_GAMEMSGS)
return;
int aParaI[3];
int NumParaI = 0;

View file

@ -746,6 +746,8 @@ void IGameController::Tick()
// check if player ready mode was disabled and it waits that all players are ready -> end warmup
if(!g_Config.m_SvPlayerReadyMode && m_GameStateTimer == TIMER_INFINITE)
SetGameState(IGS_WARMUP_USER, 0);
else if(m_GameStateTimer == 3 * Server()->TickSpeed())
StartRound();
break;
case IGS_START_COUNTDOWN:
case IGS_GAME_PAUSED:

View file

@ -102,7 +102,7 @@ protected:
int m_aTeamscore[NUM_TEAMS];
void EndMatch() { SetGameState(IGS_END_MATCH, TIMER_END); }
void EndRound() { SetGameState(IGS_END_ROUND, TIMER_END); }
void EndRound() { SetGameState(IGS_END_ROUND, TIMER_END/2); }
// info
int m_GameFlags;