bc-deeplib 1.0.2 → 1.0.3
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/.types/declarations.d.ts +15 -0
- package/.types/elements.d.ts +38 -0
- package/.types/type-override.d.ts +3 -0
- package/README.md +1 -1
- package/package.json +28 -12
- package/public/styles/DeepLib.css +206 -0
- package/public/styles/Gratitude.css +23 -0
- package/src/Base/BaseModule.ts +45 -0
- package/src/Base/BaseSubscreen.ts +198 -0
- package/src/Base/Initialization.ts +83 -0
- package/src/Base/Modules.ts +16 -0
- package/src/Base/SettingDefinitions.ts +14 -0
- package/src/DeepLib.ts +33 -0
- package/src/Migrators/BaseMigrator.ts +4 -0
- package/src/Models/Base.ts +4 -0
- package/src/Models/Settings.ts +7 -0
- package/src/Modules/GUI.ts +123 -0
- package/src/Modules/Version.ts +89 -0
- package/src/Screens/Debug.ts +99 -0
- package/src/Screens/MainMenu.ts +138 -0
- package/src/Screens/Support.ts +99 -0
- package/src/Utilities/Data.ts +40 -0
- package/src/Utilities/Elements/.AdvancedElements.ts +70 -0
- package/src/Utilities/Elements/.ElementHelpers.ts +100 -0
- package/src/Utilities/Elements/Button.ts +54 -0
- package/src/Utilities/Elements/Checkbox.ts +63 -0
- package/src/Utilities/Elements/Input.ts +72 -0
- package/src/Utilities/Elements/Label.ts +50 -0
- package/src/Utilities/Elements/Tooltip.ts +30 -0
- package/src/Utilities/Logger.ts +79 -0
- package/src/Utilities/Messages.ts +36 -0
- package/src/Utilities/SDK.ts +104 -0
- package/src/Utilities/String.ts +31 -0
- package/src/Utilities/Style.ts +24 -0
- package/src/Utilities/Translation.ts +59 -0
- package/dist/Base/BaseModule.d.ts +0 -13
- package/dist/Base/BaseModule.js +0 -41
- package/dist/Base/BaseSetting.d.ts +0 -29
- package/dist/Base/BaseSetting.js +0 -152
- package/dist/Base/Modules.d.ts +0 -5
- package/dist/Base/Modules.js +0 -17
- package/dist/Base/SettingDefinitions.d.ts +0 -8
- package/dist/Base/SettingDefinitions.js +0 -19
- package/dist/Base/SettingUtils.d.ts +0 -17
- package/dist/Base/SettingUtils.js +0 -101
- package/dist/DeepLib.d.ts +0 -17
- package/dist/DeepLib.js +0 -33
- package/dist/Models/Base.d.ts +0 -4
- package/dist/Models/Base.js +0 -2
- package/dist/Models/Settings.d.ts +0 -6
- package/dist/Models/Settings.js +0 -2
- package/dist/Modules/Version.d.ts +0 -13
- package/dist/Modules/Version.js +0 -62
- package/dist/Screens/MainMenu.d.ts +0 -11
- package/dist/Screens/MainMenu.js +0 -80
- package/dist/Screens/Support.d.ts +0 -14
- package/dist/Screens/Support.js +0 -99
- package/dist/Utils/Data.d.ts +0 -5
- package/dist/Utils/Data.js +0 -42
- package/dist/Utils/Logger.d.ts +0 -4
- package/dist/Utils/Logger.js +0 -6
- package/dist/Utils/Messages.d.ts +0 -2
- package/dist/Utils/Messages.js +0 -32
- package/dist/Utils/RibbonMenu.d.ts +0 -9
- package/dist/Utils/RibbonMenu.js +0 -32
- package/dist/Utils/SDK.d.ts +0 -21
- package/dist/Utils/SDK.js +0 -75
- package/dist/Utils/String.d.ts +0 -5
- package/dist/Utils/String.js +0 -30
- package/dist/Utils/Translation.d.ts +0 -10
- package/dist/Utils/Translation.js +0 -43
package/dist/Screens/MainMenu.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MainMenu = void 0;
|
|
4
|
-
const BaseSetting_js_1 = require("../Base/BaseSetting.js");
|
|
5
|
-
const SettingUtils_js_1 = require("../Base/SettingUtils.js");
|
|
6
|
-
class MainMenu extends BaseSetting_js_1.GuiSubscreen {
|
|
7
|
-
subscreens = [];
|
|
8
|
-
get name() {
|
|
9
|
-
return 'mainmenu';
|
|
10
|
-
}
|
|
11
|
-
constructor(module) {
|
|
12
|
-
super(module);
|
|
13
|
-
this.subscreens = module.subscreens;
|
|
14
|
-
}
|
|
15
|
-
Load() {
|
|
16
|
-
if (!SettingUtils_js_1.GUI.instance?.currentSubscreen) {
|
|
17
|
-
this.setSubscreen(this);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
super.Load();
|
|
21
|
-
}
|
|
22
|
-
Run() {
|
|
23
|
-
let tmp = BaseSetting_js_1.GuiSubscreen.START_X;
|
|
24
|
-
var prev = MainCanvas.textAlign;
|
|
25
|
-
BaseSetting_js_1.GuiSubscreen.START_X = 550;
|
|
26
|
-
MainCanvas.textAlign = 'left';
|
|
27
|
-
DrawCharacter(Player, 50, 50, 0.9, false);
|
|
28
|
-
DrawButton(1815, 75, 90, 90, '', 'White', 'Icons/Exit.png');
|
|
29
|
-
MainCanvas.textAlign = 'center';
|
|
30
|
-
let i = 0;
|
|
31
|
-
for (const screen of this.subscreens) {
|
|
32
|
-
const PX = Math.floor(i / 6);
|
|
33
|
-
const PY = i % 6;
|
|
34
|
-
if (screen.name == 'mainmenu')
|
|
35
|
-
continue;
|
|
36
|
-
DrawButton(BaseSetting_js_1.GuiSubscreen.START_X + 430 * PX, 190 + 120 * PY, 450, 90, '', 'White', '', '');
|
|
37
|
-
DrawImageResize(screen.icon, BaseSetting_js_1.GuiSubscreen.START_X + 430 * PX + 10, 190 + 120 * PY + 10, 70, 70);
|
|
38
|
-
MainCanvas.textAlign = 'left';
|
|
39
|
-
MainCanvas.textAlign = 'center';
|
|
40
|
-
i++;
|
|
41
|
-
MainCanvas.textAlign = 'left';
|
|
42
|
-
}
|
|
43
|
-
DrawButton(1500, 630, 405, 80, '', 'IndianRed');
|
|
44
|
-
DrawImageResize('Icons/ServiceBell.png', 1510, 640, 60, 60);
|
|
45
|
-
DrawTextFit('Reset', 1580, 670, 320, 'Black');
|
|
46
|
-
DrawButton(1500, 730, 405, 80, '', '#BDA203', '', 'Open Responsive Wiki on GitHub.', false);
|
|
47
|
-
DrawImageResize('Icons/Introduction.png', 1510, 740, 60, 60);
|
|
48
|
-
DrawTextFit('Wiki', 1580, 770, 320, 'Black');
|
|
49
|
-
DrawButton(1500, 830, 405, 80, '', '#49225C');
|
|
50
|
-
DrawImageResize('Assets/Female3DCG/Emoticon/Coffee/Icon.png', 1510, 840, 60, 60);
|
|
51
|
-
DrawTextFit('Support Me❤', 1580, 870, 320, 'Black');
|
|
52
|
-
BaseSetting_js_1.GuiSubscreen.START_X = tmp;
|
|
53
|
-
MainCanvas.textAlign = prev;
|
|
54
|
-
}
|
|
55
|
-
Click() {
|
|
56
|
-
if (MouseIn(1815, 75, 90, 90))
|
|
57
|
-
return this.Exit();
|
|
58
|
-
let tmp = BaseSetting_js_1.GuiSubscreen.START_X;
|
|
59
|
-
BaseSetting_js_1.GuiSubscreen.START_X = 550;
|
|
60
|
-
let i = 0;
|
|
61
|
-
for (const screen of this.subscreens) {
|
|
62
|
-
const PX = Math.floor(i / 6);
|
|
63
|
-
const PY = i % 6;
|
|
64
|
-
if (screen.name == 'mainmenu')
|
|
65
|
-
continue;
|
|
66
|
-
if (MouseIn(BaseSetting_js_1.GuiSubscreen.START_X + 430 * PX, 190 + 120 * PY, 450, 90)) {
|
|
67
|
-
this.setSubscreen(screen);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
i++;
|
|
71
|
-
}
|
|
72
|
-
BaseSetting_js_1.GuiSubscreen.START_X = tmp;
|
|
73
|
-
}
|
|
74
|
-
Exit() {
|
|
75
|
-
CharacterAppearanceForceUpCharacter = -1;
|
|
76
|
-
CharacterLoadCanvas(Player);
|
|
77
|
-
this.setSubscreen(null);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.MainMenu = MainMenu;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { GuiSubscreen } from '../Base/BaseSetting.js';
|
|
2
|
-
export declare class GuiSupport extends GuiSubscreen {
|
|
3
|
-
private static thankYouList;
|
|
4
|
-
private static thankYouNext;
|
|
5
|
-
private static thankYou;
|
|
6
|
-
get name(): string;
|
|
7
|
-
get structure(): any[];
|
|
8
|
-
static getSupporter(): string;
|
|
9
|
-
static doNextThankYou(): void;
|
|
10
|
-
Load(): void;
|
|
11
|
-
Run(): void;
|
|
12
|
-
Click(): void;
|
|
13
|
-
Exit(): void;
|
|
14
|
-
}
|
package/dist/Screens/Support.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuiSupport = void 0;
|
|
4
|
-
const BaseSetting_js_1 = require("../Base/BaseSetting.js");
|
|
5
|
-
const Translation_js_1 = require("../Utils/Translation.js");
|
|
6
|
-
class GuiSupport extends BaseSetting_js_1.GuiSubscreen {
|
|
7
|
-
static thankYouList = ['Ellena', 'weboos'];
|
|
8
|
-
static thankYouNext = 0;
|
|
9
|
-
static thankYou = '';
|
|
10
|
-
get name() {
|
|
11
|
-
return 'Support';
|
|
12
|
-
}
|
|
13
|
-
get structure() {
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
type: 'button',
|
|
17
|
-
position: [BaseSetting_js_1.GuiSubscreen.START_X, BaseSetting_js_1.GuiSubscreen.START_Y],
|
|
18
|
-
size: [405, 80],
|
|
19
|
-
label: 'support.button.ko-fi',
|
|
20
|
-
color: '#49225C',
|
|
21
|
-
image: 'https://storage.ko-fi.com/cdn/nav-logo-stroke.png',
|
|
22
|
-
disabled: false,
|
|
23
|
-
callback() {
|
|
24
|
-
window.open('https://ko-fi.com/monikka_bc', '_blank');
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
type: 'any',
|
|
29
|
-
position: [BaseSetting_js_1.GuiSubscreen.START_X, BaseSetting_js_1.GuiSubscreen.START_Y + BaseSetting_js_1.GuiSubscreen.Y_MOD + 20],
|
|
30
|
-
size: [405, 80],
|
|
31
|
-
label: 'support.button.patreon',
|
|
32
|
-
color: '#49225C',
|
|
33
|
-
image: 'https://c5.patreon.com/external/favicon/rebrand/favicon-32.png?v=af5597c2ef',
|
|
34
|
-
disabled: false,
|
|
35
|
-
callback() {
|
|
36
|
-
window.open('https://patreon.com/monikka_bc', '_blank');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
}
|
|
41
|
-
static getSupporter() {
|
|
42
|
-
if (GuiSupport.thankYouNext < CommonTime())
|
|
43
|
-
GuiSupport.doNextThankYou();
|
|
44
|
-
return `${(0, Translation_js_1.getText)('support.other.thankyou')}, ${GuiSupport.thankYou}`;
|
|
45
|
-
}
|
|
46
|
-
static doNextThankYou() {
|
|
47
|
-
if (GuiSupport.thankYou && GuiSupport.thankYouList.length < 2)
|
|
48
|
-
return;
|
|
49
|
-
GuiSupport.thankYou = CommonRandomItemFromList(GuiSupport.thankYou, GuiSupport.thankYouList);
|
|
50
|
-
GuiSupport.thankYouNext = CommonTime() + 4000;
|
|
51
|
-
}
|
|
52
|
-
Load() {
|
|
53
|
-
GuiSupport.doNextThankYou();
|
|
54
|
-
ElementCreateDiv('DeepLibGratitude');
|
|
55
|
-
let elm = document.getElementById('DeepLibGratitude');
|
|
56
|
-
ElementContent('DeepLibGratitude', gratitudeHtml);
|
|
57
|
-
const font = MainCanvas.canvas.clientWidth <= MainCanvas.canvas.clientHeight * 2
|
|
58
|
-
? MainCanvas.canvas.clientWidth / 50
|
|
59
|
-
: MainCanvas.canvas.clientHeight / 25;
|
|
60
|
-
Object.assign(elm.style, {
|
|
61
|
-
fontFamily: CommonGetFontName(),
|
|
62
|
-
fontSize: font + 'px'
|
|
63
|
-
});
|
|
64
|
-
super.Load();
|
|
65
|
-
}
|
|
66
|
-
Run() {
|
|
67
|
-
super.Run();
|
|
68
|
-
let tmp = BaseSetting_js_1.GuiSubscreen.START_X;
|
|
69
|
-
BaseSetting_js_1.GuiSubscreen.START_X = 550;
|
|
70
|
-
DrawText(GuiSupport.getSupporter(), BaseSetting_js_1.GuiSubscreen.START_X + 300, BaseSetting_js_1.GuiSubscreen.START_Y - BaseSetting_js_1.GuiSubscreen.Y_MOD, 'Black', '#D7F6E9');
|
|
71
|
-
BaseSetting_js_1.GuiSubscreen.START_X = tmp;
|
|
72
|
-
}
|
|
73
|
-
Click() {
|
|
74
|
-
super.Click();
|
|
75
|
-
}
|
|
76
|
-
Exit() {
|
|
77
|
-
ElementRemove('Gratitude');
|
|
78
|
-
super.Exit();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.GuiSupport = GuiSupport;
|
|
82
|
-
const gratitudeHtml = `
|
|
83
|
-
<h1 class="ResponsiveH">Dear Supporters!</h1>
|
|
84
|
-
<p class="ResponsiveP">
|
|
85
|
-
I want to take a moment to express my heartfelt gratitude for considering supporting me. Your willingness to stand by
|
|
86
|
-
my side in this creative journey means the world to me, and I am truly humbled by your generosity.
|
|
87
|
-
</p>
|
|
88
|
-
<p class="ResponsiveP">
|
|
89
|
-
Your support goes far beyond the financial contributions; it represents belief in my work and a shared passion for
|
|
90
|
-
what I do. Your encouragement inspires me to continue developing.
|
|
91
|
-
</p>
|
|
92
|
-
<p class="ResponsiveP">
|
|
93
|
-
Your support not only helps me sustain and grow as a developer, but also enables me to dedicate more time and
|
|
94
|
-
resources to producing high-quality mods. It allows me to explore new ideas, enhance my skills, and bring even more
|
|
95
|
-
meaningful and enjoyable content to you.
|
|
96
|
-
</p>
|
|
97
|
-
<p class="ResponsiveP">Thank you all~</p>
|
|
98
|
-
<p class="ResponsiveP">With love, Monikka♥</p>
|
|
99
|
-
`;
|
package/dist/Utils/Data.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { SettingsModel } from '../Models/Settings.js';
|
|
2
|
-
export declare const PlayerStorage: (modName: string) => SettingsModel;
|
|
3
|
-
export declare const ExtensionStorage: (modName: string) => string;
|
|
4
|
-
export declare function dataTake(): void;
|
|
5
|
-
export declare function dataStore(): void;
|
package/dist/Utils/Data.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dataStore = exports.dataTake = exports.ExtensionStorage = exports.PlayerStorage = void 0;
|
|
4
|
-
const SDK_js_1 = require("./SDK.js");
|
|
5
|
-
const DeepLib_js_1 = require("../DeepLib.js");
|
|
6
|
-
const String_js_1 = require("./String.js");
|
|
7
|
-
const PlayerStorage = (modName) => (typeof Player?.[modName] === 'object' ? CommonCloneDeep(Player?.[modName]) : undefined);
|
|
8
|
-
exports.PlayerStorage = PlayerStorage;
|
|
9
|
-
const ExtensionStorage = (modName) => Player.ExtensionSettings[modName];
|
|
10
|
-
exports.ExtensionStorage = ExtensionStorage;
|
|
11
|
-
function dataTake() {
|
|
12
|
-
const modName = SDK_js_1.bcSdkMod.ModInfo.name;
|
|
13
|
-
if ((0, exports.ExtensionStorage)(modName)) {
|
|
14
|
-
Player[modName] = JSON.parse(LZString.decompressFromBase64((0, exports.ExtensionStorage)(modName)));
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
Player[modName] = {};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.dataTake = dataTake;
|
|
21
|
-
function dataStore() {
|
|
22
|
-
const modName = SDK_js_1.bcSdkMod.ModInfo.name;
|
|
23
|
-
const modVersion = SDK_js_1.bcSdkMod.ModInfo.version;
|
|
24
|
-
if (!(0, exports.ExtensionStorage)(modName))
|
|
25
|
-
Player.ExtensionSettings[modName] = '';
|
|
26
|
-
const Data = {
|
|
27
|
-
Global: {
|
|
28
|
-
ModEnabled: (0, exports.PlayerStorage)(modName).Global.ModEnabled,
|
|
29
|
-
ShowNewVersionMessage: (0, exports.PlayerStorage)(modName).Global.ShowNewVersionMessage
|
|
30
|
-
},
|
|
31
|
-
Version: modVersion
|
|
32
|
-
};
|
|
33
|
-
for (let module of (0, DeepLib_js_1.modules)()) {
|
|
34
|
-
if (!module.settingsStorage)
|
|
35
|
-
continue;
|
|
36
|
-
Data[module.settingsStorage] = (0, exports.PlayerStorage)(modName)[module.settingsStorage];
|
|
37
|
-
}
|
|
38
|
-
;
|
|
39
|
-
Player.ExtensionSettings[modName] = String_js_1._String.encode(Data);
|
|
40
|
-
ServerPlayerExtensionSettingsSync(modName);
|
|
41
|
-
}
|
|
42
|
-
exports.dataStore = dataStore;
|
package/dist/Utils/Logger.d.ts
DELETED
package/dist/Utils/Logger.js
DELETED
package/dist/Utils/Messages.d.ts
DELETED
package/dist/Utils/Messages.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendAction = exports.sendLocalSmart = void 0;
|
|
4
|
-
function sendLocalSmart(id, message, timeoutInSeconds) {
|
|
5
|
-
const div = document.createElement('div');
|
|
6
|
-
div.id = id;
|
|
7
|
-
div.setAttribute('class', 'ChatMessage DeepLibMessage');
|
|
8
|
-
div.setAttribute('data-time', ChatRoomCurrentTime());
|
|
9
|
-
div.setAttribute('data-sender', Player?.MemberNumber + '');
|
|
10
|
-
div.innerHTML =
|
|
11
|
-
message.replaceAll('\n\t', '') +
|
|
12
|
-
`<br><a class="DeepLibText" onClick='document.getElementById("${id}").remove();'><b>Close (Click)</b></a>`;
|
|
13
|
-
ChatRoomAppendChat(div);
|
|
14
|
-
if (!timeoutInSeconds)
|
|
15
|
-
return;
|
|
16
|
-
setTimeout(() => div?.remove(), timeoutInSeconds * 1000);
|
|
17
|
-
}
|
|
18
|
-
exports.sendLocalSmart = sendLocalSmart;
|
|
19
|
-
function sendAction(msg) {
|
|
20
|
-
ServerSend('ChatRoomChat', {
|
|
21
|
-
Content: 'Beep',
|
|
22
|
-
Type: 'Action',
|
|
23
|
-
Dictionary: [
|
|
24
|
-
{ Tag: 'Beep', Text: 'msg' },
|
|
25
|
-
{ Tag: '发送私聊', Text: 'msg' },
|
|
26
|
-
{ Tag: 'Biep', Text: 'msg' },
|
|
27
|
-
{ Tag: 'Sonner', Text: 'msg' },
|
|
28
|
-
{ Tag: 'msg', Text: msg }
|
|
29
|
-
]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
exports.sendAction = sendAction;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare class RibbonMenu {
|
|
2
|
-
private static START_Y;
|
|
3
|
-
private static MOD_Y;
|
|
4
|
-
static getYPos(modIndex: number): number;
|
|
5
|
-
static registerMod(modName: string): void;
|
|
6
|
-
static getModIndex(modName: string): number | undefined;
|
|
7
|
-
static drawModButton(modIndex: number | undefined, callback: (modIndex: number) => void): void;
|
|
8
|
-
static handleModClick(modIndex: number | undefined, callback: (modIndex: number) => void): void;
|
|
9
|
-
}
|
package/dist/Utils/RibbonMenu.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RibbonMenu = void 0;
|
|
4
|
-
class RibbonMenu {
|
|
5
|
-
static START_Y = 820;
|
|
6
|
-
static MOD_Y = 110;
|
|
7
|
-
static getYPos(modIndex) {
|
|
8
|
-
return this.START_Y - this.MOD_Y * (modIndex % 6);
|
|
9
|
-
}
|
|
10
|
-
static registerMod(modName) {
|
|
11
|
-
if (!window.RibbonMenuMods)
|
|
12
|
-
window.RibbonMenuMods = [];
|
|
13
|
-
if (window.RibbonMenuMods.length >= 6)
|
|
14
|
-
return console.warn(`${modName} can't be added to Ribbon Menu. It is full`);
|
|
15
|
-
window.RibbonMenuMods.push(modName);
|
|
16
|
-
}
|
|
17
|
-
static getModIndex(modName) {
|
|
18
|
-
return window.RibbonMenuMods?.indexOf(modName);
|
|
19
|
-
}
|
|
20
|
-
static drawModButton(modIndex, callback) {
|
|
21
|
-
if (PreferenceSubscreen === "" && modIndex !== undefined)
|
|
22
|
-
callback(modIndex);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
static handleModClick(modIndex, callback) {
|
|
26
|
-
if (PreferenceSubscreen === "" && modIndex !== undefined)
|
|
27
|
-
if (MouseIn(1815, RibbonMenu.getYPos(modIndex), 90, 90))
|
|
28
|
-
callback(modIndex);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.RibbonMenu = RibbonMenu;
|
package/dist/Utils/SDK.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ModSDKModInfo, ModSDKModOptions, PatchHook } from 'bondage-club-mod-sdk';
|
|
2
|
-
export declare enum HookPriority {
|
|
3
|
-
Observe = 0,
|
|
4
|
-
AddBehavior = 1,
|
|
5
|
-
ModifyBehavior = 5,
|
|
6
|
-
OverrideBehavior = 10,
|
|
7
|
-
Top = 100
|
|
8
|
-
}
|
|
9
|
-
type ModuleCategory = string;
|
|
10
|
-
export declare class bcSdkMod {
|
|
11
|
-
private static SDK;
|
|
12
|
-
private static patchedFunctions;
|
|
13
|
-
static ModInfo: ModSDKModInfo;
|
|
14
|
-
constructor(info: ModSDKModInfo, options: ModSDKModOptions);
|
|
15
|
-
initPatchableFunction(target: string): PatchedFunctionData;
|
|
16
|
-
hookFunction(target: string, priority: number, hook: PatchHook, module?: ModuleCategory | null): () => void;
|
|
17
|
-
patchFunction(target: string, patches: Record<string, string>): void;
|
|
18
|
-
removeHookByModule(target: string, module: ModuleCategory): boolean;
|
|
19
|
-
removeAllHooksByModule(module: ModuleCategory): boolean;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
package/dist/Utils/SDK.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bcSdkMod = exports.HookPriority = void 0;
|
|
7
|
-
const bondage_club_mod_sdk_1 = __importDefault(require("bondage-club-mod-sdk"));
|
|
8
|
-
var HookPriority;
|
|
9
|
-
(function (HookPriority) {
|
|
10
|
-
HookPriority[HookPriority["Observe"] = 0] = "Observe";
|
|
11
|
-
HookPriority[HookPriority["AddBehavior"] = 1] = "AddBehavior";
|
|
12
|
-
HookPriority[HookPriority["ModifyBehavior"] = 5] = "ModifyBehavior";
|
|
13
|
-
HookPriority[HookPriority["OverrideBehavior"] = 10] = "OverrideBehavior";
|
|
14
|
-
HookPriority[HookPriority["Top"] = 100] = "Top";
|
|
15
|
-
})(HookPriority || (exports.HookPriority = HookPriority = {}));
|
|
16
|
-
class bcSdkMod {
|
|
17
|
-
static SDK;
|
|
18
|
-
static patchedFunctions = new Map();
|
|
19
|
-
static ModInfo;
|
|
20
|
-
constructor(info, options) {
|
|
21
|
-
bcSdkMod.SDK = bondage_club_mod_sdk_1.default.registerMod(info, options);
|
|
22
|
-
bcSdkMod.ModInfo = info;
|
|
23
|
-
}
|
|
24
|
-
initPatchableFunction(target) {
|
|
25
|
-
let result = bcSdkMod.patchedFunctions.get(target);
|
|
26
|
-
if (!result) {
|
|
27
|
-
result = {
|
|
28
|
-
name: target,
|
|
29
|
-
hooks: []
|
|
30
|
-
};
|
|
31
|
-
bcSdkMod.patchedFunctions.set(target, result);
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
hookFunction(target, priority, hook, module = null) {
|
|
36
|
-
const data = this.initPatchableFunction(target);
|
|
37
|
-
if (data.hooks.some((h) => h.hook === hook)) {
|
|
38
|
-
return () => null;
|
|
39
|
-
}
|
|
40
|
-
const removeCallback = bcSdkMod.SDK?.hookFunction(target, priority, hook);
|
|
41
|
-
data.hooks.push({
|
|
42
|
-
hook,
|
|
43
|
-
priority,
|
|
44
|
-
module,
|
|
45
|
-
removeCallback
|
|
46
|
-
});
|
|
47
|
-
data.hooks.sort((a, b) => b.priority - a.priority);
|
|
48
|
-
return removeCallback;
|
|
49
|
-
}
|
|
50
|
-
patchFunction(target, patches) {
|
|
51
|
-
this.patchFunction(target, patches);
|
|
52
|
-
}
|
|
53
|
-
removeHookByModule(target, module) {
|
|
54
|
-
const data = this.initPatchableFunction(target);
|
|
55
|
-
for (let i = data.hooks.length - 1; i >= 0; i--) {
|
|
56
|
-
if (data.hooks[i].module === module) {
|
|
57
|
-
data.hooks[i].removeCallback();
|
|
58
|
-
data.hooks.splice(i, 1);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
removeAllHooksByModule(module) {
|
|
64
|
-
for (const data of bcSdkMod.patchedFunctions.values()) {
|
|
65
|
-
for (let i = data.hooks.length - 1; i >= 0; i--) {
|
|
66
|
-
if (data.hooks[i].module === module) {
|
|
67
|
-
data.hooks[i].removeCallback();
|
|
68
|
-
data.hooks.splice(i, 1);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.bcSdkMod = bcSdkMod;
|
package/dist/Utils/String.d.ts
DELETED
package/dist/Utils/String.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._String = void 0;
|
|
4
|
-
class _String {
|
|
5
|
-
static encode(string) {
|
|
6
|
-
return LZString.compressToBase64(JSON.stringify(string));
|
|
7
|
-
}
|
|
8
|
-
static decode(string) {
|
|
9
|
-
let d = LZString.decompressFromBase64(string);
|
|
10
|
-
let data = {};
|
|
11
|
-
try {
|
|
12
|
-
let decoded = JSON.parse(d);
|
|
13
|
-
data = decoded;
|
|
14
|
-
}
|
|
15
|
-
catch { }
|
|
16
|
-
if (data)
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
|
-
static shuffle(string) {
|
|
20
|
-
let temp = JSON.parse(JSON.stringify(string));
|
|
21
|
-
let ret = [];
|
|
22
|
-
while (temp.length > 0) {
|
|
23
|
-
let d = Math.floor(Math.random() * temp.length);
|
|
24
|
-
ret.push(temp[d]);
|
|
25
|
-
temp.splice(d, 1);
|
|
26
|
-
}
|
|
27
|
-
return ret;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports._String = _String;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class Localization {
|
|
2
|
-
private static Translation;
|
|
3
|
-
private static FallbackTranslation;
|
|
4
|
-
private static ServerUrl;
|
|
5
|
-
static load(serverUrl: string): Promise<void>;
|
|
6
|
-
static getText(srcTag: string): string;
|
|
7
|
-
private static fetchLanguageFile;
|
|
8
|
-
private static parseLanguageFile;
|
|
9
|
-
}
|
|
10
|
-
export declare const getText: (string: string) => string;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getText = exports.Localization = void 0;
|
|
4
|
-
class Localization {
|
|
5
|
-
static Translation = {};
|
|
6
|
-
static FallbackTranslation = {};
|
|
7
|
-
static ServerUrl = '';
|
|
8
|
-
static async load(serverUrl) {
|
|
9
|
-
this.ServerUrl = serverUrl;
|
|
10
|
-
const lang = TranslationLanguage.toLowerCase();
|
|
11
|
-
this.Translation = await Localization.fetchLanguageFile(lang);
|
|
12
|
-
if (lang == 'en') {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
this.FallbackTranslation = await Localization.fetchLanguageFile('en');
|
|
16
|
-
}
|
|
17
|
-
static getText(srcTag) {
|
|
18
|
-
return this.Translation[srcTag] || this.FallbackTranslation?.[srcTag] || srcTag || '';
|
|
19
|
-
}
|
|
20
|
-
static async fetchLanguageFile(lang) {
|
|
21
|
-
const response = await fetch(`${this.ServerUrl}/translations/${lang}.lang`);
|
|
22
|
-
if (lang != 'en' && !response.ok) {
|
|
23
|
-
return this.fetchLanguageFile('en');
|
|
24
|
-
}
|
|
25
|
-
const langFileContent = await response.text();
|
|
26
|
-
return this.parseLanguageFile(langFileContent);
|
|
27
|
-
}
|
|
28
|
-
static parseLanguageFile(content) {
|
|
29
|
-
const translations = {};
|
|
30
|
-
const lines = content.split('\n');
|
|
31
|
-
for (const line of lines) {
|
|
32
|
-
if (line.trim() === '' || line.trim().startsWith('#')) {
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
const [key, value] = line.split('=');
|
|
36
|
-
translations[key.trim()] = value.trim();
|
|
37
|
-
}
|
|
38
|
-
return translations;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.Localization = Localization;
|
|
42
|
-
const getText = (string) => Localization.getText(string);
|
|
43
|
-
exports.getText = getText;
|