Rename "override plugin" to "update plugin"

To match the terminology used by Starfield's Creation Kit.
This commit is contained in:
Oliver Hamlet
2024-06-28 19:21:21 +01:00
parent 46c19a4a7a
commit f6d4cea461
5 changed files with 34 additions and 32 deletions
+7 -7
View File
@@ -106,10 +106,10 @@ public:
virtual bool IsMediumPlugin() const = 0;
/**
* Check if the plugin is an override plugin.
* @return True if plugin is an override plugin, false otherwise.
* Check if the plugin is an update plugin.
* @return True if plugin is an update plugin, false otherwise.
*/
virtual bool IsOverridePlugin() const = 0;
virtual bool IsUpdatePlugin() const = 0;
/**
* Check if the plugin is or would be valid as a light plugin.
@@ -126,11 +126,11 @@ public:
virtual bool IsValidAsMediumPlugin() const = 0;
/**
* Check if the plugin is or would be valid as an override plugin.
* @return True if the plugin is a valid override plugin or would be a valid
* override plugin, false otherwise.
* Check if the plugin is or would be valid as an update plugin.
* @return True if the plugin is a valid update plugin or would be a valid
* update plugin, false otherwise.
*/
virtual bool IsValidAsOverridePlugin() const = 0;
virtual bool IsValidAsUpdatePlugin() const = 0;
/**
* Check if the plugin contains any records other than its TES4 header.
+7 -7
View File
@@ -315,13 +315,13 @@ bool Plugin::IsMediumPlugin() const {
return isMediumPlugin;
}
bool Plugin::IsOverridePlugin() const {
bool isOverridePlugin = false;
bool Plugin::IsUpdatePlugin() const {
bool isUpdatePlugin = false;
const auto ret =
esp_plugin_is_update_plugin(esPlugin.get(), &isOverridePlugin);
HandleEspluginError("check if \"" + name_ + "\" is an override plugin", ret);
esp_plugin_is_update_plugin(esPlugin.get(), &isUpdatePlugin);
HandleEspluginError("check if \"" + name_ + "\" is an update plugin", ret);
return isOverridePlugin;
return isUpdatePlugin;
}
bool Plugin::IsValidAsLightPlugin() const {
@@ -344,12 +344,12 @@ bool Plugin::IsValidAsMediumPlugin() const {
return isValid;
}
bool Plugin::IsValidAsOverridePlugin() const {
bool Plugin::IsValidAsUpdatePlugin() const {
bool isValid = false;
const auto ret =
esp_plugin_is_valid_as_update_plugin(esPlugin.get(), &isValid);
HandleEspluginError(
"check if \"" + name_ + "\" is valid as an override plugin", ret);
"check if \"" + name_ + "\" is valid as an update plugin", ret);
return isValid;
}
+2 -2
View File
@@ -73,11 +73,11 @@ public:
bool IsLightPlugin() const override;
bool IsMediumPlugin() const override;
bool IsOverridePlugin() const override;
bool IsUpdatePlugin() const override;
bool IsValidAsLightPlugin() const override;
bool IsValidAsMediumPlugin() const override;
bool IsValidAsOverridePlugin() const override;
bool IsValidAsUpdatePlugin() const override;
bool IsEmpty() const override;
bool LoadsArchive() const override;
bool DoRecordsOverlap(const PluginInterface& plugin) const override;
+16 -14
View File
@@ -198,10 +198,10 @@ public:
bool IsMaster() const override { return false; }
bool IsLightPlugin() const override { return false; }
bool IsMediumPlugin() const override { return false; }
bool IsOverridePlugin() const override { return false; }
bool IsUpdatePlugin() const override { return false; }
bool IsValidAsLightPlugin() const override { return false; }
bool IsValidAsMediumPlugin() const override { return false; }
bool IsValidAsOverridePlugin() const override { return false; }
bool IsValidAsUpdatePlugin() const override { return false; }
bool IsEmpty() const override { return false; }
bool LoadsArchive() const override { return false; }
bool DoRecordsOverlap(const PluginInterface&) const override { return true; }
@@ -378,7 +378,7 @@ TEST_P(
}
TEST_P(PluginTest,
isOverridePluginShouldOnlyBeTrueForAStarfieldOverridePlugin) {
isUpdatePluginShouldOnlyBeTrueForAStarfieldUpdatePlugin) {
auto bytes = ReadFile(dataPath / blankMasterDependentEsp);
bytes[9] = 0x2;
WriteFile(dataPath / blankMasterDependentEsp, bytes);
@@ -390,8 +390,8 @@ TEST_P(PluginTest,
game_.DataPath() / blankMasterDependentEsp,
true);
EXPECT_FALSE(plugin1.IsOverridePlugin());
EXPECT_EQ(GetParam() == GameType::starfield, plugin2.IsOverridePlugin());
EXPECT_FALSE(plugin1.IsUpdatePlugin());
EXPECT_EQ(GetParam() == GameType::starfield, plugin2.IsUpdatePlugin());
}
TEST_P(PluginTest, loadingAPluginWithMastersShouldReadThemCorrectly) {
@@ -580,19 +580,21 @@ TEST_P(
TEST_P(
PluginTest,
IsValidAsOverridePluginShouldOnlyReturnTrueForAStarfieldPluginWithNoNewRecords) {
const auto sourcePluginName =
GetParam() == GameType::starfield ? blankFullEsm : blankEsp;
const auto overridePluginName = GetParam() == GameType::starfield
? blankMasterDependentEsp
: blankDifferentPluginDependentEsp;
IsValidAsUpdatePluginShouldOnlyReturnTrueForAStarfieldPluginWithNoNewRecords) {
const auto sourcePluginName = GetParam() == GameType::starfield
? blankFullEsm
: blankEsp;
const auto updatePluginName = GetParam() == GameType::starfield
? blankMasterDependentEsp
: blankDifferentPluginDependentEsp;
Plugin plugin1(game_.GetType(),
game_.GetCache(),
game_.DataPath() / sourcePluginName,
false);
Plugin plugin2(game_.GetType(),
game_.GetCache(),
game_.DataPath() / overridePluginName,
game_.DataPath() / updatePluginName,
false);
if (GetParam() == GameType::starfield) {
@@ -603,9 +605,9 @@ TEST_P(
plugin2.ResolveRecordIds(nullptr);
}
EXPECT_FALSE(plugin1.IsValidAsOverridePlugin());
EXPECT_FALSE(plugin1.IsValidAsUpdatePlugin());
EXPECT_EQ(GetParam() == GameType::starfield,
plugin2.IsValidAsOverridePlugin());
plugin2.IsValidAsUpdatePlugin());
}
TEST_P(PluginTest,
@@ -62,13 +62,13 @@ public:
bool IsMediumPlugin() const override { return false; }
bool IsOverridePlugin() const override { return false; }
bool IsUpdatePlugin() const override { return false; }
bool IsValidAsLightPlugin() const override { return false; }
bool IsValidAsMediumPlugin() const override { return false; }
bool IsValidAsOverridePlugin() const override { return false; }
bool IsValidAsUpdatePlugin() const override { return false; }
bool IsEmpty() const override { return false; }