Skip to content
Permalink
Browse files
Merge pull request #9356 from JosJuice/android-save-ingame-change
Android: Correctly save in-game settings changes to disk
  • Loading branch information
lioncash committed Dec 24, 2020
2 parents 1d489b3 + 6f05c40 commit 464bc80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
@@ -3,8 +3,9 @@
public class NativeConfig
{
public static final int LAYER_BASE_OR_CURRENT = 0;
public static final int LAYER_LOCAL_GAME = 1;
public static final int LAYER_ACTIVE = 2;
public static final int LAYER_BASE = 1;
public static final int LAYER_LOCAL_GAME = 2;
public static final int LAYER_ACTIVE = 3;

public static native boolean isSettingSaveable(String file, String section, String key);

@@ -200,7 +200,7 @@ public void saveSettings(SettingsActivityView view, Context context)
SettingsFile.saveFile(entry.getKey(), entry.getValue(), view);
}

NativeConfig.save(NativeConfig.LAYER_BASE_OR_CURRENT);
NativeConfig.save(NativeConfig.LAYER_BASE);

if (!NativeLibrary.IsRunning())
{
@@ -14,8 +14,9 @@
#include "jni/AndroidCommon/AndroidCommon.h"

constexpr jint LAYER_BASE_OR_CURRENT = 0;
constexpr jint LAYER_LOCAL_GAME = 1;
constexpr jint LAYER_ACTIVE = 2;
constexpr jint LAYER_BASE = 1;
constexpr jint LAYER_LOCAL_GAME = 2;
constexpr jint LAYER_ACTIVE = 3;

static Config::Location GetLocation(JNIEnv* env, jstring file, jstring section, jstring key)
{
@@ -60,6 +61,10 @@ static std::shared_ptr<Config::Layer> GetLayer(jint layer, const Config::Locatio
layer_type = Config::LayerType::CurrentRun;
break;

case LAYER_BASE:
layer_type = Config::LayerType::Base;
break;

case LAYER_LOCAL_GAME:
layer_type = Config::LayerType::LocalGame;
break;

0 comments on commit 464bc80

Please sign in to comment.