ENH: Let TextPrefetchFile return the relevant text cache

This commit is contained in:
bananarama92 2025-02-19 15:35:13 +01:00
parent 42a2e6002d
commit 60b921bbf7
No known key found for this signature in database
GPG key ID: E83C7D3B5DA36248

View file

@ -69,11 +69,15 @@ function TextPrefetch(Module, TextGroup) {
/**
* Trigger the caching of a specific file into the text cache
* @param {string} file
* @returns {TextCache}
*/
function TextPrefetchFile(file) {
if (!TextAllScreenCache.has(file)) {
TextAllScreenCache.set(file, new TextCache(file));
let cache = TextAllScreenCache.get(file);
if (!cache) {
cache = new TextCache(file);
TextAllScreenCache.set(file, cache);
}
return cache;
}
const InterfaceStringsPath = "Screens/Interface.csv";