mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-18 16:52:18 +00:00
Compare commits
10 commits
b7540ec261
...
b8847bcbfb
Author | SHA1 | Date | |
---|---|---|---|
b8847bcbfb | |||
3fd0062fb7 | |||
0f12044fcd | |||
8f2c288698 | |||
4b6f2e22a8 | |||
7bbd51cf73 | |||
dcd02b50bb | |||
4fe956dffc | |||
ChillerDragon | 7c2f058c40 | ||
6bf4a016ba |
|
@ -424,7 +424,10 @@ void CServerBrowserHttp::Refresh()
|
|||
}
|
||||
bool ServerbrowserParseUrl(NETADDR *pOut, const char *pUrl)
|
||||
{
|
||||
return net_addr_from_url(pOut, pUrl, nullptr, 0) != 0;
|
||||
int Failure = net_addr_from_url(pOut, pUrl, nullptr, 0);
|
||||
if(Failure || pOut->port == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool CServerBrowserHttp::Validate(json_value *pJson)
|
||||
{
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
virtual void BindInt(int Idx, int Value) = 0;
|
||||
virtual void BindInt64(int Idx, int64_t Value) = 0;
|
||||
virtual void BindFloat(int Idx, float Value) = 0;
|
||||
virtual void BindNull(int Idx) = 0;
|
||||
|
||||
// Print expanded sql statement
|
||||
virtual void Print() = 0;
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
void BindInt(int Idx, int Value) override;
|
||||
void BindInt64(int Idx, int64_t Value) override;
|
||||
void BindFloat(int Idx, float Value) override;
|
||||
void BindNull(int Idx) override;
|
||||
|
||||
void Print() override {}
|
||||
bool Step(bool *pEnd, char *pError, int ErrorSize) override;
|
||||
|
@ -421,6 +422,22 @@ void CMysqlConnection::BindFloat(int Idx, float Value)
|
|||
pParam->error = nullptr;
|
||||
}
|
||||
|
||||
void CMysqlConnection::BindNull(int Idx)
|
||||
{
|
||||
m_NewQuery = true;
|
||||
Idx -= 1;
|
||||
dbg_assert(0 <= Idx && Idx < (int)m_vStmtParameters.size(), "index out of bounds");
|
||||
|
||||
MYSQL_BIND *pParam = &m_vStmtParameters[Idx];
|
||||
pParam->buffer_type = MYSQL_TYPE_NULL;
|
||||
pParam->buffer = nullptr;
|
||||
pParam->buffer_length = 0;
|
||||
pParam->length = nullptr;
|
||||
pParam->is_null = nullptr;
|
||||
pParam->is_unsigned = false;
|
||||
pParam->error = nullptr;
|
||||
}
|
||||
|
||||
bool CMysqlConnection::Step(bool *pEnd, char *pError, int ErrorSize)
|
||||
{
|
||||
if(m_NewQuery)
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
void BindInt(int Idx, int Value) override;
|
||||
void BindInt64(int Idx, int64_t Value) override;
|
||||
void BindFloat(int Idx, float Value) override;
|
||||
void BindNull(int Idx) override;
|
||||
|
||||
void Print() override;
|
||||
bool Step(bool *pEnd, char *pError, int ErrorSize) override;
|
||||
|
@ -241,6 +242,13 @@ void CSqliteConnection::BindFloat(int Idx, float Value)
|
|||
m_Done = false;
|
||||
}
|
||||
|
||||
void CSqliteConnection::BindNull(int Idx)
|
||||
{
|
||||
int Result = sqlite3_bind_null(m_pStmt, Idx);
|
||||
AssertNoError(Result);
|
||||
m_Done = false;
|
||||
}
|
||||
|
||||
// Keep support for SQLite < 3.14 on older Linux distributions. MinGW does not
|
||||
// support __attribute__((weak)): https://sourceware.org/bugzilla/show_bug.cgi?id=9687
|
||||
#if defined(__GNUC__) && !defined(__MINGW32__)
|
||||
|
|
|
@ -98,6 +98,8 @@ MACRO_CONFIG_INT(ClDyncamStabilizing, cl_dyncam_stabilizing, 0, 0, 100, CFGFLAG_
|
|||
MACRO_CONFIG_INT(ClMultiViewSensitivity, cl_multiview_sensitivity, 100, 0, 200, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Set how fast the camera will move to the desired location (higher = faster)")
|
||||
MACRO_CONFIG_INT(ClMultiViewZoomSmoothness, cl_multiview_zoom_smoothness, 1300, 50, 5000, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Set the smoothness of the multi-view zoom (in ms, higher = slower)")
|
||||
|
||||
MACRO_CONFIG_INT(ClSpectatorMouseclicks, cl_spectator_mouseclicks, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Enables left-click to toggle between spectating the closest player and free-view")
|
||||
|
||||
MACRO_CONFIG_INT(EdAutosaveInterval, ed_autosave_interval, 10, 0, 240, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Interval in minutes at which a copy of the current editor map is automatically saved to the 'auto' folder (0 for off)")
|
||||
MACRO_CONFIG_INT(EdAutosaveMax, ed_autosave_max, 10, 0, 1000, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Maximum number of autosaves that are kept per map name (0 = no limit)")
|
||||
MACRO_CONFIG_INT(EdSmoothZoomTime, ed_smooth_zoom_time, 250, 0, 5000, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Time of smooth zoom animation in the editor in ms (0 for off)")
|
||||
|
|
|
@ -193,6 +193,23 @@ bool CSpectator::OnInput(const IInput::CEvent &Event)
|
|||
OnRelease();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(g_Config.m_ClSpectatorMouseclicks)
|
||||
{
|
||||
if(m_pClient->m_Snap.m_SpecInfo.m_Active && !IsActive() && !GameClient()->m_MultiViewActivated &&
|
||||
!Ui()->IsPopupOpen() && m_pClient->m_GameConsole.IsClosed() && !m_pClient->m_Menus.IsActive())
|
||||
{
|
||||
if(Event.m_Flags & IInput::FLAG_PRESS && Event.m_Key == KEY_MOUSE_1)
|
||||
{
|
||||
if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW)
|
||||
Spectate(SPEC_FREEVIEW);
|
||||
else
|
||||
SpectateClosest();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ void CStatboard::OnMessage(int MsgType, void *pRawMsg)
|
|||
|
||||
if(t <= p)
|
||||
return;
|
||||
str_utf8_truncate(aName, sizeof(aName), p, t - p);
|
||||
str_truncate(aName, sizeof(aName), p, t - p);
|
||||
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
|
|
|
@ -1301,21 +1301,24 @@ float CUi::DoScrollbarV(const void *pId, const CUIRect *pRect, float Current)
|
|||
}
|
||||
else if(HotItem() == pId)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
if(InsideHandle)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseY() - Handle.y;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseY() - Handle.y;
|
||||
m_ActiveScrollbarOffset = Handle.h / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0) && !InsideHandle && InsideRail)
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = Handle.h / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
|
||||
if(InsideHandle && !MouseButton(0))
|
||||
if(InsideRail && !MouseButton(0))
|
||||
{
|
||||
SetHotItem(pId);
|
||||
}
|
||||
|
@ -1380,19 +1383,22 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
|
|||
}
|
||||
else if(HotItem() == pId)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
if(InsideHandle)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseX() - Handle.x;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseX() - Handle.x;
|
||||
m_ActiveScrollbarOffset = Handle.w / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0) && !InsideHandle && InsideRail)
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = Handle.w / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
|
||||
if(!pColorInner && (InsideHandle || Grabbed) && (CheckActiveItem(pId) || HotItem() == pId))
|
||||
{
|
||||
|
@ -1400,7 +1406,7 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
|
|||
Handle.y -= 1.5f;
|
||||
}
|
||||
|
||||
if(InsideHandle && !MouseButton(0))
|
||||
if(InsideRail && !MouseButton(0))
|
||||
{
|
||||
SetHotItem(pId);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue