mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-27 16:33:38 +00:00
Disable 3D settings in the core for CarScreen mode
Signed-off-by: matheusgomesms <matheusgomesms@noreply.codeberg.org>
This commit is contained in:
committed by
Matheus Gomes
parent
f1cf844986
commit
935f18d5e4
@@ -2424,6 +2424,10 @@ void Framework::Allow3dMode(bool allow3d, bool allow3dBuildings)
|
||||
if (!m_powerManager.IsFacilityEnabled(power_management::Facility::Buildings3d))
|
||||
allow3dBuildings = false;
|
||||
|
||||
/// If we are in CarPlay/AA mode and Navigation is active, force 3D buildings off.
|
||||
if (m_isCarScreenMode && m_routingManager.IsRoutingActive())
|
||||
allow3dBuildings = false;
|
||||
|
||||
m_drapeEngine->Allow3dMode(allow3d, allow3dBuildings);
|
||||
}
|
||||
|
||||
@@ -3224,6 +3228,10 @@ void Framework::OnRouteFollow(routing::RouterType type)
|
||||
// GetRoutingSettings(type).m_matchRoute to the FollowRoute() instead of |isPedestrianRoute|.
|
||||
// |isArrowGlued| parameter fully corresponds to |m_matchRoute| in RoutingSettings.
|
||||
m_drapeEngine->FollowRoute(scale, scale3d, enableAutoZoom, !isPedestrianRoute /* isArrowGlued */);
|
||||
|
||||
bool allow3d, allow3dBuildings;
|
||||
Load3dMode(allow3d, allow3dBuildings);
|
||||
Allow3dMode(allow3d, allow3dBuildings);
|
||||
}
|
||||
|
||||
// RoutingManager::Delegate
|
||||
@@ -3292,3 +3300,15 @@ void Framework::OnPowerSchemeChanged(power_management::Scheme const actualScheme
|
||||
if (actualScheme == power_management::Scheme::EconomyMaximum && GetTrafficManager().IsEnabled())
|
||||
GetTrafficManager().SetEnabled(false);
|
||||
}
|
||||
|
||||
void Framework::SetCarScreenMode(bool enabled)
|
||||
{
|
||||
if (m_isCarScreenMode == enabled)
|
||||
return;
|
||||
|
||||
m_isCarScreenMode = enabled;
|
||||
|
||||
bool allow3d, allow3dBuildings;
|
||||
Load3dMode(allow3d, allow3dBuildings);
|
||||
Allow3dMode(allow3d, allow3dBuildings);
|
||||
}
|
||||
|
||||
@@ -769,4 +769,9 @@ public:
|
||||
// PowerManager::Subscriber override.
|
||||
void OnPowerFacilityChanged(power_management::Facility const facility, bool enabled) override;
|
||||
void OnPowerSchemeChanged(power_management::Scheme const actualScheme) override;
|
||||
|
||||
public:
|
||||
/// Call this from iOS/Android when CarPlay/AA session starts/ends
|
||||
void SetCarScreenMode(bool enabled);
|
||||
bool m_isCarScreenMode = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user