new extras system
This commit is contained in:
@@ -24,7 +24,6 @@ public partial class MainViewModel : ObservableObject
|
||||
private readonly UpdateCheckOptions updateOptions = new();
|
||||
private ModpackInfo modpackInfo = new();
|
||||
private ModpackConfig updateConfig = new();
|
||||
private ModpackFeatures? features;
|
||||
private UpdateCheckResult? lastUpdateCheckResult;
|
||||
|
||||
[ObservableProperty] private string? minecraftProfileFolder;
|
||||
@@ -99,7 +98,7 @@ public partial class MainViewModel : ObservableObject
|
||||
|
||||
private bool AllowExtras()
|
||||
{
|
||||
return features != null && features.IsEnabled(ModpackFeatures.FeatureAllowExtas, new AllowExtrasFeatureContext(modpackInfo));
|
||||
return !string.IsNullOrWhiteSpace(modpackInfo.ExtrasKey) && updateConfig.ExtrasKeys.Contains(modpackInfo.ExtrasKey);
|
||||
}
|
||||
|
||||
public void LoadProfileToUi()
|
||||
@@ -191,15 +190,14 @@ public partial class MainViewModel : ObservableObject
|
||||
// Ignore
|
||||
}
|
||||
|
||||
features = new(updateConfig);
|
||||
modpackInfo.ExtrasKey = InstallKey?.Trim();
|
||||
if (!features.IsInvalid() && !string.IsNullOrWhiteSpace(modpackInfo.ExtrasKey) && !AllowExtras())
|
||||
if (!string.IsNullOrWhiteSpace(modpackInfo.ExtrasKey) && !AllowExtras())
|
||||
{
|
||||
SetStatus(GeneralLangRes.InstallationKeyNotValid, AppGlobals.Symbols.GetImageSource(AppSymbols.general_warning_sign));
|
||||
return false;
|
||||
}
|
||||
|
||||
CanUseExtrasKey = CanUseExtrasKey = !string.IsNullOrWhiteSpace(updateConfig.UnleashApiUrl);
|
||||
CanUseExtrasKey = updateConfig.ExtrasKeys.Count > 0;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(MinecraftProfileFolder) /*|| modpackInfo.Valid*/)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user