CreateGuild.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. if(Utils.copyToZone(str)){
  24. console.log("copy succ")
  25. nav_info.scene.showTip("copy succc");
  26. Utils.tryStartApp();
  27. }
  28. else{
  29. nav_info.scene.showTip("copy fail");
  30. }
  31. }
  32. }