mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 03:11:29 +08:00
fix(scenes) 种田系统测试,添加按钮等
This commit is contained in:
1 parent
ce4e04740a
commit
761a9338ba
19 files changed
+1248
-86
No files matched your search
@@ -253,15 +253,20 @@ export default class ItemListTestScene extends Phaser.Scene {
|
||||
createButtons() {
|
||||
const buttonWidth = 200;
|
||||
const buttonHeight = 40;
|
||||
const buttonY = this.sys.game.config.height - 100;
|
||||
const buttonY = this.sys.game.config.height - 150;
|
||||
|
||||
// 创建背包按钮
|
||||
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY, '打开/关闭背包', () => {
|
||||
this.inventoryUI.toggle();
|
||||
});
|
||||
|
||||
// 创建随机物品按钮
|
||||
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY, '创建随机物品', () => {
|
||||
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 50, '创建随机物品', () => {
|
||||
this.itemManager.createRandomItem();
|
||||
});
|
||||
|
||||
// 创建清理物品按钮
|
||||
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 50, '清理所有物品', () => {
|
||||
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 100, '清理所有物品', () => {
|
||||
this.itemManager.clearAllItems();
|
||||
this.itemInfoText.setText('所有物品已清理');
|
||||
// 更新物品列表UI
|
||||
@@ -269,6 +274,11 @@ export default class ItemListTestScene extends Phaser.Scene {
|
||||
this.itemListUI.updateItems(this.player, this.itemManager.getActiveItems());
|
||||
}
|
||||
});
|
||||
|
||||
// 创建返回菜单按钮
|
||||
this.createButton(this.sys.game.config.width - buttonWidth - 10, buttonY + 150, '返回菜单', () => {
|
||||
this.scene.start('BootScene');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user