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C;gBAC1C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;aAC/E;QACL,CAAC;QAED,UAAU,CAAC,IAAuB;YAC9B,IAAI,IAAI,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YAClD,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YAC3B,IAAI,KAAK,GAAG,uBAAU,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAsB,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7K,CAAC;KACJ,CAAA;IA9BY,qBAAqB;QADjC,wCAAe,CAAC,oCAAiB,CAAC;OACtB,qBAAqB,CA8BjC;IAAD,4BAAC;KAAA;AA9BY,sDAAqB","file":"","sourceRoot":"/","sourcesContent":["import { GameRecord } from \"../../../avg/AVG\";\nimport { RoleType } from \"../../../avg/EditorEnums\";\nimport { Subpresenter } from \"../../../common/classbase/PresenterBase\";\nimport { GameConfig } from \"../../../GameConfig\";\nimport { GameModelManager } from \"../../model/GameModelManager\";\nimport GameRoleDataModel from \"../../model/GameRoleDataModel\";\nimport { RegSubpresenter } from \"../PresenterCCViewFactory\";\nimport { LikeLevelView, LikeLevelViewType } from \"../view/type/LikeLevelSubview\";\n\n@RegSubpresenter(LikeLevelViewType)\nexport class LikeLevelSubpresenter extends Subpresenter<LikeLevelView> {\n onOpen() {\n super.onOpen();\n if (!(this.owner as any)[\"getRoleId\"]) {\n console.error(\"owner need provide roleId by getRoleId\");\n return;\n }\n let roleId = (this.owner as any)[\"getRoleId\"]() as number;\n let roleData = GameModelManager.getRoleData(roleId)!;\n if (roleData.getConfig().RoleType === RoleType.Role_Major) {\n this.updateView(roleData);\n this._disposable.add(GameRecord.onRecordVariableChange(\"like\" + roleId, () => {\n this.updateView(roleData);\n }));\n this._disposable.add(GameRecord.onGlobalVariableChange(\"like\" + roleId, () => {\n this.updateView(roleData);\n }));\n } else {\n let likestr = GameConfig.debug ? \"0\" : \"\";\n this.view.setProps({ visible: false, level: 0, percent: 0, like: likestr });\n }\n }\n\n updateView(role: GameRoleDataModel) {\n let data = role.getRoleLikeLevel();\n data.currLike = data.currLike ? data.currLike : 0;\n let v = role.getRoleLike();\n let value = GameConfig.debug && v ? v as unknown as string : \"\";\n this.view.setProps({ visible: true, level: data.level ? data.level : 0, percent: data.level === data.maxLevel ? 1 : (data.currLike / data.nextLevelLike), like: value });\n }\n}"]}