| | 1 | | using DCL.SettingsCommon.SettingsControllers.BaseControllers; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace DCL.SettingsControls |
| | 5 | | { |
| | 6 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Players Name Opacity", fileName = "PlayersNameOpacity")] |
| | 7 | | public class PlayersNameOpacityControlController : SliderSettingsControlController |
| | 8 | | { |
| | 9 | | public override void Initialize() |
| | 10 | | { |
| 1 | 11 | | base.Initialize(); |
| 1 | 12 | | UpdateSetting(currentGeneralSettings.namesOpacity); |
| 1 | 13 | | } |
| | 14 | |
|
| 1 | 15 | | public override object GetStoredValue() { return currentGeneralSettings.namesOpacity; } |
| | 16 | |
|
| | 17 | | public override void UpdateSetting(object newValue) |
| | 18 | | { |
| 2 | 19 | | float valueAsFloat = (float)newValue; |
| 2 | 20 | | currentGeneralSettings.namesOpacity = valueAsFloat; |
| 2 | 21 | | DataStore.i.HUDs.avatarNamesOpacity.Set(valueAsFloat); |
| 2 | 22 | | RaiseOnIndicatorLabelChange(valueAsFloat.ToString("0.0")); |
| 2 | 23 | | } |
| | 24 | | } |
| | 25 | | } |