summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp9
-rw-r--r--src/defaults.cpp29
2 files changed, 27 insertions, 11 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 1199c1213..f01d5b12c 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2941,6 +2941,13 @@ void Client::checkConfigVersion()
if (config.getIntValue("npcfontSize") == 13)
config.deleteKey("npcfontSize");
}
+ if (version < 2)
+ {
+ if (config.getIntValue("screenButtonsSize") == 1)
+ config.deleteKey("screenButtonsSize");
+ if (config.getIntValue("screenJoystickSize") == 1)
+ config.deleteKey("screenJoystickSize");
+ }
- config.setValue("cfgver", 1);
+ config.setValue("cfgver", 2);
}
diff --git a/src/defaults.cpp b/src/defaults.cpp
index bee70d570..92ef24627 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -324,37 +324,46 @@ void getConfigDefaults2(DefaultsData *const configData)
{
if (!configData)
return;
- if (mainGraphics->getHeight() < 480)
- {
- AddDEF("screenButtonsSize", 0);
- AddDEF("screenJoystickSize", 0);
- }
- else
- {
- AddDEF("screenButtonsSize", 1);
- AddDEF("screenJoystickSize", 1);
- }
const int density = graphicsManager.getDensity();
int size = 12;
+ int buttonSize = 1;
switch (density)
{
+ case DENSITY_LOW:
+ case DENSITY_MEDIUM:
+ buttonSize = 1;
+ break;
case DENSITY_TV:
size = 14;
+ buttonSize = 1;
break;
case DENSITY_HIGH:
size = 16;
+ buttonSize = 2;
break;
case DENSITY_XHIGH:
size = 18;
+ buttonSize = 3;
break;
case DENSITY_XXHIGH:
size = 20;
+ buttonSize = 3;
break;
default:
break;
}
AddDEF("fontSize", size);
AddDEF("npcfontSize", size + 1);
+ if (mainGraphics->getHeight() < 480)
+ {
+ AddDEF("screenButtonsSize", 0);
+ AddDEF("screenJoystickSize", 0);
+ }
+ else
+ {
+ AddDEF("screenButtonsSize", buttonSize);
+ AddDEF("screenJoystickSize", buttonSize);
+ }
}
DefaultsData* getBrandingDefaults()