Skip to content

Commit

Permalink
Update 3.5.16
Browse files Browse the repository at this point in the history
  • Loading branch information
vektor9999 committed Mar 27, 2024
1 parent bc63b2f commit 9405eca
Show file tree
Hide file tree
Showing 12 changed files with 147 additions and 79 deletions.
5 changes: 4 additions & 1 deletion Vcc.Nolvus.Core/Interfaces/IModOrganizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
using System.Text;
using System.Diagnostics;
using System.Threading.Tasks;
using Vcc.Nolvus.Core.Misc;

namespace Vcc.Nolvus.Core.Interfaces
{
public interface IModOrganizer : ISoftware, IModsContainer
{
{
Task<List<ModObject>> GetModsMetaData(string Profile, Action<string, int> Progress = null);
List<string> GetProfiles();
}
}
2 changes: 1 addition & 1 deletion Vcc.Nolvus.Core/Interfaces/IModsContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ namespace Vcc.Nolvus.Core.Interfaces
{
public interface IModsContainer
{
Task<List<ModObject>> GetModsMetaData(Action<string, int> Progress = null);
Task<List<ModObject>> GetModsMetaData(Action<string, int> Progress = null);
}
}
2 changes: 1 addition & 1 deletion Vcc.Nolvus.Core/Misc/ModObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override string ToString()
public class ModObjectList
{
private List<ModObject> _List = new List<ModObject>();

public string Profile { get; set; }
public int AddedModsCount
{
get { return _List.Where(x => x.Status == ModObjectStatus.CustomInstalled).ToList().Count; }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 42 additions & 19 deletions Vcc.Nolvus.Dashboard/Frames/Instance/InstanceDetailFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace Vcc.Nolvus.Dashboard.Frames.Instance
public partial class InstanceDetailFrame : DashboardFrame
{
private ModObjectList ModListStatus = new ModObjectList();
private string _CurrentProfile;

public InstanceDetailFrame()
{
Expand Down Expand Up @@ -66,6 +67,14 @@ public InstanceDetailFrame(IDashboard Dashboard, FrameParameters Params)

}

private string SelectedProfile
{
get
{
return DrpDwnLstProfiles.SelectedValue.ToString();
}
}

protected override async Task OnLoadedAsync()
{
try
Expand All @@ -75,23 +84,9 @@ protected override async Task OnLoadedAsync()
LblHeader.Text = Instance.Name + " v" + Instance.Version;
ServiceSingleton.Dashboard.Info("Instance mods for " + Instance.Name + " v" + Instance.Version);

LoadGrids(await LoadModStatus());

if (ModListStatus.HasMods)
{
if (ModListStatus.AddedModsCount > 0 || ModListStatus.RemovedModsCount > 0)
{
PnlHeader.BackColor = Color.FromArgb(255, 0, 0);
LblHeader.Text += " - Errors Detected";
}
else if (ModListStatus.VersionMismatchCount > 0)
{
PnlHeader.BackColor = Color.FromArgb(255, 128, 0);
LblHeader.Text += " - Warning Detected";
}
}


DrpDwnLstProfiles.Visible = false;
DrpDwnLstProfiles.DataSource = ServiceSingleton.Packages.ModOrganizer2.GetProfiles();
DrpDwnLstProfiles.SelectedIndex = 0;
}
catch(Exception ex)
{
Expand Down Expand Up @@ -169,7 +164,7 @@ public async Task<ModObjectList> LoadModStatus()
ServiceSingleton.Dashboard.Status("Loading mods...");
ModListStatus = await ServiceSingleton.CheckerService.CheckModList(
await ServiceSingleton.SoftwareProvider.ModOrganizer2.GetModsMetaData((s, p) =>
await ServiceSingleton.SoftwareProvider.ModOrganizer2.GetModsMetaData(SelectedProfile, (s, p) =>
{
ServiceSingleton.Dashboard.Status(string.Format("{0} ({1}%)", s, p));
ServiceSingleton.Dashboard.Progress(p);
Expand All @@ -183,7 +178,9 @@ await ServiceSingleton.Packages.GetModsMetaData((s, p) =>
{
ServiceSingleton.Dashboard.Status(s);
}
);
);
ModListStatus.Profile = SelectedProfile;
return ModListStatus;
}
Expand Down Expand Up @@ -390,5 +387,31 @@ await ServiceSingleton.Report.GenerateReportToPdf(ModListStatus, Properties.Reso
{
}
}

private async void DrpDwnLstProfiles_SelectedIndexChanged(object sender, EventArgs e)
{
if (_CurrentProfile != SelectedProfile)
{
_CurrentProfile = SelectedProfile;

LoadGrids(await LoadModStatus());

if (ModListStatus.HasMods)
{
if (ModListStatus.AddedModsCount > 0 || ModListStatus.RemovedModsCount > 0)
{
PnlHeader.BackColor = Color.FromArgb(255, 0, 0);
LblHeader.Text += " - Errors Detected";
}
else if (ModListStatus.VersionMismatchCount > 0)
{
PnlHeader.BackColor = Color.FromArgb(255, 128, 0);
LblHeader.Text += " - Warning Detected";
}
}

DrpDwnLstProfiles.Visible = true;
}
}
}
}
4 changes: 2 additions & 2 deletions Vcc.Nolvus.Dashboard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.5.15")]
[assembly: AssemblyFileVersion("3.5.15.0")]
[assembly: AssemblyVersion("3.5.16")]
[assembly: AssemblyFileVersion("3.5.16.0")]
2 changes: 1 addition & 1 deletion Vcc.Nolvus.Package/Files/ModFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected virtual async Task DoDownload(string Link, DownloadProgressChangedHand
try
{
ServiceSingleton.Logger.Log(string.Format("Downloading file {0}", FileName));
await ServiceSingleton.Files.DownloadFile(Link, Path.Combine(ServiceSingleton.Folders.DownloadDirectory, this.FileName), OnProgress);
await ServiceSingleton.Files.DownloadFile(Link, Path.Combine(ServiceSingleton.Folders.DownloadDirectory, FileName), OnProgress);
}
catch (Exception ex)
{
Expand Down
12 changes: 6 additions & 6 deletions Vcc.Nolvus.Package/Mods/InstallableElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public ModProgress Progress
{
if (_p == null)
{
_p = new ModProgress();

_p.Name = Name + " by " + Author + " (v " + Version + ")";
_p.Status = "Initializing";
_p.Mbs = 0;
_p.Image = FormatImage();
_p = new ModProgress() {
Name = Name + " by " + Author + " (v " + Version + ")",
Status = "Initializing",
Mbs = 0,
Image = FormatImage()
};
}

return _p;
Expand Down
11 changes: 8 additions & 3 deletions Vcc.Nolvus.Package/Mods/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public override string ToString()
}
protected override void CreateElementIni()
{
if (this.Display)
if (Display)
{
File.WriteAllText(Path.Combine(MoDirectoryFullName, "meta.ini"), string.Format(MetaIni, "0", Version, GetInstallFileName().Replace("\\", "/"), "0"));
}
Expand Down Expand Up @@ -265,7 +265,7 @@ protected override async Task DoUnpack()
ServiceSingleton.Logger.Log(string.Format("Unpacking mod {0}", Name));
var Counter = 0;
foreach (BsaUnPacking BSA in this.Bsas)
foreach (BsaUnPacking BSA in Bsas)
{
await BSA.UnPack(Path.Combine(ServiceSingleton.Folders.ExtractDirectory, ExtractSubDir));
Expand Down Expand Up @@ -333,7 +333,12 @@ protected override async Task DoPatch()
if (Patcher != null)
{
ServiceSingleton.Logger.Log(string.Format("Patching mod {0}", Name));
await Patcher.PatchFiles(MoDirectoryFullName, ServiceSingleton.Instances.WorkingInstance.StockGame, DownloadingProgress, ExtractingProgress, PatchingProgress);
await Patcher.PatchFiles(MoDirectoryFullName,
ServiceSingleton.Instances.WorkingInstance.StockGame,
DownloadingProgress,
ExtractingProgress,
PatchingProgress);
}
}
catch (Exception ex)
Expand Down
Loading

0 comments on commit 9405eca

Please sign in to comment.