123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- import { _decorator, Component, Label, Node, Prefab } from 'cc';
- import { SelectDifficultyPanel } from './SelectDifficultyPanel';
- import { SelectSkinPanel } from './SelectSkinPanel';
- import { SelectMapPanel } from './SelectMapPanel';
- import { LevelContainer } from './LevelContainer';
- import { defaultSkin, Difficulty, Skin, SuperFind} from '../../script/Manager/LocalDataMgr';
- import EventMgr from '../../script/Manager/EventMgr';
- const { ccclass, property } = _decorator;
- @ccclass('SuperFindPanel')
- export class SuperFindPanel extends Component {
- @property(SelectDifficultyPanel)
- selDifPanel: SelectDifficultyPanel = null
- @property(SelectSkinPanel)
- selSkinPanel: SelectSkinPanel = null
- @property(SelectMapPanel)
- selMapPanel: SelectMapPanel = null
- @property(LevelContainer)
- lvlContainer: LevelContainer = null
- @property(Node)
- editBtns:Node = null
- @property(Node)
- noEditBtns:Node = null
- @property(Label)
- tipLabel: Label = null
- @property(Label)
- tipLabel2: Label = null
- @property(Label)
- showOrHideScaleLabel: Label = null
- @property(Node)
- bottom: Node = null
- _showScale:boolean = false
- protected start(): void {
- this.init()
- EventMgr.ins.addEventListener("refreshLevelInfo",this.refreshInfo,this)
- }
- init()
- {
- this.refreshInfo()
- let bgPath = SuperFind.superFindData.imgPath
- let selectSkins:string[] = Skin.getSelectSkinPath()
- selectSkins = selectSkins.length > 0?selectSkins:[defaultSkin]
- this.lvlContainer.genLvlContent(bgPath,selectSkins,Difficulty.difficutyData.difficutyCount,Difficulty.difficutyData.scales)
- }
- OpenselDifPanel() {
- this.selDifPanel.node.active = true;
- this.selDifPanel.init();
- }
- OpenSelSkinPanel() {
- this.selSkinPanel.node.active = true;
- this.selSkinPanel.init();
- }
- OpenSelMapPanel() {
- this.selMapPanel.node.active = true;
- this.selMapPanel.init();
- }
- OpenEditBtns()
- {
- this.editBtns.active = true
- this.lvlContainer.swtichEditMode(true)
- this.noEditBtns.active = false
- }
- CloseEditBtns()
- {
- this.editBtns.active = false
- this.lvlContainer.swtichEditMode(false)
- this.noEditBtns.active = true
- }
- CloseSelDifPanel() {
- this.selDifPanel.node.active = false;
- }
- CloseSelSkinPanel() {
- this.selSkinPanel.node.active = false;
- }
- CloseSelMapPanel() {
- this.selMapPanel.node.active = false;
- }
-
- close()
- {
- this.node.destroy()
- }
- onEditFinishClick()
- {
- this.CloseEditBtns()
- }
- onRegenerateClick()
- {
- this.lvlContainer.regenerate()
- }
- onHideClick()
- {
- this.bottom.active = false
- }
- onTipClick()
- {
- this.lvlContainer.showOneHint()
- }
- refreshInfo()
- {
- this.tipLabel.string = SuperFind.superFindData.title
- this.tipLabel2.string = SuperFind.superFindData.levelDesc
- }
- showOrHideScale()
- {
- this._showScale = !this._showScale
- this.lvlContainer.showOrHideScale(this._showScale)
- this.showOrHideScaleLabel.string = this._showScale?"隐藏缩放":"显示缩放"
- }
- }
|