Make old opaque theme colors translucent once
Configs saved before 0.1.3 hold the old default and preset background and primary colors fully opaque, so glass didn't show for anyone updating. On a config without Menu blur (new in 0.1.3), colors that are an old default or preset get their translucent alpha; colors players picked stay as they are. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -156,10 +156,25 @@ public class ConfigManager {
|
||||
* Load only a single property immediately after creation
|
||||
*/
|
||||
private void loadSingleProperty(String name, Property prop) {
|
||||
JsonNode element = getSaved(name);
|
||||
|
||||
if (element != null) {
|
||||
prop.loadFromJson(element);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
JsonNode source = cachedJson != null ? cachedJson : loadAndCache();
|
||||
if (source == null || !source.isObject())
|
||||
return;
|
||||
return null;
|
||||
|
||||
JsonNode currentScope = source;
|
||||
|
||||
@@ -170,16 +185,12 @@ public class ConfigManager {
|
||||
if (next != null && next.isObject()) {
|
||||
currentScope = next;
|
||||
} else {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
JsonNode element = currentScope.get(name);
|
||||
|
||||
if (element != null) {
|
||||
prop.loadFromJson(element);
|
||||
}
|
||||
return currentScope.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user