FFDialogBox.ts 889 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import ViewObject from "../../../main/ViewObject";
  2. const {ccclass, property} = cc._decorator;
  3. /**
  4. * 战斗中的弹出对话框
  5. */
  6. @ccclass
  7. export default class FFDialogBox extends ViewObject {
  8. @property(cc.Label)
  9. mTitle: cc.Label = null;
  10. @property(cc.Label)
  11. mContent: cc.Label = null;
  12. @property(cc.Label)
  13. mBtLabelOK: cc.Label = null;
  14. @property(cc.Label)
  15. mBtLabelCancel: cc.Label = null;
  16. public okCallback:()=>void;
  17. public cancelCallback:()=>void;
  18. public onclickOK(){
  19. if(this.okCallback){
  20. this.okCallback()
  21. }
  22. }
  23. public onclickCancel(){
  24. if(this.cancelCallback){
  25. this.cancelCallback()
  26. }
  27. }
  28. public setOKCallback(callback:()=>void){
  29. this.okCallback = callback
  30. }
  31. public setCancelCallback(callback:()=>void){
  32. this.cancelCallback = callback
  33. }
  34. }