update 页面跳转
This commit is contained in:
@@ -69,12 +69,20 @@ export class PreloadUI extends Component {
|
||||
//Utils.addInnerEL(InnerMsgCode.UI_ShowPrompt, this, this.resiveShowPrompt)
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
|
||||
// 添加新的事件监听
|
||||
|
||||
this.appVersion = this._nodeTab.appVersion.getComponent(Label);
|
||||
this.loginBtn = this._nodeTab.btnLogin;
|
||||
this.loginBtn.active = false;
|
||||
this.appVersion.string = `app version: ${prodConfig.appVersion}`;
|
||||
this.VideoPlayer = this._nodeTab.VideoPlayer.getComponent(VideoPlayer);
|
||||
|
||||
this.VideoPlayer.node.on(
|
||||
VideoPlayer.EventType.META_LOADED,
|
||||
this.onVideoReadyToPlay,
|
||||
this
|
||||
);
|
||||
|
||||
GButton.BandClick(this.loginBtn, this.onLogin, this);
|
||||
|
||||
this.jinduBar = this.node.getChildByName("jinduBar");
|
||||
@@ -105,10 +113,12 @@ export class PreloadUI extends Component {
|
||||
this.preloadFiles();
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
|
||||
}
|
||||
protected onDestroy(): void {}
|
||||
|
||||
onVideoReadyToPlay() {
|
||||
console.log("Video Ready");
|
||||
this._nodeTab.VideoPlayer.getComponent(VideoPlayer).play();
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
if (!this.preloadFinish) {
|
||||
return;
|
||||
|
||||
@@ -223,25 +223,15 @@ export class ChatController {
|
||||
// 通知界面收到回复
|
||||
this.callback?.onMessageReceived(response);
|
||||
|
||||
// 增加聊天次数计数
|
||||
//this.chatModel.incrementChatCount();
|
||||
|
||||
// 注意:情绪状态将通过异步事件更新,不在这里同步获取
|
||||
|
||||
console.log(`Response received from role ${roleId}: ${response}`);
|
||||
return true;
|
||||
} else {
|
||||
// 移除加载中的对话
|
||||
//this.dialogManager?.removeLoadingDialog();
|
||||
|
||||
const error = new Error("AI返回了空响应");
|
||||
this.handleError(error);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
// 移除加载中的对话
|
||||
//this.dialogManager?.removeLoadingDialog();
|
||||
|
||||
|
||||
ErrorHandler.Instance.handleApiError(
|
||||
error,
|
||||
"ChatController.sendMessage",
|
||||
|
||||
@@ -87,7 +87,7 @@ export class NavigationManager {
|
||||
//初始化默认选的girl
|
||||
let cacheGirlId = sys.localStorage.getItem(this.LastSelectGirlID);
|
||||
if (!cacheGirlId) {
|
||||
cacheGirlId = 10002;
|
||||
cacheGirlId = 10016;
|
||||
sys.localStorage.setItem(this.LastSelectGirlID, cacheGirlId);
|
||||
}
|
||||
this._instance.selectedGirlId = Number(cacheGirlId);
|
||||
@@ -355,7 +355,6 @@ export class NavigationManager {
|
||||
`[NavigationManager] 无法确定basePanel类型: ${basePanel.name}`
|
||||
);
|
||||
}
|
||||
|
||||
// 存储动画配置
|
||||
this.subPanelAnimationConfigs.set(n, config);
|
||||
|
||||
@@ -466,6 +465,7 @@ export class NavigationManager {
|
||||
}
|
||||
|
||||
const duration = config.duration || 0.3;
|
||||
//panel.active = false;
|
||||
|
||||
switch (config.openAnimation) {
|
||||
case PageTransitionType.SCALE:
|
||||
|
||||
@@ -92,6 +92,11 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
|
||||
}
|
||||
|
||||
onLoadCT() {
|
||||
this.node.active = false;
|
||||
this.scheduleOnce(() => {
|
||||
this.node.active = true;
|
||||
}, 0.1);
|
||||
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
|
||||
this.waitingAI = this._nodeTab.waitingAI;
|
||||
|
||||
@@ -28,6 +28,10 @@ export class GirlListPanel extends li_BaseView {
|
||||
category: number;
|
||||
|
||||
onLoadCT() {
|
||||
this.node.active = false;
|
||||
this.scheduleOnce(() => {
|
||||
this.node.active = true;
|
||||
}, 0.1);
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
this.registerListener();
|
||||
this.itemInst = this._nodeTab.BubbleItem.getComponent(GirlListItem);
|
||||
|
||||
@@ -121,7 +121,6 @@ export class GirlListPopupPanel extends li_BaseView {
|
||||
this.close();
|
||||
TipsPanel.show("Buy Succeed");
|
||||
} else {
|
||||
//ViewManager.I.openBundlesView("PurchasePanel");
|
||||
this.close();
|
||||
TipsPanel.show("Insufficient balance, need to purchase");
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ import LanguageUtils, {
|
||||
LanguageType,
|
||||
} from "../../../Main/Common/LanguageUtils";
|
||||
import AudioManager from "../../../Main/Manager/AudioManager";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import {
|
||||
NavigationManager,
|
||||
PageTransitionType,
|
||||
} from "../../manager/NavigationManager";
|
||||
import { PlayerDataService } from "../../network/services/PlayerDataService";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
|
||||
@@ -150,6 +153,9 @@ export class PersonalPanel extends li_BaseView {
|
||||
NavigationManager.Instance.openSubPanel("SettingPanel", this.node);
|
||||
}
|
||||
private openPurchase() {
|
||||
NavigationManager.Instance.openSubPanel("PurchasePanel", this.node);
|
||||
NavigationManager.Instance.openSubPanel("PurchasePanel", this.node, null, {
|
||||
openAnimation: PageTransitionType.SLIDE_LEFT,
|
||||
closeAnimation: PageTransitionType.SLIDE_RIGHT,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@ export class PurchasePanel extends li_BaseView {
|
||||
web3BtnNotSelect;
|
||||
|
||||
onLoadCT(): void {
|
||||
this.node.active = false;
|
||||
this.scheduleOnce(() => {
|
||||
this.node.active = true;
|
||||
}, 0.2);
|
||||
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
this.coinNum = this._nodeTab.coinNum.getComponent(Label);
|
||||
this.vipLeftTime = this._nodeTab.vipText.getComponent(Label);
|
||||
|
||||
@@ -294,7 +294,10 @@ export class ThemePanel extends li_BaseView {
|
||||
}
|
||||
|
||||
enterShop() {
|
||||
NavigationManager.Instance.openSubPanel("PurchasePanel", this.node);
|
||||
NavigationManager.Instance.openSubPanel("PurchasePanel", this.node, null, {
|
||||
openAnimation: PageTransitionType.SLIDE_LEFT,
|
||||
closeAnimation: PageTransitionType.SLIDE_RIGHT,
|
||||
});
|
||||
}
|
||||
|
||||
chatWithRec() {
|
||||
|
||||
@@ -96,6 +96,14 @@ export class ThemeItem extends Component {
|
||||
this.category
|
||||
);
|
||||
NavigationManager.Instance.setSelectedCategoryId(this.category);
|
||||
NavigationManager.Instance.openSubPanel("GirlListPanel", this.baseNode);
|
||||
NavigationManager.Instance.openSubPanel(
|
||||
"GirlListPanel",
|
||||
this.baseNode,
|
||||
null,
|
||||
{
|
||||
openAnimation: PageTransitionType.SLIDE_LEFT,
|
||||
closeAnimation: PageTransitionType.SLIDE_RIGHT,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export class UITransitionHelper {
|
||||
|
||||
// 设置初始位置为屏幕右侧外
|
||||
node.setPosition(screenWidth, 0, 0);
|
||||
|
||||
|
||||
// 执行滑入动画到屏幕中心
|
||||
tween(node)
|
||||
.to(
|
||||
|
||||
Reference in New Issue
Block a user