zane hace 1 mes
padre
commit
b5ad15177e

+ 2 - 1
assets/resources/i18n/en.ts

@@ -7,7 +7,8 @@ export const languages = {
   Family: {
     CreateFamilySuccessTitle: "Success",
     CreateFamilySuccess:
-      "Create Family Success,You can invite your friends to join your family now",
+      `🎉 Congrats! You’re now the Owner of the Family: [{value}].
+ Start growing your family now!`,
     RemoveSuccessTitle: "Success",
     RemoveConfirmContent: "Are you sure to remove this player?",
     RemoveMemberSuccess: "Remove Success",

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 414 - 231
assets/resources/prefab/family/FamilyPageHas.prefab


+ 5 - 2
assets/resources/prefab/family/FamilyPageNo.ts

@@ -8,6 +8,7 @@ import { instantiate } from "cc";
 import EV, { EV_TYPE } from "../../scripts/mgr/EV";
 import { Tips } from "../../scripts/mgr/Tips";
 import UserM from "../../scripts/api/UserM";
+import ShareM from "../../scripts/mgr/ShareM";
 const { ccclass, property } = _decorator;
 
 @ccclass("FamilyPageNo")
@@ -20,8 +21,10 @@ export class FamilyPageNo extends BaseUI {
       return;
     }
     let title = Utils.setI18nLabel("Family.CreateFamilySuccessTitle");
-    let content = Utils.setI18nLabel("Family.CreateFamilySuccess");
-    let success = await TipsLayer.confirm(title, content);
+    let content = Utils.setI18nLabel("Family.CreateFamilySuccess", name);
+    let familyOwner = UserM.ins.getUserName();
+    let shareLink = await ShareM.ins.getFamilyShareLink(name, familyOwner);
+    let success = await TipsLayer.confirm(title, content, shareLink);
     if (success) {
       UserM.ins.setMockHasFamily(true);
       EV.ins.emit(EV_TYPE.FAMILY_STATUS_UPDATE);

+ 2 - 0
assets/resources/prefab/hall/PageFamily.ts

@@ -40,6 +40,8 @@ export class PageFamily extends BaseUI {
 
   public onShow(): void {
     this.refresh();
+
+    // TipsLayer.showConfirm("test", "test");
   }
 
   async refresh() {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 311 - 397
assets/resources/prefab/layer/TipsLayer.prefab


+ 25 - 8
assets/resources/prefab/layer/TipsLayer.ts

@@ -3,6 +3,8 @@ import BaseUI from "../../scripts/base/BaseUI";
 import { Hall } from "../hall/Hall";
 import { RichText } from "cc";
 import { Label } from "cc";
+import PayM from "../../scripts/mgr/PayM";
+import ShareM from "../../scripts/mgr/ShareM";
 const { ccclass, property } = _decorator;
 
 export class TipsData {
@@ -13,6 +15,7 @@ export class TipsData {
   onCancel: () => void = null;
   singleName: string = "";
   link: string = null;
+  shareLink: string = null;
 }
 
 export interface OnConfirm {
@@ -21,7 +24,11 @@ export interface OnConfirm {
 
 @ccclass("TipsLayer")
 export class TipsLayer extends BaseUI {
-  static confirm(title: string, content: string): Promise<boolean> {
+  static confirm(
+    title: string,
+    content: string,
+    shareLink: string = null
+  ): Promise<boolean> {
     return new Promise((resolve, reject) => {
       let tipsData: TipsData = {
         title: title,
@@ -36,14 +43,14 @@ export class TipsLayer extends BaseUI {
         },
         forceConfirm: true,
         singleName: null,
+        shareLink: shareLink,
       };
       TipsLayer.show(tipsData);
     });
   }
-  private onConfirm: OnConfirm = null;
   private static single: Map<string, Node> = new Map();
   static async show(data: TipsData): Promise<TipsLayer> {
-    if (data.singleName) {
+    if (data.singleName && data.singleName != "") {
       if (TipsLayer.single.has(data.singleName)) {
         return TipsLayer.single.get(data.singleName).getComponent(TipsLayer);
       }
@@ -52,7 +59,7 @@ export class TipsLayer extends BaseUI {
     let layer = await Hall.ins.showLayer("prefab/layer/TipsLayer");
     let comp = layer.getComponent(TipsLayer);
     comp.init(data);
-    if (data.singleName) {
+    if (data.singleName && data.singleName != "") {
       TipsLayer.single.set(data.singleName, layer);
     }
     return comp;
@@ -76,21 +83,25 @@ export class TipsLayer extends BaseUI {
   private data: TipsData;
   init(data: TipsData) {
     this.data = data;
+    let self = this;
     if (data.title == null || data.title == "") {
       this.FindNode("lbl_title").active = false;
     } else {
       this.setText("lbl_title", data.title);
     }
-    // this.setText("lbl_content", data.content);
 
     this.FindAs("lbl_content", RichText).string = data.content;
 
     if (data.forceConfirm) {
-      this.FindNode("tap_close").active = false;
-      this.FindNode("btn_close").active = false;
-      this.FindNode("btn_close_button").active = false;
+      setTimeout(() => {
+        self.FindNode("tap_close").active = false;
+        self.FindNode("btn_close").active = false;
+        self.FindNode("btn_close_button").active = false;
+      }, 500);
     }
 
+    this.FindNode("btn_share").active = data.shareLink && data.shareLink != "";
+
     this.FindNode("btn_link").active = data.link != null;
     this.FindNode("btn_link").getComponent(Label).string = data.link;
     // this.setText("btn_link", data.link);
@@ -112,6 +123,12 @@ export class TipsLayer extends BaseUI {
       this.data?.onConfirm?.();
       this.closePage();
     }
+
+    switch (name) {
+      case "btn_share":
+        ShareM.ins.share(this.data.shareLink);
+        break;
+    }
   }
   protected onDestroy(): void {
     if (this.data?.singleName) {

+ 2 - 0
assets/resources/scripts/base/AB.ts

@@ -26,6 +26,8 @@ export default class AB {
     let commonTextures = await this.loadDir("texture/common", SpriteFrame);
     console.warn("common textures loaded:", commonTextures.length);
 
+    await this.loadPrefab("prefab/layer/TipsLayer");
+
     return true;
   }
 

+ 3 - 0
assets/resources/scripts/mgr/PayM.ts

@@ -1,6 +1,9 @@
 import TgM from "./TgM";
 
 export default class PayM {
+  share(shareLink: string) {
+    throw new Error("Method not implemented.");
+  }
   
   private static _ins: PayM;
   public static get ins(): PayM {

+ 15 - 3
assets/resources/scripts/mgr/ShareM.ts

@@ -11,15 +11,27 @@ export default class ShareM {
   private static readonly tgLink = `https://t.me/TelgatherPortalBot/portal`;
   private static readonly webLink = `https://portal.telgather.com`;
   async shareFamily(familyName: string, familyOwner: string) {
+    let shareLink = await this.getFamilyShareLink(familyName, familyOwner);
+    await this.share(shareLink);
+  }
+
+  async getFamilyShareLink(
+    familyName: string,
+    familyOwner: string
+  ): Promise<string> {
     let isTg = await TgM.ins.isTG();
     let link = isTg ? ShareM.tgLink : ShareM.webLink;
     let fullString = `Join my Family from Telgather Game Portal now to share progress and unlock rewards together!
-[${familyName}] [${familyOwner}] ${link}`;
+    [${familyName}] [${familyOwner}] ${link}`;
+    return fullString;
+  }
 
+  async share(shareLink: string) {
+    let isTg = await TgM.ins.isTG();
     if (isTg) {
-      TgM.ins.shareToTg(fullString);
+      TgM.ins.shareToTg(shareLink);
     } else {
-      Utils.copyText(fullString);
+      Utils.copyText(shareLink);
       Tips.show("Copied to clipboard");
     }
   }

BIN
assets/resources/texture/common/bg_block_black.png


+ 134 - 0
assets/resources/texture/common/bg_block_black.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "7d801846-775e-4e8f-869b-bb2aac1e107d",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "7d801846-775e-4e8f-869b-bb2aac1e107d@6c48a",
+      "displayName": "bg_block_black",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "7d801846-775e-4e8f-869b-bb2aac1e107d",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "7d801846-775e-4e8f-869b-bb2aac1e107d@f9941",
+      "displayName": "bg_block_black",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "auto",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": -0.5,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 283,
+        "height": 304,
+        "rawWidth": 284,
+        "rawHeight": 304,
+        "borderTop": 100,
+        "borderBottom": 100,
+        "borderLeft": 100,
+        "borderRight": 100,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -141.5,
+            -152,
+            0,
+            141.5,
+            -152,
+            0,
+            -141.5,
+            152,
+            0,
+            141.5,
+            152,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            304,
+            283,
+            304,
+            0,
+            0,
+            283,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            0.9964788732394366,
+            0,
+            0,
+            1,
+            0.9964788732394366,
+            1
+          ],
+          "minPos": [
+            -141.5,
+            -152,
+            0
+          ],
+          "maxPos": [
+            141.5,
+            152,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "7d801846-775e-4e8f-869b-bb2aac1e107d@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "7d801846-775e-4e8f-869b-bb2aac1e107d@6c48a"
+  }
+}

+ 2 - 2
settings/v2/packages/information.json

@@ -7,7 +7,7 @@
       "enable": true,
       "customSplash": {
         "complete": true,
-        "form": "https://creator-api.cocos.com/api/form/show?sid=44a8766990987461eae385c4fd2979c8"
+        "form": "https://creator-api.cocos.com/api/form/show?sid=d87da536ccdf19cb24727f534391b889"
       }
     },
     "removeSplash": {
@@ -16,7 +16,7 @@
       "enable": true,
       "removeSplash": {
         "complete": true,
-        "form": "https://creator-api.cocos.com/api/form/show?sid=44a8766990987461eae385c4fd2979c8"
+        "form": "https://creator-api.cocos.com/api/form/show?sid=d87da536ccdf19cb24727f534391b889"
       }
     }
   }

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio