import { NetManager } from 'duiba-tw';
import { DataManager } from 'duiba-tw';
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 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' }
}