CreateGuild.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { _decorator, Component, EditBox, Node, sys, utils } from 'cc';
  2. import { UtilsPanel } from '../../scene/script/UtilsPanel';
  3. import { Config, nav_info } from '../../scene/script/NavInfo';
  4. import { Utils } from '../../scene/script/Utils';
  5. const { ccclass } = _decorator;
  6. @ccclass('CreateGuild')
  7. export class CreateGuild extends Component {
  8. private edit_name: EditBox = null;
  9. private edit_desc: EditBox = null;
  10. protected onLoad(){
  11. UtilsPanel.getAllNeedCom(this, this.node, false);
  12. }
  13. private onGoClick(){
  14. if(!this.edit_name.string.length){
  15. nav_info.scene.showTip("guild name can not emtpy");
  16. return;
  17. }
  18. if(!this.edit_desc.string.length){
  19. nav_info.scene.showTip("guild desc can not emtpy");
  20. return;
  21. }
  22. let str = Config.copy_prefix + "createguild&"+this.edit_name.string + "&" + this.edit_desc.string;
  23. Utils.copyToZone(str, this, this.onCopy);
  24. }
  25. public onCopy(succ:boolean){
  26. if(succ){
  27. console.log("copy succ")
  28. nav_info.scene.showTip("copy succc");
  29. Utils.tryStartApp();
  30. }
  31. else{
  32. nav_info.scene.showTip("copy fail");
  33. }
  34. }
  35. }