| | 1 | | using DCL; |
| | 2 | | using static Decentraland.Bff.AboutResponse.Types; |
| | 3 | |
|
| | 4 | | namespace DCLPlugins.RealmPlugin |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// Toggles the state of the minimap depending on the value of the AboutConfiguration.Minimap.Enabled we just entere |
| | 8 | | /// It also toggles the visibility of a Jump To Home button, which is required every time going into a world. |
| | 9 | | /// If the minimap and the jump home button is visible, they can both co-exist on an ON state. |
| | 10 | | /// </summary> |
| | 11 | | public class RealmMinimapModifier : IRealmModifier |
| | 12 | | { |
| | 13 | | private readonly BaseVariable<bool> minimapVisible; |
| | 14 | | private readonly BaseVariable<bool> jumpHomeButtonVisible; |
| | 15 | |
|
| 8 | 16 | | public RealmMinimapModifier(DataStore_HUDs dataStoreHUDs) |
| | 17 | | { |
| 8 | 18 | | minimapVisible = dataStoreHUDs.minimapVisible; |
| 8 | 19 | | jumpHomeButtonVisible = dataStoreHUDs.jumpHomeButtonVisible; |
| 8 | 20 | | } |
| | 21 | |
|
| 2 | 22 | | public void Dispose() { } |
| | 23 | |
|
| | 24 | | public void OnEnteredRealm(bool isWorld, AboutConfiguration realmConfiguration) |
| | 25 | | { |
| 2 | 26 | | minimapVisible.Set(realmConfiguration.Minimap.Enabled); |
| 2 | 27 | | jumpHomeButtonVisible.Set(isWorld); |
| 2 | 28 | | } |
| | 29 | | } |
| | 30 | | } |