bc-deeplib 1.0.1 → 1.0.2
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/Base/BaseModule.js +5 -5
- package/dist/Base/SettingUtils.d.ts +1 -1
- package/dist/Base/SettingUtils.js +34 -1
- package/dist/DeepLib.d.ts +12 -0
- package/dist/DeepLib.js +12 -0
- package/dist/Modules/Version.d.ts +1 -2
- package/dist/Modules/Version.js +11 -11
- package/dist/Screens/Support.js +4 -4
- package/dist/Utils/Data.js +3 -3
- package/dist/Utils/SDK.d.ts +1 -1
- package/dist/Utils/SDK.js +9 -9
- package/package.json +1 -1
package/dist/Base/BaseModule.js
CHANGED
|
@@ -13,13 +13,13 @@ class BaseModule {
|
|
|
13
13
|
get settings() {
|
|
14
14
|
if (!this.settingsStorage)
|
|
15
15
|
return {};
|
|
16
|
-
if (!(0, Data_js_1.PlayerStorage)(SDK_js_1.
|
|
17
|
-
Player[SDK_js_1.
|
|
16
|
+
if (!(0, Data_js_1.PlayerStorage)(SDK_js_1.bcSdkMod.ModInfo.name)) {
|
|
17
|
+
Player[SDK_js_1.bcSdkMod.ModInfo.name] = {};
|
|
18
18
|
this.registerDefaultSettings();
|
|
19
19
|
}
|
|
20
|
-
else if (!(0, Data_js_1.PlayerStorage)(SDK_js_1.
|
|
20
|
+
else if (!(0, Data_js_1.PlayerStorage)(SDK_js_1.bcSdkMod.ModInfo.name)[this.settingsStorage])
|
|
21
21
|
this.registerDefaultSettings();
|
|
22
|
-
return (0, Data_js_1.PlayerStorage)(SDK_js_1.
|
|
22
|
+
return (0, Data_js_1.PlayerStorage)(SDK_js_1.bcSdkMod.ModInfo.name)[this.settingsStorage];
|
|
23
23
|
}
|
|
24
24
|
get defaultSettings() {
|
|
25
25
|
return null;
|
|
@@ -32,7 +32,7 @@ class BaseModule {
|
|
|
32
32
|
const defaults = this.defaultSettings;
|
|
33
33
|
if (!storage || !defaults)
|
|
34
34
|
return;
|
|
35
|
-
(0, Data_js_1.PlayerStorage)(SDK_js_1.
|
|
35
|
+
(0, Data_js_1.PlayerStorage)(SDK_js_1.bcSdkMod.ModInfo.name)[storage] = Object.assign(defaults, (0, Data_js_1.PlayerStorage)(SDK_js_1.bcSdkMod.ModInfo.name)[storage] ?? {});
|
|
36
36
|
}
|
|
37
37
|
Load() { }
|
|
38
38
|
Run() { }
|
|
@@ -11,7 +11,7 @@ export declare class GUI extends BaseModule {
|
|
|
11
11
|
get currentSubscreen(): GuiSubscreen | null;
|
|
12
12
|
set currentSubscreen(subscreen: GuiSubscreen | string | null);
|
|
13
13
|
get currentCharacter(): Character;
|
|
14
|
-
constructor(
|
|
14
|
+
constructor();
|
|
15
15
|
get defaultSettings(): null;
|
|
16
16
|
Load(): void;
|
|
17
17
|
}
|
|
@@ -3,8 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GUI = void 0;
|
|
4
4
|
const BaseModule_js_1 = require("./BaseModule.js");
|
|
5
5
|
const Modules_js_1 = require("./Modules.js");
|
|
6
|
+
const RibbonMenu_js_1 = require("../Utils/RibbonMenu.js");
|
|
7
|
+
const Translation_js_1 = require("../Utils/Translation.js");
|
|
6
8
|
const SettingDefinitions_js_1 = require("./SettingDefinitions.js");
|
|
7
9
|
const MainMenu_js_1 = require("../Screens/MainMenu.js");
|
|
10
|
+
const SDK_js_1 = require("../Utils/SDK.js");
|
|
8
11
|
class GUI extends BaseModule_js_1.BaseModule {
|
|
9
12
|
static instance = null;
|
|
10
13
|
_subscreens;
|
|
@@ -44,7 +47,7 @@ class GUI extends BaseModule_js_1.BaseModule {
|
|
|
44
47
|
get currentCharacter() {
|
|
45
48
|
return Player;
|
|
46
49
|
}
|
|
47
|
-
constructor(
|
|
50
|
+
constructor() {
|
|
48
51
|
super();
|
|
49
52
|
if (GUI.instance) {
|
|
50
53
|
throw new Error("Duplicate initialization");
|
|
@@ -63,6 +66,36 @@ class GUI extends BaseModule_js_1.BaseModule {
|
|
|
63
66
|
this._subscreens.push(new module.settingsScreen(module));
|
|
64
67
|
}
|
|
65
68
|
this._mainMenu.subscreens = this._subscreens;
|
|
69
|
+
let modIndex = RibbonMenu_js_1.RibbonMenu.getModIndex(SDK_js_1.bcSdkMod.ModInfo.name);
|
|
70
|
+
SDK_js_1.bcSdkMod.prototype.hookFunction("PreferenceRun", SDK_js_1.HookPriority.OverrideBehavior, (args, next) => {
|
|
71
|
+
if (this._currentSubscreen) {
|
|
72
|
+
MainCanvas.textAlign = "left";
|
|
73
|
+
this._currentSubscreen.Run();
|
|
74
|
+
MainCanvas.textAlign = "center";
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
next(args);
|
|
78
|
+
RibbonMenu_js_1.RibbonMenu.drawModButton(modIndex, (modIndex) => {
|
|
79
|
+
DrawButton(1815, RibbonMenu_js_1.RibbonMenu.getYPos(modIndex), 90, 90, "", "White", "Icons/Arousal.png", (0, Translation_js_1.getText)("infosheet.button.responsive_popup"));
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
SDK_js_1.bcSdkMod.prototype.hookFunction("PreferenceClick", SDK_js_1.HookPriority.OverrideBehavior, (args, next) => {
|
|
83
|
+
if (this._currentSubscreen) {
|
|
84
|
+
this._currentSubscreen.Click();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
next(args);
|
|
88
|
+
RibbonMenu_js_1.RibbonMenu.handleModClick(modIndex, (modIndex) => {
|
|
89
|
+
(0, SettingDefinitions_js_1.setSubscreen)(new MainMenu_js_1.MainMenu(this));
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
SDK_js_1.bcSdkMod.prototype.hookFunction("InformationSheetExit", SDK_js_1.HookPriority.OverrideBehavior, (args, next) => {
|
|
93
|
+
if (this._currentSubscreen) {
|
|
94
|
+
this._currentSubscreen.Exit();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
return next(args);
|
|
98
|
+
});
|
|
66
99
|
}
|
|
67
100
|
}
|
|
68
101
|
exports.GUI = GUI;
|
package/dist/DeepLib.d.ts
CHANGED
|
@@ -3,3 +3,15 @@ export * from './Base/BaseSetting.js';
|
|
|
3
3
|
export * from './Base/Modules.js';
|
|
4
4
|
export * from './Base/SettingDefinitions.js';
|
|
5
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
CHANGED
|
@@ -19,3 +19,15 @@ __exportStar(require("./Base/BaseSetting.js"), exports);
|
|
|
19
19
|
__exportStar(require("./Base/Modules.js"), exports);
|
|
20
20
|
__exportStar(require("./Base/SettingDefinitions.js"), exports);
|
|
21
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,10 +1,9 @@
|
|
|
1
1
|
import { BaseModule } from "../Base/BaseModule";
|
|
2
|
-
import { ModSDKModAPI } from 'bondage-club-mod-sdk';
|
|
3
2
|
export declare class VersionModule extends BaseModule {
|
|
4
3
|
private static isItNewVersion;
|
|
5
4
|
static Version: string;
|
|
6
5
|
static NewVersionMessage: string;
|
|
7
|
-
constructor(
|
|
6
|
+
constructor(newVersionMessage: string);
|
|
8
7
|
Load(): void;
|
|
9
8
|
static isNewVersion(current: string | undefined, candidate: string): boolean;
|
|
10
9
|
static sendNewVersionMessage(): void;
|
package/dist/Modules/Version.js
CHANGED
|
@@ -9,15 +9,17 @@ class VersionModule extends BaseModule_1.BaseModule {
|
|
|
9
9
|
static isItNewVersion = false;
|
|
10
10
|
static Version;
|
|
11
11
|
static NewVersionMessage;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(newVersionMessage) {
|
|
13
13
|
super();
|
|
14
|
-
VersionModule.Version = version;
|
|
14
|
+
VersionModule.Version = SDK_1.bcSdkMod.ModInfo.version;
|
|
15
15
|
VersionModule.NewVersionMessage = newVersionMessage;
|
|
16
16
|
}
|
|
17
17
|
Load() {
|
|
18
|
-
SDK_1.
|
|
18
|
+
SDK_1.bcSdkMod.prototype.hookFunction("ChatRoomSync", SDK_1.HookPriority.Observe, (args, next) => {
|
|
19
19
|
next(args);
|
|
20
|
-
|
|
20
|
+
if ((0, Data_1.PlayerStorage)(SDK_1.bcSdkMod.ModInfo.name).Global.ShowNewVersionMessage && VersionModule.isItNewVersion) {
|
|
21
|
+
VersionModule.sendNewVersionMessage();
|
|
22
|
+
}
|
|
21
23
|
}, 'VersionsModule');
|
|
22
24
|
}
|
|
23
25
|
static isNewVersion(current, candidate) {
|
|
@@ -36,18 +38,16 @@ class VersionModule extends BaseModule_1.BaseModule {
|
|
|
36
38
|
return false;
|
|
37
39
|
}
|
|
38
40
|
static sendNewVersionMessage() {
|
|
39
|
-
|
|
40
|
-
(0, Messages_1.sendLocalSmart)("DeepLibModNewVersion", VersionModule.NewVersionMessage);
|
|
41
|
-
}
|
|
41
|
+
(0, Messages_1.sendLocalSmart)("DeepLibModNewVersion", VersionModule.NewVersionMessage);
|
|
42
42
|
}
|
|
43
43
|
static saveVersion() {
|
|
44
|
-
if ((0, Data_1.PlayerStorage)(SDK_1.
|
|
45
|
-
(0, Data_1.PlayerStorage)(SDK_1.
|
|
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
46
|
}
|
|
47
47
|
}
|
|
48
48
|
static loadVersion() {
|
|
49
|
-
if ((0, Data_1.PlayerStorage)(SDK_1.
|
|
50
|
-
return (0, Data_1.PlayerStorage)(SDK_1.
|
|
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
51
|
}
|
|
52
52
|
return;
|
|
53
53
|
}
|
package/dist/Screens/Support.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.GuiSupport = void 0;
|
|
|
4
4
|
const BaseSetting_js_1 = require("../Base/BaseSetting.js");
|
|
5
5
|
const Translation_js_1 = require("../Utils/Translation.js");
|
|
6
6
|
class GuiSupport extends BaseSetting_js_1.GuiSubscreen {
|
|
7
|
-
static thankYouList = ['Ellena'];
|
|
7
|
+
static thankYouList = ['Ellena', 'weboos'];
|
|
8
8
|
static thankYouNext = 0;
|
|
9
9
|
static thankYou = '';
|
|
10
10
|
get name() {
|
|
@@ -51,9 +51,9 @@ class GuiSupport extends BaseSetting_js_1.GuiSubscreen {
|
|
|
51
51
|
}
|
|
52
52
|
Load() {
|
|
53
53
|
GuiSupport.doNextThankYou();
|
|
54
|
-
ElementCreateDiv('
|
|
55
|
-
let elm = document.getElementById('
|
|
56
|
-
ElementContent('
|
|
54
|
+
ElementCreateDiv('DeepLibGratitude');
|
|
55
|
+
let elm = document.getElementById('DeepLibGratitude');
|
|
56
|
+
ElementContent('DeepLibGratitude', gratitudeHtml);
|
|
57
57
|
const font = MainCanvas.canvas.clientWidth <= MainCanvas.canvas.clientHeight * 2
|
|
58
58
|
? MainCanvas.canvas.clientWidth / 50
|
|
59
59
|
: MainCanvas.canvas.clientHeight / 25;
|
package/dist/Utils/Data.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.PlayerStorage = PlayerStorage;
|
|
|
9
9
|
const ExtensionStorage = (modName) => Player.ExtensionSettings[modName];
|
|
10
10
|
exports.ExtensionStorage = ExtensionStorage;
|
|
11
11
|
function dataTake() {
|
|
12
|
-
const modName = SDK_js_1.
|
|
12
|
+
const modName = SDK_js_1.bcSdkMod.ModInfo.name;
|
|
13
13
|
if ((0, exports.ExtensionStorage)(modName)) {
|
|
14
14
|
Player[modName] = JSON.parse(LZString.decompressFromBase64((0, exports.ExtensionStorage)(modName)));
|
|
15
15
|
}
|
|
@@ -19,8 +19,8 @@ function dataTake() {
|
|
|
19
19
|
}
|
|
20
20
|
exports.dataTake = dataTake;
|
|
21
21
|
function dataStore() {
|
|
22
|
-
const modName = SDK_js_1.
|
|
23
|
-
const modVersion = SDK_js_1.
|
|
22
|
+
const modName = SDK_js_1.bcSdkMod.ModInfo.name;
|
|
23
|
+
const modVersion = SDK_js_1.bcSdkMod.ModInfo.version;
|
|
24
24
|
if (!(0, exports.ExtensionStorage)(modName))
|
|
25
25
|
Player.ExtensionSettings[modName] = '';
|
|
26
26
|
const Data = {
|
package/dist/Utils/SDK.d.ts
CHANGED
package/dist/Utils/SDK.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.bcSdkMod = exports.HookPriority = void 0;
|
|
7
7
|
const bondage_club_mod_sdk_1 = __importDefault(require("bondage-club-mod-sdk"));
|
|
8
8
|
var HookPriority;
|
|
9
9
|
(function (HookPriority) {
|
|
@@ -13,22 +13,22 @@ var HookPriority;
|
|
|
13
13
|
HookPriority[HookPriority["OverrideBehavior"] = 10] = "OverrideBehavior";
|
|
14
14
|
HookPriority[HookPriority["Top"] = 100] = "Top";
|
|
15
15
|
})(HookPriority || (exports.HookPriority = HookPriority = {}));
|
|
16
|
-
class
|
|
16
|
+
class bcSdkMod {
|
|
17
17
|
static SDK;
|
|
18
18
|
static patchedFunctions = new Map();
|
|
19
19
|
static ModInfo;
|
|
20
20
|
constructor(info, options) {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
bcSdkMod.SDK = bondage_club_mod_sdk_1.default.registerMod(info, options);
|
|
22
|
+
bcSdkMod.ModInfo = info;
|
|
23
23
|
}
|
|
24
24
|
initPatchableFunction(target) {
|
|
25
|
-
let result =
|
|
25
|
+
let result = bcSdkMod.patchedFunctions.get(target);
|
|
26
26
|
if (!result) {
|
|
27
27
|
result = {
|
|
28
28
|
name: target,
|
|
29
29
|
hooks: []
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
bcSdkMod.patchedFunctions.set(target, result);
|
|
32
32
|
}
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
@@ -37,7 +37,7 @@ class bcModSdk {
|
|
|
37
37
|
if (data.hooks.some((h) => h.hook === hook)) {
|
|
38
38
|
return () => null;
|
|
39
39
|
}
|
|
40
|
-
const removeCallback =
|
|
40
|
+
const removeCallback = bcSdkMod.SDK?.hookFunction(target, priority, hook);
|
|
41
41
|
data.hooks.push({
|
|
42
42
|
hook,
|
|
43
43
|
priority,
|
|
@@ -61,7 +61,7 @@ class bcModSdk {
|
|
|
61
61
|
return true;
|
|
62
62
|
}
|
|
63
63
|
removeAllHooksByModule(module) {
|
|
64
|
-
for (const data of
|
|
64
|
+
for (const data of bcSdkMod.patchedFunctions.values()) {
|
|
65
65
|
for (let i = data.hooks.length - 1; i >= 0; i--) {
|
|
66
66
|
if (data.hooks[i].module === module) {
|
|
67
67
|
data.hooks[i].removeCallback();
|
|
@@ -72,4 +72,4 @@ class bcModSdk {
|
|
|
72
72
|
return true;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
exports.
|
|
75
|
+
exports.bcSdkMod = bcSdkMod;
|