mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge branch 'master' of http://github.com/oy/teeworlds
Conflicts: src/game/variables.h
This commit is contained in:
commit
47714c9468
|
@ -2059,7 +2059,7 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
{
|
||||
if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention
|
||||
{
|
||||
ShowWindow(GetConsoleWindow(), SW_HIDE);
|
||||
FreeConsole();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ void CInput::Init()
|
|||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
}
|
||||
|
||||
void CInput::MouseRelative(int *x, int *y)
|
||||
void CInput::MouseRelative(float *x, float *y)
|
||||
{
|
||||
int nx = 0, ny = 0;
|
||||
float Sens = g_Config.m_InpMousesens/100.0f;
|
||||
|
@ -65,8 +65,8 @@ void CInput::MouseRelative(int *x, int *y)
|
|||
}
|
||||
}
|
||||
|
||||
*x = (int)(nx*Sens);
|
||||
*y = (int)(ny*Sens);
|
||||
*x = nx*Sens;
|
||||
*y = ny*Sens;
|
||||
}
|
||||
|
||||
void CInput::MouseModeAbsolute()
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
|
||||
virtual void Init();
|
||||
|
||||
virtual void MouseRelative(int *x, int *y);
|
||||
virtual void MouseRelative(float *x, float *y);
|
||||
virtual void MouseModeAbsolute();
|
||||
virtual void MouseModeRelative();
|
||||
virtual int MouseDoubleClick();
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
virtual void MouseModeAbsolute() = 0;
|
||||
virtual int MouseDoubleClick() = 0;
|
||||
|
||||
virtual void MouseRelative(int *x, int *y) = 0;
|
||||
virtual void MouseRelative(float *x, float *y) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ void CEmoticon::OnRender()
|
|||
|
||||
m_WasActive = true;
|
||||
|
||||
int x, y;
|
||||
float x, y;
|
||||
Input()->MouseRelative(&x, &y);
|
||||
|
||||
m_SelectorMouse.x += x;
|
||||
|
|
|
@ -201,7 +201,7 @@ void CHud::RenderTeambalanceWarning()
|
|||
|
||||
void CHud::RenderVoting()
|
||||
{
|
||||
if(!m_pClient->m_pVoting->IsVoting())
|
||||
if(!m_pClient->m_pVoting->IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK)
|
||||
return;
|
||||
|
||||
Graphics()->TextureSet(-1);
|
||||
|
@ -229,11 +229,11 @@ void CHud::RenderVoting()
|
|||
|
||||
const char *pYesKey = m_pClient->m_pBinds->GetKey("vote yes");
|
||||
const char *pNoKey = m_pClient->m_pBinds->GetKey("vote no");
|
||||
str_format(Buf, sizeof(Buf), "%s - Vote Yes", pYesKey);
|
||||
str_format(Buf, sizeof(Buf), "%s - %s", pYesKey, Localize("Vote Yes"));
|
||||
Base.y += Base.h+1;
|
||||
UI()->DoLabel(&Base, Buf, 6.0f, -1);
|
||||
|
||||
str_format(Buf, sizeof(Buf), "Vote No - %s", pNoKey);
|
||||
str_format(Buf, sizeof(Buf), "%s - %s", Localize("Vote No"), pNoKey);
|
||||
UI()->DoLabel(&Base, Buf, 6.0f, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -437,9 +437,9 @@ void CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType
|
|||
else
|
||||
{
|
||||
str_format(Item.m_aName, min(static_cast<int>(sizeof(Item.m_aName)), Length), " %s", pName);
|
||||
char aBuffer[512];
|
||||
str_format(aBuffer, sizeof(aBuffer), "%s/%s", pSelf->m_aCurrentDemoFolder, Item.m_aFilename);
|
||||
// TODO: many items slow this down, don't load the info from every file when making the filelist
|
||||
char aBuffer[512];
|
||||
str_format(aBuffer, sizeof(aBuffer), "%s/%s", pSelf->m_aCurrentDemoFolder, Item.m_aFilename);
|
||||
// TODO: many items slow this down, don't load the info from every file when making the filelist
|
||||
Item.m_Valid = pSelf->DemoPlayer()->GetDemoInfo(pSelf->Storage(), aBuffer, StorageType, Item.m_aMap, sizeof(Item.m_aMap));
|
||||
}
|
||||
Item.m_IsDir = IsDir != 0;
|
||||
|
@ -486,17 +486,17 @@ void CMenus::RenderDemoList(CUIRect MainView)
|
|||
m_DemolistDelEntry = false;
|
||||
}
|
||||
|
||||
char aFooterLabel[128] = {0};
|
||||
if(m_DemolistSelectedIndex >= 0)
|
||||
{
|
||||
if(str_comp(m_lDemos[m_DemolistSelectedIndex].m_aFilename, "..") == 0)
|
||||
str_copy(aFooterLabel, Localize("Parent Folder"), sizeof(aFooterLabel));
|
||||
else if(m_DemolistSelectedIsDir)
|
||||
str_copy(aFooterLabel, Localize("Folder"), sizeof(aFooterLabel));
|
||||
else if(!m_lDemos[m_DemolistSelectedIndex].m_Valid)
|
||||
str_copy(aFooterLabel, Localize("Invalid Demo"), sizeof(aFooterLabel));
|
||||
else
|
||||
str_format(aFooterLabel, sizeof(aFooterLabel), "%s: %s", Localize("Map"), m_lDemos[m_DemolistSelectedIndex].m_aMap);
|
||||
char aFooterLabel[128] = {0};
|
||||
if(m_DemolistSelectedIndex >= 0)
|
||||
{
|
||||
if(str_comp(m_lDemos[m_DemolistSelectedIndex].m_aFilename, "..") == 0)
|
||||
str_copy(aFooterLabel, Localize("Parent Folder"), sizeof(aFooterLabel));
|
||||
else if(m_DemolistSelectedIsDir)
|
||||
str_copy(aFooterLabel, Localize("Folder"), sizeof(aFooterLabel));
|
||||
else if(!m_lDemos[m_DemolistSelectedIndex].m_Valid)
|
||||
str_copy(aFooterLabel, Localize("Invalid Demo"), sizeof(aFooterLabel));
|
||||
else
|
||||
str_format(aFooterLabel, sizeof(aFooterLabel), "%s: %s", Localize("Map"), m_lDemos[m_DemolistSelectedIndex].m_aMap);
|
||||
}
|
||||
|
||||
// render background
|
||||
|
|
|
@ -309,9 +309,9 @@ void CGameClient::OnInit()
|
|||
void CGameClient::DispatchInput()
|
||||
{
|
||||
// handle mouse movement
|
||||
int x=0, y=0;
|
||||
float x = 0.0f, y = 0.0f;
|
||||
Input()->MouseRelative(&x, &y);
|
||||
if(x || y)
|
||||
if(x != 0.0f || y != 0.0f)
|
||||
{
|
||||
for(int h = 0; h < m_Input.m_Num; h++)
|
||||
{
|
||||
|
|
|
@ -3286,8 +3286,8 @@ void CEditor::DoMapBorder()
|
|||
|
||||
void CEditor::UpdateAndRender()
|
||||
{
|
||||
static int s_MouseX = 0;
|
||||
static int s_MouseY = 0;
|
||||
static float s_MouseX = 0.0f;
|
||||
static float s_MouseY = 0.0f;
|
||||
|
||||
if(m_Animate)
|
||||
m_AnimateTime = (time_get()-m_AnimateStart)/(float)time_freq();
|
||||
|
@ -3297,7 +3297,7 @@ void CEditor::UpdateAndRender()
|
|||
|
||||
// handle mouse movement
|
||||
float mx, my, Mwx, Mwy;
|
||||
int rx, ry;
|
||||
float rx, ry;
|
||||
{
|
||||
Input()->MouseRelative(&rx, &ry);
|
||||
m_MouseDeltaX = rx;
|
||||
|
@ -3309,10 +3309,8 @@ void CEditor::UpdateAndRender()
|
|||
s_MouseY += ry;
|
||||
}
|
||||
|
||||
if(s_MouseX < 0) s_MouseX = 0;
|
||||
if(s_MouseY < 0) s_MouseY = 0;
|
||||
if(s_MouseX > UI()->Screen()->w) s_MouseX = (int)UI()->Screen()->w;
|
||||
if(s_MouseY > UI()->Screen()->h) s_MouseY = (int)UI()->Screen()->h;
|
||||
clamp(s_MouseX, 0.0f, UI()->Screen()->w);
|
||||
clamp(s_MouseY, 0.0f, UI()->Screen()->h);
|
||||
|
||||
// update the ui
|
||||
mx = s_MouseX;
|
||||
|
|
|
@ -67,9 +67,7 @@ MACRO_CONFIG_INT(SvInactiveKickTime, sv_inactivekick_time, 180, 0, 9999, CFGFLAG
|
|||
MACRO_CONFIG_INT(SvInactiveKick, sv_inactivekick, 1, 0, 2, CFGFLAG_SERVER, "How to deal with inactive players (0=move to spectator, 1=move to free spectator slot/kick, 2=kick)", 3)
|
||||
|
||||
MACRO_CONFIG_INT(SvVoteKick, sv_vote_kick, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to kick players", 3)
|
||||
MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 300, 0, 9999, CFGFLAG_SERVER, "The time to ban a player if kicked by vote. 0 makes it just use kick", 3)
|
||||
/*MACRO_CONFIG_INT(SvVoteScorelimit, sv_vote_scorelimit, 0, 0, 1, CFGFLAG_SERVER, "Allow voting to change score limit")
|
||||
MACRO_CONFIG_INT(SvVoteTimelimit, sv_vote_timelimit, 0, 0, 1, CFGFLAG_SERVER, "Allow voting to change time limit")*/
|
||||
MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time to ban a player if kicked by vote. 0 makes it just use kick", 3)
|
||||
|
||||
// debug
|
||||
#ifdef CONF_DEBUG // this one can crash the server if not used correctly
|
||||
|
|
Loading…
Reference in a new issue