@cabin-icarus/tooltip_generator 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/init.ts ADDED
@@ -0,0 +1,143 @@
1
+ import * as fs from 'fs';
2
+
3
+ function copyFiles() {
4
+ console.log("Copying initial files...");
5
+ const resourcePath = "node_modules/~resource";
6
+ let filePath = __dirname + "/tsconfig.json";
7
+ if (fs.existsSync(resourcePath))
8
+ {
9
+ filePath = __dirname + "/tsconfig.json";
10
+ let resultPath = resourcePath + "/tsconfig.json";
11
+ console.log(`Checking if tsconfig.json exists in ${filePath}`)
12
+ if (fs.existsSync(resultPath))
13
+ {
14
+ console.log("tsconfig.json found!");
15
+ } else {
16
+ fs.copyFileSync(filePath, resultPath);
17
+ console.log(`Not found, tsconfig.json copied to ${resultPath} folder`);
18
+ }
19
+ filePath = __dirname + "/ModifierProperties.d.ts";
20
+ resultPath = resourcePath + "/ModifierProperties.d.ts";
21
+ console.log(`Checking if ModifierProperties.d.ts exists in ${filePath}`)
22
+ if (fs.existsSync(resultPath))
23
+ {
24
+ console.log("ModifierProperties.d.ts found!");
25
+ } else {
26
+ fs.copyFileSync(filePath, resultPath);
27
+ console.log(`Not found, ModifierProperties.d.ts copied to ${resultPath} folder`);
28
+ }
29
+ filePath = __dirname + "/languages.ts";
30
+ resultPath = resourcePath + "/languages.ts";
31
+ console.log(`Checking if languages.ts exsts in ${filePath}`)
32
+ if (fs.existsSync(resultPath))
33
+ {
34
+ console.log("languages.ts found!");
35
+ } else {
36
+ fs.copyFileSync(filePath, resultPath);
37
+ console.log(`Not found, languages.ts copied to ${resultPath} folder`);
38
+ }
39
+ filePath = __dirname + "/languages.js";
40
+ resultPath = resourcePath + "/languages.js";
41
+ console.log(`Checking if languages.js exsts in ${filePath}`)
42
+ if (fs.existsSync(resultPath))
43
+ {
44
+ console.log("languages.js found!");
45
+ } else {
46
+ fs.copyFileSync(filePath, resultPath);
47
+ console.log(`Not found, languages.js copied to ${resultPath} folder`);
48
+ }
49
+ }
50
+
51
+ let dirPath = __dirname + "/localization";
52
+ if (fs.existsSync(filePath) && fs.existsSync(resourcePath))
53
+ {
54
+ let resultPath = resourcePath + "/localization";
55
+ console.log(`Checking if localization folder exists in ${resultPath}`);
56
+ if (!fs.existsSync(resultPath))
57
+ {
58
+ fs.mkdirSync(resultPath);
59
+ console.log("localization folder not found, creating the folder.")
60
+ }
61
+ console.log(`Checking if localization folder is empty`);
62
+ if (fs.readdirSync(resultPath).length === 0) {
63
+ console.log(`Localization folder is empty, copying example files.`);
64
+ if (!fs.existsSync(resultPath + "/localizationData.ts"))
65
+ {
66
+ fs.copyFileSync(dirPath + "/localizationData.ts", resultPath + "/localizationData.ts");
67
+ }
68
+ if (!fs.existsSync(resultPath + "/localizationData.js"))
69
+ {
70
+ fs.copyFileSync(dirPath + "/localizationData.js", resultPath + "/localizationData.js");
71
+ }
72
+ }
73
+ }
74
+ console.log("\x1b[36m%s\x1b[0m", "Finished copy process!");
75
+ }
76
+
77
+ function changeImports()
78
+ {
79
+ const resourcePath = "node_modules/~resource";
80
+ const compilerFilePath = __dirname + "/localizationCompiler.ts";
81
+
82
+ if (fs.existsSync(compilerFilePath))
83
+ {
84
+ fs.readFile(compilerFilePath, 'utf8' ,(err, data) =>
85
+ {
86
+ if (err) {return console.log(err)}
87
+ const result = data.replace('import { Language } from "./languages"', 'import { Language } from "~resource/languages"')
88
+
89
+ fs.writeFile(compilerFilePath, result, 'utf8', function (err) {
90
+ if (err) return console.log(err);
91
+ });
92
+ })
93
+ }
94
+
95
+ const compilerJSFilePath = __dirname + "/localizationCompiler.js";
96
+
97
+ if (fs.existsSync(compilerJSFilePath))
98
+ {
99
+ fs.readFile(compilerJSFilePath, 'utf8' ,(err, data) =>
100
+ {
101
+ if (err) {return console.log(err)}
102
+ const result = data.replace('languages_1 = require("./languages");', 'languages_1 = require("~resource/languages");')
103
+
104
+ fs.writeFile(compilerJSFilePath, result, 'utf8', function (err) {
105
+ if (err) return console.log(err);
106
+ });
107
+ })
108
+ }
109
+
110
+ const interfacesFilePath = __dirname + "/localizationInterfaces.ts";
111
+
112
+ if (fs.existsSync(interfacesFilePath))
113
+ {
114
+ fs.readFile(interfacesFilePath, 'utf8' ,(err, data) =>
115
+ {
116
+ if (err) {return console.log(err)}
117
+ const stringResult = data.replace('import { Language } from "./languages"', 'import { Language } from "~resource/languages"')
118
+
119
+ fs.writeFile(interfacesFilePath, stringResult, 'utf8', function (err) {
120
+ if (err) return console.log(err);
121
+ });
122
+ })
123
+ }
124
+
125
+ const exampleFilePath = resourcePath + "/localization/localizationData.ts"
126
+
127
+ if (fs.existsSync(exampleFilePath))
128
+ {
129
+ fs.readFile(exampleFilePath, 'utf8' ,(err, data) =>
130
+ {
131
+ if (err) {return console.log(err)}
132
+ const stringResult = data.replace('import { AbilityLocalization, LocalizationData, ModifierLocalization, StandardLocalization } from "../localizationInterfaces";',
133
+ 'import { AbilityLocalization, LocalizationData, ModifierLocalization, StandardLocalization } from "~generator/localizationInterfaces";')
134
+
135
+ fs.writeFile(exampleFilePath, stringResult, 'utf8', function (err) {
136
+ if (err) return console.log(err);
137
+ });
138
+ })
139
+ }
140
+ }
141
+
142
+ copyFiles();
143
+ changeImports();
package/install.js ADDED
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __values = (this && this.__values) || function(o) {
22
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
23
+ if (m) return m.call(o);
24
+ if (o && typeof o.length === "number") return {
25
+ next: function () {
26
+ if (o && i >= o.length) o = void 0;
27
+ return { value: o && o[i++], done: !o };
28
+ }
29
+ };
30
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
31
+ };
32
+ var __read = (this && this.__read) || function (o, n) {
33
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
34
+ if (!m) return o;
35
+ var i = m.call(o), r, ar = [], e;
36
+ try {
37
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
38
+ }
39
+ catch (error) { e = { error: error }; }
40
+ finally {
41
+ try {
42
+ if (r && !r.done && (m = i["return"])) m.call(i);
43
+ }
44
+ finally { if (e) throw e.error; }
45
+ }
46
+ return ar;
47
+ };
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ var fs = __importStar(require("fs"));
50
+ var child = __importStar(require("child_process"));
51
+ // define package insertions
52
+ var devScripts = [
53
+ ["dev:localizationCompiler", "tsc --project node_modules/~resource/tsconfig.json"],
54
+ ["dev:localizationCompilerWatcher", "tsc --project node_modules/~resource/tsconfig.json --watch"],
55
+ ["dev:runlocalizationWatcher", "node node_modules/~generator/fsWatcher.js"]
56
+ ];
57
+ var initSCript = ["init", "link-module-alias && node node_modules/~generator/init.js"];
58
+ var aliases = [
59
+ ["~resource", "resource"],
60
+ ["~generator", "node_modules/@shushishtok/tooltip_generator"]
61
+ ];
62
+ // Check package.json
63
+ function CheckPackage() {
64
+ var e_1, _a;
65
+ console.log("Searching for package.json...");
66
+ var rootPath = "../../../";
67
+ var scriptPath = "./";
68
+ // adjust existing package.json
69
+ if (fs.existsSync(rootPath + "package.json")) {
70
+ console.log("Checking existing package.json...");
71
+ var goalPackageRaw = fs.readFileSync(rootPath + "package.json");
72
+ var goalPackage = JSON.parse(goalPackageRaw.toString());
73
+ // check script part
74
+ var hasDev = false;
75
+ var hasInit = false;
76
+ if (goalPackage.scripts) {
77
+ var scripts = goalPackage.scripts;
78
+ for (var name_1 in scripts) {
79
+ if (name_1 == "dev") {
80
+ if (scripts[name_1] !== "run-p dev:*") {
81
+ console.log("\x1b[31m%s\x1b[0m", "Unexpected 'dev' script in package.json!");
82
+ return;
83
+ }
84
+ hasDev = true;
85
+ }
86
+ if (name_1 == "init") {
87
+ if (scripts[name_1] !== "link-module-alias && node node_modules/~generator/init.js") {
88
+ console.log("\x1b[31m%s\x1b[0m", "Unexpected 'init' script in package.json!");
89
+ return;
90
+ }
91
+ hasInit = true;
92
+ }
93
+ }
94
+ }
95
+ else {
96
+ goalPackage.scripts = {};
97
+ }
98
+ if (!hasDev) {
99
+ goalPackage.scripts["dev"] = "run-p dev:*";
100
+ }
101
+ try {
102
+ for (var devScripts_1 = __values(devScripts), devScripts_1_1 = devScripts_1.next(); !devScripts_1_1.done; devScripts_1_1 = devScripts_1.next()) {
103
+ var _b = __read(devScripts_1_1.value, 2), name_2 = _b[0], cmd = _b[1];
104
+ goalPackage.scripts[name_2] = cmd;
105
+ }
106
+ }
107
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
108
+ finally {
109
+ try {
110
+ if (devScripts_1_1 && !devScripts_1_1.done && (_a = devScripts_1.return)) _a.call(devScripts_1);
111
+ }
112
+ finally { if (e_1) throw e_1.error; }
113
+ }
114
+ if (!hasInit) {
115
+ goalPackage.scripts["init"] = "link-module-alias && node node_modules/~generator/init.js";
116
+ }
117
+ // check module aliases
118
+ var hasResource = false;
119
+ var hasGenerator = false;
120
+ if (goalPackage._moduleAliases) {
121
+ for (var name_3 in goalPackage._moduleAliases) {
122
+ if (name_3 == "~resource") {
123
+ hasResource = true;
124
+ }
125
+ if (name_3 == "~generator") {
126
+ hasGenerator = true;
127
+ }
128
+ }
129
+ }
130
+ else {
131
+ goalPackage._moduleAliases = {};
132
+ }
133
+ if (!hasResource) {
134
+ goalPackage._moduleAliases["~resource"] = "resource";
135
+ }
136
+ if (!hasGenerator) {
137
+ goalPackage._moduleAliases["~generator"] = "node_modules/@shushishtok/tooltip_generator";
138
+ }
139
+ var origPackagePath = scriptPath + "package.json";
140
+ if (fs.existsSync(origPackagePath)) {
141
+ var origPackageRaw = fs.readFileSync(scriptPath + "package.json");
142
+ var origPackage = JSON.parse(origPackageRaw.toString());
143
+ if (!goalPackage.dependencies) {
144
+ goalPackage.dependencies = {};
145
+ }
146
+ if (!goalPackage.devDependencies) {
147
+ goalPackage.devDependencies = {};
148
+ }
149
+ origPackage.dependencies["@shushishtok/tooltip_generator"] = "latest";
150
+ for (var name_4 in origPackage.devDependencies) {
151
+ if (!goalPackage.devDependencies.hasOwnProperty(name_4) && !goalPackage.dependencies.hasOwnProperty(name_4)) {
152
+ goalPackage.devDependencies[name_4] = origPackage.devDependencies[name_4];
153
+ }
154
+ }
155
+ for (var name_5 in origPackage.dependencies) {
156
+ if (!goalPackage.dependencies.hasOwnProperty(name_5) && !goalPackage.devDependencies.hasOwnProperty(name_5)) {
157
+ goalPackage.dependencies[name_5] = origPackage.dependencies[name_5];
158
+ }
159
+ }
160
+ }
161
+ console.log("Creating backup of package.json...");
162
+ fs.copyFileSync(rootPath + "package.json", rootPath + "backup_package.json");
163
+ console.log("Adjusting package.json...");
164
+ var data = JSON.stringify(goalPackage, undefined, 2);
165
+ fs.writeFileSync(rootPath + "package.json", data);
166
+ // copy the default package.json if there wasn't any previously
167
+ }
168
+ else {
169
+ var copyPackage = scriptPath + "_package.json";
170
+ if (fs.existsSync(copyPackage)) {
171
+ console.log("Copying new package.json");
172
+ fs.copyFileSync(copyPackage, rootPath + "package.json");
173
+ }
174
+ else {
175
+ console.log("\x1b[31m%s\x1b[0m", "\nCouldn't find _package.json! Have you installed this module correctly?");
176
+ return;
177
+ }
178
+ }
179
+ console.log("Running final installation, please wait for the success message...");
180
+ child.exec("npm install", {
181
+ cwd: rootPath,
182
+ }, function (err, stdout) {
183
+ if (err) {
184
+ console.log("\x1b[31m%s\x1b[0m", "Something went wrong...\n\n");
185
+ console.log(err);
186
+ }
187
+ else {
188
+ console.log("\x1b[32m%s\x1b[0m", "package.json adjustments successful!");
189
+ }
190
+ });
191
+ }
192
+ CheckPackage();
package/install.ts ADDED
@@ -0,0 +1,144 @@
1
+ import * as fs from 'fs';
2
+ import * as child from 'child_process';
3
+
4
+ interface packageSnippet {
5
+ scripts?: {[name: string]: string};
6
+ _moduleAliases?: {[name: string]: string};
7
+ dependencies?: {[name: string]: string};
8
+ devDependencies?: {[name: string]: string};
9
+ }
10
+
11
+ // define package insertions
12
+ const devScripts = [
13
+ ["dev:runlocalizationWatcher", "ts-node node_modules/~generator/fsWatcher.ts"]
14
+ ]
15
+ const initSCript = ["init", "link-module-alias && ts-node node_modules/~generator/init.ts"]
16
+ const aliases = [
17
+ ["~resource", "resource"],
18
+ ["~generator", "node_modules/@cabin-icarus/tooltip_generator"]
19
+ ]
20
+
21
+ // Check package.json
22
+ function CheckPackage() {
23
+ console.log("Searching for package.json...");
24
+ const rootPath = "../../../";
25
+ const scriptPath = "./";
26
+
27
+ // adjust existing package.json
28
+ if (fs.existsSync(rootPath + "package.json")) {
29
+ console.log("Checking existing package.json...")
30
+ const goalPackageRaw = fs.readFileSync(rootPath + "package.json");
31
+ const goalPackage = JSON.parse(goalPackageRaw.toString()) as packageSnippet;
32
+
33
+ // check script part
34
+ let hasDev = false;
35
+ let hasInit = false;
36
+ if (goalPackage.scripts) {
37
+ let scripts = goalPackage.scripts;
38
+ for (const name in scripts) {
39
+ if (name == "dev") {
40
+ if (scripts[name] !== "run-p dev:*") {
41
+ console.log("\x1b[31m%s\x1b[0m", "Unexpected 'dev' script in package.json!");
42
+ return;
43
+ }
44
+ hasDev = true;
45
+ }
46
+ if (name == "init") {
47
+ if (scripts[name] !== "link-module-alias && node node_modules/~generator/init.js") {
48
+ console.log("\x1b[31m%s\x1b[0m", "Unexpected 'init' script in package.json!");
49
+ return;
50
+ }
51
+ hasInit = true;
52
+ }
53
+ }
54
+ } else {
55
+ goalPackage.scripts = {};
56
+ }
57
+ if (!hasDev) {
58
+ goalPackage.scripts["dev"] = "run-p dev:*";
59
+ }
60
+ for (const [name, cmd] of devScripts) {
61
+ goalPackage.scripts[name] = cmd;
62
+ }
63
+ if (!hasInit) {
64
+ goalPackage.scripts["init"] = "link-module-alias && ts-node node_modules/~generator/init.ts";
65
+ }
66
+
67
+ // check module aliases
68
+ let hasResource = false;
69
+ let hasGenerator = false;
70
+ if (goalPackage._moduleAliases) {
71
+ for (const name in goalPackage._moduleAliases) {
72
+ if (name == "~resource") {
73
+ hasResource = true;
74
+ }
75
+ if (name == "~generator") {
76
+ hasGenerator = true;
77
+ }
78
+ }
79
+ } else {
80
+ goalPackage._moduleAliases = {};
81
+ }
82
+ if (!hasResource) {
83
+ goalPackage._moduleAliases["~resource"] = "resource";
84
+ }
85
+ if (!hasGenerator) {
86
+ goalPackage._moduleAliases["~generator"] = "node_modules/@cabin-icarus/tooltip_generator";
87
+ }
88
+
89
+ const origPackagePath = scriptPath + "package.json";
90
+ if (fs.existsSync(origPackagePath)) {
91
+ const origPackageRaw = fs.readFileSync(scriptPath + "package.json");
92
+ const origPackage = JSON.parse(origPackageRaw.toString()) as packageSnippet;
93
+
94
+ if (!goalPackage.dependencies) {
95
+ goalPackage.dependencies = {};
96
+ }
97
+ if (!goalPackage.devDependencies) {
98
+ goalPackage.devDependencies = {};
99
+ }
100
+ origPackage.dependencies!["@cabin-icarus/tooltip_generator"] = "latest"
101
+
102
+ for (const name in origPackage.devDependencies!) {
103
+ if (!goalPackage.devDependencies.hasOwnProperty(name) && !goalPackage.dependencies.hasOwnProperty(name)) {
104
+ goalPackage.devDependencies[name] = origPackage.devDependencies[name];
105
+ }
106
+ }
107
+ for (const name in origPackage.dependencies!) {
108
+ if (!goalPackage.dependencies.hasOwnProperty(name) && !goalPackage.devDependencies.hasOwnProperty(name)) {
109
+ goalPackage.dependencies[name] = origPackage.dependencies[name];
110
+ }
111
+ }
112
+ }
113
+
114
+ console.log("Creating backup of package.json...");
115
+ fs.copyFileSync(rootPath + "package.json", rootPath + "backup_package.json");
116
+ console.log("Adjusting package.json...");
117
+ let data = JSON.stringify(goalPackage, undefined, 2);
118
+ fs.writeFileSync(rootPath + "package.json", data);
119
+
120
+ // copy the default package.json if there wasn't any previously
121
+ } else {
122
+ const copyPackage = scriptPath + "_package.json";
123
+ if (fs.existsSync(copyPackage)) {
124
+ console.log("Copying new package.json");
125
+ fs.copyFileSync(copyPackage, rootPath + "package.json");
126
+ } else {
127
+ console.log("\x1b[31m%s\x1b[0m", "\nCouldn't find _package.json! Have you installed this module correctly?")
128
+ return;
129
+ }
130
+ }
131
+ console.log("Running final installation, please wait for the success message...")
132
+ child.exec("yarn install", {
133
+ cwd: rootPath,
134
+ }, (err, stdout) => {
135
+ if (err) {
136
+ console.log("\x1b[31m%s\x1b[0m", "Something went wrong...\n\n");
137
+ console.log(err);
138
+ } else {
139
+ console.log("\x1b[32m%s\x1b[0m", "package.json adjustments successful!");
140
+ }
141
+ })
142
+ }
143
+
144
+ CheckPackage();
package/languages.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Language = void 0;
4
+ var Language;
5
+ (function (Language) {
6
+ Language["None"] = "none";
7
+ // Brazilian = 'brazilian',
8
+ // Bulgarian = 'bulgarian',
9
+ // Czech = 'czech',
10
+ // Danish = 'danish',
11
+ Language["English"] = "english";
12
+ // Finnish = 'finnish',
13
+ // French = `french`,
14
+ // German = `german`,
15
+ // Greek = 'greek',
16
+ // Hungarian = 'hungarian',
17
+ // Italian = 'italian',
18
+ // Japanese = 'japanese',
19
+ // Koreana = 'koreana',
20
+ // Latam = 'latam',
21
+ // Norwegian = `norwegian`,
22
+ // Polish = 'polish',
23
+ // Portuguese = `portuguese`,
24
+ Language["Russian"] = "russian";
25
+ Language["Schinese"] = "schinese";
26
+ // Spanish = `spanish`,
27
+ // Swedish = `swedish`,
28
+ // TChinese = `tchinese`,
29
+ // Thai = 'thai',
30
+ // Turkish = 'turkish',
31
+ // Ukrainian = 'ukrainian',
32
+ // Vietnamese = `vietnamese`
33
+ })(Language = exports.Language || (exports.Language = {}));
package/languages.ts ADDED
@@ -0,0 +1,30 @@
1
+ export enum Language
2
+ {
3
+ None = 'none',
4
+ // Brazilian = 'brazilian',
5
+ // Bulgarian = 'bulgarian',
6
+ // Czech = 'czech',
7
+ // Danish = 'danish',
8
+ English = 'english',
9
+ // Finnish = 'finnish',
10
+ // French = `french`,
11
+ // German = `german`,
12
+ // Greek = 'greek',
13
+ // Hungarian = 'hungarian',
14
+ // Italian = 'italian',
15
+ // Japanese = 'japanese',
16
+ // Koreana = 'koreana',
17
+ // Latam = 'latam',
18
+ // Norwegian = `norwegian`,
19
+ // Polish = 'polish',
20
+ // Portuguese = `portuguese`,
21
+ Russian = `russian`,
22
+ Schinese = `schinese`,
23
+ // Spanish = `spanish`,
24
+ // Swedish = `swedish`,
25
+ // TChinese = `tchinese`,
26
+ // Thai = 'thai',
27
+ // Turkish = 'turkish',
28
+ // Ukrainian = 'ukrainian',
29
+ // Vietnamese = `vietnamese`
30
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenerateLocalizationData = void 0;
4
+ function GenerateLocalizationData() {
5
+ // This section can be safely ignored, as it is only logic.
6
+ //#region Localization logic
7
+ // Arrays
8
+ var Abilities = new Array();
9
+ var Modifiers = new Array();
10
+ var StandardTooltips = new Array();
11
+ // Create object of arrays
12
+ var localization_info = {
13
+ AbilityArray: Abilities,
14
+ ModifierArray: Modifiers,
15
+ StandardArray: StandardTooltips,
16
+ };
17
+ //#endregion
18
+ // Enter localization data below!
19
+ StandardTooltips.push({
20
+ classname: "Hello",
21
+ name: "test"
22
+ });
23
+ // Return data to compiler
24
+ return localization_info;
25
+ }
26
+ exports.GenerateLocalizationData = GenerateLocalizationData;
@@ -0,0 +1,31 @@
1
+ import { AbilityLocalization, LocalizationData, ModifierLocalization, StandardLocalization } from "../localizationInterfaces";
2
+ import { Language } from "../languages";
3
+
4
+ export function GenerateLocalizationData(): LocalizationData
5
+ {
6
+ // This section can be safely ignored, as it is only logic.
7
+ //#region Localization logic
8
+ // Arrays
9
+ const Abilities: Array<AbilityLocalization> = new Array<AbilityLocalization>();
10
+ const Modifiers: Array<ModifierLocalization> = new Array<ModifierLocalization>();
11
+ const StandardTooltips: Array<StandardLocalization> = new Array<StandardLocalization>();
12
+
13
+ // Create object of arrays
14
+ const localization_info: LocalizationData =
15
+ {
16
+ AbilityArray: Abilities,
17
+ ModifierArray: Modifiers,
18
+ StandardArray: StandardTooltips,
19
+ };
20
+ //#endregion
21
+
22
+ // Enter localization data below!
23
+ StandardTooltips.push({
24
+ classname: "Hello",
25
+ name: "test"
26
+ });
27
+
28
+
29
+ // Return data to compiler
30
+ return localization_info;
31
+ }