Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ public static string BigRelicImagePath(this string path)
return Path.Join(MainFile.ResPath, "images", "relics", "big", "relic.png");
}

public static string PotionImagePath(this string path)
{
path = Path.Join(MainFile.ResPath, "images", "potions", path);
if (ResourceLoader.Exists(path)) return path;

MainFile.Logger.Info("Could not find potion image path: " + path);
return Path.Join(MainFile.ResPath, "images", "potions", "potion.png");
}

public static string CharacterUiPath(this string path)
{
return Path.Join(MainFile.ResPath, "images", "charui", path);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
using BaseLib.Abstracts;
using BaseLib.Utils;
using CharMod.CharModCode.Character;
using CharMod.CharModCode.Extensions;

namespace CharMod.CharModCode.Potions;

[Pool(typeof(CharModPotionPool))]
public abstract class CharModPotion : CustomPotionModel;
public abstract class CharModPotion : CustomPotionModel
{
public override string? CustomPackedImagePath =>
$"{Id.Entry.RemovePrefix().ToLowerInvariant()}.png".PotionImagePath();
}