Merge pull request 'Remove the upgrade of opaque theme colors from before 0.1.3' (#14) from drop-color-upgrade into master
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
@@ -163,14 +163,6 @@ public class ConfigManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the config file has a value for {@code name} in this namespace,
|
|
||||||
* which tells which version last saved it.
|
|
||||||
*/
|
|
||||||
public boolean isSaved(String name) {
|
|
||||||
return getSaved(name) != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private JsonNode getSaved(String name) {
|
private JsonNode getSaved(String name) {
|
||||||
JsonNode source = cachedJson != null ? cachedJson : loadAndCache();
|
JsonNode source = cachedJson != null ? cachedJson : loadAndCache();
|
||||||
if (source == null || !source.isObject())
|
if (source == null || !source.isObject())
|
||||||
|
|||||||
@@ -81,29 +81,6 @@ public class Theme {
|
|||||||
config.property("Widget Radius", WIDGET_RADIUS, "Corner rounding of buttons and cards");
|
config.property("Widget Radius", WIDGET_RADIUS, "Corner rounding of buttons and cards");
|
||||||
|
|
||||||
config.property("Font", FONT, "Font of every Saturn screen");
|
config.property("Font", FONT, "Font of every Saturn screen");
|
||||||
|
|
||||||
if (!parent.isSaved(Config.MENU_BLUR)) {
|
|
||||||
upgradeOpaqueColors();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Before 0.1.3 panels and cards were made translucent in code, and the
|
|
||||||
* background and primary colors were saved fully opaque. Saved colors that
|
|
||||||
* are an old default or preset get the translucency the colors now carry
|
|
||||||
* themselves; colors the player picked are left as they are. Runs only on
|
|
||||||
* configs from older versions, so a preset color later set opaque on
|
|
||||||
* purpose stays opaque.
|
|
||||||
*/
|
|
||||||
private static void upgradeOpaqueColors() {
|
|
||||||
for (Preset preset : PRESETS) {
|
|
||||||
if (BACKGROUND.value == (preset.background() | 0xFF000000)) {
|
|
||||||
BACKGROUND.value = preset.background();
|
|
||||||
}
|
|
||||||
if (PRIMARY.value == (preset.primary() | 0xFF000000)) {
|
|
||||||
PRIMARY.value = preset.primary();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user