asajs 3.0.2 → 3.0.4
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/dist/cjs/compilers/BindingCompiler.js +458 -0
- package/dist/cjs/compilers/BindingFunctions.js +267 -0
- package/dist/cjs/compilers/Compiler.js +158 -0
- package/dist/cjs/compilers/Compress.js +55 -0
- package/dist/cjs/compilers/Config.js +138 -0
- package/dist/cjs/compilers/Encoder.js +90 -0
- package/dist/cjs/compilers/Installer.js +123 -0
- package/dist/cjs/compilers/PreCompile.js +86 -0
- package/dist/cjs/compilers/generator/GenerateDir.js +51 -0
- package/dist/cjs/compilers/generator/JsonBuilder.js +66 -0
- package/dist/cjs/compilers/generator/LangBuilder.js +65 -0
- package/dist/cjs/compilers/generator/Log.js +45 -0
- package/dist/cjs/compilers/generator/Manifest.js +63 -0
- package/dist/cjs/compilers/generator/Save.js +87 -0
- package/dist/cjs/compilers/generator/SearchFiles.js +70 -0
- package/dist/cjs/compilers/generator/Sounds.js +91 -0
- package/dist/cjs/compilers/generator/Template.js +54 -0
- package/dist/cjs/compilers/generator/UIBuilder.js +123 -0
- package/dist/cjs/compilers/reader/Audio.js +81 -0
- package/dist/cjs/compilers/reader/Color.js +65 -0
- package/dist/cjs/compilers/reader/CurrentLine.js +36 -0
- package/dist/cjs/compilers/reader/Env.js +21 -0
- package/dist/cjs/compilers/reader/GlobalVariables.js +23 -0
- package/dist/cjs/compilers/reader/Object.js +44 -0
- package/dist/cjs/compilers/reader/ReadBinding.js +67 -0
- package/dist/cjs/compilers/reader/ReadProperties.js +118 -0
- package/dist/cjs/components/AddCollectionChill.js +41 -0
- package/dist/cjs/components/Animation.js +127 -0
- package/dist/cjs/components/AnimationKeyFrame.js +49 -0
- package/dist/cjs/components/Class.js +95 -0
- package/dist/cjs/components/LocalizeText.js +59 -0
- package/dist/cjs/components/Modify.js +377 -0
- package/dist/cjs/components/Random.js +104 -0
- package/dist/cjs/components/UI.js +387 -0
- package/dist/cjs/components/Vanilla.js +57915 -0
- package/dist/cjs/index.js +291 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/template.js +37 -0
- package/dist/cjs/types/components/ChildIdentifier.js +16 -0
- package/dist/cjs/types/components/Identifier.js +17 -0
- package/dist/cjs/types/components/NameCallback.js +16 -0
- package/dist/cjs/types/components/UIIdentifier.js +16 -0
- package/dist/cjs/types/components/UIInterface.js +16 -0
- package/dist/cjs/types/enums/Anchor.js +39 -0
- package/dist/cjs/types/enums/AnimTypes.js +39 -0
- package/dist/cjs/types/enums/BindingCondition.js +36 -0
- package/dist/cjs/types/enums/BindingName.js +4208 -0
- package/dist/cjs/types/enums/BindingType.js +35 -0
- package/dist/cjs/types/enums/ClipDirecion.js +35 -0
- package/dist/cjs/types/enums/Collection.js +202 -0
- package/dist/cjs/types/enums/Direction.js +33 -0
- package/dist/cjs/types/enums/EasingTypes.js +62 -0
- package/dist/cjs/types/enums/EnumColor.js +37 -0
- package/dist/cjs/types/enums/FocusNavigationMode.js +34 -0
- package/dist/cjs/types/enums/FontSize.js +34 -0
- package/dist/cjs/types/enums/FontType.js +35 -0
- package/dist/cjs/types/enums/GlobalVariables.js +345 -0
- package/dist/cjs/types/enums/InputModeCondition.js +33 -0
- package/dist/cjs/types/enums/ItemAuxID.js +31 -0
- package/dist/cjs/types/enums/JsonUIArrayName.js +36 -0
- package/dist/cjs/types/enums/MappingFrom.js +81 -0
- package/dist/cjs/types/enums/MappingTo.js +248 -0
- package/dist/cjs/types/enums/MappingTypes.js +34 -0
- package/dist/cjs/types/enums/Orientation.js +32 -0
- package/dist/cjs/types/enums/Renderer.js +68 -0
- package/dist/cjs/types/enums/Rotation.js +33 -0
- package/dist/cjs/types/enums/Scope.js +32 -0
- package/dist/cjs/types/enums/TextTypes.js +33 -0
- package/dist/cjs/types/enums/TextureFileSystem.js +41 -0
- package/dist/cjs/types/enums/Types.js +57 -0
- package/dist/cjs/types/objects/Animation.js +16 -0
- package/dist/cjs/types/objects/BindingHook.js +16 -0
- package/dist/cjs/types/objects/BindingInterface.js +16 -0
- package/dist/cjs/types/objects/ButtonMapping.js +16 -0
- package/dist/cjs/types/objects/Factory.js +16 -0
- package/dist/cjs/types/objects/Installer.js +53 -0
- package/dist/cjs/types/objects/Manifest.js +56 -0
- package/dist/cjs/types/objects/Modify.js +16 -0
- package/dist/cjs/types/objects/PropertyBag.js +16 -0
- package/dist/cjs/types/objects/Sound.js +16 -0
- package/dist/cjs/types/objects/Variables.js +16 -0
- package/dist/cjs/types/objects/elements/Button.js +17 -0
- package/dist/cjs/types/objects/elements/CollectionPanel.js +17 -0
- package/dist/cjs/types/objects/elements/Custom.js +17 -0
- package/dist/cjs/types/objects/elements/Dropdown.js +17 -0
- package/dist/cjs/types/objects/elements/EditBox.js +17 -0
- package/dist/cjs/types/objects/elements/Grid.js +16 -0
- package/dist/cjs/types/objects/elements/Image.js +17 -0
- package/dist/cjs/types/objects/elements/InputPanel.js +16 -0
- package/dist/cjs/types/objects/elements/Label.js +17 -0
- package/dist/cjs/types/objects/elements/PropertiesType.js +17 -0
- package/dist/cjs/types/objects/elements/Screen.js +17 -0
- package/dist/cjs/types/objects/elements/ScrollView.js +17 -0
- package/dist/cjs/types/objects/elements/ScrollbarBox.js +17 -0
- package/dist/cjs/types/objects/elements/ScrollbarTrack.js +17 -0
- package/dist/cjs/types/objects/elements/SelectionWheel.js +17 -0
- package/dist/cjs/types/objects/elements/Slider.js +17 -0
- package/dist/cjs/types/objects/elements/SliderBox.js +17 -0
- package/dist/cjs/types/objects/elements/StackPanel.js +16 -0
- package/dist/cjs/types/objects/elements/Toggle.js +17 -0
- package/dist/cjs/types/objects/elements/TooltipTrigger.js +16 -0
- package/dist/cjs/types/objects/elements/panel.js +16 -0
- package/dist/cjs/types/objects/properties/Buttons.js +16 -0
- package/dist/cjs/types/objects/properties/CollectionIndexs.js +16 -0
- package/dist/cjs/types/objects/properties/Collections.js +16 -0
- package/dist/cjs/types/objects/properties/Controls.js +16 -0
- package/dist/cjs/types/objects/properties/Dropdowns.js +16 -0
- package/dist/cjs/types/objects/properties/Focus.js +16 -0
- package/dist/cjs/types/objects/properties/FocusContainerCustom.js +16 -0
- package/dist/cjs/types/objects/properties/Grids.js +16 -0
- package/dist/cjs/types/objects/properties/Inputs.js +16 -0
- package/dist/cjs/types/objects/properties/Layouts.js +16 -0
- package/dist/cjs/types/objects/properties/Properties.js +16 -0
- package/dist/cjs/types/objects/properties/Renderers.js +16 -0
- package/dist/cjs/types/objects/properties/Screens.js +16 -0
- package/dist/cjs/types/objects/properties/ScrollViews.js +16 -0
- package/dist/cjs/types/objects/properties/SelectionWheels.js +16 -0
- package/dist/cjs/types/objects/properties/SliderBoxs.js +16 -0
- package/dist/cjs/types/objects/properties/Sliders.js +16 -0
- package/dist/cjs/types/objects/properties/Sounds.js +16 -0
- package/dist/cjs/types/objects/properties/Specials.js +16 -0
- package/dist/cjs/types/objects/properties/Sprites.js +16 -0
- package/dist/cjs/types/objects/properties/StackPanels.js +16 -0
- package/dist/cjs/types/objects/properties/TTS.js +16 -0
- package/dist/cjs/types/objects/properties/TextEdits.js +16 -0
- package/dist/cjs/types/objects/properties/Texts.js +16 -0
- package/dist/cjs/types/objects/properties/Toggles.js +16 -0
- package/dist/cjs/types/objects/properties/TooltipTriggers.js +16 -0
- package/dist/cjs/types/objects/properties/Variables.js +16 -0
- package/dist/cjs/types/values/Any.js +16 -0
- package/dist/cjs/types/values/Binding.js +16 -0
- package/dist/cjs/types/values/Bool.js +16 -0
- package/dist/cjs/types/values/ColorVector.js +16 -0
- package/dist/cjs/types/values/ElementPath.js +16 -0
- package/dist/cjs/types/values/Hex.js +16 -0
- package/dist/cjs/types/values/Number.js +16 -0
- package/dist/cjs/types/values/RangeVector.js +16 -0
- package/dist/cjs/types/values/Str.js +16 -0
- package/dist/cjs/types/values/StringVector.js +16 -0
- package/dist/cjs/types/values/TargetElementPath.js +16 -0
- package/dist/cjs/types/values/Variable.js +16 -0
- package/dist/cjs/types/values/Vector.js +16 -0
- package/dist/esm/index.js +68470 -0
- package/dist/esm/package.json +1 -0
- package/dist/types/compilers/BindingCompiler.d.ts +44 -0
- package/dist/types/compilers/BindingFunctions.d.ts +10 -0
- package/dist/types/compilers/Compiler.d.ts +3 -0
- package/dist/types/compilers/Compress.d.ts +1 -0
- package/dist/types/compilers/Config.d.ts +95 -0
- package/dist/types/compilers/Encoder.d.ts +11 -0
- package/dist/types/compilers/Installer.d.ts +14 -0
- package/dist/types/compilers/PreCompile.d.ts +4 -0
- package/dist/types/compilers/generator/GenerateDir.d.ts +1 -0
- package/dist/types/compilers/generator/JsonBuilder.d.ts +28 -0
- package/dist/types/compilers/generator/LangBuilder.d.ts +4 -0
- package/dist/types/compilers/generator/Log.d.ts +9 -0
- package/dist/types/compilers/generator/Manifest.d.ts +21 -0
- package/dist/types/compilers/generator/Save.d.ts +16 -0
- package/dist/types/compilers/generator/SearchFiles.d.ts +11 -0
- package/dist/types/compilers/generator/Sounds.d.ts +5 -0
- package/dist/types/compilers/generator/Template.d.ts +1 -0
- package/dist/types/compilers/generator/UIBuilder.d.ts +9 -0
- package/dist/types/compilers/reader/Audio.d.ts +1 -0
- package/dist/types/compilers/reader/Color.d.ts +5 -0
- package/dist/types/compilers/reader/CurrentLine.d.ts +1 -0
- package/dist/types/compilers/reader/Env.d.ts +1 -0
- package/dist/types/compilers/reader/GlobalVariables.d.ts +1 -0
- package/dist/types/compilers/reader/Object.d.ts +11 -0
- package/dist/types/compilers/reader/ReadBinding.d.ts +6 -0
- package/dist/types/compilers/reader/ReadProperties.d.ts +3 -0
- package/dist/types/components/AddCollectionChill.d.ts +6 -0
- package/dist/types/components/Animation.d.ts +15 -0
- package/dist/types/components/AnimationKeyFrame.d.ts +10 -0
- package/dist/types/components/Class.d.ts +68 -0
- package/dist/types/components/LocalizeText.d.ts +21 -0
- package/dist/types/components/Modify.d.ts +30 -0
- package/dist/types/components/Random.d.ts +20 -0
- package/dist/types/components/UI.d.ts +89 -0
- package/dist/types/components/Vanilla.d.ts +19729 -0
- package/dist/types/index.d.ts +136 -0
- package/dist/types/template.d.ts +4 -0
- package/dist/types/types/components/ChildIdentifier.d.ts +11 -0
- package/dist/types/types/components/Identifier.d.ts +4 -0
- package/dist/types/types/components/NameCallback.d.ts +3 -0
- package/dist/types/types/components/UIIdentifier.d.ts +4 -0
- package/dist/types/types/components/UIInterface.d.ts +16 -0
- package/dist/types/types/enums/Anchor.d.ts +11 -0
- package/dist/types/types/enums/AnimTypes.d.ts +11 -0
- package/dist/types/types/enums/BindingCondition.d.ts +8 -0
- package/dist/types/types/enums/BindingName.d.ts +4180 -0
- package/dist/types/types/enums/BindingType.d.ts +7 -0
- package/dist/types/types/enums/ClipDirecion.d.ts +7 -0
- package/dist/types/types/enums/Collection.d.ts +174 -0
- package/dist/types/types/enums/Direction.d.ts +5 -0
- package/dist/types/types/enums/EasingTypes.d.ts +34 -0
- package/dist/types/types/enums/EnumColor.d.ts +9 -0
- package/dist/types/types/enums/FocusNavigationMode.d.ts +6 -0
- package/dist/types/types/enums/FontSize.d.ts +6 -0
- package/dist/types/types/enums/FontType.d.ts +7 -0
- package/dist/types/types/enums/GlobalVariables.d.ts +317 -0
- package/dist/types/types/enums/InputModeCondition.d.ts +5 -0
- package/dist/types/types/enums/ItemAuxID.d.ts +3 -0
- package/dist/types/types/enums/JsonUIArrayName.d.ts +7 -0
- package/dist/types/types/enums/MappingFrom.d.ts +53 -0
- package/dist/types/types/enums/MappingTo.d.ts +220 -0
- package/dist/types/types/enums/MappingTypes.d.ts +6 -0
- package/dist/types/types/enums/Orientation.d.ts +4 -0
- package/dist/types/types/enums/Renderer.d.ts +40 -0
- package/dist/types/types/enums/Rotation.d.ts +5 -0
- package/dist/types/types/enums/Scope.d.ts +4 -0
- package/dist/types/types/enums/TextTypes.d.ts +5 -0
- package/dist/types/types/enums/TextureFileSystem.d.ts +13 -0
- package/dist/types/types/enums/Types.d.ts +29 -0
- package/dist/types/types/objects/Animation.d.ts +36 -0
- package/dist/types/types/objects/BindingHook.d.ts +1 -0
- package/dist/types/types/objects/BindingInterface.d.ts +21 -0
- package/dist/types/types/objects/ButtonMapping.d.ts +18 -0
- package/dist/types/types/objects/Factory.d.ts +2 -0
- package/dist/types/types/objects/Installer.d.ts +26 -0
- package/dist/types/types/objects/Manifest.d.ts +74 -0
- package/dist/types/types/objects/Modify.d.ts +52 -0
- package/dist/types/types/objects/PropertyBag.d.ts +2 -0
- package/dist/types/types/objects/Sound.d.ts +8 -0
- package/dist/types/types/objects/Variables.d.ts +1 -0
- package/dist/types/types/objects/elements/Button.d.ts +4 -0
- package/dist/types/types/objects/elements/CollectionPanel.d.ts +4 -0
- package/dist/types/types/objects/elements/Custom.d.ts +5 -0
- package/dist/types/types/objects/elements/Dropdown.d.ts +4 -0
- package/dist/types/types/objects/elements/EditBox.d.ts +4 -0
- package/dist/types/types/objects/elements/Grid.d.ts +4 -0
- package/dist/types/types/objects/elements/Image.d.ts +4 -0
- package/dist/types/types/objects/elements/InputPanel.d.ts +7 -0
- package/dist/types/types/objects/elements/Label.d.ts +4 -0
- package/dist/types/types/objects/elements/PropertiesType.d.ts +45 -0
- package/dist/types/types/objects/elements/Screen.d.ts +4 -0
- package/dist/types/types/objects/elements/ScrollView.d.ts +5 -0
- package/dist/types/types/objects/elements/ScrollbarBox.d.ts +4 -0
- package/dist/types/types/objects/elements/ScrollbarTrack.d.ts +4 -0
- package/dist/types/types/objects/elements/SelectionWheel.d.ts +4 -0
- package/dist/types/types/objects/elements/Slider.d.ts +4 -0
- package/dist/types/types/objects/elements/SliderBox.d.ts +5 -0
- package/dist/types/types/objects/elements/StackPanel.d.ts +7 -0
- package/dist/types/types/objects/elements/Toggle.d.ts +4 -0
- package/dist/types/types/objects/elements/TooltipTrigger.d.ts +8 -0
- package/dist/types/types/objects/elements/panel.d.ts +6 -0
- package/dist/types/types/objects/properties/Buttons.d.ts +5 -0
- package/dist/types/types/objects/properties/CollectionIndexs.d.ts +4 -0
- package/dist/types/types/objects/properties/Collections.d.ts +6 -0
- package/dist/types/types/objects/properties/Controls.d.ts +27 -0
- package/dist/types/types/objects/properties/Dropdowns.d.ts +6 -0
- package/dist/types/types/objects/properties/Focus.d.ts +28 -0
- package/dist/types/types/objects/properties/FocusContainerCustom.d.ts +5 -0
- package/dist/types/types/objects/properties/Grids.d.ts +15 -0
- package/dist/types/types/objects/properties/Inputs.d.ts +13 -0
- package/dist/types/types/objects/properties/Layouts.d.ts +35 -0
- package/dist/types/types/objects/properties/Properties.d.ts +27 -0
- package/dist/types/types/objects/properties/Renderers.d.ts +5 -0
- package/dist/types/types/objects/properties/Screens.d.ts +23 -0
- package/dist/types/types/objects/properties/ScrollViews.d.ts +17 -0
- package/dist/types/types/objects/properties/SelectionWheels.d.ts +13 -0
- package/dist/types/types/objects/properties/SliderBoxs.d.ts +6 -0
- package/dist/types/types/objects/properties/Sliders.d.ts +23 -0
- package/dist/types/types/objects/properties/Sounds.d.ts +10 -0
- package/dist/types/types/objects/properties/Specials.d.ts +60 -0
- package/dist/types/types/objects/properties/Sprites.d.ts +33 -0
- package/dist/types/types/objects/properties/StackPanels.d.ts +5 -0
- package/dist/types/types/objects/properties/TTS.d.ts +24 -0
- package/dist/types/types/objects/properties/TextEdits.d.ts +19 -0
- package/dist/types/types/objects/properties/Texts.d.ts +26 -0
- package/dist/types/types/objects/properties/Toggles.d.ts +24 -0
- package/dist/types/types/objects/properties/TooltipTriggers.d.ts +7 -0
- package/dist/types/types/objects/properties/Variables.d.ts +3 -0
- package/dist/types/types/values/Any.d.ts +4 -0
- package/dist/types/types/values/Binding.d.ts +2 -0
- package/dist/types/types/values/Bool.d.ts +2 -0
- package/dist/types/types/values/ColorVector.d.ts +6 -0
- package/dist/types/types/values/ElementPath.d.ts +2 -0
- package/dist/types/types/values/Hex.d.ts +1 -0
- package/dist/types/types/values/Number.d.ts +4 -0
- package/dist/types/types/values/RangeVector.d.ts +5 -0
- package/dist/types/types/values/Str.d.ts +2 -0
- package/dist/types/types/values/StringVector.d.ts +6 -0
- package/dist/types/types/values/TargetElementPath.d.ts +1 -0
- package/dist/types/types/values/Variable.d.ts +1 -0
- package/dist/types/types/values/Vector.d.ts +5 -0
- package/package.json +4 -4
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
|
+
var Encoder_exports = {};
|
|
32
|
+
__export(Encoder_exports, {
|
|
33
|
+
Encoder: () => Encoder
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Encoder_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_Class = require("../components/Class");
|
|
38
|
+
var import_PreCompile = require("./PreCompile");
|
|
39
|
+
var import_Object = require("./reader/Object");
|
|
40
|
+
const _Encoder = class _Encoder extends import_Class.Class {
|
|
41
|
+
static start() {
|
|
42
|
+
for (const path of import_PreCompile.jsonFilePath) {
|
|
43
|
+
const code = _Encoder.readCode(path);
|
|
44
|
+
const encode = _Encoder.encode(code);
|
|
45
|
+
_Encoder.replaceCode(path, encode);
|
|
46
|
+
_Encoder.count++;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static replaceCode(path, code) {
|
|
50
|
+
import_fs.default.writeFileSync(path, (0, import_PreCompile.WritePreComment)(code).replaceAll("\\\\", "\\"), "utf-8");
|
|
51
|
+
}
|
|
52
|
+
static encode(code) {
|
|
53
|
+
return Array.isArray(code) ? _Encoder.encodeArray(code) : _Encoder.encodeObject(code);
|
|
54
|
+
}
|
|
55
|
+
static encodeArray(code) {
|
|
56
|
+
return code.map((value) => {
|
|
57
|
+
const valueType = typeof value;
|
|
58
|
+
if (valueType === "object") {
|
|
59
|
+
return _Encoder.encode(value);
|
|
60
|
+
} else if (valueType === "string") return _Encoder.encodeString(value);
|
|
61
|
+
else return value;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static encodeObject(code) {
|
|
65
|
+
return import_Object.Obj.map(code, (key, value) => {
|
|
66
|
+
const valueType = typeof value;
|
|
67
|
+
key = _Encoder.encodeString(key);
|
|
68
|
+
if (valueType === "object") {
|
|
69
|
+
return {
|
|
70
|
+
key,
|
|
71
|
+
value: _Encoder.encode(value)
|
|
72
|
+
};
|
|
73
|
+
} else if (valueType === "string") {
|
|
74
|
+
return { key, value: _Encoder.encodeString(value) };
|
|
75
|
+
} else return { key, value };
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
static encodeString(code) {
|
|
79
|
+
return Array.from(code).map((char) => "\\u".concat(char.charCodeAt(0).toString(16).padStart(4, "0"))).join("");
|
|
80
|
+
}
|
|
81
|
+
static readCode(path) {
|
|
82
|
+
return JSON.parse(import_fs.default.readFileSync(path, "utf-8"));
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
__publicField(_Encoder, "count", 0);
|
|
86
|
+
let Encoder = _Encoder;
|
|
87
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
+
0 && (module.exports = {
|
|
89
|
+
Encoder
|
|
90
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
|
+
var Installer_exports = {};
|
|
32
|
+
__export(Installer_exports, {
|
|
33
|
+
ResourcePacks: () => ResourcePacks
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Installer_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_Save = require("./generator/Save");
|
|
38
|
+
var import_UIBuilder = require("./generator/UIBuilder");
|
|
39
|
+
var import_Config = require("./Config");
|
|
40
|
+
class ResourcePacks {
|
|
41
|
+
constructor(data) {
|
|
42
|
+
__publicField(this, "gamePath");
|
|
43
|
+
__publicField(this, "gameDataPath");
|
|
44
|
+
__publicField(this, "installPath");
|
|
45
|
+
__publicField(this, "globalResoucePacksPath");
|
|
46
|
+
const config = import_Config.Configs.getConfig();
|
|
47
|
+
if (config.installer.installPath && config.installer.customPath) {
|
|
48
|
+
this.gamePath = config.installer.installPath;
|
|
49
|
+
} else {
|
|
50
|
+
switch (process.platform) {
|
|
51
|
+
case "win32":
|
|
52
|
+
this.gamePath = "".concat(process.env.LOCALAPPDATA, "/Packages/").concat(data.installGame, "/LocalState");
|
|
53
|
+
break;
|
|
54
|
+
case "linux":
|
|
55
|
+
this.gamePath = "".concat(process.env.HOME, "/.local/share/mcpelauncher");
|
|
56
|
+
if (!import_fs.default.existsSync(this.gamePath))
|
|
57
|
+
this.gamePath = "".concat(process.env.HOME, "/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher");
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
this.gamePath = "";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
this.gameDataPath = "".concat(this.gamePath, "/games/com.mojang");
|
|
64
|
+
this.installPath = "".concat(this.gameDataPath, "/").concat(data.installFolder);
|
|
65
|
+
this.globalResoucePacksPath = "".concat(this.gameDataPath, "/minecraftpe/global_resource_packs.json");
|
|
66
|
+
}
|
|
67
|
+
isPackInstalled(uuid, version) {
|
|
68
|
+
const globalResourcePacks = import_fs.default.existsSync(
|
|
69
|
+
this.globalResoucePacksPath
|
|
70
|
+
) ? JSON.parse(import_fs.default.readFileSync(this.globalResoucePacksPath, "utf-8")) : [];
|
|
71
|
+
const versionIsArray = Array.isArray(version);
|
|
72
|
+
if (versionIsArray) version = JSON.stringify(version);
|
|
73
|
+
for (const packData of globalResourcePacks) {
|
|
74
|
+
if (packData.pack_id === uuid && (versionIsArray ? JSON.stringify(packData.version) : packData.version) === version)
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
installPack(uuid, version) {
|
|
80
|
+
if (this.isPackInstalled(uuid, version)) return;
|
|
81
|
+
const globalResourcePacks = import_fs.default.existsSync(
|
|
82
|
+
this.globalResoucePacksPath
|
|
83
|
+
) ? JSON.parse(import_fs.default.readFileSync(this.globalResoucePacksPath, "utf-8")) : [];
|
|
84
|
+
import_fs.default.writeFileSync(
|
|
85
|
+
this.globalResoucePacksPath,
|
|
86
|
+
JSON.stringify([
|
|
87
|
+
{
|
|
88
|
+
pack_id: uuid,
|
|
89
|
+
version
|
|
90
|
+
},
|
|
91
|
+
...globalResourcePacks
|
|
92
|
+
]),
|
|
93
|
+
"utf-8"
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
uninstallPack(uuid, version) {
|
|
97
|
+
const globalResourcePacks = import_fs.default.existsSync(
|
|
98
|
+
this.globalResoucePacksPath
|
|
99
|
+
) ? JSON.parse(import_fs.default.readFileSync(this.globalResoucePacksPath, "utf-8")) : [];
|
|
100
|
+
const versionIsArray = Array.isArray(version);
|
|
101
|
+
if (versionIsArray) version = JSON.stringify(version);
|
|
102
|
+
let i = -1;
|
|
103
|
+
for (const packData of globalResourcePacks) {
|
|
104
|
+
i++;
|
|
105
|
+
if (packData.pack_id === uuid && (versionIsArray ? JSON.stringify(packData.version) : packData.version) === version) {
|
|
106
|
+
globalResourcePacks.splice(i, 1);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
import_fs.default.writeFileSync(this.globalResoucePacksPath, JSON.stringify(globalResourcePacks));
|
|
111
|
+
}
|
|
112
|
+
getInstallPath() {
|
|
113
|
+
return "".concat(this.installPath, "/").concat(import_Save.Save.getBuildID());
|
|
114
|
+
}
|
|
115
|
+
packLink() {
|
|
116
|
+
import_UIBuilder.UIBuilder.delete(".minecraft");
|
|
117
|
+
import_fs.default.symlinkSync(this.getInstallPath(), ".minecraft", "junction");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
ResourcePacks
|
|
123
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var PreCompile_exports = {};
|
|
30
|
+
__export(PreCompile_exports, {
|
|
31
|
+
UIWriteJson: () => UIWriteJson,
|
|
32
|
+
WritePreComment: () => WritePreComment,
|
|
33
|
+
jsonFilePath: () => jsonFilePath
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(PreCompile_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_Config = require("./Config");
|
|
38
|
+
if (!import_fs.default.existsSync("comment.txt")) {
|
|
39
|
+
import_fs.default.writeFileSync("comment.txt", "", "utf-8");
|
|
40
|
+
}
|
|
41
|
+
const timeMap = {};
|
|
42
|
+
console.time = function(label) {
|
|
43
|
+
timeMap[label] = performance.now();
|
|
44
|
+
};
|
|
45
|
+
console.timeLog = function(tag, ...data) {
|
|
46
|
+
const now = performance.now();
|
|
47
|
+
const time = now - timeMap[tag];
|
|
48
|
+
console.log(
|
|
49
|
+
"\x1B[90m[".concat(time.toFixed(2), "ms]"),
|
|
50
|
+
"\x1B[32m[".concat(tag, "]\x1B[0m"),
|
|
51
|
+
">>",
|
|
52
|
+
...data,
|
|
53
|
+
"\x1B[0m"
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
console.timeEnd = function(label) {
|
|
57
|
+
delete timeMap[label];
|
|
58
|
+
};
|
|
59
|
+
function WritePreComment(data) {
|
|
60
|
+
const comment = "This file is generated by the JSONUI SCRIPTING compiler. Do not edit it directly.";
|
|
61
|
+
if (import_fs.default.readFileSync("comment.txt", "utf-8").trim() !== "") {
|
|
62
|
+
const info = import_fs.default.readFileSync("comment.txt", "utf-8").replaceAll("\n", "\n * ");
|
|
63
|
+
return "/*\n * ".concat(comment, "\n * ----------------------------------------------------------------------\n * ").concat(info, "\n */\n").concat(JSON.stringify(
|
|
64
|
+
data
|
|
65
|
+
));
|
|
66
|
+
} else {
|
|
67
|
+
return "// ".concat(comment, "\n").concat(JSON.stringify(data));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const jsonFilePath = [];
|
|
71
|
+
function UIWriteJson(file, data, options) {
|
|
72
|
+
const writeData = JSON.stringify(data);
|
|
73
|
+
if (writeData == "{}") return;
|
|
74
|
+
if (import_Config.Configs.getConfig().compiler.encodeJson) {
|
|
75
|
+
import_fs.default.writeFileSync(file, writeData, options);
|
|
76
|
+
} else {
|
|
77
|
+
import_fs.default.writeFileSync(file, WritePreComment(data), options);
|
|
78
|
+
}
|
|
79
|
+
jsonFilePath.push(file);
|
|
80
|
+
}
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
UIWriteJson,
|
|
84
|
+
WritePreComment,
|
|
85
|
+
jsonFilePath
|
|
86
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var GenerateDir_exports = {};
|
|
30
|
+
__export(GenerateDir_exports, {
|
|
31
|
+
GenerateDir: () => GenerateDir
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(GenerateDir_exports);
|
|
34
|
+
var import_fs = __toESM(require("fs"));
|
|
35
|
+
function GenerateDir(installPath, path) {
|
|
36
|
+
path = path ? "".concat(installPath, "/").concat(path) : installPath;
|
|
37
|
+
if (!import_fs.default.existsSync(path)) {
|
|
38
|
+
let lastPath = "";
|
|
39
|
+
const folderPath = path.split("/") || [];
|
|
40
|
+
folderPath.pop();
|
|
41
|
+
for (const folder of folderPath) {
|
|
42
|
+
if (!(folder === "" || import_fs.default.existsSync("".concat(lastPath).concat(folder))))
|
|
43
|
+
import_fs.default.mkdirSync("".concat(lastPath).concat(folder));
|
|
44
|
+
lastPath = "".concat(lastPath).concat(folder, "/");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
GenerateDir
|
|
51
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
var JsonBuilder_exports = {};
|
|
22
|
+
__export(JsonBuilder_exports, {
|
|
23
|
+
JsonBuilder: () => JsonBuilder
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(JsonBuilder_exports);
|
|
26
|
+
var import_Class = require("../../components/Class");
|
|
27
|
+
var import_Config = require("../Config");
|
|
28
|
+
var import_CurrentLine = require("../reader/CurrentLine");
|
|
29
|
+
var import_Log = require("./Log");
|
|
30
|
+
class JsonBuilder extends import_Class.Class {
|
|
31
|
+
static registerGlobalVariable(key, value) {
|
|
32
|
+
this.save.globalVariables["$".concat(key)] = value;
|
|
33
|
+
}
|
|
34
|
+
static registerElement(namespace, element) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
const extension = import_Config.Configs.getConfig().compiler.fileExtension;
|
|
37
|
+
const buildFile = (_a = this.save.build)[_b = "".concat(namespace).concat(extension === "" ? "" : ".".concat(extension))] || (_a[_b] = { namespace });
|
|
38
|
+
for (const e in buildFile) {
|
|
39
|
+
if (e.split("@")[0] === element.getFullPath().split("@")[0]) {
|
|
40
|
+
import_Log.Log.error(
|
|
41
|
+
"".concat((0, import_CurrentLine.CurrentLine)(), " element has a duplicate name and namespace, which can be override.")
|
|
42
|
+
);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
buildFile[element.getFullPath()] = element;
|
|
47
|
+
}
|
|
48
|
+
static getModify(modifyFile, modifyElement) {
|
|
49
|
+
var _a;
|
|
50
|
+
return (_a = this.save.modify[modifyFile]) == null ? void 0 : _a[modifyElement];
|
|
51
|
+
}
|
|
52
|
+
static registerModify(modifyFile, modifyElement, modify) {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
const modifyFileSave = (_b = (_a = this.save.modify)[modifyFile]) != null ? _b : _a[modifyFile] = {};
|
|
55
|
+
return modifyFileSave[modifyElement] = modify;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
__publicField(JsonBuilder, "save", {
|
|
59
|
+
build: {},
|
|
60
|
+
globalVariables: {},
|
|
61
|
+
modify: {}
|
|
62
|
+
});
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
JsonBuilder
|
|
66
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var LangBuilder_exports = {};
|
|
30
|
+
__export(LangBuilder_exports, {
|
|
31
|
+
LangBuilder: () => LangBuilder
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(LangBuilder_exports);
|
|
34
|
+
var import_fs = __toESM(require("fs"));
|
|
35
|
+
var import_Class = require("../../components/Class");
|
|
36
|
+
var import_LocalizeText = require("../../components/LocalizeText");
|
|
37
|
+
class LangBuilder extends import_Class.Class {
|
|
38
|
+
static build(buildPath) {
|
|
39
|
+
import_fs.default.mkdirSync("".concat(buildPath, "/texts"), { recursive: true });
|
|
40
|
+
for (const langFile in import_LocalizeText.localizeText) {
|
|
41
|
+
const langContent = import_LocalizeText.localizeText[langFile];
|
|
42
|
+
let text = "## The entire text below is built entirely using JSONUI SCRIPTING!";
|
|
43
|
+
for (const key in langContent) {
|
|
44
|
+
text += "\n".concat(key, "=").concat(langContent[key]);
|
|
45
|
+
}
|
|
46
|
+
if (import_fs.default.existsSync(".bedrock/texts/".concat(langFile, ".lang"))) {
|
|
47
|
+
const content = import_fs.default.readFileSync(".bedrock/texts/".concat(langFile, ".lang"), "utf-8");
|
|
48
|
+
import_fs.default.writeFileSync(
|
|
49
|
+
"".concat(buildPath, "/texts/").concat(langFile, ".lang"),
|
|
50
|
+
"".concat(content, "\n\n").concat(text),
|
|
51
|
+
"utf-8"
|
|
52
|
+
);
|
|
53
|
+
console.timeLog("COMPILER", "".concat(langFile, ".lang has been updated!"));
|
|
54
|
+
} else {
|
|
55
|
+
import_fs.default.writeFileSync("".concat(buildPath, "/texts/").concat(langFile, ".lang"), text, "utf-8");
|
|
56
|
+
console.timeLog("COMPILER", "".concat(langFile, ".lang has been generated!"));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return Object.keys(import_LocalizeText.localizeText).length;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
LangBuilder
|
|
65
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Log_exports = {};
|
|
20
|
+
__export(Log_exports, {
|
|
21
|
+
Log: () => Log,
|
|
22
|
+
Logs: () => Logs
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Log_exports);
|
|
25
|
+
var import_Class = require("../../components/Class");
|
|
26
|
+
const Logs = [];
|
|
27
|
+
class Log extends import_Class.Class {
|
|
28
|
+
static warning(message) {
|
|
29
|
+
Logs.push({
|
|
30
|
+
type: "warning",
|
|
31
|
+
message: "\x1B[93m[Warning]\x1B[0m >> ".concat(message)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
static error(message) {
|
|
35
|
+
Logs.push({
|
|
36
|
+
type: "error",
|
|
37
|
+
message: "\x1B[31m[Error]\x1B[0m >> ".concat(message)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
Log,
|
|
44
|
+
Logs
|
|
45
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
var Manifest_exports = {};
|
|
22
|
+
__export(Manifest_exports, {
|
|
23
|
+
Manifest: () => Manifest
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Manifest_exports);
|
|
26
|
+
var import_Manifest = require("../../types/objects/Manifest");
|
|
27
|
+
var import_Save = require("./Save");
|
|
28
|
+
class Manifest {
|
|
29
|
+
constructor(header, type = import_Manifest.Type.Resources, metadata) {
|
|
30
|
+
__publicField(this, "manifest");
|
|
31
|
+
const uuid = import_Save.Save.uuid();
|
|
32
|
+
this.manifest = {
|
|
33
|
+
format_version: 2,
|
|
34
|
+
header: {
|
|
35
|
+
name: header.name,
|
|
36
|
+
uuid: header.uuid || uuid[0],
|
|
37
|
+
description: header.description,
|
|
38
|
+
version: header.version || [1, 0, 0]
|
|
39
|
+
},
|
|
40
|
+
modules: [
|
|
41
|
+
{
|
|
42
|
+
type,
|
|
43
|
+
uuid: uuid[1],
|
|
44
|
+
version: [1, 0, 0]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
metadata: metadata && {
|
|
48
|
+
authors: metadata.authors,
|
|
49
|
+
license: metadata.license,
|
|
50
|
+
url: metadata.url,
|
|
51
|
+
product_type: metadata.producType,
|
|
52
|
+
generated_with: metadata.generatedWith
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
buildJson() {
|
|
57
|
+
return JSON.stringify(this.manifest, null, 4);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
Manifest
|
|
63
|
+
});
|