mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add ui_smooth_scroll_time
variable to adjust smooth scrolling
This variable adjusts the time for smooth scrolling of all scrollregions and listboxes in the menus and editor. The value `0` disables smooth scrolling entirely.
This commit is contained in:
parent
831b67e2cb
commit
bbd20cde2b
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <engine/client.h>
|
||||
#include <engine/keys.h>
|
||||
#include <engine/shared/config.h>
|
||||
|
||||
#include "ui_scrollregion.h"
|
||||
|
||||
|
@ -67,7 +68,7 @@ void CScrollRegion::End()
|
|||
CUIRect RegionRect = m_ClipRect;
|
||||
RegionRect.w += m_Params.m_ScrollbarWidth;
|
||||
|
||||
const float AnimationDuration = 0.5f;
|
||||
const float AnimationDuration = g_Config.m_UiSmoothScrollTime / 1000.0f;
|
||||
|
||||
if(UI()->Enabled() && UI()->MouseHovered(&RegionRect))
|
||||
{
|
||||
|
|
|
@ -131,6 +131,7 @@ MACRO_CONFIG_INT(UiToolboxPage, ui_toolbox_page, 0, 0, 2, CFGFLAG_CLIENT | CFGFL
|
|||
MACRO_CONFIG_STR(UiServerAddress, ui_server_address, 1024, "localhost:8303", CFGFLAG_CLIENT | CFGFLAG_SAVE | CFGFLAG_INSENSITIVE, "Interface server address")
|
||||
MACRO_CONFIG_INT(UiMousesens, ui_mousesens, 200, 1, 100000, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Mouse sensitivity for menus/editor")
|
||||
MACRO_CONFIG_INT(UiControllerSens, ui_controller_sens, 100, 1, 100000, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Controller sensitivity for menus/editor")
|
||||
MACRO_CONFIG_INT(UiSmoothScrollTime, ui_smooth_scroll_time, 500, 0, 5000, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Time of smooth scrolling animation in menus/editor in ms (0 for off)")
|
||||
|
||||
MACRO_CONFIG_COL(UiColor, ui_color, 0xE4A046AF, CFGFLAG_CLIENT | CFGFLAG_SAVE | CFGFLAG_COLALPHA, "Interface color") // 160 70 175 228 hasalpha
|
||||
|
||||
|
|
Loading…
Reference in a new issue