1e05df6b-92a9-4dbd-ba55-fd849f3329b2.js
2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
"use strict";
cc._RF.push(module, '1e05d9rkqlNvbpV/YSfMymy', 'DatingEventSceneModel');
// script/game/model/DatingEventSceneModel.ts
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatingEventSceneModel = exports.DatingEventStatus = void 0;
const simba_config_manager_1 = require("simba-config-manager");
const AVG_1 = require("../../avg/AVG");
const EditorEnums_1 = require("../../avg/EditorEnums");
const DateSceneConfig_1 = require("../../config/DateSceneConfig");
const GameModelManager_1 = require("./GameModelManager");
/**
* 剧情状态
*/
var DatingEventStatus;
(function (DatingEventStatus) {
/**剧情未解锁 */
DatingEventStatus[DatingEventStatus["Locked"] = 1] = "Locked";
/**新剧情 */
DatingEventStatus[DatingEventStatus["New"] = 2] = "New";
/**剧情在进度中 */
DatingEventStatus[DatingEventStatus["InProgress"] = 3] = "InProgress";
/**完成剧情 */
DatingEventStatus[DatingEventStatus["Completed"] = 4] = "Completed";
})(DatingEventStatus = exports.DatingEventStatus || (exports.DatingEventStatus = {}));
class DatingEventSceneModel {
constructor(id) {
this._isExtra = false;
this._id = id;
this._recordKey = "de" + this._id;
this._bg = "";
}
get id() { return this._id; }
get config() { return simba_config_manager_1.ConfigManager.getConfig(DateSceneConfig_1.dateSceneConfig, this._id); }
get status() { return this._status; }
set status(v) {
if (this._status !== v) {
this._status = v;
AVG_1.GameRecord.recordVariables[this._recordKey + ".s"] = v;
}
}
get firstPlot() { return this._firstPlot; }
set firstPlot(plot) {
this._firstPlot = plot;
AVG_1.GameRecord.recordVariables[this._recordKey + ".f"] = plot.id;
}
get background() { return this._bg; }
set background(bg) {
this._bg = bg;
AVG_1.GameRecord.recordVariables[this._recordKey + ".bg"] = bg;
}
async initFromRecords() {
this._status = AVG_1.GameRecord.recordVariables[this._recordKey + ".s"] || DatingEventStatus.Locked;
let inProgress = GameModelManager_1.GameModelManager.checkBranchIsInProgress(this.id);
if (inProgress) {
this._status = DatingEventStatus.InProgress;
}
let comp = GameModelManager_1.GameModelManager.checkBranchIsComplete(this.id);
if (comp) {
this._status = DatingEventStatus.Completed;
}
let firstPlotId = this.config.DateType === EditorEnums_1.DateType.Date_Normal ? AVG_1.GameRecord.recordVariables[this._recordKey + ".f"] : this.config.start_plot_id;
this._firstPlot = (await AVG_1.getPlot(firstPlotId));
this._bg = AVG_1.GameRecord.recordVariables[this._recordKey + ".bg"] || "";
}
get isExtra() { return this._isExtra; }
set isExtra(isExtra) {
this._isExtra = isExtra;
}
}
exports.DatingEventSceneModel = DatingEventSceneModel;
cc._RF.pop();