mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
feat: 全局配置不存在时会优先使用当前配置的字段,并赋值给全局配置
This commit is contained in:
@@ -65,6 +65,14 @@ namespace MaaWpfGui.Helper
|
||||
_logger.Debug("Read global configuration key {Key} with default value {DefaultValue}, configuration hit: {HasValue}, configuration value {Value}", key, defaultValue, hasValue, value);
|
||||
if (!hasValue)
|
||||
{
|
||||
hasValue = _kvs.TryGetValue(key, out value);
|
||||
if (hasValue)
|
||||
{
|
||||
_logger.Debug("Read global configuration key {Key} with current configuration value {Value}, configuration hit: {HasValue}, configuration value {Value}", key, value, hasValue, value);
|
||||
SetGlobalValue(key, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
SetGlobalValue(key, defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user