diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-07-24 00:18:39 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-07-24 00:18:39 +0200 |
commit | 09422740a4dbb21d719b5cc34fc19b6f6ff6ae51 (patch) | |
tree | 112cc8c9f20b0979f44a88d665a830a9246c104e /src | |
parent | b7767dd9aae27f0fe6b7ae3b99d0f51860979f82 (diff) | |
download | minetest-mirror_hands.tar.xz |
Add setting to mirror handsmirror_hands
Diffstat (limited to 'src')
-rw-r--r-- | src/client/camera.cpp | 5 | ||||
-rw-r--r-- | src/defaultsettings.cpp | 1 | ||||
-rw-r--r-- | src/settings_translation_file.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/client/camera.cpp b/src/client/camera.cpp index 5ca4e4908..3b4c2fad8 100644 --- a/src/client/camera.cpp +++ b/src/client/camera.cpp @@ -45,7 +45,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define WIELDMESH_AMPLITUDE_X 7.0f #define WIELDMESH_AMPLITUDE_Y 10.0f -#define HANDS (int i = 0, s = +1; i <= 1; i++, s *= -1) // i is index, s is sign +#define HANDS (int i = 0, s = +1; i <= +1; i++, s = -1, (void) s) // i is index, s is sign Camera::Camera(MapDrawControl &draw_control, Client *client, RenderingEngine *rendering_engine): m_draw_control(draw_control), @@ -529,6 +529,9 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 tool_reload_ratio) m_player_light_color = player->light_color; for HANDS { + if (g_settings->getBool("mirror_hands")) + s *= -1; + // Position the wielded item //v3f wield_position = v3f(45, -35, 65); v3f wield_position = v3f(m_wieldmesh_offset.X, m_wieldmesh_offset.Y, 65); diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 222000712..6320dc6d0 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -207,6 +207,7 @@ void set_default_settings() settings->setDefault("enable_clouds", "true"); settings->setDefault("view_bobbing_amount", "1.0"); settings->setDefault("fall_bobbing_amount", "0.03"); + settings->setDefault("mirror_hands", "false"); settings->setDefault("enable_3d_clouds", "true"); settings->setDefault("cloud_radius", "12"); settings->setDefault("menu_clouds", "true"); diff --git a/src/settings_translation_file.cpp b/src/settings_translation_file.cpp index 03bb564fb..ad0aaa9b1 100644 --- a/src/settings_translation_file.cpp +++ b/src/settings_translation_file.cpp @@ -86,6 +86,8 @@ fake_function() { gettext("Enable view bobbing and amount of view bobbing.\nFor example: 0 for no view bobbing; 1.0 for normal; 2.0 for double."); gettext("Fall bobbing factor"); gettext("Multiplier for fall bobbing.\nFor example: 0 for no view bobbing; 1.0 for normal; 2.0 for double."); + gettext("Mirror hands"); + gettext("Draw main hand on left side of screen, offhand on right side."); gettext("Camera"); gettext("Near plane"); gettext("Camera 'near clipping plane' distance in nodes, between 0 and 0.25\nOnly works on GLES platforms. Most users will not need to change this.\nIncreasing can reduce artifacting on weaker GPUs.\n0.1 = Default, 0.25 = Good value for weaker tablets."); |