Commit 51ad54b9 authored by 李维's avatar 李维

新版本提示框和确认框

parent 1b9d6a9d
...@@ -74,40 +74,58 @@ export default class NewClass extends middleLayerBase { ...@@ -74,40 +74,58 @@ export default class NewClass extends middleLayerBase {
this.tipsTween.stop(); this.tipsTween.stop();
tipsLayer.active = false; tipsLayer.active = false;
} }
const label = cc.find('middleLayer/tipsLayer/tips/label');
label.getComponent(cc.Label).string = ` ${str} `;
const tips = cc.find('middleLayer/tipsLayer/tips');
tipsLayer.active = true; tipsLayer.active = true;
tips.width = Math.max(300, label.width + 50); const label = cc.find('middleLayer/tipsLayer/bg/bg_tips/label');
label.getComponent(cc.Label).string = str;
label.getComponent(cc.Label)["_forceUpdateRenderData"](true)
const bgCat = cc.find("middleLayer/tipsLayer/bg/bg_cat")
const bgBoard = cc.find("middleLayer/tipsLayer/bg/bg_tips")
const bgCatHand = cc.find("middleLayer/tipsLayer/bg/bg_cathand")
this.tipsTween = cc.tween(tips) bgBoard.width = label.width < 400 ? 400 : label.width + 100;
.set({ opacity: 255 })
.to(5, { opacity: 0 }) const bgCatWidget = bgCat.getComponent(cc.Widget)
const bgCatHandWidget = bgCatHand.getComponent(cc.Widget)
bgCatWidget.horizontalCenter = -bgBoard.width / 2 - 20;
bgCatHandWidget.horizontalCenter = -bgBoard.width / 2 + 50;
this.tipsTween = cc.tween(tipsLayer)
.set({ opacity: 0 })
.to(0.1, { opacity: 255 })
.delay(1.5)
.to(0.2, { opacity: 0 })
.call(() => { .call(() => {
tipsLayer.active = false; tipsLayer.active = false;
this.tipsTween = null; this.tipsTween = null;
}) })
.start(); .start();
} }
async showConfirm(str: string, yesFun: Function = null, noFun: Function = null) { async showConfirm(str: string, yesFun: Function = null, noFun: Function = null) {
if (this.IS_BUNDLE_LOADING) { if (this.IS_BUNDLE_LOADING) {
return; return;
} }
const tipsLayer = cc.find('middleLayer/confirmLayer'); const tipsLayer = cc.find('middleLayer/confirmLayer');
const label = cc.find('middleLayer/confirmLayer/confirm_bg/label');
label.getComponent(cc.Label).string = ` ${str} `;
const tips = cc.find('middleLayer/confirmLayer/confirm_bg');
tipsLayer.active = true; tipsLayer.active = true;
tips.width = Math.max(684, label.width + 50);
const yesBtn = cc.find('middleLayer/confirmLayer/confirm_bg/btn_yes'); const bgBoard = cc.find("middleLayer/confirmLayer/bgBoard")
const label = cc.find('middleLayer/confirmLayer/label');
label.getComponent(cc.Label).string = str;
label.getComponent(cc.Label)["_forceUpdateRenderData"](true)
bgBoard.width = label.width < 537 ? 537 : label.width + 100;
const yesBtn = cc.find('middleLayer/confirmLayer/btn_yes');
buttonOnceClick(yesBtn, (evt) => { buttonOnceClick(yesBtn, (evt) => {
yesFun && yesFun(evt); yesFun && yesFun(evt);
yesBtn.off("click"); yesBtn.off("click");
noBtn.off("click"); noBtn.off("click");
tipsLayer.active = false; tipsLayer.active = false;
}); });
const noBtn = cc.find('middleLayer/confirmLayer/confirm_bg/btn_no');
const noBtn = cc.find('middleLayer/confirmLayer/btn_no');
buttonOnceClick(noBtn, (evt) => { buttonOnceClick(noBtn, (evt) => {
noFun && noFun(evt); noFun && noFun(evt);
yesBtn.off("click"); yesBtn.off("click");
...@@ -115,15 +133,14 @@ export default class NewClass extends middleLayerBase { ...@@ -115,15 +133,14 @@ export default class NewClass extends middleLayerBase {
tipsLayer.active = false; tipsLayer.active = false;
}); });
} }
async hideConfirm() { async hideConfirm() {
const tipsLayer = cc.find('middleLayer/confirmLayer'); const tipsLayer = cc.find('middleLayer/confirmLayer');
const label = cc.find('middleLayer/confirmLayer/confirm_bg/label'); const label = cc.find('middleLayer/confirmLayer/label');
label.getComponent(cc.Label).string = ``; label.getComponent(cc.Label).string = ``;
const tips = cc.find('middleLayer/confirmLayer/confirm_bg');
tips.width = Math.max(684);
const yesBtn = cc.find('middleLayer/confirmLayer/confirm_bg/btn_yes'); const yesBtn = cc.find('middleLayer/confirmLayer/btn_yes');
const noBtn = cc.find('middleLayer/confirmLayer/confirm_bg/btn_no'); const noBtn = cc.find('middleLayer/confirmLayer/btn_no');
yesBtn.off("click"); yesBtn.off("click");
noBtn.off("click"); noBtn.off("click");
tipsLayer.active = false; tipsLayer.active = false;
......
{
"ver": "1.1.2",
"uuid": "ae5e7d75-b266-4742-aa86-1d2e0d5cc907",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "fbbadac6-cc6a-47cb-8f2e-cef8d97e484a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 187,
"height": 239,
"platformSettings": {},
"subMetas": {
"bg_cat": {
"ver": "1.0.4",
"uuid": "b7db2eee-bfb1-477f-96f5-875da7f89a46",
"rawTextureUuid": "fbbadac6-cc6a-47cb-8f2e-cef8d97e484a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 187,
"height": 239,
"rawWidth": 187,
"rawHeight": 239,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5c306e4a-3353-47d7-890f-318642d09593",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 31,
"height": 21,
"platformSettings": {},
"subMetas": {
"bg_cathand": {
"ver": "1.0.4",
"uuid": "6739e769-16b0-434b-a166-2d05baa290e9",
"rawTextureUuid": "5c306e4a-3353-47d7-890f-318642d09593",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 31,
"height": 21,
"rawWidth": 31,
"rawHeight": 21,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9b174661-7b81-4243-8f21-e824695965cf",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 97,
"height": 100,
"platformSettings": {},
"subMetas": {
"bg_footprint": {
"ver": "1.0.4",
"uuid": "1c04001e-c211-4f97-a0ca-d09458f3cb34",
"rawTextureUuid": "9b174661-7b81-4243-8f21-e824695965cf",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 97,
"height": 100,
"rawWidth": 97,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b8fad0cb-aaa0-4e82-aeee-4c61c8bbf0ef",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 537,
"height": 390,
"platformSettings": {},
"subMetas": {
"bg_tip": {
"ver": "1.0.4",
"uuid": "10b51ca8-0285-44e7-9c1c-d57b4fcf6365",
"rawTextureUuid": "b8fad0cb-aaa0-4e82-aeee-4c61c8bbf0ef",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 537,
"height": 390,
"rawWidth": 537,
"rawHeight": 390,
"borderTop": 251,
"borderBottom": 113,
"borderLeft": 249,
"borderRight": 249,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "7840d873-6ca8-450d-8c13-338f369617f5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 146,
"height": 146,
"platformSettings": {},
"subMetas": {
"bg_tips": {
"ver": "1.0.4",
"uuid": "4536d05d-e69b-46ae-a7be-993e1492c983",
"rawTextureUuid": "7840d873-6ca8-450d-8c13-338f369617f5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 144,
"height": 144,
"rawWidth": 146,
"rawHeight": 146,
"borderTop": 64,
"borderBottom": 60,
"borderLeft": 67,
"borderRight": 58,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c6551020-413e-43ab-934e-8fbf0ee4c638",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 135,
"height": 73,
"platformSettings": {},
"subMetas": {
"btn_no": {
"ver": "1.0.4",
"uuid": "6c9ad520-60e0-40e2-9205-ffbf0ed6cf11",
"rawTextureUuid": "c6551020-413e-43ab-934e-8fbf0ee4c638",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 2,
"trimY": 2,
"width": 131,
"height": 69,
"rawWidth": 135,
"rawHeight": 73,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ea2f7628-f91d-4374-bce1-1186bec99ccd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 135,
"height": 73,
"platformSettings": {},
"subMetas": {
"btn_yes": {
"ver": "1.0.4",
"uuid": "a8790360-a9cb-4f41-9e51-5ed08bd56229",
"rawTextureUuid": "ea2f7628-f91d-4374-bce1-1186bec99ccd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 2,
"trimY": 1,
"width": 131,
"height": 70,
"rawWidth": 135,
"rawHeight": 73,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment