Skip to content

Commit

Permalink
调整
Browse files Browse the repository at this point in the history
  • Loading branch information
Vera-Firefly committed Sep 9, 2024
1 parent b2713db commit db7f84a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,16 @@ private void showSetGLVersionDialog() {
String glVersion = mMesaGLVersion.getText().toString();
String glslVersion = mMesaGLSLVersion.getText().toString();

if (!isValidVersion(glVersion, "2.8", "4.6") && !isValidVersion(glslVersion, "280", "460")) {
if (!isValidVersion(glVersion, "2.8", "4.6") || !isValidVersion(glslVersion, "280", "460")) {
showSetGLVersionDialog();
mMesaGLVersion.setError(getString(R.string.customglglsl_alertdialog_error_gl));
mMesaGLVersion.requestFocus();
mMesaGLSLVersion.setError(getString(R.string.customglglsl_alertdialog_error_glsl));
mMesaGLSLVersion.requestFocus();
return;
} else if (!isValidVersion(glVersion, "2.8", "4.6")) {
showSetGLVersionDialog();
mMesaGLVersion.setError(getString(R.string.customglglsl_alertdialog_error_gl));
mMesaGLVersion.requestFocus();
return;
} else if (!isValidVersion(glslVersion, "280", "460")) {
showSetGLVersionDialog();
mMesaGLSLVersion.setError(getString(R.string.customglglsl_alertdialog_error_glsl));
mMesaGLSLVersion.requestFocus();
if (!isValidVersion(glVersion, "2.8", "4.6")) {
mMesaGLVersion.setError(getString(R.string.customglglsl_alertdialog_error_gl));
mMesaGLVersion.requestFocus();
}
if (!isValidVersion(glslVersion, "280", "460")) {
mMesaGLSLVersion.setError(getString(R.string.customglglsl_alertdialog_error_glsl));
mMesaGLSLVersion.requestFocus();
}
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ private void setMemoryAllocationDialog(CustomSeekBarPreference seek, int maxRAM)
mSetJavaMemory.setError(requireContext().getString(R.string.setting_java_memory_outofrange, checkValue));
return;
}
if (Memory < 256) {
if (Memory < 256 || Memory > maxRAM) {
setMemoryAllocationDialog(seek, maxRAM);
mSetJavaMemory.setError(requireContext().getString(R.string.zh_setting_java_memory_too_small, 256));
return;
}
if (Memory > maxRAM) {
setMemoryAllocationDialog(seek, maxRAM);
mSetJavaMemory.setError(requireContext().getString(R.string.zh_setting_java_memory_too_big, maxRAM));
if (Memory < 256) {
mSetJavaMemory.setError(requireContext().getString(R.string.zh_setting_java_memory_too_small, 256));
}
if (Memory > maxRAM) {
mSetJavaMemory.setError(requireContext().getString(R.string.zh_setting_java_memory_too_big, maxRAM));
}
return;
}
seek.setValue(Memory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ private void setVideoResolutionDialog(CustomSeekBarPreference seek) {
mSetVideoResolution.setError(requireContext().getString(R.string.setting_set_resolution_outofrange, checkValue));
return;
}
if (Value < 25) {
if (Value < 25 || Value > 1000) {
setVideoResolutionDialog(seek);
mSetVideoResolution.setError(requireContext().getString(R.string.setting_set_resolution_too_small, 25));
return;
}
if (Value > 1000) {
setVideoResolutionDialog(seek);
mSetVideoResolution.setError(requireContext().getString(R.string.setting_set_resolution_too_big, 1000));
if (Value < 25) {
mSetVideoResolution.setError(requireContext().getString(R.string.setting_set_resolution_too_small, 25));
}
if (Value > 1000) {
mSetVideoResolution.setError(requireContext().getString(R.string.setting_set_resolution_too_big, 1000));
}
return;
}
if (Value > 100) {
Expand Down

0 comments on commit db7f84a

Please sign in to comment.