init
This commit is contained in:
+261
@@ -0,0 +1,261 @@
|
||||
System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Button, Node, LocalSaveMgr, UIManager, UISwitcher, AudioMgr, PanelBase, AssetController, GameController, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _class3, _crd, ccclass, property, SettingPanel;
|
||||
|
||||
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
||||
|
||||
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
||||
|
||||
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
||||
|
||||
function _reportPossibleCrUseOfLocalSaveMgr(extras) {
|
||||
_reporterNs.report("LocalSaveMgr", "../framework/data/LocalSaveMgr", _context.meta, extras);
|
||||
}
|
||||
|
||||
function _reportPossibleCrUseOfUIManager(extras) {
|
||||
_reporterNs.report("UIManager", "../framework/ui/UIManager", _context.meta, extras);
|
||||
}
|
||||
|
||||
function _reportPossibleCrUseOfUISwitcher(extras) {
|
||||
_reporterNs.report("UISwitcher", "../framework/ui/UISwitcher", _context.meta, extras);
|
||||
}
|
||||
|
||||
function _reportPossibleCrUseOfAudioMgr(extras) {
|
||||
_reporterNs.report("AudioMgr", "../framework/audio/AudioMgr", _context.meta, extras);
|
||||
}
|
||||
|
||||
function _reportPossibleCrUseOfPanelBase(extras) {
|
||||
_reporterNs.report("PanelBase", "../framework/ui/PanelBase", _context.meta, extras);
|
||||
}
|
||||
|
||||
function _reportPossibleCrUseOfAssetController(extras) {
|
||||
_reporterNs.report("AssetController", "../AssetController", _context.meta, extras);
|
||||
}
|
||||
|
||||
function _reportPossibleCrUseOfGameController(extras) {
|
||||
_reporterNs.report("GameController", "../GameController", _context.meta, extras);
|
||||
}
|
||||
|
||||
return {
|
||||
setters: [function (_unresolved_) {
|
||||
_reporterNs = _unresolved_;
|
||||
}, function (_cc) {
|
||||
_cclegacy = _cc.cclegacy;
|
||||
__checkObsolete__ = _cc.__checkObsolete__;
|
||||
__checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
|
||||
_decorator = _cc._decorator;
|
||||
Button = _cc.Button;
|
||||
Node = _cc.Node;
|
||||
}, function (_unresolved_2) {
|
||||
LocalSaveMgr = _unresolved_2.LocalSaveMgr;
|
||||
}, function (_unresolved_3) {
|
||||
UIManager = _unresolved_3.UIManager;
|
||||
}, function (_unresolved_4) {
|
||||
UISwitcher = _unresolved_4.UISwitcher;
|
||||
}, function (_unresolved_5) {
|
||||
AudioMgr = _unresolved_5.AudioMgr;
|
||||
}, function (_unresolved_6) {
|
||||
PanelBase = _unresolved_6.PanelBase;
|
||||
}, function (_unresolved_7) {
|
||||
AssetController = _unresolved_7.AssetController;
|
||||
}, function (_unresolved_8) {
|
||||
GameController = _unresolved_8.GameController;
|
||||
}],
|
||||
execute: function () {
|
||||
_crd = true;
|
||||
|
||||
_cclegacy._RF.push({}, "9c4d5YfxQ1IFLInKgIGZp5p", "SettingPanel", undefined);
|
||||
|
||||
__checkObsolete__(['_decorator', 'Button', 'Component', 'Label', 'Node', 'Tween', 'tween', 'Vec3']);
|
||||
|
||||
({
|
||||
ccclass,
|
||||
property
|
||||
} = _decorator);
|
||||
|
||||
_export("SettingPanel", SettingPanel = (_dec = ccclass('SettingPanel'), _dec2 = property({
|
||||
type: Button
|
||||
}), _dec3 = property({
|
||||
type: Button
|
||||
}), _dec4 = property({
|
||||
type: Button
|
||||
}), _dec5 = property({
|
||||
type: _crd && UISwitcher === void 0 ? (_reportPossibleCrUseOfUISwitcher({
|
||||
error: Error()
|
||||
}), UISwitcher) : UISwitcher
|
||||
}), _dec6 = property({
|
||||
type: _crd && UISwitcher === void 0 ? (_reportPossibleCrUseOfUISwitcher({
|
||||
error: Error()
|
||||
}), UISwitcher) : UISwitcher
|
||||
}), _dec7 = property({
|
||||
type: Node
|
||||
}), _dec8 = property({
|
||||
type: Node
|
||||
}), _dec(_class = (_class2 = (_class3 = class SettingPanel extends (_crd && PanelBase === void 0 ? (_reportPossibleCrUseOfPanelBase({
|
||||
error: Error()
|
||||
}), PanelBase) : PanelBase) {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
||||
_initializerDefineProperty(this, "restartBtn", _descriptor, this);
|
||||
|
||||
_initializerDefineProperty(this, "closeBtn", _descriptor2, this);
|
||||
|
||||
_initializerDefineProperty(this, "toMainBtn", _descriptor3, this);
|
||||
|
||||
_initializerDefineProperty(this, "soundSwitcher", _descriptor4, this);
|
||||
|
||||
_initializerDefineProperty(this, "musicSwitcher", _descriptor5, this);
|
||||
|
||||
_initializerDefineProperty(this, "music", _descriptor6, this);
|
||||
|
||||
_initializerDefineProperty(this, "sound", _descriptor7, this);
|
||||
}
|
||||
|
||||
onLoad() {
|
||||
SettingPanel.instance = this;
|
||||
this.closeBtn.node.on(Button.EventType.CLICK, this.closeBtnCallBack, this);
|
||||
this.restartBtn.node.on(Button.EventType.CLICK, this.restartCallBack, this);
|
||||
this.toMainBtn.node.on(Button.EventType.CLICK, this.toMainCallBack, this);
|
||||
this.node.active = false;
|
||||
this.soundSwitcher.addCallBack(this.soundCallBack);
|
||||
this.musicSwitcher.addCallBack(this.musicCallBack);
|
||||
}
|
||||
|
||||
restartCallBack() {
|
||||
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
|
||||
error: Error()
|
||||
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
|
||||
error: Error()
|
||||
}), AssetController) : AssetController).instance.click);
|
||||
(_crd && GameController === void 0 ? (_reportPossibleCrUseOfGameController({
|
||||
error: Error()
|
||||
}), GameController) : GameController).getInstance().gameRestart();
|
||||
}
|
||||
|
||||
toMainCallBack() {
|
||||
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
|
||||
error: Error()
|
||||
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
|
||||
error: Error()
|
||||
}), AssetController) : AssetController).instance.click);
|
||||
(_crd && GameController === void 0 ? (_reportPossibleCrUseOfGameController({
|
||||
error: Error()
|
||||
}), GameController) : GameController).getInstance().backMain();
|
||||
}
|
||||
|
||||
soundCallBack() {
|
||||
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
|
||||
error: Error()
|
||||
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
|
||||
error: Error()
|
||||
}), AssetController) : AssetController).instance.click);
|
||||
(_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
|
||||
error: Error()
|
||||
}), LocalSaveMgr) : LocalSaveMgr).instance.activeSound(SettingPanel.instance.soundSwitcher.value);
|
||||
}
|
||||
|
||||
musicCallBack() {
|
||||
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
|
||||
error: Error()
|
||||
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
|
||||
error: Error()
|
||||
}), AssetController) : AssetController).instance.click);
|
||||
console.log("musicCallBack");
|
||||
(_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
|
||||
error: Error()
|
||||
}), LocalSaveMgr) : LocalSaveMgr).instance.activeMusic(SettingPanel.instance.musicSwitcher.value);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
(_crd && GameController === void 0 ? (_reportPossibleCrUseOfGameController({
|
||||
error: Error()
|
||||
}), GameController) : GameController).getInstance().curLevel.pause();
|
||||
}
|
||||
|
||||
onOpen() {
|
||||
SettingPanel.instance.refresh();
|
||||
SettingPanel.instance.soundSwitcher.SetValue(!(_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
|
||||
error: Error()
|
||||
}), LocalSaveMgr) : LocalSaveMgr).instance.playerData.muteSound);
|
||||
SettingPanel.instance.musicSwitcher.SetValue(!(_crd && LocalSaveMgr === void 0 ? (_reportPossibleCrUseOfLocalSaveMgr({
|
||||
error: Error()
|
||||
}), LocalSaveMgr) : LocalSaveMgr).instance.playerData.muteMusic);
|
||||
}
|
||||
|
||||
closeBtnCallBack(button) {
|
||||
(_crd && GameController === void 0 ? (_reportPossibleCrUseOfGameController({
|
||||
error: Error()
|
||||
}), GameController) : GameController).getInstance().curLevel.ContinueRun();
|
||||
(_crd && AudioMgr === void 0 ? (_reportPossibleCrUseOfAudioMgr({
|
||||
error: Error()
|
||||
}), AudioMgr) : AudioMgr).inst.playOneShot((_crd && AssetController === void 0 ? (_reportPossibleCrUseOfAssetController({
|
||||
error: Error()
|
||||
}), AssetController) : AssetController).instance.click); // AudioMgr.inst.playOneShot(AssetController.instance.click)
|
||||
|
||||
(_crd && UIManager === void 0 ? (_reportPossibleCrUseOfUIManager({
|
||||
error: Error()
|
||||
}), UIManager) : UIManager).instance.closePanel(SettingPanel);
|
||||
}
|
||||
|
||||
start() {}
|
||||
|
||||
}, _class3.instance = void 0, _class3), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "restartBtn", [_dec2], {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
initializer: function initializer() {
|
||||
return null;
|
||||
}
|
||||
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "closeBtn", [_dec3], {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
initializer: function initializer() {
|
||||
return null;
|
||||
}
|
||||
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "toMainBtn", [_dec4], {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
initializer: function initializer() {
|
||||
return null;
|
||||
}
|
||||
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "soundSwitcher", [_dec5], {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
initializer: function initializer() {
|
||||
return null;
|
||||
}
|
||||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "musicSwitcher", [_dec6], {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
initializer: function initializer() {
|
||||
return null;
|
||||
}
|
||||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "music", [_dec7], {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
initializer: function initializer() {
|
||||
return null;
|
||||
}
|
||||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "sound", [_dec8], {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
initializer: function initializer() {
|
||||
return null;
|
||||
}
|
||||
})), _class2)) || _class));
|
||||
|
||||
_cclegacy._RF.pop();
|
||||
|
||||
_crd = false;
|
||||
}
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=272d64b5902574fa3c4e1d917eb5c8c66cc47e6e.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user