"use strict"; cc._RF.push(module, 'b8857ikWK9ByKZXy/MzWhtd', 'SetNormalPanel'); // Script/view/setNormal/SetNormalPanel.ts "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); var BaseView_1 = require("../../../lightMVC/core/base/BaseView"); var App_1 = require("../../Manager/App"); var SDK_1 = require("../../sdk/SDK"); var Interstitial_1 = require("../../sdk/vivo/Interstitial"); var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; var SetNormalPanel = /** @class */ (function (_super) { __extends(SetNormalPanel, _super); function SetNormalPanel() { return _super !== null && _super.apply(this, arguments) || this; } SetNormalPanel.prototype.drawView = function () { var _this = this; SDK_1.default.Instance.showInterstitial(Interstitial_1.InterstitialType.INTERSTITIAL_GAME_PAUSE); // 返回 var closeBtn = this.ui.getNode("close"); closeBtn.on(cc.Node.EventType.TOUCH_END, function () { cc.director.resume(); _this.closeView(); }, this); var btnBack = this.ui.getNode("btnBackhall"); btnBack.on(cc.Node.EventType.TOUCH_END, function () { cc.director.resume(); cc.director.loadScene("hallScene"); }, this); this.setMusic(); this.setEffect(); }; //设置音乐 SetNormalPanel.prototype.setMusic = function () { var MusicBtn = this.ui.getNode("music"); var musicOn = MusicBtn.getChildByName('on'); var musicOff = MusicBtn.getChildByName('off'); musicOn.active = (App_1.App.SoundManager.allowPlayBGM) ? true : false; musicOff.active = (App_1.App.SoundManager.allowPlayBGM) ? false : true; MusicBtn.on(cc.Node.EventType.TOUCH_END, function () { App_1.App.SoundManager.allowPlayBGM = !App_1.App.SoundManager.allowPlayBGM; musicOn.active = (App_1.App.SoundManager.allowPlayBGM) ? true : false; musicOff.active = (App_1.App.SoundManager.allowPlayBGM) ? false : true; App_1.App.LocalStorageUtil.setBoolean(App_1.App.LocalStorageUtil.lst_music, App_1.App.SoundManager.allowPlayBGM); console.log('点击音乐', App_1.App.SoundManager.allowPlayBGM); }, this); }; //设置音效 SetNormalPanel.prototype.setEffect = function () { var EffectBtn = this.ui.getNode("audio"); var effectOn = EffectBtn.getChildByName('on'); var effectOff = EffectBtn.getChildByName('off'); effectOn.active = (App_1.App.SoundManager.allowPlayEffect) ? true : false; effectOff.active = (App_1.App.SoundManager.allowPlayEffect) ? false : true; EffectBtn.on(cc.Node.EventType.TOUCH_END, function () { App_1.App.SoundManager.allowPlayEffect = !App_1.App.SoundManager.allowPlayEffect; effectOn.active = (App_1.App.SoundManager.allowPlayEffect) ? true : false; effectOff.active = (App_1.App.SoundManager.allowPlayEffect) ? false : true; App_1.App.LocalStorageUtil.setBoolean(App_1.App.LocalStorageUtil.lst_effect, App_1.App.SoundManager.allowPlayEffect); console.log('点击音效', App_1.App.SoundManager.allowPlayEffect); }, this); }; SetNormalPanel.path = function () { return "hallScene/prefabs/SetNormalPanel"; }; SetNormalPanel = __decorate([ ccclass ], SetNormalPanel); return SetNormalPanel; }(BaseView_1.BaseView)); exports.default = SetNormalPanel; cc._RF.pop();