mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Replace names used for game types
Use the game names rather than their acronyms (aside from suffixes, which are widely used). This also changes the CXX wrapper to use PascalCase for the game types it exposes for consistency. The outer C++ wrapper is unchanged.
This commit is contained in:
+22
-22
@@ -7,27 +7,27 @@
|
||||
namespace {
|
||||
loot::GameType convert(loot::rust::GameType gameType) {
|
||||
switch (gameType) {
|
||||
case loot::rust::GameType::tes3:
|
||||
case loot::rust::GameType::Morrowind:
|
||||
return loot::GameType::tes3;
|
||||
case loot::rust::GameType::tes4:
|
||||
case loot::rust::GameType::Oblivion:
|
||||
return loot::GameType::tes4;
|
||||
case loot::rust::GameType::tes5:
|
||||
case loot::rust::GameType::Skyrim:
|
||||
return loot::GameType::tes5;
|
||||
case loot::rust::GameType::tes5se:
|
||||
case loot::rust::GameType::SkyrimSE:
|
||||
return loot::GameType::tes5se;
|
||||
case loot::rust::GameType::tes5vr:
|
||||
case loot::rust::GameType::SkyrimVR:
|
||||
return loot::GameType::tes5vr;
|
||||
case loot::rust::GameType::fo3:
|
||||
case loot::rust::GameType::Fallout3:
|
||||
return loot::GameType::fo3;
|
||||
case loot::rust::GameType::fonv:
|
||||
case loot::rust::GameType::FalloutNV:
|
||||
return loot::GameType::fonv;
|
||||
case loot::rust::GameType::fo4:
|
||||
case loot::rust::GameType::Fallout4:
|
||||
return loot::GameType::fo4;
|
||||
case loot::rust::GameType::fo4vr:
|
||||
case loot::rust::GameType::Fallout4VR:
|
||||
return loot::GameType::fo4vr;
|
||||
case loot::rust::GameType::starfield:
|
||||
case loot::rust::GameType::Starfield:
|
||||
return loot::GameType::starfield;
|
||||
case loot::rust::GameType::openmw:
|
||||
case loot::rust::GameType::OpenMW:
|
||||
return loot::GameType::openmw;
|
||||
default:
|
||||
throw std::logic_error("Unsupported GameType value");
|
||||
@@ -37,27 +37,27 @@ loot::GameType convert(loot::rust::GameType gameType) {
|
||||
loot::rust::GameType convert(loot::GameType gameType) {
|
||||
switch (gameType) {
|
||||
case loot::GameType::tes3:
|
||||
return loot::rust::GameType::tes3;
|
||||
return loot::rust::GameType::Morrowind;
|
||||
case loot::GameType::tes4:
|
||||
return loot::rust::GameType::tes4;
|
||||
return loot::rust::GameType::Oblivion;
|
||||
case loot::GameType::tes5:
|
||||
return loot::rust::GameType::tes5;
|
||||
return loot::rust::GameType::Skyrim;
|
||||
case loot::GameType::tes5se:
|
||||
return loot::rust::GameType::tes5se;
|
||||
return loot::rust::GameType::SkyrimSE;
|
||||
case loot::GameType::tes5vr:
|
||||
return loot::rust::GameType::tes5vr;
|
||||
return loot::rust::GameType::SkyrimVR;
|
||||
case loot::GameType::fo3:
|
||||
return loot::rust::GameType::fo3;
|
||||
return loot::rust::GameType::Fallout3;
|
||||
case loot::GameType::fonv:
|
||||
return loot::rust::GameType::fonv;
|
||||
return loot::rust::GameType::FalloutNV;
|
||||
case loot::GameType::fo4:
|
||||
return loot::rust::GameType::fo4;
|
||||
return loot::rust::GameType::Fallout4;
|
||||
case loot::GameType::fo4vr:
|
||||
return loot::rust::GameType::fo4vr;
|
||||
return loot::rust::GameType::Fallout4VR;
|
||||
case loot::GameType::starfield:
|
||||
return loot::rust::GameType::starfield;
|
||||
return loot::rust::GameType::Starfield;
|
||||
case loot::GameType::openmw:
|
||||
return loot::rust::GameType::openmw;
|
||||
return loot::rust::GameType::OpenMW;
|
||||
default:
|
||||
throw std::logic_error("Unsupported GameType value");
|
||||
}
|
||||
|
||||
+22
-22
@@ -10,17 +10,17 @@ impl TryFrom<libloot::GameType> for GameType {
|
||||
|
||||
fn try_from(value: libloot::GameType) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
libloot::GameType::TES4 => Ok(GameType::tes4),
|
||||
libloot::GameType::TES5 => Ok(GameType::tes5),
|
||||
libloot::GameType::FO3 => Ok(GameType::fo3),
|
||||
libloot::GameType::FONV => Ok(GameType::fonv),
|
||||
libloot::GameType::FO4 => Ok(GameType::fo4),
|
||||
libloot::GameType::TES5SE => Ok(GameType::tes5se),
|
||||
libloot::GameType::FO4VR => Ok(GameType::fo4vr),
|
||||
libloot::GameType::TES5VR => Ok(GameType::tes5vr),
|
||||
libloot::GameType::TES3 => Ok(GameType::tes3),
|
||||
libloot::GameType::Starfield => Ok(GameType::starfield),
|
||||
libloot::GameType::OpenMW => Ok(GameType::openmw),
|
||||
libloot::GameType::Oblivion => Ok(GameType::Oblivion),
|
||||
libloot::GameType::Skyrim => Ok(GameType::Skyrim),
|
||||
libloot::GameType::Fallout3 => Ok(GameType::Fallout3),
|
||||
libloot::GameType::FalloutNV => Ok(GameType::FalloutNV),
|
||||
libloot::GameType::Fallout4 => Ok(GameType::Fallout4),
|
||||
libloot::GameType::SkyrimSE => Ok(GameType::SkyrimSE),
|
||||
libloot::GameType::Fallout4VR => Ok(GameType::Fallout4VR),
|
||||
libloot::GameType::SkyrimVR => Ok(GameType::SkyrimVR),
|
||||
libloot::GameType::Morrowind => Ok(GameType::Morrowind),
|
||||
libloot::GameType::Starfield => Ok(GameType::Starfield),
|
||||
libloot::GameType::OpenMW => Ok(GameType::OpenMW),
|
||||
_ => Err(UnsupportedEnumValueError),
|
||||
}
|
||||
}
|
||||
@@ -31,17 +31,17 @@ impl TryFrom<GameType> for libloot::GameType {
|
||||
|
||||
fn try_from(value: GameType) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
GameType::tes4 => Ok(libloot::GameType::TES4),
|
||||
GameType::tes5 => Ok(libloot::GameType::TES5),
|
||||
GameType::fo3 => Ok(libloot::GameType::FO3),
|
||||
GameType::fonv => Ok(libloot::GameType::FONV),
|
||||
GameType::fo4 => Ok(libloot::GameType::FO4),
|
||||
GameType::tes5se => Ok(libloot::GameType::TES5SE),
|
||||
GameType::fo4vr => Ok(libloot::GameType::FO4VR),
|
||||
GameType::tes5vr => Ok(libloot::GameType::TES5VR),
|
||||
GameType::tes3 => Ok(libloot::GameType::TES3),
|
||||
GameType::starfield => Ok(libloot::GameType::Starfield),
|
||||
GameType::openmw => Ok(libloot::GameType::OpenMW),
|
||||
GameType::Oblivion => Ok(libloot::GameType::Oblivion),
|
||||
GameType::Skyrim => Ok(libloot::GameType::Skyrim),
|
||||
GameType::Fallout3 => Ok(libloot::GameType::Fallout3),
|
||||
GameType::FalloutNV => Ok(libloot::GameType::FalloutNV),
|
||||
GameType::Fallout4 => Ok(libloot::GameType::Fallout4),
|
||||
GameType::SkyrimSE => Ok(libloot::GameType::SkyrimSE),
|
||||
GameType::Fallout4VR => Ok(libloot::GameType::Fallout4VR),
|
||||
GameType::SkyrimVR => Ok(libloot::GameType::SkyrimVR),
|
||||
GameType::Morrowind => Ok(libloot::GameType::Morrowind),
|
||||
GameType::Starfield => Ok(libloot::GameType::Starfield),
|
||||
GameType::OpenMW => Ok(libloot::GameType::OpenMW),
|
||||
_ => Err(UnsupportedEnumValueError),
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -210,17 +210,17 @@ impl TryFrom<ffi::LogLevel> for libloot::LogLevel {
|
||||
mod ffi {
|
||||
|
||||
pub enum GameType {
|
||||
tes4,
|
||||
tes5,
|
||||
fo3,
|
||||
fonv,
|
||||
fo4,
|
||||
tes5se,
|
||||
fo4vr,
|
||||
tes5vr,
|
||||
tes3,
|
||||
starfield,
|
||||
openmw,
|
||||
Oblivion,
|
||||
Skyrim,
|
||||
Fallout3,
|
||||
FalloutNV,
|
||||
Fallout4,
|
||||
SkyrimSE,
|
||||
Fallout4VR,
|
||||
SkyrimVR,
|
||||
Morrowind,
|
||||
Starfield,
|
||||
OpenMW,
|
||||
}
|
||||
|
||||
pub enum MessageType {
|
||||
|
||||
@@ -39,7 +39,7 @@ TEST(libloot_revision, shouldReturnExpectedValue) {
|
||||
}
|
||||
|
||||
TEST(new_game, shouldThrowIfGivenNonsense) {
|
||||
EXPECT_THROW(new_game(GameType::fo3, "foo"), ::rust::Error);
|
||||
EXPECT_THROW(new_game(GameType::Fallout3, "foo"), ::rust::Error);
|
||||
}
|
||||
|
||||
TEST(Message, creation) {
|
||||
|
||||
+18
-18
@@ -26,15 +26,15 @@ impl TryFrom<libloot::GameType> for GameType {
|
||||
|
||||
fn try_from(value: libloot::GameType) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
libloot::GameType::TES4 => Ok(GameType::Oblivion),
|
||||
libloot::GameType::TES5 => Ok(GameType::Skyrim),
|
||||
libloot::GameType::FO3 => Ok(GameType::Fallout3),
|
||||
libloot::GameType::FONV => Ok(GameType::FalloutNV),
|
||||
libloot::GameType::FO4 => Ok(GameType::Fallout4),
|
||||
libloot::GameType::TES5SE => Ok(GameType::SkyrimSE),
|
||||
libloot::GameType::FO4VR => Ok(GameType::Fallout4VR),
|
||||
libloot::GameType::TES5VR => Ok(GameType::SkyrimVR),
|
||||
libloot::GameType::TES3 => Ok(GameType::Morrowind),
|
||||
libloot::GameType::Oblivion => Ok(GameType::Oblivion),
|
||||
libloot::GameType::Skyrim => Ok(GameType::Skyrim),
|
||||
libloot::GameType::Fallout3 => Ok(GameType::Fallout3),
|
||||
libloot::GameType::FalloutNV => Ok(GameType::FalloutNV),
|
||||
libloot::GameType::Fallout4 => Ok(GameType::Fallout4),
|
||||
libloot::GameType::SkyrimSE => Ok(GameType::SkyrimSE),
|
||||
libloot::GameType::Fallout4VR => Ok(GameType::Fallout4VR),
|
||||
libloot::GameType::SkyrimVR => Ok(GameType::SkyrimVR),
|
||||
libloot::GameType::Morrowind => Ok(GameType::Morrowind),
|
||||
libloot::GameType::Starfield => Ok(GameType::Starfield),
|
||||
libloot::GameType::OpenMW => Ok(GameType::OpenMW),
|
||||
_ => Err(UnsupportedEnumValueError),
|
||||
@@ -45,15 +45,15 @@ impl TryFrom<libloot::GameType> for GameType {
|
||||
impl From<GameType> for libloot::GameType {
|
||||
fn from(value: GameType) -> Self {
|
||||
match value {
|
||||
GameType::Oblivion => libloot::GameType::TES4,
|
||||
GameType::Skyrim => libloot::GameType::TES5,
|
||||
GameType::Fallout3 => libloot::GameType::FO3,
|
||||
GameType::FalloutNV => libloot::GameType::FONV,
|
||||
GameType::Fallout4 => libloot::GameType::FO4,
|
||||
GameType::SkyrimSE => libloot::GameType::TES5SE,
|
||||
GameType::Fallout4VR => libloot::GameType::FO4VR,
|
||||
GameType::SkyrimVR => libloot::GameType::TES5VR,
|
||||
GameType::Morrowind => libloot::GameType::TES3,
|
||||
GameType::Oblivion => libloot::GameType::Oblivion,
|
||||
GameType::Skyrim => libloot::GameType::Skyrim,
|
||||
GameType::Fallout3 => libloot::GameType::Fallout3,
|
||||
GameType::FalloutNV => libloot::GameType::FalloutNV,
|
||||
GameType::Fallout4 => libloot::GameType::Fallout4,
|
||||
GameType::SkyrimSE => libloot::GameType::SkyrimSE,
|
||||
GameType::Fallout4VR => libloot::GameType::Fallout4VR,
|
||||
GameType::SkyrimVR => libloot::GameType::SkyrimVR,
|
||||
GameType::Morrowind => libloot::GameType::Morrowind,
|
||||
GameType::Starfield => libloot::GameType::Starfield,
|
||||
GameType::OpenMW => libloot::GameType::OpenMW,
|
||||
}
|
||||
|
||||
+18
-18
@@ -26,15 +26,15 @@ impl TryFrom<libloot::GameType> for GameType {
|
||||
|
||||
fn try_from(value: libloot::GameType) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
libloot::GameType::TES4 => Ok(GameType::Oblivion),
|
||||
libloot::GameType::TES5 => Ok(GameType::Skyrim),
|
||||
libloot::GameType::FO3 => Ok(GameType::Fallout3),
|
||||
libloot::GameType::FONV => Ok(GameType::FalloutNV),
|
||||
libloot::GameType::FO4 => Ok(GameType::Fallout4),
|
||||
libloot::GameType::TES5SE => Ok(GameType::SkyrimSE),
|
||||
libloot::GameType::FO4VR => Ok(GameType::Fallout4VR),
|
||||
libloot::GameType::TES5VR => Ok(GameType::SkyrimVR),
|
||||
libloot::GameType::TES3 => Ok(GameType::Morrowind),
|
||||
libloot::GameType::Oblivion => Ok(GameType::Oblivion),
|
||||
libloot::GameType::Skyrim => Ok(GameType::Skyrim),
|
||||
libloot::GameType::Fallout3 => Ok(GameType::Fallout3),
|
||||
libloot::GameType::FalloutNV => Ok(GameType::FalloutNV),
|
||||
libloot::GameType::Fallout4 => Ok(GameType::Fallout4),
|
||||
libloot::GameType::SkyrimSE => Ok(GameType::SkyrimSE),
|
||||
libloot::GameType::Fallout4VR => Ok(GameType::Fallout4VR),
|
||||
libloot::GameType::SkyrimVR => Ok(GameType::SkyrimVR),
|
||||
libloot::GameType::Morrowind => Ok(GameType::Morrowind),
|
||||
libloot::GameType::Starfield => Ok(GameType::Starfield),
|
||||
libloot::GameType::OpenMW => Ok(GameType::OpenMW),
|
||||
_ => Err(UnsupportedEnumValueError),
|
||||
@@ -47,15 +47,15 @@ impl TryFrom<GameType> for libloot::GameType {
|
||||
|
||||
fn try_from(value: GameType) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
GameType::Oblivion => Ok(libloot::GameType::TES4),
|
||||
GameType::Skyrim => Ok(libloot::GameType::TES5),
|
||||
GameType::Fallout3 => Ok(libloot::GameType::FO3),
|
||||
GameType::FalloutNV => Ok(libloot::GameType::FONV),
|
||||
GameType::Fallout4 => Ok(libloot::GameType::FO4),
|
||||
GameType::SkyrimSE => Ok(libloot::GameType::TES5SE),
|
||||
GameType::Fallout4VR => Ok(libloot::GameType::FO4VR),
|
||||
GameType::SkyrimVR => Ok(libloot::GameType::TES5VR),
|
||||
GameType::Morrowind => Ok(libloot::GameType::TES3),
|
||||
GameType::Oblivion => Ok(libloot::GameType::Oblivion),
|
||||
GameType::Skyrim => Ok(libloot::GameType::Skyrim),
|
||||
GameType::Fallout3 => Ok(libloot::GameType::Fallout3),
|
||||
GameType::FalloutNV => Ok(libloot::GameType::FalloutNV),
|
||||
GameType::Fallout4 => Ok(libloot::GameType::Fallout4),
|
||||
GameType::SkyrimSE => Ok(libloot::GameType::SkyrimSE),
|
||||
GameType::Fallout4VR => Ok(libloot::GameType::Fallout4VR),
|
||||
GameType::SkyrimVR => Ok(libloot::GameType::SkyrimVR),
|
||||
GameType::Morrowind => Ok(libloot::GameType::Morrowind),
|
||||
GameType::Starfield => Ok(libloot::GameType::Starfield),
|
||||
GameType::OpenMW => Ok(libloot::GameType::OpenMW),
|
||||
}
|
||||
|
||||
+19
-12
@@ -13,21 +13,21 @@ pub fn find_associated_archives(
|
||||
plugin_path: &Path,
|
||||
) -> Vec<PathBuf> {
|
||||
match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => Vec::new(),
|
||||
GameType::Morrowind | GameType::OpenMW => Vec::new(),
|
||||
|
||||
// Skyrim (non-SE) plugins can only load BSAs that have exactly the same
|
||||
// basename, ignoring file extensions.
|
||||
GameType::TES5 => find_associated_archive(plugin_path),
|
||||
GameType::Skyrim => find_associated_archive(plugin_path),
|
||||
|
||||
// Skyrim SE can load BSAs that have exactly the same basename, ignoring
|
||||
// file extensions, and also BSAs with filenames of the form "<basename>
|
||||
// - Textures.bsa" (case-insensitively). This assumes that Skyrim VR
|
||||
// works the same way as Skyrim SE.
|
||||
GameType::TES5SE | GameType::TES5VR => find_associated_archives_with_suffixes(plugin_path, BSA_FILE_EXTENSION, &["", " - Textures"]),
|
||||
GameType::SkyrimSE | GameType::SkyrimVR => find_associated_archives_with_suffixes(plugin_path, BSA_FILE_EXTENSION, &["", " - Textures"]),
|
||||
|
||||
// Oblivion .esp files can load archives which begin with the plugin
|
||||
// basename.
|
||||
GameType::TES4 => {
|
||||
GameType::Oblivion => {
|
||||
if has_ascii_extension(plugin_path, "esp") {
|
||||
find_associated_archives_with_arbitrary_suffixes(plugin_path, game_cache)
|
||||
} else {
|
||||
@@ -37,7 +37,7 @@ pub fn find_associated_archives(
|
||||
|
||||
// FO3, FNV, FO4 plugins can load archives which begin with the plugin
|
||||
// basename. This assumes that FO4 VR works the same way as FO4.
|
||||
GameType::FO3 | GameType::FONV | GameType::FO4 | GameType::FO4VR =>
|
||||
GameType::Fallout3 | GameType::FalloutNV | GameType::Fallout4 | GameType::Fallout4VR =>
|
||||
find_associated_archives_with_arbitrary_suffixes(plugin_path, game_cache)
|
||||
,
|
||||
|
||||
@@ -228,8 +228,8 @@ mod tests {
|
||||
let data_path = tmp_dir.path().to_path_buf();
|
||||
|
||||
match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => {}
|
||||
GameType::FO4 | GameType::FO4VR | GameType::Starfield => {
|
||||
GameType::Morrowind | GameType::OpenMW => {}
|
||||
GameType::Fallout4 | GameType::Fallout4VR | GameType::Starfield => {
|
||||
let source = absolute("./testing-plugins/Fallout 4/Data").unwrap();
|
||||
copy_file(&source, &data_path, "Blank - Main.ba2");
|
||||
copy_file(&source, &data_path, "Blank - Textures.ba2");
|
||||
@@ -308,7 +308,7 @@ mod tests {
|
||||
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::TES3 | GameType::OpenMW | GameType::TES4
|
||||
GameType::Morrowind | GameType::OpenMW | GameType::Oblivion
|
||||
) {
|
||||
assert!(archives.is_empty());
|
||||
} else {
|
||||
@@ -330,7 +330,7 @@ mod tests {
|
||||
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::TES3 | GameType::OpenMW | GameType::Starfield
|
||||
GameType::Morrowind | GameType::OpenMW | GameType::Starfield
|
||||
) {
|
||||
assert!(archives.is_empty());
|
||||
} else {
|
||||
@@ -350,7 +350,7 @@ mod tests {
|
||||
&fixture.data_path.join(BLANK_ESP),
|
||||
);
|
||||
|
||||
if matches!(game_type, GameType::TES3 | GameType::OpenMW) {
|
||||
if matches!(game_type, GameType::Morrowind | GameType::OpenMW) {
|
||||
assert!(archives.is_empty());
|
||||
} else {
|
||||
assert!(!archives.is_empty());
|
||||
@@ -371,7 +371,10 @@ mod tests {
|
||||
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::FO3 | GameType::FONV | GameType::FO4 | GameType::FO4VR
|
||||
GameType::Fallout3
|
||||
| GameType::FalloutNV
|
||||
| GameType::Fallout4
|
||||
| GameType::Fallout4VR
|
||||
) {
|
||||
assert!(!archives.is_empty());
|
||||
} else {
|
||||
@@ -393,7 +396,11 @@ mod tests {
|
||||
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::TES4 | GameType::FO3 | GameType::FONV | GameType::FO4 | GameType::FO4VR
|
||||
GameType::Oblivion
|
||||
| GameType::Fallout3
|
||||
| GameType::FalloutNV
|
||||
| GameType::Fallout4
|
||||
| GameType::Fallout4VR
|
||||
) {
|
||||
assert!(!archives.is_empty());
|
||||
} else {
|
||||
|
||||
@@ -157,7 +157,7 @@ mod tests {
|
||||
|
||||
let state = loot_condition_interpreter::State::new(
|
||||
loot_condition_interpreter::GameType::Oblivion,
|
||||
source_plugins_path(crate::GameType::TES4),
|
||||
source_plugins_path(crate::GameType::Oblivion),
|
||||
);
|
||||
let result = evaluate_all_conditions(plugin, &state).unwrap().unwrap();
|
||||
|
||||
@@ -183,7 +183,7 @@ mod tests {
|
||||
|
||||
let state = loot_condition_interpreter::State::new(
|
||||
loot_condition_interpreter::GameType::Oblivion,
|
||||
source_plugins_path(crate::GameType::TES4),
|
||||
source_plugins_path(crate::GameType::Oblivion),
|
||||
);
|
||||
assert!(evaluate_all_conditions(plugin, &state).unwrap().is_none());
|
||||
}
|
||||
|
||||
+41
-41
@@ -456,7 +456,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn load_masterlist_should_succeed_if_given_a_valid_path() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -466,7 +466,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn load_masterlist_with_prelude_should_succeed_if_given_valid_paths() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database
|
||||
@@ -478,7 +478,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn load_userlist_should_succeed_if_given_a_valid_path() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_userlist(&fixture.metadata_path).unwrap();
|
||||
@@ -499,7 +499,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_write_only_user_metadata() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -518,7 +518,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_succeed_if_the_path_does_not_exist() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("userlist.yaml");
|
||||
|
||||
@@ -531,7 +531,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_succeed_if_the_path_does_not_exist_and_truncation_is_allowed() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("userlist.yaml");
|
||||
|
||||
@@ -544,7 +544,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_succeed_if_the_path_exists_and_truncation_is_allowed() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("userlist.yaml");
|
||||
|
||||
@@ -559,7 +559,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_error_if_the_parent_path_does_not_exist() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("missing/userlist.yaml");
|
||||
|
||||
@@ -572,7 +572,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_error_if_the_path_is_read_only() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("userlist.yaml");
|
||||
|
||||
@@ -591,7 +591,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_error_if_the_path_exists_and_truncation_is_not_allowed() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("userlist.yaml");
|
||||
|
||||
@@ -610,7 +610,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_only_write_plugin_bash_tags_and_dirty_info() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("minimal.yaml");
|
||||
|
||||
@@ -656,7 +656,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_succeed_if_the_path_does_not_exist() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("minimal.yaml");
|
||||
|
||||
@@ -669,7 +669,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_succeed_if_the_path_does_not_exist_and_truncation_is_allowed() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("minimal.yaml");
|
||||
|
||||
@@ -682,7 +682,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_succeed_if_the_path_exists_and_truncation_is_allowed() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("minimal.yaml");
|
||||
|
||||
@@ -697,7 +697,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_error_if_the_parent_path_does_not_exist() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("missing/minimal.yaml");
|
||||
|
||||
@@ -710,7 +710,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_error_if_the_path_is_read_only() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("minimal.yaml");
|
||||
|
||||
@@ -729,7 +729,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_error_if_the_path_exists_and_truncation_is_not_allowed() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
let output_path = fixture.inner.local_path.join("minimal.yaml");
|
||||
|
||||
@@ -745,7 +745,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn known_bash_tags_should_append_userlist_tags_to_masterlist_tags() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -766,7 +766,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_append_userlist_messages_to_masterlist_messages() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -792,7 +792,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_filter_out_messages_with_false_conditions_when_evaluating_conditions() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -818,7 +818,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_true_if_the_condition_is_true() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
|
||||
assert!(database.evaluate("file(\"Blank.esp\")").unwrap());
|
||||
@@ -826,7 +826,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_false_if_the_condition_is_false() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
|
||||
assert!(!database.evaluate("file(\"missing.esp\")").unwrap());
|
||||
@@ -838,7 +838,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_default_group_before_metadata_has_been_loaded() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
|
||||
assert_eq!(&[Group::default(),], database.groups(true).as_slice());
|
||||
@@ -846,7 +846,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_not_include_user_groups_if_param_is_false() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -872,7 +872,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_merge_masterlist_and_userlist_groups() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -901,7 +901,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn user_groups_should_not_include_masterlist_groups() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -911,7 +911,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn set_user_groups_should_replace_existing_user_groups() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -944,7 +944,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn groups_path_should_find_path_using_masterlist_and_user_metadata() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -970,7 +970,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_none_if_plugin_has_no_metadata_set() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
|
||||
assert!(
|
||||
@@ -983,7 +983,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_none_if_plugin_metadata_has_only_name() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.set_plugin_user_metadata(PluginMetadata::new(BLANK_ESM).unwrap());
|
||||
@@ -998,7 +998,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_prefer_user_metadata_when_merging_metadata() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1023,7 +1023,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_only_masterlist_metadata_if_include_user_metadata_is_false() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1045,7 +1045,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_filter_out_metadata_with_false_conditions_when_evaluating_conditions() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1074,7 +1074,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_none_if_plugin_has_no_user_metadata_set() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let database = fixture.database();
|
||||
|
||||
assert!(
|
||||
@@ -1087,7 +1087,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_none_if_plugin_user_metadata_has_only_name() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.set_plugin_user_metadata(PluginMetadata::new(BLANK_ESM).unwrap());
|
||||
@@ -1102,7 +1102,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_return_only_user_metadata() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1124,7 +1124,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_filter_out_metadata_with_false_conditions_when_evaluating_conditions() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1151,7 +1151,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_replace_existing_user_metadata_for_the_plugin() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1177,7 +1177,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn should_not_modify_masterlist_metadata_for_the_plugin() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1203,7 +1203,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn discard_plugin_user_metadata_should_discard_only_user_metadata_for_only_the_given_plugin() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
@@ -1242,7 +1242,7 @@ plugins:
|
||||
|
||||
#[test]
|
||||
fn discard_all_user_metadata_should_not_remove_masterlist_metadata() {
|
||||
let fixture = Fixture::new(GameType::TES4);
|
||||
let fixture = Fixture::new(GameType::Oblivion);
|
||||
let mut database = fixture.database();
|
||||
|
||||
database.load_masterlist(&fixture.metadata_path).unwrap();
|
||||
|
||||
+96
-96
File diff suppressed because it is too large
Load Diff
+26
-26
@@ -331,10 +331,10 @@ fn has_plugin_file_extension(game_type: GameType, plugin_path: &Path) -> bool {
|
||||
} else {
|
||||
matches!(
|
||||
game_type,
|
||||
GameType::FO4
|
||||
| GameType::FO4VR
|
||||
| GameType::TES5SE
|
||||
| GameType::TES5VR
|
||||
GameType::Fallout4
|
||||
| GameType::Fallout4VR
|
||||
| GameType::SkyrimSE
|
||||
| GameType::SkyrimVR
|
||||
| GameType::Starfield
|
||||
) && extension.eq_ignore_ascii_case("esl")
|
||||
}
|
||||
@@ -510,7 +510,7 @@ mod tests {
|
||||
#[test]
|
||||
fn new_should_handle_non_ascii_filenames_correctly() {
|
||||
let tmp_dir = tempdir().unwrap();
|
||||
let source_path = source_plugins_path(GameType::TES4).join(BLANK_ESM);
|
||||
let source_path = source_plugins_path(GameType::Oblivion).join(BLANK_ESM);
|
||||
let path = tmp_dir.path().join(NON_ASCII_ESM);
|
||||
|
||||
std::fs::copy(source_path, &path).unwrap();
|
||||
@@ -539,10 +539,10 @@ mod tests {
|
||||
|
||||
#[expect(clippy::float_cmp, reason = "float values should be exactly equal")]
|
||||
match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => {
|
||||
GameType::Morrowind | GameType::OpenMW => {
|
||||
assert_eq!(1.2, plugin.header_version().unwrap());
|
||||
}
|
||||
GameType::TES4 => assert_eq!(0.8, plugin.header_version().unwrap()),
|
||||
GameType::Oblivion => assert_eq!(0.8, plugin.header_version().unwrap()),
|
||||
GameType::Starfield => assert_eq!(0.96, plugin.header_version().unwrap()),
|
||||
_ => assert_eq!(0.94, plugin.header_version().unwrap()),
|
||||
}
|
||||
@@ -610,18 +610,18 @@ mod tests {
|
||||
|
||||
#[expect(clippy::float_cmp, reason = "float values should be exactly equal")]
|
||||
match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => {
|
||||
GameType::Morrowind | GameType::OpenMW => {
|
||||
assert_eq!(1.2, plugin.header_version().unwrap());
|
||||
}
|
||||
GameType::TES4 => assert_eq!(0.8, plugin.header_version().unwrap()),
|
||||
GameType::Oblivion => assert_eq!(0.8, plugin.header_version().unwrap()),
|
||||
GameType::Starfield => assert_eq!(0.96, plugin.header_version().unwrap()),
|
||||
_ => assert_eq!(0.94, plugin.header_version().unwrap()),
|
||||
}
|
||||
|
||||
let expected_crc = match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => 3_317_676_987,
|
||||
GameType::Morrowind | GameType::OpenMW => 3_317_676_987,
|
||||
GameType::Starfield => 1_422_425_298,
|
||||
GameType::TES4 => 3_759_349_588,
|
||||
GameType::Oblivion => 3_759_349_588,
|
||||
_ => 3_000_242_590,
|
||||
};
|
||||
|
||||
@@ -629,7 +629,7 @@ mod tests {
|
||||
assert!(!plugin.do_assets_overlap(&plugin));
|
||||
assert_eq!(0, plugin.asset_count());
|
||||
|
||||
if matches!(game_type, GameType::TES3 | GameType::OpenMW) {
|
||||
if matches!(game_type, GameType::Morrowind | GameType::OpenMW) {
|
||||
let master = Plugin::new(
|
||||
game_type,
|
||||
&GameCache::default(),
|
||||
@@ -678,7 +678,7 @@ mod tests {
|
||||
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::TES3 | GameType::OpenMW | GameType::Starfield
|
||||
GameType::Morrowind | GameType::OpenMW | GameType::Starfield
|
||||
) {
|
||||
// The Starfield test data doesn't include a BA2 file.
|
||||
assert!(!plugin.loads_archive());
|
||||
@@ -742,7 +742,7 @@ mod tests {
|
||||
|
||||
assert!(
|
||||
Plugin::new(
|
||||
GameType::TES4,
|
||||
GameType::Oblivion,
|
||||
&GameCache::default(),
|
||||
path,
|
||||
LoadScope::HeaderOnly
|
||||
@@ -802,10 +802,10 @@ mod tests {
|
||||
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::FO4
|
||||
| GameType::FO4VR
|
||||
| GameType::TES5SE
|
||||
| GameType::TES5VR
|
||||
GameType::Fallout4
|
||||
| GameType::Fallout4VR
|
||||
| GameType::SkyrimSE
|
||||
| GameType::SkyrimVR
|
||||
| GameType::Starfield
|
||||
) {
|
||||
assert!(light.is_light_plugin());
|
||||
@@ -948,10 +948,10 @@ mod tests {
|
||||
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::FO4
|
||||
| GameType::FO4VR
|
||||
| GameType::TES5SE
|
||||
| GameType::TES5VR
|
||||
GameType::Fallout4
|
||||
| GameType::Fallout4VR
|
||||
| GameType::SkyrimSE
|
||||
| GameType::SkyrimVR
|
||||
| GameType::Starfield
|
||||
) {
|
||||
assert!(result);
|
||||
@@ -1053,10 +1053,10 @@ mod tests {
|
||||
let result = has_plugin_file_extension(game_type, Path::new("file.esl"));
|
||||
if matches!(
|
||||
game_type,
|
||||
GameType::FO4
|
||||
| GameType::TES5SE
|
||||
| GameType::FO4VR
|
||||
| GameType::TES5VR
|
||||
GameType::Fallout4
|
||||
| GameType::SkyrimSE
|
||||
| GameType::Fallout4VR
|
||||
| GameType::SkyrimVR
|
||||
| GameType::Starfield
|
||||
) {
|
||||
assert!(result);
|
||||
|
||||
+29
-23
@@ -28,10 +28,12 @@ pub const NON_ASCII_ESM: &str = "non\u{00C1}scii.esm";
|
||||
|
||||
pub fn source_plugins_path(game_type: GameType) -> PathBuf {
|
||||
match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => absolute("./testing-plugins/Morrowind/Data Files"),
|
||||
GameType::TES4 => absolute("./testing-plugins/Oblivion/Data"),
|
||||
GameType::Morrowind | GameType::OpenMW => {
|
||||
absolute("./testing-plugins/Morrowind/Data Files")
|
||||
}
|
||||
GameType::Oblivion => absolute("./testing-plugins/Oblivion/Data"),
|
||||
GameType::Starfield => absolute("./testing-plugins/Starfield/Data"),
|
||||
GameType::FO3 | GameType::FONV | GameType::TES5 => {
|
||||
GameType::Fallout3 | GameType::FalloutNV | GameType::Skyrim => {
|
||||
absolute("./testing-plugins/Skyrim/Data")
|
||||
}
|
||||
_ => absolute("./testing-plugins/SkyrimSE/Data"),
|
||||
@@ -41,12 +43,12 @@ pub fn source_plugins_path(game_type: GameType) -> PathBuf {
|
||||
|
||||
fn master_file(game_type: GameType) -> &'static str {
|
||||
match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => "Morrowind.esm",
|
||||
GameType::TES4 => "Oblivion.esm",
|
||||
GameType::TES5 | GameType::TES5SE | GameType::TES5VR => "Skyrim.esm",
|
||||
GameType::FO3 => "Fallout3.esm",
|
||||
GameType::FONV => "FalloutNV.esm",
|
||||
GameType::FO4 | GameType::FO4VR => "Fallout4.esm",
|
||||
GameType::Morrowind | GameType::OpenMW => "Morrowind.esm",
|
||||
GameType::Oblivion => "Oblivion.esm",
|
||||
GameType::Skyrim | GameType::SkyrimSE | GameType::SkyrimVR => "Skyrim.esm",
|
||||
GameType::Fallout3 => "Fallout3.esm",
|
||||
GameType::FalloutNV => "FalloutNV.esm",
|
||||
GameType::Fallout4 | GameType::Fallout4VR => "Fallout4.esm",
|
||||
GameType::Starfield => "Starfield.esm",
|
||||
}
|
||||
}
|
||||
@@ -62,14 +64,18 @@ fn touch(file_path: &Path) {
|
||||
fn supports_light_plugins(game_type: GameType) -> bool {
|
||||
matches!(
|
||||
game_type,
|
||||
GameType::TES5SE | GameType::TES5VR | GameType::FO4 | GameType::FO4VR | GameType::Starfield
|
||||
GameType::SkyrimSE
|
||||
| GameType::SkyrimVR
|
||||
| GameType::Fallout4
|
||||
| GameType::Fallout4VR
|
||||
| GameType::Starfield
|
||||
)
|
||||
}
|
||||
|
||||
fn is_load_order_timestamp_based(game_type: GameType) -> bool {
|
||||
matches!(
|
||||
game_type,
|
||||
GameType::TES3 | GameType::TES4 | GameType::FO3 | GameType::FONV
|
||||
GameType::Morrowind | GameType::Oblivion | GameType::Fallout3 | GameType::FalloutNV
|
||||
)
|
||||
}
|
||||
|
||||
@@ -119,7 +125,7 @@ fn set_load_order(
|
||||
use std::io::Write;
|
||||
|
||||
match game_type {
|
||||
GameType::TES3 | GameType::OpenMW => {}
|
||||
GameType::Morrowind | GameType::OpenMW => {}
|
||||
_ => {
|
||||
let mut file = File::create(local_path.join("Plugins.txt")).unwrap();
|
||||
for (plugin, is_active) in load_order {
|
||||
@@ -149,7 +155,7 @@ fn set_load_order(
|
||||
|
||||
mod_time += Duration::from_secs(60);
|
||||
}
|
||||
} else if game_type == GameType::TES5 {
|
||||
} else if game_type == GameType::Skyrim {
|
||||
let mut file = File::create(local_path.join("loadorder.txt")).unwrap();
|
||||
for (plugin, _) in load_order {
|
||||
writeln!(file, "{plugin}").unwrap();
|
||||
@@ -160,7 +166,7 @@ fn set_load_order(
|
||||
fn data_path(game_type: GameType, game_path: &Path) -> PathBuf {
|
||||
match game_type {
|
||||
GameType::OpenMW => game_path.join("resources/vfs"),
|
||||
GameType::TES3 => game_path.join("Data Files"),
|
||||
GameType::Morrowind => game_path.join("Data Files"),
|
||||
_ => game_path.join("Data"),
|
||||
}
|
||||
}
|
||||
@@ -312,15 +318,15 @@ impl Fixture {
|
||||
#[rstest::rstest]
|
||||
pub fn all_game_types(
|
||||
#[values(
|
||||
GameType::TES4,
|
||||
GameType::TES5,
|
||||
GameType::FO3,
|
||||
GameType::FONV,
|
||||
GameType::FO4,
|
||||
GameType::TES5SE,
|
||||
GameType::FO4VR,
|
||||
GameType::TES5VR,
|
||||
GameType::TES3,
|
||||
GameType::Oblivion,
|
||||
GameType::Skyrim,
|
||||
GameType::Fallout3,
|
||||
GameType::FalloutNV,
|
||||
GameType::Fallout4,
|
||||
GameType::SkyrimSE,
|
||||
GameType::Fallout4VR,
|
||||
GameType::SkyrimVR,
|
||||
GameType::Morrowind,
|
||||
GameType::Starfield,
|
||||
GameType::OpenMW
|
||||
)]
|
||||
|
||||
Reference in New Issue
Block a user