mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
Add GUI scale setting and volume contrast setting
GUI scale (#737): - add display.gui-scale setting (0 - auto, 1..4 - fixed integer scale) - auto mode picks the largest scale keeping at least 640x480 UI units - apply scale in GUI (root size, camera, cursor, tooltips, scissors) - HUD layout and ModelViewer use scaled coordinates - add GUI Scale trackbar to display settings Volume contrast (#399): - add audio.volume-contrast setting (100% - unchanged sounds, 0% - loud sounds are lowered to the level of quiet ones) - loudness (RMS) of a sound is calculated once and cached - add trackbar to audio settings and reset page
This commit is contained in:
parent
dacebf94bc
commit
708c276787
14 changed files with 158 additions and 17 deletions
|
|
@ -1,6 +1,7 @@
|
|||
function create_trackbar_setting(id, name, step, postfix)
|
||||
function create_trackbar_setting(id, name, step, postfix, tooltip)
|
||||
local info = app.get_setting_info(id)
|
||||
postfix = postfix or ""
|
||||
tooltip = tooltip or ""
|
||||
document.root:add(gui.template("track_setting", {
|
||||
id=id,
|
||||
name=gui.str(name, "settings"),
|
||||
|
|
@ -8,7 +9,8 @@ function create_trackbar_setting(id, name, step, postfix)
|
|||
min=info.min,
|
||||
max=info.max,
|
||||
step=step,
|
||||
postfix=postfix
|
||||
postfix=postfix,
|
||||
tooltip=gui.str(tooltip, "settings")
|
||||
}))
|
||||
update_trackbar_label(app.get_setting(id), id, name, postfix)
|
||||
end
|
||||
|
|
@ -78,6 +80,7 @@ function on_open()
|
|||
create_trackbar_setting("audio.volume-ui", "UI Sounds", 0.01)
|
||||
create_trackbar_setting("audio.volume-ambient", "Ambient", 0.01)
|
||||
create_trackbar_setting("audio.volume-music", "Music", 0.01)
|
||||
create_trackbar_setting("audio.volume-contrast", "Volume Contrast", 0.01, "", "audio.volume-contrast.tooltip")
|
||||
|
||||
document.root:add("<label context='settings'>@Microphone</label>")
|
||||
document.root:add("<select id='input_device_select' "..
|
||||
|
|
|
|||
|
|
@ -9,6 +9,14 @@ tostring_overrides["display.framerate"] = function(x)
|
|||
end
|
||||
end
|
||||
|
||||
tostring_overrides["display.gui-scale"] = function(x)
|
||||
if x == 0 then
|
||||
return gui.str("Auto")
|
||||
else
|
||||
return tostring(x)
|
||||
end
|
||||
end
|
||||
|
||||
function create_trackbar_setting(id, name, step, postfix, tooltip, changeonrelease)
|
||||
local info = app.get_setting_info(id)
|
||||
postfix = postfix or ""
|
||||
|
|
@ -57,6 +65,7 @@ end
|
|||
function on_open()
|
||||
create_trackbar_setting("camera.fov", "FOV", 1, "°")
|
||||
create_trackbar_setting("display.framerate", "Framerate", 1, "", "", true)
|
||||
create_trackbar_setting("display.gui-scale", "GUI Scale", 1, "", "display.gui-scale.tooltip", true)
|
||||
|
||||
document.root:add(string.format(
|
||||
"<select context='settings' onselect='function(opt) app.set_setting(\"display.window-mode\", tonumber(opt)) end' selected='%s'>"..
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ function reset_audio()
|
|||
reset_setting("audio.volume-ui")
|
||||
reset_setting("audio.volume-ambient")
|
||||
reset_setting("audio.volume-music")
|
||||
reset_setting("audio.volume-contrast")
|
||||
end
|
||||
|
||||
function reset_display()
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ Dependencies=Зависимости
|
|||
Description=Описание
|
||||
Converting world...=Выполняется конвертация мира...
|
||||
Unlimited=Неограниченно
|
||||
Auto=Авто
|
||||
Chat=Чат
|
||||
Console=Консоль
|
||||
Log=Лог
|
||||
|
|
@ -39,7 +40,9 @@ pack.remove-confirm=Удалить весь поставляемый паком/
|
|||
|
||||
# Подсказки
|
||||
audio.acoustic-effects.tooltip=Акустические эффекты могут не поддерживаться системой
|
||||
audio.volume-contrast.tooltip=Меньше - громкие звуки приглушаются до уровня тихих (ночной режим)
|
||||
audio.recording-enabled.tooltip=Включает функции записи звука
|
||||
display.gui-scale.tooltip=Размер интерфейса: Авто, 1–4
|
||||
graphics.enable-fog.tooltip=Отображать туман / дымку
|
||||
graphics.gamma.tooltip=Кривая яркости освещения
|
||||
graphics.backlight.tooltip=Подсветка, предотвращающая полную темноту
|
||||
|
|
@ -95,6 +98,7 @@ settings.Fog Curve=Кривая Тумана
|
|||
settings.FOV=Поле Зрения
|
||||
settings.Fullscreen=Полный экран
|
||||
settings.Framerate=Частота кадров
|
||||
settings.GUI Scale=Масштаб интерфейса
|
||||
settings.Gamma=Гамма
|
||||
settings.Language=Язык
|
||||
settings.Load Distance=Дистанция Загрузки
|
||||
|
|
@ -102,6 +106,7 @@ settings.Load Speed=Скорость Загрузки
|
|||
settings.Master Volume=Общая Громкость
|
||||
settings.Mouse Sensitivity=Чувствительность Мыши
|
||||
settings.Music=Музыка
|
||||
settings.Volume Contrast=Контраст громкости
|
||||
settings.Regular Sounds=Обычные Звуки
|
||||
settings.UI Sounds=Звуки Интерфейса
|
||||
settings.V-Sync=Вертикальная Синхронизация
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue