Add ZoomBypass cheat to always allow clientside zoom #63
|
@ -48,6 +48,7 @@ core.cheats = {
|
|||
["Reach"] = "reach",
|
||||
["PointLiquids"] = "point_liquids",
|
||||
["PrivBypass"] = "priv_bypass",
|
||||
["ZoomBypass"] = "zoom_bypass",
|
||||
["AutoRespawn"] = "autorespawn",
|
||||
["ThroughWalls"] = "dont_point_nodes",
|
||||
},
|
||||
|
|
|
@ -2329,6 +2329,11 @@ xray_nodes (XRay Nodes) string default:stone,mcl_core:stone
|
|||
|
||||
priv_bypass (PrivBypass) bool true
|
||||
|
||||
zoom_bypass (ZoomBypass) bool true
|
||||
|
||||
# The zoom FOV when using ZoomBypass. Lower values mean more zoom. Default: 15.0
|
||||
zoom_bypass_fov (ZoomBypass FOV) float 15.0
|
||||
|
||||
fastdig (FastDig) bool false
|
||||
|
||||
fastplace (FastPlace) bool false
|
||||
|
|
|
@ -478,7 +478,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 tool_reload_ratio)
|
|||
* If not, check for zoom and set to zoom FOV.
|
||||
* Otherwise, default to m_cache_fov.
|
||||
*/
|
||||
if (m_fov_transition_active) {
|
||||
if(!g_settings->getBool("zoom_bypass") && m_fov_transition_active) {
|
||||
// Smooth FOV transition
|
||||
// Dynamically calculate FOV delta based on frametimes
|
||||
f32 delta = (frametime / m_transition_time) * m_fov_diff;
|
||||
|
@ -490,7 +490,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 tool_reload_ratio)
|
|||
m_fov_transition_active = false;
|
||||
m_curr_fov_degrees = m_target_fov_degrees;
|
||||
}
|
||||
} else if (m_server_sent_fov) {
|
||||
} else if (!g_settings->getBool("zoom_bypass") && m_server_sent_fov) {
|
||||
// Instantaneous FOV change
|
||||
m_curr_fov_degrees = m_target_fov_degrees;
|
||||
} else if (player->getPlayerControl().zoom && player->getZoomFOV() > 0.001f) {
|
||||
|
|
|
@ -1707,7 +1707,10 @@ void GenericCAO::setProperties(ObjectProperties newprops)
|
|||
collision_box.MaxEdge *= BS;
|
||||
player->setCollisionbox(collision_box);
|
||||
player->setEyeHeight(m_prop.eye_height);
|
||||
player->setZoomFOV(m_prop.zoom_fov);
|
||||
if (g_settings->getBool("zoom_bypass"))
|
||||
player->setZoomFOV(g_settings->getFloat("zoom_bypass_fov"));
|
||||
else
|
||||
player->setZoomFOV(m_prop.zoom_fov);
|
||||
}
|
||||
|
||||
if ((m_is_player && !m_is_local_player) && m_prop.nametag.empty())
|
||||
|
|
|
@ -1662,7 +1662,7 @@ void Game::toggleFullViewRange()
|
|||
void Game::checkZoomEnabled()
|
||||
{
|
||||
LocalPlayer *player = client->getEnv().getLocalPlayer();
|
||||
if (player->getZoomFOV() < 0.001f || player->getFov().fov > 0.0f)
|
||||
if (!g_settings->getBool("zoom_bypass") && (player->getZoomFOV() < 0.001f || player->getFov().fov > 0.0f))
|
||||
m_game_ui->showTranslatedStatusText("Zoom currently disabled by game or mod");
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,8 @@ void set_default_settings()
|
|||
settings->setDefault("xray_nodes", "default:stone,mcl_core:stone");
|
||||
settings->setDefault("fullbright", "false");
|
||||
settings->setDefault("priv_bypass", "true");
|
||||
settings->setDefault("zoom_bypass", "true");
|
||||
settings->setDefault("zoom_bypass_fov", "15.0");
|
||||
settings->setDefault("freecam", "false");
|
||||
settings->setDefault("prevent_natural_damage", "true");
|
||||
settings->setDefault("freecam", "false");
|
||||
|
|
Loading…
Reference in New Issue