去掉大部分 调试信息

This commit is contained in:
2025-08-21 14:33:42 +08:00
parent 92faa0fe09
commit 213149881c
27 changed files with 164 additions and 164 deletions

View File

@@ -14,11 +14,11 @@ export class ItemInfoComp extends Component {
private isListening: boolean = false;
start() {
console.log("[ItemInfoComp]:start");
// console.log("[ItemInfoComp]:start");
}
onAdded(args: any) {
console.log("[ItemInfoComp]:onAdded", args);
// console.log("[ItemInfoComp]:onAdded", args);
this.setupTouchListener();
this.update_data(args);
}
@@ -40,7 +40,7 @@ export class ItemInfoComp extends Component {
this.touchListener = input.on(Input.EventType.TOUCH_START, this.onTouchStart, this);
this.isListening = true;
console.log("[ItemInfoComp]: Touch listener setup");
// console.log("[ItemInfoComp]: Touch listener setup");
}
/**
@@ -52,7 +52,7 @@ export class ItemInfoComp extends Component {
this.isListening = false;
this.touchListener = null;
console.log("[ItemInfoComp]: Touch listener removed");
// console.log("[ItemInfoComp]: Touch listener removed");
}
}
@@ -66,7 +66,7 @@ export class ItemInfoComp extends Component {
// 检查触摸点是否在弹窗范围内
if (!this.isTouchInNodeBounds(touchPos, nodePos)) {
console.log("[ItemInfoComp]: Touch outside bounds, closing popup");
// console.log("[ItemInfoComp]: Touch outside bounds, closing popup");
this.closeItemInfo();
}
}
@@ -97,7 +97,7 @@ export class ItemInfoComp extends Component {
* @param args 物品参数 {item_uuid: number, count?: number}
*/
update_data(args: any) {
console.log("[ItemInfoComp]:update_data", args);
// console.log("[ItemInfoComp]:update_data", args);
if (!args || !args.item_uuid) {
console.error("[ItemInfoComp]: Invalid args", args);
@@ -139,13 +139,13 @@ export class ItemInfoComp extends Component {
*/
private setItemIcon(iconPath: string) {
let path=`gui/items/${iconPath}`
console.log("[ItemComp]: setItemIcon", path);
// console.log("[ItemComp]: setItemIcon", path);
resources.load(path, SpriteFrame, (err, spriteFrame) => {
if (err) {
console.error("[ItemComp]: Failed to load item icon", iconPath, err);
return;
}
console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
// console.log("[ItemComp]: setItemIcon", iconPath, spriteFrame);
this.node.getChildByName("item").getChildByName("icon").getComponent(Sprite)!.spriteFrame = spriteFrame;
});
}
@@ -268,7 +268,7 @@ export class ItemInfoComp extends Component {
* 关闭物品信息弹窗
*/
closeItemInfo() {
console.log("[ItemInfoComp]: Close item info");
// console.log("[ItemInfoComp]: Close item info");
this.removeTouchListener();
oops.gui.removeByNode(this.node)
}
@@ -277,7 +277,7 @@ export class ItemInfoComp extends Component {
* 使用物品
*/
useItem() {
console.log("[ItemInfoComp]: Use item", this.item_uuid);
// console.log("[ItemInfoComp]: Use item", this.item_uuid);
// 这里可以添加使用物品的逻辑
// 比如消耗物品、触发效果等
}
@@ -286,7 +286,7 @@ export class ItemInfoComp extends Component {
* 丢弃物品
*/
dropItem() {
console.log("[ItemInfoComp]: Drop item", this.item_uuid);
// console.log("[ItemInfoComp]: Drop item", this.item_uuid);
// 这里可以添加丢弃物品的逻辑
// 比如从背包中移除、显示确认对话框等
}