Skip to content

Commit

Permalink
Merge branch 'core' of github.com:EverestAPI/Everest into core
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Nov 6, 2023
2 parents c6e8512 + 864dd49 commit 8969c68
Show file tree
Hide file tree
Showing 7 changed files with 412 additions and 61 deletions.
32 changes: 17 additions & 15 deletions Celeste.Mod.mm/Content/Dialog/English.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,23 @@
OOBE_SETTINGS_OK= OK

# Mod Toggle Menu
MODOPTIONS_MODTOGGLE= TOGGLE MODS
MODOPTIONS_MODTOGGLE_LOADING= Loading mod information...
MODOPTIONS_MODTOGGLE_TOGGLEDEPS= Toggle Dependencies Automatically
MODOPTIONS_MODTOGGLE_TOGGLEDEPS_MESSAGE1= When you enable a mod, all its dependencies will be enabled.
MODOPTIONS_MODTOGGLE_TOGGLEDEPS_MESSAGE2= When you disable a mod, all mods that depend on it will be disabled.
MODOPTIONS_MODTOGGLE_MESSAGE_1= If you enable or disable mods, your blacklist.txt will be replaced,
MODOPTIONS_MODTOGGLE_MESSAGE_2= and Celeste will restart to apply changes.
MODOPTIONS_MODTOGGLE_MESSAGE_3= Highlighted mods are used by other enabled mods as a dependency.
MODOPTIONS_MODTOGGLE_WHITELISTWARN= Disable your whitelist for these settings to be applied properly.
MODOPTIONS_MODTOGGLE_ENABLEALL= Enable All
MODOPTIONS_MODTOGGLE_DISABLEALL= Disable All
MODOPTIONS_MODTOGGLE_CANCEL= Cancel
MODOPTIONS_MODTOGGLE_ZIPS= Zip Files
MODOPTIONS_MODTOGGLE_DIRECTORIES= Directories
MODOPTIONS_MODTOGGLE_BINS= Map Bin Files
MODOPTIONS_MODTOGGLE= TOGGLE MODS
MODOPTIONS_MODTOGGLE_LOADING= Loading mod information...
MODOPTIONS_MODTOGGLE_TOGGLEDEPS= Toggle Dependencies Automatically
MODOPTIONS_MODTOGGLE_TOGGLEDEPS_MESSAGE1= When you enable a mod, all its dependencies will be enabled.
MODOPTIONS_MODTOGGLE_TOGGLEDEPS_MESSAGE2= When you disable a mod, all mods that depend on it will be disabled.
MODOPTIONS_MODTOGGLE_PROTECTFAVORITES= Protect Favorites
MODOPTIONS_MODTOGGLE_PROTECTFAVORITES_MESSAGE= Press {0} to add or remove mods from your favorite list.
MODOPTIONS_MODTOGGLE_MESSAGE_1= If you enable or disable mods, your blacklist.txt will be replaced,
MODOPTIONS_MODTOGGLE_MESSAGE_2= and Celeste will restart to apply changes.
MODOPTIONS_MODTOGGLE_MESSAGE_3= Highlighted mods are used by other enabled mods as a dependency.
MODOPTIONS_MODTOGGLE_WHITELISTWARN= Disable your whitelist for these settings to be applied properly.
MODOPTIONS_MODTOGGLE_ENABLEALL= Enable All
MODOPTIONS_MODTOGGLE_DISABLEALL= Disable All
MODOPTIONS_MODTOGGLE_CANCEL= Cancel
MODOPTIONS_MODTOGGLE_ZIPS= Zip Files
MODOPTIONS_MODTOGGLE_DIRECTORIES= Directories
MODOPTIONS_MODTOGGLE_BINS= Map Bin Files

# Asset Reload Helper
ASSETRELOADHELPER_RELOADINGMAP= Reloading map
Expand Down
2 changes: 2 additions & 0 deletions Celeste.Mod.mm/Content/Dialog/French.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@
MODOPTIONS_MODTOGGLE_TOGGLEDEPS= (Dés)activer les dépendances automatiquement
MODOPTIONS_MODTOGGLE_TOGGLEDEPS_MESSAGE1= Si vous activez un mod, toutes ses dépendances seront également activées.
MODOPTIONS_MODTOGGLE_TOGGLEDEPS_MESSAGE2= Si vous désactivez un mod, tous les mods qui l'utilisent comme dépendance seront désactivés.
MODOPTIONS_MODTOGGLE_PROTECTFAVORITES= Protéger les mods favoris
MODOPTIONS_MODTOGGLE_PROTECTFAVORITES_MESSAGE= Appuyez sur {0} pour ajouter/supprimer des mods de la liste des favoris.
MODOPTIONS_MODTOGGLE_MESSAGE_1= Si vous activez ou désactivez des mods, votre blacklist.txt sera remplacé,
MODOPTIONS_MODTOGGLE_MESSAGE_2= et Celeste va redémarrer pour appliquer les changements.
MODOPTIONS_MODTOGGLE_MESSAGE_3= Les mods mis en surbrillance sont utilisés par d'autres mods activés comme des dépendances.
Expand Down
15 changes: 15 additions & 0 deletions Celeste.Mod.mm/Mod/Everest/Everest.Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public static class Loader {
/// </summary>
public static ReadOnlyCollection<string> Blacklist => _Blacklist?.AsReadOnly();

/// <summary>
/// The path to the Everest /Mods/favorites.txt file.
/// </summary>
public static string PathFavorites { get; internal set; }
internal static HashSet<string> Favorites = new HashSet<string>();

/// <summary>
/// The path to the Everest /Mods/temporaryblacklist.txt file.
/// </summary>
Expand Down Expand Up @@ -157,6 +163,15 @@ internal static void LoadAuto() {
}
}

PathFavorites = Path.Combine(PathMods, "favorites.txt");
if (File.Exists(PathFavorites)) {
Favorites = new HashSet<string>(File.ReadAllLines(PathFavorites).Select(l => (l.StartsWith("#") ? "" : l).Trim()));
} else {
using (StreamWriter writer = File.CreateText(PathFavorites)) {
writer.WriteLine("# This is the favorites list. Lines starting with # are ignored.");
}
}

Stopwatch watch = Stopwatch.StartNew();

enforceOptionalDependencies = true;
Expand Down
Loading

0 comments on commit 8969c68

Please sign in to comment.