mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
add note about using threshold for subtitle duration
This commit is contained in:
parent
77b7d1a49e
commit
922ba9ed5c
@ -255,6 +255,9 @@ impl AudioFrontend {
|
||||
},
|
||||
};
|
||||
|
||||
// NOTE: Threshold here is meant to give subtitles some idea of the duration of
|
||||
// the audio, it doesn't have to be perfect but in the future, if possible we
|
||||
// might want to switch it out for the actual duration.
|
||||
(file, item.threshold, item.subtitle.as_deref())
|
||||
})
|
||||
}
|
||||
|
@ -289,9 +289,7 @@ impl<'a> Widget for Subtitles<'a> {
|
||||
subtitles
|
||||
.subtitles
|
||||
.iter()
|
||||
.filter_map(|(localization, data)| {
|
||||
Some((localization, data.last()?))
|
||||
})
|
||||
.filter_map(|(localization, data)| Some((localization, data.last()?)))
|
||||
.filter(|(_, data)| {
|
||||
data.position.map_or(true, |pos| {
|
||||
pos.distance_squared(listener_pos)
|
||||
|
Loading…
Reference in New Issue
Block a user