update import function using get TranslationsByKey (#6427)
This commit is contained in:
@@ -14944,25 +14944,28 @@
|
||||
});
|
||||
});
|
||||
|
||||
// NPC-Import button
|
||||
// NPC-Import button// NPC-Import button
|
||||
on("clicked:importnpc", function () {
|
||||
getAttrs(["npc_import"], function (values) {
|
||||
|
||||
console.log("Import Triggert");
|
||||
var endtoken = 'ENDTOKEN';
|
||||
var input = values.npc_import + endtoken;
|
||||
// strip :
|
||||
var input = values.npc_import.replace(/:/g, '') + endtoken;
|
||||
//Keywords to look for
|
||||
var keywords = ["Größe:", "Gewicht:", "MU", "KL", "IN", "CH", "FF", "GE", "KO", "KK", "LeP", "AsP", "KaP", "INI", "VW", "SK", "ZK", "GS", "RS/BE:", "Aktionen:", "Sonderfertigkeiten:", "Talente:", "Zauber:", "Größenkategorie:", "Typus:", "Anrufungsschwierigkeit:", "Beute:", "Kampfverhalten:", "Flucht:", "Jagd:", "Schmerz +1 bei:", "Sonderregeln:", "Anzahl:", "ENDTOKEN"];
|
||||
var keywords = ["groesse", "gewicht", "MU", "KL", "IN", "CH", "FF", "GE", "KO", "KK", "lep", "asp", "kap", "INI", "VW", "sk", "zk", "gs", "RS/BE", "aktionen", "sonderfertigkeiten", "talente", "zauber", "gkategorie", "typus", "anrufungsschwierigkeit", "beute", "kampfverhalten", "flucht", "jagd", "schmerzplus1", "sonderregeln", "anzahl", "ENDTOKEN"];
|
||||
//array for the results
|
||||
var multi = [];
|
||||
|
||||
|
||||
keywords.forEach(function (key, index, keywords) {
|
||||
var translatedKey = getTranslationByKey(key);
|
||||
var newArray = [];
|
||||
newArray[0] = key; //add keyword
|
||||
newArray[0] = translatedKey; //add keyword
|
||||
newArray[1] = index; //add keyword index
|
||||
newArray[2] = input.search(key); //add position in text
|
||||
newArray[2] = input.search(translatedKey); //add position in text
|
||||
newArray[3] = ''; //result value
|
||||
multi[index] = newArray;
|
||||
console.log(key + " "+ translatedKey);
|
||||
//console.log(multi[index][0]+" inloop "+multi[index][1]);
|
||||
});
|
||||
|
||||
@@ -15059,5 +15062,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@@ -702,6 +702,16 @@
|
||||
"ruestung_preset_6":"BE 3",
|
||||
"ruestung_mod":"Zusätzliche Modifikatoren: ",
|
||||
"npc-import":"NPC-Stats-Block importieren: (Achtung: Beta-Status!)",
|
||||
"import":"Starte Import"
|
||||
"import":"Starte Import",
|
||||
"lep":"LeP",
|
||||
"asp":"AsP",
|
||||
"kap":"KaP",
|
||||
"INI":"INI",
|
||||
"VW":"VW",
|
||||
"RS/BE":"RS/BE",
|
||||
"aktionen":"Aktionen",
|
||||
"anrufungsschwierigkeit":"Anrufungsschwierigkeit",
|
||||
"schmerzplus1":"Schmerz +1 bei",
|
||||
"ENDTOKEN":"ENDTOKEN"
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user