Skip to content

Commit

Permalink
feat: Category support. Added empty objects and minimal npcs categori…
Browse files Browse the repository at this point in the history
…es. (Jorixon#93)

tweak: Added some more info to the "mod added" notification and "mod moved" notification.

fix: Honkai star rail 3DMigotoLoader not starting as admin. Now checking the "run this program as an administrator" on the file "3DMigotoLoader.exe" should start it as admin, this worked for me at least

chore: Minor improvements to the underlying code of the Mod installer helper
  • Loading branch information
Jorixon authored Nov 28, 2023
1 parent b0e94de commit 7349b41
Show file tree
Hide file tree
Showing 65 changed files with 1,534 additions and 646 deletions.
2 changes: 2 additions & 0 deletions src/GIMI-ModManager.Core/Contracts/Entities/ISkinMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ namespace GIMI_ModManager.Core.Contracts.Entities;
public interface ISkinMod : IMod, IEqualityComparer<ISkinMod>, IEquatable<ISkinMod>
{
Guid Id { get; }
public string GetDisplayName();
public bool HasMergedInI { get; }
public void ClearCache();
public SkinModSettingsManager Settings { get; }
public SkinModKeySwapManager? KeySwaps { get; }
public new ISkinMod CopyTo(string absPath);

public bool ContainsOnlyJasmFiles();
public string? GetModIniPath();
Expand Down
13 changes: 11 additions & 2 deletions src/GIMI-ModManager.Core/Contracts/Services/ISkinManagerService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GIMI_ModManager.Core.Contracts.Entities;
using GIMI_ModManager.Core.GamesService.Interfaces;
using GIMI_ModManager.Core.GamesService.Models;
using GIMI_ModManager.Core.Services;
using OneOf;
using OneOf.Types;
Expand All @@ -25,7 +26,7 @@ public Task InitializeAsync(string activeModsFolderPath, string? unloadedModsFol
/// <param name="characterFolderToReorganize">If null, reorganize all mods outside of characters mod folders</param>
/// <param name="disableMods">If true will also disable the mods</param>
/// <returns>Mods moved</returns>
public Task<int> ReorganizeModsAsync(string? characterFolderToReorganize = null,
public Task<int> ReorganizeModsAsync(InternalName? characterFolderToReorganize = null,
bool disableMods = false);

/// <summary>
Expand Down Expand Up @@ -61,12 +62,20 @@ public void ExportMods(ICollection<ICharacterModList> characterModLists, string
public Task DisableModListAsync(IModdableObject moddableObject, bool deleteFolder = false);

/// <summary>
/// <para>
/// Copes/Moves the mod to the destination mod list. Will throw if the mod is already in the destination mod list or there are duplicate names.
/// </para>
/// <para>
/// !!!IMPORTANT!!!
/// If the mod is copied, then this will return a new instance of the mod. If the mod is moved,
/// then this will return the same instance of the mod. Both cases will return the same instance of the mod in the destination mod list.
/// !!!IMPORTANT!!!
/// </para>
/// </summary>
/// <param name="mod">The Mod to be copied/moved</param>
/// <param name="modList">The modList where the mod will be moved to</param>
/// <param name="move">If true, will move the mod instead of copying it</param>
public void AddMod(ISkinMod mod, ICharacterModList modList, bool move = false);
public ISkinMod AddMod(ISkinMod mod, ICharacterModList modList, bool move = false);
}

public enum SetModStatus
Expand Down
15 changes: 15 additions & 0 deletions src/GIMI-ModManager.Core/Entities/Mods/SkinMod/SkinMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ public class SkinMod : Mod, ISkinMod
public SkinModKeySwapManager? KeySwaps { get; private set; }


public string GetDisplayName()
{
var displayName = Settings.TryGetSettings(out var settings) && !settings.CustomName.IsNullOrEmpty()
? settings.CustomName
: GetNameWithoutDisabledPrefix();

return displayName;
}

public bool HasMergedInI => KeySwaps is not null;


Expand Down Expand Up @@ -106,6 +115,12 @@ public bool ContainsOnlyJasmFiles()
?.FullName;
}

public override ISkinMod CopyTo(string absPath)
{
var newModFolder = base.CopyTo(absPath);
return CreateModAsync(newModFolder.FullPath).GetAwaiter().GetResult();
}

public string? GetModIniPath() => HasMergedInIFile(_modDirectory);

public string GetNameWithoutDisabledPrefix() =>
Expand Down
Loading

0 comments on commit 7349b41

Please sign in to comment.