import { HtmlTextParser } from './../components/HtmlTextParser';
import { DataManager } from '../../libs/tw/manager/DataManager';
import { NetManager } from '../../libs/tw/manager/NetManager';
import Panel from "../views/Panel";
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 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' }
}