Skip to main content

Crate banished_mods

Crate banished_mods 

Source
Expand description

The mod list Un-Banished shares between the game and the mod manager: the .pkm packages in the pack directory, which are enabled and in what order, and their conflicts. It is the port of IO::Modification (Runtime), moved out of the game so that both read and write the same settings in the same way.

  • The list (RefreshList): every *.pkm the pack directory holds (FileSystem::FindFiles), read with PackageFile::ReadPackfile: its name, author, description, icon, preview and files. A mod is known by its file’s name without the extension; the settings keep whether it is enabled (ModEnabled_<file>) and its place in the list (ModIndex_<file>). Each mod lists the others that hold one of its files (its conflicts).
  • Saving (SaveList) writes both settings for every mod.

Inferred: the list is ordered by the saved index, a mod without one after the others in the directory’s order.

text is a settings store for the settings file, for tools that run without the game.

Original: Runtime 0x1800b0d40, Runtime 0x1800b2e50.

Modules§

preview
Mod preview images from the mod sites: PNG, JPEG or WebP (by their first bytes, since sites name files with the wrong extension: banishedinfo.com’s .png are often JPEG, and Nexus Mods’ CDN sends WebP for .jpg addresses), decoded to RGBA for the game’s and the mod manager’s lists.
text
The settings file as name=value lines, for tools that run without the game (the mod manager). It keeps every value it reads, so writing the file back changes only what was set. The game reads the same file through its own Persistence.

Structs§

Mod
One mod (Modification::Mod, 0x80 bytes).
Modification
The mod list: every package found, in list order.

Traits§

Settings
Where the mod list reads and writes its settings: the game’s Persistence, or a text::TextSettings. Names are made from a section and a name (ModEnabled_ and the file), as IO::Persistence does.

Functions§

find
FileSystem::FindFiles(GetPackDirectory(), "*.pkm"): the packages in the folder.