bc-deeplib 1.0.2 → 1.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.
Files changed (48) hide show
  1. package/.types/declarations.d.ts +15 -0
  2. package/.types/elements.d.ts +38 -0
  3. package/.types/type-override.d.ts +3 -0
  4. package/README.md +1 -1
  5. package/dist/main.js +1894 -0
  6. package/dist/main.js.map +1 -0
  7. package/dist/public/styles/DeepLib.css +206 -0
  8. package/dist/public/styles/Gratitude.css +23 -0
  9. package/package.json +28 -12
  10. package/public/styles/DeepLib.css +206 -0
  11. package/public/styles/Gratitude.css +23 -0
  12. package/src/DeepLib.ts +33 -0
  13. package/dist/Base/BaseModule.d.ts +0 -13
  14. package/dist/Base/BaseModule.js +0 -41
  15. package/dist/Base/BaseSetting.d.ts +0 -29
  16. package/dist/Base/BaseSetting.js +0 -152
  17. package/dist/Base/Modules.d.ts +0 -5
  18. package/dist/Base/Modules.js +0 -17
  19. package/dist/Base/SettingDefinitions.d.ts +0 -8
  20. package/dist/Base/SettingDefinitions.js +0 -19
  21. package/dist/Base/SettingUtils.d.ts +0 -17
  22. package/dist/Base/SettingUtils.js +0 -101
  23. package/dist/DeepLib.d.ts +0 -17
  24. package/dist/DeepLib.js +0 -33
  25. package/dist/Models/Base.d.ts +0 -4
  26. package/dist/Models/Base.js +0 -2
  27. package/dist/Models/Settings.d.ts +0 -6
  28. package/dist/Models/Settings.js +0 -2
  29. package/dist/Modules/Version.d.ts +0 -13
  30. package/dist/Modules/Version.js +0 -62
  31. package/dist/Screens/MainMenu.d.ts +0 -11
  32. package/dist/Screens/MainMenu.js +0 -80
  33. package/dist/Screens/Support.d.ts +0 -14
  34. package/dist/Screens/Support.js +0 -99
  35. package/dist/Utils/Data.d.ts +0 -5
  36. package/dist/Utils/Data.js +0 -42
  37. package/dist/Utils/Logger.d.ts +0 -4
  38. package/dist/Utils/Logger.js +0 -6
  39. package/dist/Utils/Messages.d.ts +0 -2
  40. package/dist/Utils/Messages.js +0 -32
  41. package/dist/Utils/RibbonMenu.d.ts +0 -9
  42. package/dist/Utils/RibbonMenu.js +0 -32
  43. package/dist/Utils/SDK.d.ts +0 -21
  44. package/dist/Utils/SDK.js +0 -75
  45. package/dist/Utils/String.d.ts +0 -5
  46. package/dist/Utils/String.js +0 -30
  47. package/dist/Utils/Translation.d.ts +0 -10
  48. package/dist/Utils/Translation.js +0 -43
package/dist/DeepLib.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export * from './Base/BaseModule.js';
2
- export * from './Base/BaseSetting.js';
3
- export * from './Base/Modules.js';
4
- export * from './Base/SettingDefinitions.js';
5
- export * from './Base/SettingUtils.js';
6
- export * from './Models/Base.js';
7
- export * from './Models/Settings.js';
8
- export * from './Modules/Version.js';
9
- export * from './Screens/MainMenu.js';
10
- export * from './Screens/Support.js';
11
- export * from './Utils/Data.js';
12
- export * from './Utils/Logger.js';
13
- export * from './Utils/Messages.js';
14
- export * from './Utils/RibbonMenu.js';
15
- export * from './Utils/SDK.js';
16
- export * from './Utils/String.js';
17
- export * from './Utils/Translation.js';
package/dist/DeepLib.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Base/BaseModule.js"), exports);
18
- __exportStar(require("./Base/BaseSetting.js"), exports);
19
- __exportStar(require("./Base/Modules.js"), exports);
20
- __exportStar(require("./Base/SettingDefinitions.js"), exports);
21
- __exportStar(require("./Base/SettingUtils.js"), exports);
22
- __exportStar(require("./Models/Base.js"), exports);
23
- __exportStar(require("./Models/Settings.js"), exports);
24
- __exportStar(require("./Modules/Version.js"), exports);
25
- __exportStar(require("./Screens/MainMenu.js"), exports);
26
- __exportStar(require("./Screens/Support.js"), exports);
27
- __exportStar(require("./Utils/Data.js"), exports);
28
- __exportStar(require("./Utils/Logger.js"), exports);
29
- __exportStar(require("./Utils/Messages.js"), exports);
30
- __exportStar(require("./Utils/RibbonMenu.js"), exports);
31
- __exportStar(require("./Utils/SDK.js"), exports);
32
- __exportStar(require("./Utils/String.js"), exports);
33
- __exportStar(require("./Utils/Translation.js"), exports);
@@ -1,4 +0,0 @@
1
- export type BaseSettingsModel = {
2
- ModEnabled: boolean;
3
- ShowNewVersionMessage: boolean;
4
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { BaseSettingsModel } from './Base';
2
- export type SettingsModel = {
3
- [x: string]: any;
4
- Global: BaseSettingsModel;
5
- Version: string;
6
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- import { BaseModule } from "../Base/BaseModule";
2
- export declare class VersionModule extends BaseModule {
3
- private static isItNewVersion;
4
- static Version: string;
5
- static NewVersionMessage: string;
6
- constructor(newVersionMessage: string);
7
- Load(): void;
8
- static isNewVersion(current: string | undefined, candidate: string): boolean;
9
- static sendNewVersionMessage(): void;
10
- static saveVersion(): void;
11
- static loadVersion(): string | undefined;
12
- static checkIfNewVersion(): void;
13
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VersionModule = void 0;
4
- const BaseModule_1 = require("../Base/BaseModule");
5
- const Data_1 = require("../Utils/Data");
6
- const Messages_1 = require("../Utils/Messages");
7
- const SDK_1 = require("../Utils/SDK");
8
- class VersionModule extends BaseModule_1.BaseModule {
9
- static isItNewVersion = false;
10
- static Version;
11
- static NewVersionMessage;
12
- constructor(newVersionMessage) {
13
- super();
14
- VersionModule.Version = SDK_1.bcSdkMod.ModInfo.version;
15
- VersionModule.NewVersionMessage = newVersionMessage;
16
- }
17
- Load() {
18
- SDK_1.bcSdkMod.prototype.hookFunction("ChatRoomSync", SDK_1.HookPriority.Observe, (args, next) => {
19
- next(args);
20
- if ((0, Data_1.PlayerStorage)(SDK_1.bcSdkMod.ModInfo.name).Global.ShowNewVersionMessage && VersionModule.isItNewVersion) {
21
- VersionModule.sendNewVersionMessage();
22
- }
23
- }, 'VersionsModule');
24
- }
25
- static isNewVersion(current, candidate) {
26
- if (current !== undefined) {
27
- const CURRENT_ = current.split("."), CANDIDATE_ = candidate.split(".");
28
- for (let i = 0; i < 3; i++) {
29
- if (CURRENT_[i] === CANDIDATE_[i]) {
30
- continue;
31
- }
32
- return CANDIDATE_[i] > CURRENT_[i];
33
- }
34
- }
35
- if (current === undefined || current === "" || !current) {
36
- return true;
37
- }
38
- return false;
39
- }
40
- static sendNewVersionMessage() {
41
- (0, Messages_1.sendLocalSmart)("DeepLibModNewVersion", VersionModule.NewVersionMessage);
42
- }
43
- static saveVersion() {
44
- if ((0, Data_1.PlayerStorage)(SDK_1.bcSdkMod.ModInfo.name)) {
45
- (0, Data_1.PlayerStorage)(SDK_1.bcSdkMod.ModInfo.name).Version = VersionModule.Version;
46
- }
47
- }
48
- static loadVersion() {
49
- if ((0, Data_1.PlayerStorage)(SDK_1.bcSdkMod.ModInfo.name)?.Version) {
50
- return (0, Data_1.PlayerStorage)(SDK_1.bcSdkMod.ModInfo.name).Version;
51
- }
52
- return;
53
- }
54
- static checkIfNewVersion() {
55
- let LoadedVersion = VersionModule.loadVersion();
56
- if (VersionModule.isNewVersion(LoadedVersion, VersionModule.Version)) {
57
- VersionModule.isItNewVersion = true;
58
- VersionModule.saveVersion();
59
- }
60
- }
61
- }
62
- exports.VersionModule = VersionModule;
@@ -1,11 +0,0 @@
1
- import { GuiSubscreen } from '../Base/BaseSetting.js';
2
- import { GUI } from '../Base/SettingUtils.js';
3
- export declare class MainMenu extends GuiSubscreen {
4
- subscreens: GuiSubscreen[];
5
- get name(): string;
6
- constructor(module: GUI);
7
- Load(): void;
8
- Run(): void;
9
- Click(): void;
10
- Exit(): void;
11
- }
@@ -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
- }
@@ -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
- `;
@@ -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;
@@ -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;
@@ -1,4 +0,0 @@
1
- declare class Logger {
2
- }
3
- export declare const logger: Logger;
4
- export {};
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logger = void 0;
4
- class Logger {
5
- }
6
- exports.logger = new Logger();
@@ -1,2 +0,0 @@
1
- export declare function sendLocalSmart(id: string, message: string, timeoutInSeconds?: number): void;
2
- export declare function sendAction(msg: string): void;
@@ -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
- }
@@ -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;
@@ -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;
@@ -1,5 +0,0 @@
1
- export declare class _String {
2
- static encode(string: string | object): any;
3
- static decode(string: string | undefined): {} | undefined;
4
- static shuffle(string: string[]): string[];
5
- }
@@ -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;