forked from Laupetin/OpenAssetTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Laupetin#71 from diamante0018/main
feat: add warning for dupe localize assets
- Loading branch information
Showing
28 changed files
with
102 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "LocalizeReadingZoneState.h" | ||
|
||
bool LocalizeReadingZoneState::DoLocalizeEntryDuplicateCheck(const std::string& key) | ||
{ | ||
const auto existingEntry = m_keys.find(key); | ||
if (existingEntry != m_keys.end()) | ||
return false; | ||
|
||
m_keys.emplace(key); | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "AssetLoading/IZoneAssetLoaderState.h" | ||
|
||
#include <string> | ||
#include <unordered_set> | ||
|
||
class LocalizeReadingZoneState final : public IZoneAssetLoaderState | ||
{ | ||
public: | ||
/** | ||
* Checks whether a localize key was already added. | ||
* Inserts key if it was not added yet. | ||
* | ||
* \param key The key to check | ||
* \returns \c true if key was not duplicated yet, \c false otherwise | ||
*/ | ||
bool DoLocalizeEntryDuplicateCheck(const std::string& key); | ||
|
||
private: | ||
std::unordered_set<std::string> m_keys; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...ng/LocalizeFile/LocalizeFileParserState.h → ...ocalize/Parsing/LocalizeFileParserState.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
#pragma once | ||
|
||
#include "Game/GameLanguage.h" | ||
#include "Localize/LocalizeFile.h" | ||
#include "Localize/LocalizeReadingZoneState.h" | ||
|
||
#include <map> | ||
#include <unordered_set> | ||
#include <vector> | ||
|
||
class LocalizeFileParserState | ||
{ | ||
public: | ||
bool m_end; | ||
|
||
std::vector<LocalizeFileEntry> m_entries; | ||
std::map<std::string, std::string> m_entries; | ||
|
||
GameLanguage m_language; | ||
LocalizeReadingZoneState* m_zone_state; | ||
std::string m_language_name_caps; | ||
|
||
std::string m_current_reference; | ||
std::unordered_set<std::string> m_current_reference_languages; | ||
|
||
explicit LocalizeFileParserState(GameLanguage language); | ||
LocalizeFileParserState(GameLanguage language, LocalizeReadingZoneState* zoneState); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ile/Sequence/SequenceLocalizeFileConfig.h → ...ing/Sequence/SequenceLocalizeFileConfig.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...e/SequenceLocalizeFileConsumeEmptyLines.h → ...e/SequenceLocalizeFileConsumeEmptyLines.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../Sequence/SequenceLocalizeFileEndMarker.h → .../Sequence/SequenceLocalizeFileEndMarker.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...uence/SequenceLocalizeFileLanguageValue.h → ...uence/SequenceLocalizeFileLanguageValue.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...File/Sequence/SequenceLocalizeFileNotes.h → ...sing/Sequence/SequenceLocalizeFileNotes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../Sequence/SequenceLocalizeFileReference.h → .../Sequence/SequenceLocalizeFileReference.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...le/Sequence/SequenceLocalizeFileVersion.h → ...ng/Sequence/SequenceLocalizeFileVersion.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters