Skip to content

Commit

Permalink
Update terminology: normal plugin to full plugin
Browse files Browse the repository at this point in the history
Full is how Starfield refers to non-medium, non-light plugins, so use that as no previous game gave an official term for them.
  • Loading branch information
Ortham committed Jun 25, 2024
1 parent 3d0b6f8 commit e3690ff
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion doc/src/load_order_mechanisms.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ There are a few hardcoded rules that trump load order, irrespective of the metho
- Official Bethesda plugins are all hardcoded to always load in a certain order before other plugins. These include the game's main master file (`Skyrim.esm` or `Fallout4.esm`), DLC plugins (e.g. `Dragonborn.esm`, `DLCNukaWorld.esm`) and Creation Club plugins (e.g. `ccQDRSSE001-SurvivalMode.esl`).
- Light plugins load amongst other plugins, but they all then get moved to the end of the load order so that in-game they all take up the `FE` load order slot. This movement does not affect conflict resolution.

A plugin's type is usually indicated by its file extension, for example `.esm` is used by master plugins, `.esl` is used by light plugins and `.esp` is used by non-master, non-light (i.e. normal) plugins. However, this isn't necessarily accurate, see Plugin Types for details.
A plugin's type is usually indicated by its file extension, for example `.esm` is used by master plugins, `.esl` is used by light plugins and `.esp` is used by non-master, non-light (i.e. full) plugins. However, this isn't necessarily accurate, see Plugin Types for details.
6 changes: 3 additions & 3 deletions src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub enum Error {
TooManyActivePlugins {
light_count: usize,
medium_count: usize,
normal_count: usize,
full_count: usize,
},
DuplicatePlugin(String),
NonMasterBeforeMaster {
Expand Down Expand Up @@ -155,8 +155,8 @@ impl fmt::Display for Error {
Error::PluginNotFound(name) => {
write!(f, "The plugin \"{name}\" is not in the load order")
}
Error::TooManyActivePlugins {light_count, medium_count, normal_count } =>
write!(f, "Maximum number of active plugins exceeded: there are {normal_count} active normal plugins, {medium_count} active medium plugins and {light_count} active light plugins"),
Error::TooManyActivePlugins {light_count, medium_count, full_count } =>
write!(f, "Maximum number of active plugins exceeded: there are {full_count} active full plugins, {medium_count} active medium plugins and {light_count} active light plugins"),
Error::DuplicatePlugin(name) =>
write!(f, "The given plugin list contains more than one instance of \"{name}\""),
Error::NonMasterBeforeMaster{ master, non_master} =>
Expand Down
6 changes: 3 additions & 3 deletions src/load_order/asterisk_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ mod tests {

// .esm plugins are loaded as ESMs, .esl plugins are loaded as ESMs and
// ESLs, ignoring their actual flags, so only worth testing a .esp that
// has the ESM flag set that has another (normal) .esp as a master.
// has the ESM flag set that has another (full) .esp as a master.

let plugins_dir = &load_order.game_settings().plugins_directory();
let plugin_name_1 = "Blank - Plugin Dependent.esp";
Expand Down Expand Up @@ -686,7 +686,7 @@ mod tests {

// .esm plugins are loaded as ESMs, .esl plugins are loaded as ESMs and
// ESLs, ignoring their actual flags, so only worth testing a .esp that
// has the ESM flag set that has another (normal) .esp as a master.
// has the ESM flag set that has another (full) .esp as a master.

let plugin_name = "Blank - Master Dependent.esm";
copy_to_test_dir(plugin_name, plugin_name, load_order.game_settings());
Expand Down Expand Up @@ -726,7 +726,7 @@ mod tests {

// .esm plugins are loaded as ESMs, .esl plugins are loaded as ESMs and
// ESLs, ignoring their actual flags, so only worth testing a .esp that
// has the ESM flag set that has another (normal) .esp as a master.
// has the ESM flag set that has another (full) .esp as a master.

let plugin_name = "Blank - Override.full.esm";
copy_to_test_dir(plugin_name, plugin_name, load_order.game_settings());
Expand Down
2 changes: 1 addition & 1 deletion src/load_order/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ mod tests {
}

#[test]
fn find_first_non_master_should_find_a_normal_esp() {
fn find_first_non_master_should_find_a_full_esp() {
let tmp_dir = tempdir().unwrap();
let plugins = prepare_plugins(&tmp_dir.path(), "Blank.esp");

Expand Down
26 changes: 13 additions & 13 deletions src/load_order/writable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::enums::Error;
use crate::plugin::Plugin;
use crate::GameSettings;

const MAX_ACTIVE_NORMAL_PLUGINS: usize = 255;
const MAX_ACTIVE_FULL_PLUGINS: usize = 255;
const MAX_ACTIVE_LIGHT_PLUGINS: usize = 4096;
const MAX_ACTIVE_MEDIUM_PLUGINS: usize = 256;

Expand Down Expand Up @@ -138,7 +138,7 @@ pub fn remove<T: MutableLoadOrder>(load_order: &mut T, plugin_name: &str) -> Res
struct PluginCounts {
light: usize,
medium: usize,
normal: usize,
full: usize,
}

impl PluginCounts {
Expand All @@ -148,7 +148,7 @@ impl PluginCounts {
} else if plugin.is_medium_plugin() {
self.medium += 1;
} else {
self.normal += 1;
self.full += 1;
}
}
}
Expand Down Expand Up @@ -189,16 +189,16 @@ pub fn activate<T: MutableLoadOrder>(load_order: &mut T, plugin_name: &str) -> R
if !plugin.is_active() {
let is_light = plugin.is_light_plugin();
let is_medium = plugin.is_medium_plugin();
let is_normal = !is_light && !is_medium;
let is_full = !is_light && !is_medium;

if (is_light && counts.light == MAX_ACTIVE_LIGHT_PLUGINS)
|| (is_medium && counts.medium == MAX_ACTIVE_MEDIUM_PLUGINS)
|| (is_normal && counts.normal == MAX_ACTIVE_NORMAL_PLUGINS)
|| (is_full && counts.full == MAX_ACTIVE_FULL_PLUGINS)
{
return Err(Error::TooManyActivePlugins {
light_count: counts.light,
medium_count: counts.medium,
normal_count: counts.normal,
full_count: counts.full,
});
} else {
plugin.activate()?;
Expand Down Expand Up @@ -229,14 +229,14 @@ pub fn set_active_plugins<T: MutableLoadOrder>(

let counts = count_plugins(load_order.plugins(), &existing_plugin_indices);

if counts.normal > MAX_ACTIVE_NORMAL_PLUGINS
if counts.full > MAX_ACTIVE_FULL_PLUGINS
|| counts.medium > MAX_ACTIVE_MEDIUM_PLUGINS
|| counts.light > MAX_ACTIVE_LIGHT_PLUGINS
{
return Err(Error::TooManyActivePlugins {
light_count: counts.light,
medium_count: counts.medium,
normal_count: counts.normal,
full_count: counts.full,
});
}

Expand Down Expand Up @@ -520,7 +520,7 @@ mod tests {
let tmp_dir = tempdir().unwrap();
let mut load_order = prepare(GameId::Oblivion, &tmp_dir.path());

for i in 0..(MAX_ACTIVE_NORMAL_PLUGINS - 1) {
for i in 0..(MAX_ACTIVE_FULL_PLUGINS - 1) {
let plugin = format!("{}.esp", i);
copy_to_test_dir("Blank.esp", &plugin, &load_order.game_settings());
load_and_insert(&mut load_order, &plugin);
Expand All @@ -536,7 +536,7 @@ mod tests {
let tmp_dir = tempdir().unwrap();
let mut load_order = prepare(GameId::Oblivion, &tmp_dir.path());

for i in 0..(MAX_ACTIVE_NORMAL_PLUGINS - 1) {
for i in 0..(MAX_ACTIVE_FULL_PLUGINS - 1) {
let plugin = format!("{}.esp", i);
copy_to_test_dir("Blank.esp", &plugin, &load_order.game_settings());
load_and_insert(&mut load_order, &plugin);
Expand All @@ -552,7 +552,7 @@ mod tests {
let tmp_dir = tempdir().unwrap();
let mut load_order = prepare(GameId::Starfield, &tmp_dir.path());

for i in 0..(MAX_ACTIVE_NORMAL_PLUGINS - 1) {
for i in 0..(MAX_ACTIVE_FULL_PLUGINS - 1) {
let plugin = format!("{}.esp", i);
copy_to_test_dir("Blank.esp", &plugin, &load_order.game_settings());
load_and_insert(&mut load_order, &plugin);
Expand All @@ -573,7 +573,7 @@ mod tests {
let tmp_dir = tempdir().unwrap();
let mut load_order = prepare(GameId::Starfield, &tmp_dir.path());

for i in 0..(MAX_ACTIVE_NORMAL_PLUGINS - 1) {
for i in 0..(MAX_ACTIVE_FULL_PLUGINS - 1) {
let plugin = format!("{}.esp", i);
copy_to_test_dir("Blank - Override.esp", &plugin, &load_order.game_settings());
load_and_insert(&mut load_order, &plugin);
Expand Down Expand Up @@ -723,7 +723,7 @@ mod tests {
"Blank - Override.esp".to_string(),
];

for i in 0..(MAX_ACTIVE_NORMAL_PLUGINS - 1) {
for i in 0..(MAX_ACTIVE_FULL_PLUGINS - 1) {
let plugin = format!("{}.esp", i);
copy_to_test_dir("Blank.esp", &plugin, &load_order.game_settings());
load_and_insert(&mut load_order, &plugin);
Expand Down

0 comments on commit e3690ff

Please sign in to comment.