Commit 48214989 authored by wildfirecode13's avatar wildfirecode13

update

parent 11c967c1
let func; let getObject;
func = (object:FYGE.Container, name:string)=>{ getObject = (object:FYGE.Container, name:string)=>{
const result = object.getChildByName(name); const result = object.getChildByName(name);
if(result) return result; if(result) return result;
for (const child of object.children) { for (const child of object.children) {
const result = func(child,name); const result = getObject(child,name);
if(result) return result; if(result) return result;
} }
return null; return null;
} }
export default func export default getObject
\ No newline at end of file \ No newline at end of file
import { Panel } from "../../module/views/Panel";
import getObject from "../getObject";
import { Tools } from "../Tools";
import { getWebData, sendWebNet, WebNetName } from "../WebNet";
export class PrizePanel extends Panel {
initUi() {
super.initUi();
}
get groupNames() { return ["prize"] }
get skinName() { return "prize" }
//两个按钮都是关闭作用
get closeBtns() {
return [getObject(this, 'prize_closebtn'), getObject(this, 'prize_okbtn')];
}
async start(data) {
super.start();
}
}
\ No newline at end of file
import { showPanel } from "../../module/ctrls";
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
import getObject from "../getObject";
import { PrizePanel } from "../panels/prize";
export class NewbieScene extends Scene { export class NewbieScene extends Scene {
get groupNames() { return ["newbie"] } get groupNames() { return ["newbie"] }
get skinName() { return "newbie" } get skinName() { return "newbie" }
initUi() { initUi() {
super.initUi() super.initUi();
} }
async start(data) { async start(data) {
super.start() super.start()
console.log(this); console.log(this);
this.addEventListener(FYGE.MouseEvent.CLICK,()=>{
showPanel(PrizePanel);
},this);
} }
initEvents() { initEvents() {
...@@ -18,4 +26,6 @@ export class NewbieScene extends Scene { ...@@ -18,4 +26,6 @@ export class NewbieScene extends Scene {
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment