import Panel from "../views/Panel";
import { NetManager } from '../../libs/tw/manager/NetManager';
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class RulePanel extends Panel {
    constructor() {
        super();
        NetManager.ins.getRule(() => {
            var tx: egret.TextField = new egret.TextField;
            tx.width = this.stage.stageWidth - 220;
            tx.textFlow = (new egret.HtmlTextParser).parser(
                DataManager.ins.getRuleData ? DataManager.ins.getRuleData.ruleText :
                    (DataManager.ins.ajaxElementData ? DataManager.ins.ajaxElementData.rule :
                        (window['ruleCFG'] ? window['ruleCFG'] : "规则")
                    )
            );
            tx.x = 110;
            tx.y = 330;
            tx.textColor = 0x333333;
            this.addChild(tx);
        })
    }

    protected get skinKey() { return 'Rule' }
}