Skip to content

Commit

Permalink
Migrate setting
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp committed Feb 27, 2025
1 parent 5efc946 commit bb10720
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/migratesettings.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Minetest
// SPDX-License-Identifier: LGPL-2.1-or-later

#include "gui/touchscreenlayout.h"
#include "settings.h"
#include "server.h"
#include "util/enum_string.h"

void migrate_settings()
{
Expand All @@ -28,4 +30,12 @@ void migrate_settings()
}
g_settings->remove("disable_anticheat");
}

// Convert touch_use_crosshair to touch_interaction_style
if (g_settings->existsLocal("touch_use_crosshair")) {
bool value = g_settings->getBool("touch_use_crosshair");
g_settings->set("touch_interaction_style", enum_to_string(
es_TouchInteractionStyle, value ? TAP_CROSSHAIR : TAP));
g_settings->remove("touch_use_crosshair");
}
}

0 comments on commit bb10720

Please sign in to comment.