mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-13 02:50:44 -05:00
udpate launcher base models
This commit is contained in:
parent
5d3b453ded
commit
5a7ff85a5c
@ -7,5 +7,6 @@
|
|||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
public string Url { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,20 +35,6 @@ namespace Aki.Launcher.Models.Launcher
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _hasProfileOnlyMods;
|
|
||||||
public bool HasProfileOnlyMods
|
|
||||||
{
|
|
||||||
get => _hasProfileOnlyMods;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_hasProfileOnlyMods != value)
|
|
||||||
{
|
|
||||||
_hasProfileOnlyMods = value;
|
|
||||||
RaisePropertyChanged(nameof(HasProfileOnlyMods));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _hasMods;
|
private bool _hasMods;
|
||||||
public bool HasMods
|
public bool HasMods
|
||||||
{
|
{
|
||||||
@ -63,7 +49,8 @@ namespace Aki.Launcher.Models.Launcher
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableCollection<AkiMod> Mods { get; private set; } = new ObservableCollection<AkiMod>();
|
public ObservableCollection<AkiMod> ActiveMods { get; private set; } = new ObservableCollection<AkiMod>();
|
||||||
|
public ObservableCollection<AkiMod> InactiveMods { get; private set; } = new ObservableCollection<AkiMod>();
|
||||||
|
|
||||||
public ModInfoCollection()
|
public ModInfoCollection()
|
||||||
{
|
{
|
||||||
@ -73,15 +60,15 @@ namespace Aki.Launcher.Models.Launcher
|
|||||||
ServerModsCount = serverMods?.Count() ?? 0;
|
ServerModsCount = serverMods?.Count() ?? 0;
|
||||||
ProfileModsCount = profileMods?.Count() ?? 0;
|
ProfileModsCount = profileMods?.Count() ?? 0;
|
||||||
|
|
||||||
foreach (var serverMod in serverMods)
|
foreach (var activeMod in serverMods)
|
||||||
{
|
{
|
||||||
serverMod.InServer = true;
|
activeMod.InServer = true;
|
||||||
Mods.Add(serverMod);
|
ActiveMods.Add(activeMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var profileMod in profileMods)
|
foreach (var inactiveMod in profileMods)
|
||||||
{
|
{
|
||||||
var existingMod = Mods.Where(x => x.Name == profileMod.Name && x.Version == profileMod.Version && x.Author == profileMod.Author).FirstOrDefault();
|
var existingMod = ActiveMods.Where(x => x.Name == inactiveMod.Name && x.Version == inactiveMod.Version && x.Author == inactiveMod.Author).FirstOrDefault();
|
||||||
|
|
||||||
if (existingMod != null)
|
if (existingMod != null)
|
||||||
{
|
{
|
||||||
@ -89,12 +76,11 @@ namespace Aki.Launcher.Models.Launcher
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
profileMod.InProfile = true;
|
inactiveMod.InProfile = true;
|
||||||
Mods.Add(profileMod);
|
InactiveMods.Add(inactiveMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
HasMods = Mods.Count() > 0;
|
HasMods = ActiveMods.Count > 0 || InactiveMods.Count > 0;
|
||||||
HasProfileOnlyMods = Mods.Where(x => x.InProfile && !x.InServer).Count() > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user