mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Merge #3263
3263: Only show smooth camera option when dyncam is on r=Learath2 a=def- As suggested by Pipou ![screenshot-20201107@112944](https://user-images.githubusercontent.com/2335377/98438742-8c1ccb00-20ec-11eb-89b5-7028a8d8097e.png) ## Checklist - [x] Tested the change ingame - [x] Provided screenshots if it is a visual change - [x] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
92df1f1627
|
@ -832,7 +832,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -1180,7 +1180,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
|
|
@ -1279,7 +1279,7 @@ Your nickname '%s' is already used (%d points). Do you still want to use it?
|
|||
Checking for existing player with your name
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Game sound volume
|
||||
|
@ -1295,13 +1295,13 @@ Highlight
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Manual
|
||||
|
||||
Race
|
||||
==
|
||||
== Corrida
|
||||
|
||||
Auto
|
||||
==
|
||||
== Auto
|
||||
|
||||
Replay
|
||||
==
|
||||
== Reproduzir
|
||||
|
|
|
@ -829,7 +829,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -1194,7 +1194,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1274,13 +1274,13 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Manual
|
||||
|
||||
Race
|
||||
==
|
||||
== Carrera
|
||||
|
||||
Auto
|
||||
==
|
||||
== Auto
|
||||
|
||||
Replay
|
||||
==
|
||||
== Repetició
|
||||
|
|
|
@ -832,7 +832,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -835,7 +835,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -832,7 +832,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -1206,7 +1206,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1286,16 +1286,16 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Manual
|
||||
|
||||
Race
|
||||
==
|
||||
== Race
|
||||
|
||||
Auto
|
||||
==
|
||||
== Automatisch
|
||||
|
||||
Replay
|
||||
==
|
||||
== Herhaling
|
||||
|
||||
Net
|
||||
==
|
||||
|
|
|
@ -833,7 +833,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1280,9 +1280,6 @@ Your nickname '%s' is already used (%d points). Do you still want to use it?
|
|||
Checking for existing player with your name
|
||||
== Prüfe auf existierenden Spieler mit deinem Namen
|
||||
|
||||
Smooth Camera
|
||||
== Weiche Kamera
|
||||
|
||||
Game sound volume
|
||||
== Spiel-Lautstärke
|
||||
|
||||
|
@ -1306,3 +1303,6 @@ Auto
|
|||
|
||||
Replay
|
||||
== Wiederholung
|
||||
|
||||
Smooth Dynamic Camera
|
||||
== Weiche Dynamische Kamera
|
||||
|
|
|
@ -835,7 +835,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -872,7 +872,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -832,7 +832,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -834,7 +834,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -826,7 +826,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -1202,7 +1202,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1282,13 +1282,13 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Manuell
|
||||
|
||||
Race
|
||||
==
|
||||
== Løp
|
||||
|
||||
Auto
|
||||
==
|
||||
== Auto
|
||||
|
||||
Replay
|
||||
==
|
||||
== Opptak
|
||||
|
|
|
@ -601,7 +601,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon on pickup
|
||||
|
|
|
@ -1206,7 +1206,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1286,13 +1286,13 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Instrukcja
|
||||
|
||||
Race
|
||||
==
|
||||
== Wyścig
|
||||
|
||||
Auto
|
||||
==
|
||||
== Auto
|
||||
|
||||
Replay
|
||||
==
|
||||
== Powtórka
|
||||
|
|
|
@ -1040,7 +1040,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Reset wanted weapon on death
|
||||
|
|
|
@ -841,7 +841,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -1241,8 +1241,8 @@ Theme
|
|||
Demos directory
|
||||
== Папка с демо
|
||||
|
||||
Smooth Camera
|
||||
== Плавная камера
|
||||
Smooth Dynamic Camera
|
||||
== Плавная Динамическая камера
|
||||
|
||||
Themes directory
|
||||
== Папка с темами
|
||||
|
@ -1287,7 +1287,7 @@ Assets directory
|
|||
== Папка с графикой
|
||||
|
||||
Manual
|
||||
==
|
||||
== Ручное
|
||||
|
||||
Race
|
||||
== Гонка
|
||||
|
|
|
@ -836,7 +836,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -1259,7 +1259,7 @@ Your nickname '%s' is already used (%d points). Do you still want to use it?
|
|||
Checking for existing player with your name
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Game sound volume
|
||||
|
@ -1281,13 +1281,13 @@ Use current map as background
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Упутство
|
||||
|
||||
Race
|
||||
==
|
||||
== Трка
|
||||
|
||||
Auto
|
||||
==
|
||||
== Ауто
|
||||
|
||||
Replay
|
||||
==
|
||||
== Помнови
|
||||
|
|
|
@ -1243,7 +1243,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Themes directory
|
||||
|
@ -1292,13 +1292,13 @@ Assets directory
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== 手动
|
||||
|
||||
Race
|
||||
==
|
||||
== 竞速赛
|
||||
|
||||
Auto
|
||||
==
|
||||
== 自动
|
||||
|
||||
Replay
|
||||
==
|
||||
== 回放
|
||||
|
|
|
@ -832,7 +832,7 @@ Activate
|
|||
Save
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Switch weapon when out of ammo
|
||||
|
|
|
@ -1207,7 +1207,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1287,13 +1287,13 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Manual
|
||||
|
||||
Race
|
||||
==
|
||||
== Carrera
|
||||
|
||||
Auto
|
||||
==
|
||||
== Auto
|
||||
|
||||
Replay
|
||||
==
|
||||
== Repetición
|
||||
|
|
|
@ -1238,7 +1238,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Themes directory
|
||||
|
@ -1284,13 +1284,13 @@ Assets directory
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Manual
|
||||
|
||||
Race
|
||||
==
|
||||
== Race
|
||||
|
||||
Auto
|
||||
==
|
||||
== Auto
|
||||
|
||||
Replay
|
||||
==
|
||||
== Repris
|
||||
|
|
|
@ -1212,7 +1212,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1286,13 +1286,13 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== 手動
|
||||
|
||||
Race
|
||||
==
|
||||
== 競速賽
|
||||
|
||||
Auto
|
||||
==
|
||||
== 自動
|
||||
|
||||
Replay
|
||||
==
|
||||
== 回放
|
||||
|
|
|
@ -1209,7 +1209,7 @@ Theme
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1286,13 +1286,13 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Manual
|
||||
|
||||
Race
|
||||
==
|
||||
== Yarış
|
||||
|
||||
Auto
|
||||
==
|
||||
== Otomatik
|
||||
|
||||
Replay
|
||||
==
|
||||
== Yeniden oynatma
|
||||
|
|
|
@ -1204,7 +1204,7 @@ Markers
|
|||
Demos directory
|
||||
==
|
||||
|
||||
Smooth Camera
|
||||
Smooth Dynamic Camera
|
||||
==
|
||||
|
||||
Skip the main menu
|
||||
|
@ -1281,13 +1281,13 @@ Play
|
|||
==
|
||||
|
||||
Manual
|
||||
==
|
||||
== Ручна
|
||||
|
||||
Race
|
||||
==
|
||||
== Гонка
|
||||
|
||||
Auto
|
||||
==
|
||||
== Авто
|
||||
|
||||
Replay
|
||||
==
|
||||
== Повтор
|
||||
|
|
|
@ -129,10 +129,10 @@ void CCamera::OnRender()
|
|||
static vec2 s_CurrentCameraOffset[2] = {vec2(0, 0), vec2(0, 0)};
|
||||
static float s_SpeedBias = 0.5f;
|
||||
|
||||
if(g_Config.m_ClCameraSmoothness > 0)
|
||||
if(g_Config.m_ClDyncamSmoothness > 0)
|
||||
{
|
||||
float CameraSpeed = (1.0f - (g_Config.m_ClCameraSmoothness / 100.0f)) * 9.5f + 0.5f;
|
||||
float CameraStabilizingFactor = 1 + g_Config.m_ClCameraStabilizing / 100.0f;
|
||||
float CameraSpeed = (1.0f - (g_Config.m_ClDyncamSmoothness / 100.0f)) * 9.5f + 0.5f;
|
||||
float CameraStabilizingFactor = 1 + g_Config.m_ClDyncamStabilizing / 100.0f;
|
||||
|
||||
s_SpeedBias += CameraSpeed * DeltaTime;
|
||||
if(g_Config.m_ClDyncam)
|
||||
|
@ -158,7 +158,7 @@ void CCamera::OnRender()
|
|||
TargetCameraOffset = normalize(m_pClient->m_pControls->m_MousePos[g_Config.m_ClDummy]) * OffsetAmount;
|
||||
}
|
||||
|
||||
if(g_Config.m_ClCameraSmoothness > 0)
|
||||
if(g_Config.m_ClDyncamSmoothness > 0)
|
||||
s_CurrentCameraOffset[g_Config.m_ClDummy] += (TargetCameraOffset - s_CurrentCameraOffset[g_Config.m_ClDummy]) * minimum(DeltaTime * s_SpeedBias, 1.0f);
|
||||
else
|
||||
s_CurrentCameraOffset[g_Config.m_ClDummy] = TargetCameraOffset;
|
||||
|
|
|
@ -107,19 +107,22 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
|
|||
}
|
||||
}
|
||||
|
||||
// smooth camera
|
||||
// smooth dynamic camera
|
||||
Left.HSplitTop(5.0f, 0, &Left);
|
||||
Left.HSplitTop(20.0f, &Button, &Left);
|
||||
if(DoButton_CheckBox(&g_Config.m_ClCameraSmoothness, Localize("Smooth Camera"), g_Config.m_ClCameraSmoothness, &Button))
|
||||
if(g_Config.m_ClDyncam)
|
||||
{
|
||||
if(g_Config.m_ClCameraSmoothness)
|
||||
if(DoButton_CheckBox(&g_Config.m_ClDyncamSmoothness, Localize("Smooth Dynamic Camera"), g_Config.m_ClDyncamSmoothness, &Button))
|
||||
{
|
||||
g_Config.m_ClCameraSmoothness = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_Config.m_ClCameraSmoothness = 50;
|
||||
g_Config.m_ClCameraStabilizing = 50;
|
||||
if(g_Config.m_ClDyncamSmoothness)
|
||||
{
|
||||
g_Config.m_ClDyncamSmoothness = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_Config.m_ClDyncamSmoothness = 50;
|
||||
g_Config.m_ClDyncamStabilizing = 50;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ MACRO_CONFIG_INT(ClDyncamMousesens, cl_dyncam_mousesens, 0, 0, 100000, CFGFLAG_C
|
|||
MACRO_CONFIG_INT(ClDyncamDeadzone, cl_dyncam_deadzone, 300, 1, 1300, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Dynamic camera dead zone")
|
||||
MACRO_CONFIG_INT(ClDyncamFollowFactor, cl_dyncam_follow_factor, 60, 0, 200, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Dynamic camera follow factor")
|
||||
|
||||
MACRO_CONFIG_INT(ClCameraSmoothness, cl_camera_smoothness, 0, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Transition amount of the camera movement, 0=instant, 100=slow and smooth")
|
||||
MACRO_CONFIG_INT(ClCameraStabilizing, cl_camera_stabilizing, 0, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Amount of camera slowdown during fast cursor movement. High value can cause delay in camera movement")
|
||||
MACRO_CONFIG_INT(ClDyncamSmoothness, cl_dyncam_smoothness, 0, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Transition amount of the camera movement, 0=instant, 100=slow and smooth")
|
||||
MACRO_CONFIG_INT(ClDyncamStabilizing, cl_dyncam_stabilizing, 0, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Amount of camera slowdown during fast cursor movement. High value can cause delay in camera movement")
|
||||
|
||||
MACRO_CONFIG_INT(EdZoomTarget, ed_zoom_target, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Zoom to the current mouse target")
|
||||
MACRO_CONFIG_INT(EdShowkeys, ed_showkeys, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "")
|
||||
|
|
Loading…
Reference in a new issue