前几天忘了上传了上传一下
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cm1e72lhd7j7v"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_sgirt"]
|
||||
|
||||
[node name="BlackBlueCrop" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
theme_override_font_sizes/font_size = 1
|
||||
icon_alignment = 1
|
||||
script = ExtResource("1_sgirt")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(199.569, 201.043)
|
||||
scale = Vector2(0.260977, 0.259058)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
modulate = Color(0, 0.152941, 0.984314, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "普通"
|
||||
horizontal_alignment = 1
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bkivlkirrx6u8"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bkivlkirrx6u8"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bt1i2yhhlor5e" path="res://assets/地块/土块1.webp" id="1_bns1c"]
|
||||
[ext_resource type="Script" uid="uid://xh5tr5co5kfu" path="res://GUI/SMY_ProgressBar.gd" id="2_1n4xp"]
|
||||
[ext_resource type="Shader" path="res://Shader/PlantSwayShader.gdshader" id="2_s5pb0"]
|
||||
[ext_resource type="Texture2D" uid="uid://xyj4ro44cwj5" path="res://assets/作物/人参/0.webp" id="3_bns1c"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_v46ok"]
|
||||
|
||||
@@ -17,8 +17,23 @@ shader_parameter/height_curve = 2.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_cyybs"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bns1c"]
|
||||
bg_color = Color(0.377919, 0.377919, 0.377919, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 15
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_s5pb0"]
|
||||
bg_color = Color(0.360784, 0.776471, 0.223529, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 15
|
||||
|
||||
[node name="CropItem" type="Button"]
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
@@ -32,8 +47,9 @@ texture = ExtResource("1_bns1c")
|
||||
|
||||
[node name="crop_sprite" type="Sprite2D" parent="."]
|
||||
material = SubResource("ShaderMaterial_s5pb0")
|
||||
position = Vector2(51, 39)
|
||||
scale = Vector2(0.06, 0.06)
|
||||
position = Vector2(51, 45)
|
||||
scale = Vector2(0.339844, 0.363281)
|
||||
texture = ExtResource("3_bns1c")
|
||||
|
||||
[node name="old_crop_sprite" type="Sprite2D" parent="."]
|
||||
material = SubResource("ShaderMaterial_s5pb0")
|
||||
@@ -41,40 +57,43 @@ position = Vector2(51, 39)
|
||||
scale = Vector2(0.06, 0.06)
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="."]
|
||||
modulate = Color(0.1, 0.1, 0.1, 1)
|
||||
material = SubResource("ShaderMaterial_cyybs")
|
||||
layout_mode = 2
|
||||
offset_left = 23.0
|
||||
offset_top = 78.0
|
||||
offset_right = 328.0
|
||||
offset_bottom = 151.0
|
||||
offset_left = 18.0
|
||||
offset_top = -5.0
|
||||
offset_right = 348.0
|
||||
offset_bottom = 68.0
|
||||
scale = Vector2(0.2, 0.2)
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_font_sizes/font_size = 50
|
||||
script = ExtResource("2_1n4xp")
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_bns1c")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_s5pb0")
|
||||
value = 80.0
|
||||
|
||||
[node name="crop_name" type="Label" parent="."]
|
||||
modulate = Color(2, 2, 2, 1)
|
||||
layout_mode = 2
|
||||
offset_top = -9.0
|
||||
offset_top = 76.0
|
||||
offset_right = 250.0
|
||||
offset_bottom = 33.0
|
||||
offset_bottom = 118.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "[空地]"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="status_label" type="Label" parent="."]
|
||||
modulate = Color(0.721569, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
offset_top = 8.0
|
||||
offset_top = 62.0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 77.0
|
||||
offset_bottom = 131.0
|
||||
scale = Vector2(0.2, 0.2)
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "[已施肥]"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://2m54c0f1ejir"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_ihcyw"]
|
||||
|
||||
[node name="GreenCrop" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
theme_override_font_sizes/font_size = 1
|
||||
icon_alignment = 1
|
||||
script = ExtResource("1_ihcyw")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(199.569, 201.043)
|
||||
scale = Vector2(0.260977, 0.259058)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
modulate = Color(0.243137, 0.729412, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "普通"
|
||||
horizontal_alignment = 1
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ibl5wbbw3pwc"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ibl5wbbw3pwc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_e25nh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bl48i2h22htyd" path="res://assets/作物/人参/收获物.webp" id="2_abhds"]
|
||||
|
||||
[node name="item_button" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
@@ -11,8 +12,9 @@ icon_alignment = 1
|
||||
script = ExtResource("1_e25nh")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(199.569, 201.043)
|
||||
scale = Vector2(0.260977, 0.259058)
|
||||
position = Vector2(200, 200)
|
||||
scale = Vector2(1.5625, 1.5625)
|
||||
texture = ExtResource("2_abhds")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://forqk66f354p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_00rx4"]
|
||||
|
||||
[node name="OrangeCrop" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
theme_override_font_sizes/font_size = 1
|
||||
icon_alignment = 1
|
||||
script = ExtResource("1_00rx4")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(200, 200)
|
||||
scale = Vector2(0.308178, 0.308356)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
modulate = Color(0.822776, 0.578065, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "普通"
|
||||
horizontal_alignment = 1
|
||||
@@ -1,25 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cmdoymcviv0ai"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_3xhou"]
|
||||
|
||||
[node name="PinkCrop" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
theme_override_font_sizes/font_size = 1
|
||||
icon_alignment = 1
|
||||
script = ExtResource("1_3xhou")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(199.569, 201.043)
|
||||
scale = Vector2(0.260977, 0.259058)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
modulate = Color(0.980392, 0, 0.552941, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "普通"
|
||||
horizontal_alignment = 1
|
||||
@@ -1,25 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://d3ve4qeggsdqy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_1yrv4"]
|
||||
|
||||
[node name="RedCrop" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
theme_override_font_sizes/font_size = 1
|
||||
icon_alignment = 1
|
||||
script = ExtResource("1_1yrv4")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(199.569, 201.043)
|
||||
scale = Vector2(0.260977, 0.259058)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
modulate = Color(1, 0.0509804, 0.0352941, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "普通"
|
||||
horizontal_alignment = 1
|
||||
@@ -1,25 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dagh3u5med30i"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_nfqts"]
|
||||
|
||||
[node name="WhiteBlueCrop" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
theme_override_font_sizes/font_size = 1
|
||||
icon_alignment = 1
|
||||
script = ExtResource("1_nfqts")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(199.569, 201.043)
|
||||
scale = Vector2(0.260977, 0.259058)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
modulate = Color(0.111013, 0.795686, 0.959948, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "普通"
|
||||
horizontal_alignment = 1
|
||||
@@ -1,5 +1,11 @@
|
||||
{
|
||||
"experience": 0,
|
||||
"宠物背包":[],
|
||||
"道具背包":[],
|
||||
"作物仓库":[],
|
||||
"巡逻宠物":[],
|
||||
"出战宠物":[],
|
||||
"个人简介": "",
|
||||
"farm_lots": [
|
||||
{"crop_type": "", "grow_time": 0, "is_dead": false, "is_diged": true, "is_planted": false, "max_grow_time": 3},
|
||||
{"crop_type": "", "grow_time": 0, "is_dead": false, "is_diged": true, "is_planted": false, "max_grow_time": 3},
|
||||
|
||||
12
Data/item_config.json
Normal file
12
Data/item_config.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"精准采集-镰刀": {"花费":100,"描述":"可以在收获作物时必定掉落该作物的种子","类型":"作物道具","道具图片":"res://assets/道具图片/紫水晶镰刀.webp"},
|
||||
"时运-镰刀": {"花费":100,"描述":"可以在收获作物时掉落更多的作物的收获物","类型":"作物道具","道具图片":"res://assets/道具图片/红宝石镰刀.webp"},
|
||||
"农家肥": {"花费":100,"描述":"(施肥道具)可以在30分钟内2倍速作物生长","类型":"作物道具","道具图片":"res://assets/道具图片/农家肥.webp"},
|
||||
"金坷垃": {"花费":100,"描述":"(施肥道具)可以在5分钟内5倍速作物的生长","类型":"作物道具","道具图片":"res://assets/道具图片/金坷垃2.webp"},
|
||||
"水壶": {"花费":100,"描述":"(浇水道具)直接让作物生长进度+1%","类型":"作物道具","道具图片":"res://assets/道具图片/铁质洒水壶.webp"},
|
||||
"水桶": {"花费":100,"描述":"(浇水道具)让作物生长进度+2%","类型":"作物道具","道具图片":"res://assets/道具图片/木质水桶2.webp"},
|
||||
"杀虫剂": {"花费":100,"描述":"杀虫,暂时没什么用","类型":"作物道具","道具图片":"res://assets/道具图片/杀虫剂.webp"},
|
||||
"除草剂": {"花费":100,"描述":"除草","类型":"作物道具","道具图片":"res://assets/道具图片/除草剂.webp"},
|
||||
"生长素": {"花费":100,"描述":"时运可以10分钟内3倍速作物生长,而且作物生长速度+3%","类型":"作物道具","道具图片":"res://assets/道具图片/生长素.webp"},
|
||||
"铲子": {"花费":100,"描述":"铲除作物","类型":"作物道具","道具图片":"res://assets/道具图片/附魔铁铲.webp"}
|
||||
}
|
||||
1466
Data/pet_data.json
Normal file
1466
Data/pet_data.json
Normal file
File diff suppressed because it is too large
Load Diff
178
GUI/CheckUpdatePanel.gd
Normal file
178
GUI/CheckUpdatePanel.gd
Normal file
@@ -0,0 +1,178 @@
|
||||
extends Control
|
||||
|
||||
# 简化版更新检测器
|
||||
# 适用于萌芽农场游戏
|
||||
|
||||
# 配置
|
||||
const GAME_ID = "mengyafarm"
|
||||
const SERVER_URL = "http://47.108.90.0:5000"
|
||||
const CURRENT_VERSION = GlobalVariables.client_version
|
||||
|
||||
# 更新信息
|
||||
var has_update = false
|
||||
var latest_version = ""
|
||||
|
||||
func _ready():
|
||||
# 初始化时隐藏面板
|
||||
self.hide()
|
||||
|
||||
# 游戏启动时自动检查更新
|
||||
call_deferred("check_for_updates")
|
||||
|
||||
func check_for_updates():
|
||||
|
||||
var http_request = HTTPRequest.new()
|
||||
add_child(http_request)
|
||||
|
||||
# 连接请求完成信号
|
||||
http_request.request_completed.connect(_on_update_check_completed)
|
||||
|
||||
# 发送请求
|
||||
var url = SERVER_URL + "/api/simple/check-version/" + GAME_ID + "?current_version=" + CURRENT_VERSION
|
||||
var error = http_request.request(url)
|
||||
|
||||
if error != OK:
|
||||
print("网络请求失败: ", error)
|
||||
|
||||
func _on_update_check_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray):
|
||||
if response_code != 200:
|
||||
print("服务器响应错误: ", response_code)
|
||||
return
|
||||
|
||||
# 解析JSON
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(body.get_string_from_utf8())
|
||||
|
||||
if parse_result != OK:
|
||||
print("解析响应失败")
|
||||
return
|
||||
|
||||
var data = json.data
|
||||
|
||||
if "error" in data:
|
||||
print("服务器错误: ", data.error)
|
||||
return
|
||||
|
||||
# 检查是否有更新
|
||||
has_update = data.get("has_update", false)
|
||||
latest_version = data.get("latest_version", "")
|
||||
|
||||
if has_update:
|
||||
print("发现新版本: ", latest_version)
|
||||
show_update_panel()
|
||||
else:
|
||||
print("已是最新版本")
|
||||
|
||||
func show_update_panel():
|
||||
"""显示更新面板"""
|
||||
self.show() # 直接显示当前面板
|
||||
|
||||
func download_update():
|
||||
"""下载更新"""
|
||||
var platform = get_platform_name()
|
||||
var download_url = SERVER_URL + "/download/" + GAME_ID + "/" + platform.to_lower()
|
||||
|
||||
print("下载链接: ", download_url)
|
||||
|
||||
# 打开下载页面
|
||||
var error = OS.shell_open(download_url)
|
||||
if error != OK:
|
||||
# 复制到剪贴板作为备选方案
|
||||
DisplayServer.clipboard_set(download_url)
|
||||
show_message("无法打开浏览器,下载链接已复制到剪贴板")
|
||||
|
||||
func get_platform_name() -> String:
|
||||
"""获取平台名称"""
|
||||
var os_name = OS.get_name()
|
||||
match os_name:
|
||||
"Windows":
|
||||
return "Windows"
|
||||
"Android":
|
||||
return "Android"
|
||||
"macOS":
|
||||
return "macOS"
|
||||
"Linux":
|
||||
return "Linux"
|
||||
_:
|
||||
return "Windows"
|
||||
|
||||
func show_message(text: String):
|
||||
"""显示消息提示"""
|
||||
var dialog = AcceptDialog.new()
|
||||
add_child(dialog)
|
||||
dialog.dialog_text = text
|
||||
dialog.popup_centered()
|
||||
|
||||
# 3秒后自动关闭
|
||||
await get_tree().create_timer(3.0).timeout
|
||||
if is_instance_valid(dialog):
|
||||
dialog.queue_free()
|
||||
|
||||
# 手动检查更新的公共方法
|
||||
func manual_check_update():
|
||||
"""手动检查更新"""
|
||||
check_for_updates()
|
||||
|
||||
# 直接跳转到相应平台下载链接
|
||||
func _on_download_button_pressed() -> void:
|
||||
"""下载按钮点击事件"""
|
||||
if not has_update:
|
||||
show_message("当前已是最新版本")
|
||||
return
|
||||
|
||||
var platform = get_platform_name()
|
||||
var download_url = SERVER_URL + "/download/" + GAME_ID + "/" + platform.to_lower()
|
||||
|
||||
print("下载链接: ", download_url)
|
||||
|
||||
# 打开下载页面
|
||||
var error = OS.shell_open(download_url)
|
||||
if error != OK:
|
||||
# 复制到剪贴板作为备选方案
|
||||
DisplayServer.clipboard_set(download_url)
|
||||
show_message("无法打开浏览器,下载链接已复制到剪贴板")
|
||||
else:
|
||||
show_message("正在打开下载页面...")
|
||||
# 可选:隐藏更新面板
|
||||
self.hide()
|
||||
|
||||
# 关闭更新面板
|
||||
func _on_close_button_pressed() -> void:
|
||||
"""关闭按钮点击事件"""
|
||||
self.hide()
|
||||
|
||||
# 稍后提醒按钮
|
||||
func _on_later_button_pressed() -> void:
|
||||
"""稍后提醒按钮点击事件"""
|
||||
print("用户选择稍后更新")
|
||||
self.hide()
|
||||
|
||||
# 检查更新按钮
|
||||
func _on_check_update_button_pressed() -> void:
|
||||
"""检查更新按钮点击事件"""
|
||||
check_for_updates()
|
||||
|
||||
# 获取更新信息的公共方法
|
||||
func get_update_info() -> Dictionary:
|
||||
"""获取更新信息"""
|
||||
return {
|
||||
"has_update": has_update,
|
||||
"current_version": CURRENT_VERSION,
|
||||
"latest_version": latest_version,
|
||||
"game_id": GAME_ID
|
||||
}
|
||||
|
||||
# 获取当前版本
|
||||
func get_current_version() -> String:
|
||||
"""获取当前版本"""
|
||||
return CURRENT_VERSION
|
||||
|
||||
# 获取最新版本
|
||||
func get_latest_version() -> String:
|
||||
"""获取最新版本"""
|
||||
return latest_version
|
||||
|
||||
# 是否有更新
|
||||
func is_update_available() -> bool:
|
||||
"""是否有更新可用"""
|
||||
return has_update
|
||||
1
GUI/CheckUpdatePanel.gd.uid
Normal file
1
GUI/CheckUpdatePanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ciwjx67wjubdy
|
||||
@@ -1,23 +1,46 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dos15dmc1b6bt"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dos15dmc1b6bt"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ct7rhywlql4y4" path="res://GUI/GameSettingPanel.gd" id="1_0c52c"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0c52c"]
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7muhe"]
|
||||
bg_color = Color(0.454524, 0.454524, 0.454524, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
corner_detail = 20
|
||||
|
||||
[node name="GameSettingPanel" type="Panel"]
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 720.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_0c52c")
|
||||
script = ExtResource("1_0c52c")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 9.0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 80.0
|
||||
offset_bottom = 97.0
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 4
|
||||
theme_override_constants/shadow_offset_y = 4
|
||||
theme_override_constants/outline_size = 20
|
||||
theme_override_constants/shadow_outline_size = 20
|
||||
theme_override_font_sizes/font_size = 45
|
||||
theme_override_font_sizes/font_size = 55
|
||||
text = "游戏设置"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -25,13 +48,16 @@ vertical_alignment = 1
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_left = 1327.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 80.0
|
||||
offset_left = 1305.0
|
||||
offset_top = 17.5
|
||||
offset_right = 1378.0
|
||||
offset_bottom = 97.5
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_7muhe")
|
||||
text = "X"
|
||||
|
||||
[node name="LinkButton" type="LinkButton" parent="."]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 15.0
|
||||
offset_top = 17.0
|
||||
@@ -42,9 +68,10 @@ uri = "http://192.168.1.110:19132/site/python"
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 80.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
offset_left = 9.0
|
||||
offset_top = 100.0
|
||||
offset_right = 1389.0
|
||||
offset_bottom = 709.0
|
||||
|
||||
[node name="Panel" type="Panel" parent="Scroll"]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -1,280 +0,0 @@
|
||||
extends Panel
|
||||
# 这是道具背包面板,用来显示玩家获得的道具
|
||||
|
||||
# 道具背包格子容器
|
||||
@onready var bag_grid: GridContainer = $ScrollContainer/Bag_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
|
||||
# 预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
# 道具使用状态
|
||||
var selected_item_name: String = ""
|
||||
var selected_item_button: Button = null
|
||||
var is_item_selected: bool = false
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
# 初始化道具背包
|
||||
func init_item_bag():
|
||||
# 清空道具背包格子
|
||||
for child in bag_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 显示背包中的道具
|
||||
update_item_bag_ui()
|
||||
|
||||
# 更新道具背包UI
|
||||
func update_item_bag_ui():
|
||||
# 清空道具背包格子
|
||||
for child in bag_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
print("更新道具背包UI,背包中道具数量:", main_game.item_bag.size())
|
||||
|
||||
# 为背包中的每个道具创建按钮
|
||||
for item_data in main_game.item_bag:
|
||||
var item_name = item_data["name"]
|
||||
var item_count = item_data["count"]
|
||||
|
||||
# 创建道具按钮
|
||||
var button = _create_item_button(item_name)
|
||||
|
||||
# 更新按钮文本显示数量
|
||||
button.text = str(item_name + "\n数量:" + str(item_count))
|
||||
|
||||
# 根据是否处于访问模式连接不同的事件
|
||||
if main_game.is_visiting_mode:
|
||||
# 访问模式下,点击道具只显示信息,不能使用
|
||||
button.pressed.connect(func(): _on_visit_item_selected(item_name, item_count))
|
||||
else:
|
||||
# 正常模式下,连接道具选择事件
|
||||
button.pressed.connect(func(): _on_item_selected(item_name, item_count, button))
|
||||
|
||||
bag_grid.add_child(button)
|
||||
|
||||
# 创建道具按钮
|
||||
func _create_item_button(item_name: String) -> Button:
|
||||
# 使用绿色按钮作为道具按钮的默认样式
|
||||
var button = main_game.item_button.duplicate()
|
||||
|
||||
# 确保按钮可见并可点击
|
||||
button.visible = true
|
||||
button.disabled = false
|
||||
button.focus_mode = Control.FOCUS_ALL
|
||||
|
||||
# 设置按钮文本
|
||||
button.text = item_name
|
||||
|
||||
# 添加工具提示,从item_config.json获取道具信息
|
||||
var item_config = _load_item_config()
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var description = item_info.get("描述", "暂无描述")
|
||||
var cost = item_info.get("花费", 0)
|
||||
|
||||
button.tooltip_text = str(
|
||||
"道具: " + item_name + "\n" +
|
||||
"价格: " + str(cost) + "元\n" +
|
||||
"描述: " + description + "\n" +
|
||||
"点击选择道具,然后对地块使用"
|
||||
)
|
||||
else:
|
||||
button.tooltip_text = str("道具: " + item_name + "\n描述: 暂无信息")
|
||||
|
||||
# 如果按钮有标题标签,设置标题
|
||||
if button.has_node("Title"):
|
||||
button.get_node("Title").text = "道具"
|
||||
button.get_node("Title").modulate = Color.CYAN # 道具标题使用青色
|
||||
|
||||
# 更新按钮的道具图片
|
||||
_update_button_item_image(button, item_name)
|
||||
|
||||
return button
|
||||
|
||||
# 加载道具配置数据
|
||||
func _load_item_config() -> Dictionary:
|
||||
# 从item_config.json加载道具配置数据
|
||||
var file = FileAccess.open("res://Server/config/item_config.json", FileAccess.READ)
|
||||
if not file:
|
||||
print("无法读取道具配置文件!")
|
||||
return {}
|
||||
|
||||
var json_text = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_text)
|
||||
if parse_result != OK:
|
||||
print("道具配置JSON解析错误:", json.get_error_message())
|
||||
return {}
|
||||
|
||||
return json.get_data()
|
||||
|
||||
# 正常模式下的道具点击处理 - 选择道具
|
||||
func _on_item_selected(item_name: String, item_count: int, button: Button):
|
||||
# 检查道具是否可以使用
|
||||
if not _is_item_usable(item_name):
|
||||
# 显示道具信息
|
||||
_show_item_info(item_name, item_count)
|
||||
return
|
||||
|
||||
# 取消之前选择的道具
|
||||
if selected_item_button and selected_item_button != button:
|
||||
_deselect_item()
|
||||
|
||||
if selected_item_name == item_name:
|
||||
# 如果点击的是已选择的道具,取消选择
|
||||
_deselect_item()
|
||||
Toast.show("已取消选择道具", Color.YELLOW, 2.0, 1.0)
|
||||
else:
|
||||
# 选择新道具
|
||||
_select_item(item_name, button)
|
||||
#点击后关闭玩家道具面板
|
||||
_on_quit_button_pressed()
|
||||
Toast.show("已选择 " + item_name + ",点击地块使用道具", Color.CYAN, 3.0, 1.0)
|
||||
|
||||
# 选择道具
|
||||
func _select_item(item_name: String, button: Button):
|
||||
selected_item_name = item_name
|
||||
selected_item_button = button
|
||||
is_item_selected = true
|
||||
|
||||
# 设置全局选择状态
|
||||
main_game.selected_item_name = item_name
|
||||
main_game.is_item_selected = true
|
||||
|
||||
# 更改按钮样式表示选中
|
||||
if button.has_node("Title"):
|
||||
button.get_node("Title").modulate = Color.YELLOW # 选中时使用黄色
|
||||
|
||||
# 取消选择道具
|
||||
func _deselect_item():
|
||||
selected_item_name = ""
|
||||
is_item_selected = false
|
||||
|
||||
# 清除全局选择状态
|
||||
main_game.selected_item_name = ""
|
||||
main_game.is_item_selected = false
|
||||
|
||||
# 恢复按钮样式
|
||||
if selected_item_button and selected_item_button.has_node("Title"):
|
||||
selected_item_button.get_node("Title").modulate = Color.CYAN
|
||||
|
||||
selected_item_button = null
|
||||
|
||||
# 检查道具是否可以使用
|
||||
func _is_item_usable(item_name: String) -> bool:
|
||||
# 根据道具类型判断是否可以使用
|
||||
match item_name:
|
||||
"农家肥", "金坷垃", "生长素":
|
||||
return true # 施肥道具
|
||||
"水壶", "水桶":
|
||||
return true # 浇水道具
|
||||
"铲子":
|
||||
return true # 铲除道具
|
||||
"除草剂":
|
||||
return true # 除草道具
|
||||
"精准采集锄", "时运锄":
|
||||
return true # 采集道具
|
||||
"杀虫剂":
|
||||
return false # 其他道具(暂不实现)
|
||||
_:
|
||||
return false
|
||||
|
||||
# 显示道具信息
|
||||
func _show_item_info(item_name: String, item_count: int):
|
||||
var info_text = ""
|
||||
|
||||
var item_config = _load_item_config()
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var description = item_info.get("描述", "暂无描述")
|
||||
var cost = item_info.get("花费", 0)
|
||||
|
||||
info_text = item_name + " (数量: " + str(item_count) + ")\n"
|
||||
info_text += "价格: " + str(cost) + "元\n"
|
||||
info_text += "描述: " + description
|
||||
|
||||
if not _is_item_usable(item_name):
|
||||
info_text += "\n注意: 此道具功能暂未实现"
|
||||
else:
|
||||
info_text = item_name + " (数量: " + str(item_count) + ")\n描述: 暂无信息"
|
||||
|
||||
Toast.show(info_text, Color.CYAN, 3.0, 1.0)
|
||||
|
||||
# 访问模式下的道具点击处理
|
||||
func _on_visit_item_selected(item_name: String, item_count: int):
|
||||
# 显示道具信息
|
||||
_show_item_info(item_name, item_count)
|
||||
|
||||
# 更新按钮的道具图片
|
||||
func _update_button_item_image(button: Button, item_name: String):
|
||||
# 检查按钮是否有CropImage节点
|
||||
var item_image = button.get_node_or_null("CropImage")
|
||||
if not item_image:
|
||||
print("道具背包按钮没有找到CropImage节点:", button.name)
|
||||
return
|
||||
|
||||
# 从配置文件获取道具图片路径
|
||||
var item_config = _load_item_config()
|
||||
var texture = null
|
||||
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var image_path = item_info.get("道具图片", "")
|
||||
|
||||
if image_path != "" and ResourceLoader.exists(image_path):
|
||||
# 尝试加载道具图片
|
||||
texture = load(image_path)
|
||||
if texture:
|
||||
print("成功加载道具图片:", item_name, " -> ", image_path)
|
||||
else:
|
||||
print("加载道具图片失败:", item_name, " -> ", image_path)
|
||||
else:
|
||||
print("道具图片路径无效或不存在:", item_name, " -> ", image_path)
|
||||
|
||||
# 如果没有找到道具图片,尝试使用默认道具图片
|
||||
if not texture:
|
||||
var default_item_path = "res://assets/道具图片/默认道具.webp"
|
||||
if ResourceLoader.exists(default_item_path):
|
||||
texture = load(default_item_path)
|
||||
if texture:
|
||||
print("使用默认道具图片:", item_name)
|
||||
|
||||
# 设置图片
|
||||
if texture:
|
||||
# CropImage是Sprite2D,直接设置texture属性
|
||||
item_image.texture = texture
|
||||
item_image.visible = true
|
||||
print("道具背包更新道具图片:", item_name)
|
||||
else:
|
||||
# 如果没有图片,隐藏图片节点
|
||||
item_image.visible = false
|
||||
print("道具背包无法获取道具图片:", item_name)
|
||||
|
||||
#=========================面板通用处理=========================
|
||||
# 关闭道具背包面板
|
||||
func _on_quit_button_pressed() -> void:
|
||||
# 打开面板后暂时禁用相机功能
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
self.hide()
|
||||
|
||||
#手动刷新道具背包面板
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
# 刷新道具背包UI
|
||||
update_item_bag_ui()
|
||||
Toast.show("道具背包已刷新", Color.GREEN, 2.0, 1.0)
|
||||
#=========================面板通用处理=========================
|
||||
|
||||
# 获取当前选择的道具名称
|
||||
func get_selected_item_name() -> String:
|
||||
return selected_item_name
|
||||
|
||||
# 检查是否有道具被选择
|
||||
func is_item_currently_selected() -> bool:
|
||||
return is_item_selected
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bypjb28h4ntdr"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://bypjb28h4ntdr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://badqjgdfhg7vt" path="res://GUI/MainMenuPanel.gd" id="1_wpehy"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddcmrh50o1y0q" path="res://assets/菜单UI/背景1.webp" id="2_eghpk"]
|
||||
@@ -8,6 +8,31 @@
|
||||
[ext_resource type="Script" uid="uid://kj7v1uxk2i6h" path="res://GUI/GameUpdatePanel.gd" id="4_fys16"]
|
||||
[ext_resource type="Texture2D" uid="uid://ccav04woielxa" path="res://assets/菜单UI/柚小青装饰品.webp" id="5_6jmhb"]
|
||||
[ext_resource type="PackedScene" uid="uid://dos15dmc1b6bt" path="res://GUI/GameSettingPanel.tscn" id="6_eghpk"]
|
||||
[ext_resource type="Script" uid="uid://ciwjx67wjubdy" path="res://GUI/CheckUpdatePanel.gd" id="9_6jmhb"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eghpk"]
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6jmhb"]
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[node name="MainMenuPanel" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -132,12 +157,22 @@ theme_override_font_sizes/font_size = 40
|
||||
text = "退出游戏"
|
||||
|
||||
[node name="GameSettingPanel" parent="." instance=ExtResource("6_eghpk")]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 138.0
|
||||
offset_top = 80.0
|
||||
offset_right = 1536.0
|
||||
offset_bottom = 800.0
|
||||
|
||||
[node name="GameAboutPanel" type="Panel" parent="."]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 720.0
|
||||
offset_left = 138.0
|
||||
offset_top = 80.0
|
||||
offset_right = 1536.0
|
||||
offset_bottom = 800.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_eghpk")
|
||||
script = ExtResource("3_y0inj")
|
||||
|
||||
[node name="Title" type="Label" parent="GameAboutPanel"]
|
||||
@@ -159,23 +194,31 @@ vertical_alignment = 1
|
||||
[node name="QuitButton" type="Button" parent="GameAboutPanel"]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_left = 1325.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 80.0
|
||||
offset_left = 1305.0
|
||||
offset_top = 17.5
|
||||
offset_right = 1380.0
|
||||
offset_bottom = 97.5
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "X"
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="GameAboutPanel"]
|
||||
layout_mode = 0
|
||||
offset_left = 15.0
|
||||
offset_top = 80.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
offset_right = 3428.0
|
||||
offset_bottom = 1636.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
|
||||
[node name="Contents" type="RichTextLabel" parent="GameAboutPanel/Scroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/normal_font_size = 30
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 20
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/normal_font_size = 70
|
||||
bbcode_enabled = true
|
||||
text = "玩法介绍:
|
||||
1.版本要匹配,服务器版本一直在更新,请及时下载最新版客户端,否者无法登录游戏
|
||||
2.游戏目前适配Windows和安卓平台,未来也会适配Linux桌面版,IOS应该会有吧...?
|
||||
@@ -191,15 +234,20 @@ text = "玩法介绍:
|
||||
[node name="GameUpdatePanel" type="Panel" parent="."]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 720.0
|
||||
offset_left = 138.0
|
||||
offset_top = 80.0
|
||||
offset_right = 1536.0
|
||||
offset_bottom = 800.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_6jmhb")
|
||||
script = ExtResource("4_fys16")
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="GameUpdatePanel"]
|
||||
layout_mode = 0
|
||||
offset_left = 15.0
|
||||
offset_top = 80.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
offset_right = 1384.0
|
||||
offset_bottom = 705.0
|
||||
|
||||
[node name="Contents" type="RichTextLabel" parent="GameUpdatePanel/Scroll"]
|
||||
layout_mode = 2
|
||||
@@ -219,20 +267,60 @@ vertical_alignment = 1
|
||||
[node name="QuitButton" type="Button" parent="GameUpdatePanel"]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_left = 1340.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 60.0
|
||||
offset_left = 1320.0
|
||||
offset_top = 17.5
|
||||
offset_right = 1380.0
|
||||
offset_bottom = 77.5
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="GameUpdatePanel"]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_right = 78.0
|
||||
offset_bottom = 60.0
|
||||
offset_left = 15.0
|
||||
offset_top = 17.5
|
||||
offset_right = 93.0
|
||||
offset_bottom = 77.5
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "刷新"
|
||||
|
||||
[node name="CheckUpdatePanel" type="Panel" parent="."]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 260.0
|
||||
offset_top = 53.0
|
||||
offset_right = 1150.0
|
||||
offset_bottom = 596.0
|
||||
script = ExtResource("9_6jmhb")
|
||||
|
||||
[node name="Title" type="Label" parent="CheckUpdatePanel"]
|
||||
layout_mode = 0
|
||||
offset_right = 890.0
|
||||
offset_bottom = 89.0
|
||||
theme_override_colors/font_color = Color(0, 1, 0, 1)
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "检测到新版本!"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="DownloadButton" type="Button" parent="CheckUpdatePanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 480.0
|
||||
offset_right = 890.0
|
||||
offset_bottom = 543.0
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "下载新版本"
|
||||
|
||||
[node name="Contents" type="Label" parent="CheckUpdatePanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 133.0
|
||||
offset_right = 890.0
|
||||
offset_bottom = 480.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "服务端一直在更新,使用旧版本客户端无法与最新版服务端兼容,
|
||||
请及时下载最新版,点击下方链接跳转到浏览器下载最新版,
|
||||
或者加入QQ群在群文件中下载最新开发版"
|
||||
|
||||
[connection signal="pressed" from="VBox/StartGameButton" to="." method="_on_start_game_button_pressed"]
|
||||
[connection signal="pressed" from="VBox/GameSettingButton" to="." method="_on_game_setting_button_pressed"]
|
||||
[connection signal="pressed" from="VBox/GameUpdateButton" to="." method="_on_game_update_button_pressed"]
|
||||
@@ -240,3 +328,4 @@ text = "刷新"
|
||||
[connection signal="pressed" from="VBox/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||
[connection signal="pressed" from="GameAboutPanel/QuitButton" to="GameAboutPanel" method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="GameUpdatePanel/QuitButton" to="GameUpdatePanel" method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="CheckUpdatePanel/DownloadButton" to="CheckUpdatePanel" method="_on_download_button_pressed"]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dsln1w1aqgf1k" path="res://assets/游戏UI/玩家默认头像.webp" id="1_sgoxp"]
|
||||
[ext_resource type="Script" uid="uid://0d2j5m6j2ema" path="res://Components/HTTPTextureRect.gd" id="2_ky0k8"]
|
||||
|
||||
[node name="player_ranking_item" type="VBoxContainer"]
|
||||
[node name="PlayerRankingItem" type="VBoxContainer"]
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 82.0
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
extends ProgressBar
|
||||
|
||||
var target_value: float = 0.0
|
||||
var animation_speed: float = 2.0
|
||||
|
||||
func _ready():
|
||||
# 初始化进度条的颜色
|
||||
modulate = Color(0.6, 0, 0.0) # 从红色到绿色的渐变
|
||||
|
||||
func _process(delta):
|
||||
update_progress_visuals()
|
||||
|
||||
func set_target_value(new_value: float):
|
||||
value = new_value
|
||||
|
||||
func update_progress_visuals():
|
||||
# 改变进度条的颜色
|
||||
var fill_ratio = value / max_value
|
||||
modulate = Color(0.6 - fill_ratio, fill_ratio, 0.0) # 从红色到绿色的渐变
|
||||
#modulate = Color(1.0 - fill_ratio, fill_ratio, 0.0) # 从红色到绿色的渐变
|
||||
#modulate = Color(0.0, 1.0 - fill_ratio, fill_ratio) # 从蓝色到绿色的渐变
|
||||
#modulate = Color(0.0, 1.0 - fill_ratio, fill_ratio * 0.75) # 从绿色到淡蓝色的渐变
|
||||
@@ -1 +0,0 @@
|
||||
uid://xh5tr5co5kfu
|
||||
@@ -1,500 +0,0 @@
|
||||
extends Panel
|
||||
|
||||
#种子商店面板
|
||||
#种子商店格子
|
||||
@onready var crop_grid_container : GridContainer = $ScrollContainer/Crop_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
|
||||
#各种排序过滤按钮
|
||||
@onready var sort_all_button : Button = $SortContainer/Sort_All#全部
|
||||
@onready var sort_common_button : Button = $SortContainer/Sort_Common#普通
|
||||
@onready var sort_superior_button : Button = $SortContainer/Sort_Superior#优良
|
||||
@onready var sort_rare_button : Button = $SortContainer/Sort_Rare#稀有
|
||||
@onready var sort_epic_button : Button = $SortContainer/Sort_Epic#史诗
|
||||
@onready var sort_legendary_button : Button = $SortContainer/Sort_Legendary#传奇
|
||||
@onready var sort_price_button : Button = $SortContainer/Sort_Price#价格
|
||||
@onready var sort_growtime_button : Button = $SortContainer/Sort_GrowTime#生长时间
|
||||
@onready var sort_profit_button : Button = $SortContainer/Sort_Profit#收益
|
||||
@onready var sort_level_button : Button = $SortContainer/Sort_Level#等级
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
# 作物图片缓存(复用主游戏的缓存系统)
|
||||
var crop_textures_cache : Dictionary = {}
|
||||
var crop_frame_counts : Dictionary = {}
|
||||
|
||||
# 当前过滤和排序设置
|
||||
var current_filter_quality = ""
|
||||
var current_sort_key = ""
|
||||
var current_sort_ascending = true
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
# 连接按钮信号
|
||||
_connect_buttons()
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
# 连接所有按钮信号
|
||||
func _connect_buttons():
|
||||
# 关闭按钮
|
||||
quit_button.pressed.connect(self._on_quit_button_pressed)
|
||||
|
||||
# 过滤按钮
|
||||
sort_all_button.pressed.connect(func(): _filter_by_quality(""))
|
||||
sort_common_button.pressed.connect(func(): _filter_by_quality("普通"))
|
||||
sort_superior_button.pressed.connect(func(): _filter_by_quality("优良"))
|
||||
sort_rare_button.pressed.connect(func(): _filter_by_quality("稀有"))
|
||||
sort_epic_button.pressed.connect(func(): _filter_by_quality("史诗"))
|
||||
sort_legendary_button.pressed.connect(func(): _filter_by_quality("传奇"))
|
||||
|
||||
# 排序按钮
|
||||
sort_price_button.pressed.connect(func(): _sort_by("花费"))
|
||||
sort_growtime_button.pressed.connect(func(): _sort_by("生长时间"))
|
||||
sort_profit_button.pressed.connect(func(): _sort_by("收益"))
|
||||
sort_level_button.pressed.connect(func(): _sort_by("等级"))
|
||||
|
||||
# 初始化商店
|
||||
func init_store():
|
||||
print("初始化商店...")
|
||||
|
||||
# 清空已有的作物按钮
|
||||
for child in crop_grid_container.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 遍历可种植的作物数据并添加到商店
|
||||
print("初始化商店,显示所有作物...")
|
||||
for crop_name in main_game.can_planted_crop:
|
||||
var crop = main_game.can_planted_crop[crop_name]
|
||||
|
||||
# 检查是否可以购买
|
||||
if not crop.get("能否购买", true):
|
||||
continue
|
||||
|
||||
# 只显示当前等级可以种植的作物
|
||||
if crop["等级"] <= main_game.level:
|
||||
var store_btn = _create_store_button(crop_name, crop["品质"])
|
||||
crop_grid_container.add_child(store_btn)
|
||||
#print("添加商店按钮: " + crop_name)
|
||||
|
||||
print("商店初始化完成,共添加按钮: " + str(crop_grid_container.get_child_count()) + "个")
|
||||
|
||||
# 更新金钱显示
|
||||
_update_money_display()
|
||||
|
||||
# 创建商店按钮
|
||||
func _create_store_button(crop_name: String, crop_quality: String) -> Button:
|
||||
# 根据品质选择相应的按钮
|
||||
var button = null
|
||||
match crop_quality:
|
||||
"普通":
|
||||
button = main_game.green_bar.duplicate()
|
||||
"优良":
|
||||
button = main_game.orange_bar.duplicate()
|
||||
"稀有":
|
||||
button = main_game.white_blue_bar.duplicate()
|
||||
"史诗":
|
||||
button = main_game.pink_bar.duplicate()
|
||||
"传奇":
|
||||
button = main_game.black_blue_bar.duplicate()
|
||||
_: # 默认情况
|
||||
button = main_game.green_bar.duplicate()
|
||||
|
||||
var crop = main_game.can_planted_crop[crop_name]
|
||||
|
||||
# 确保按钮可见并可点击
|
||||
button.visible = true
|
||||
button.disabled = false
|
||||
button.focus_mode = Control.FOCUS_ALL
|
||||
|
||||
# 设置按钮文本,显示价格
|
||||
button.text = str(crop_quality + "-" + crop_name + "\n价格: ¥" + str(crop["花费"]))
|
||||
|
||||
# 将成熟时间从秒转换为天时分秒格式
|
||||
var total_seconds = int(crop["生长时间"])
|
||||
|
||||
# 定义时间单位换算
|
||||
var SECONDS_PER_MINUTE = 60
|
||||
var SECONDS_PER_HOUR = 3600
|
||||
var SECONDS_PER_DAY = 86400
|
||||
|
||||
# 计算各时间单位
|
||||
var days = total_seconds / SECONDS_PER_DAY
|
||||
total_seconds %= SECONDS_PER_DAY
|
||||
|
||||
var hours = total_seconds / SECONDS_PER_HOUR
|
||||
total_seconds %= SECONDS_PER_HOUR
|
||||
|
||||
var minutes = total_seconds / SECONDS_PER_MINUTE
|
||||
var seconds = total_seconds % SECONDS_PER_MINUTE
|
||||
|
||||
# 构建时间字符串(只显示有值的单位)
|
||||
var time_str = ""
|
||||
if days > 0:
|
||||
time_str += str(days) + "天"
|
||||
if hours > 0:
|
||||
time_str += str(hours) + "小时"
|
||||
if minutes > 0:
|
||||
time_str += str(minutes) + "分钟"
|
||||
if seconds > 0:
|
||||
time_str += str(seconds) + "秒"
|
||||
|
||||
button.tooltip_text = str(
|
||||
"作物: " + crop_name + "\n" +
|
||||
"品质: " + crop_quality + "\n" +
|
||||
"价格: " + str(crop["花费"]) + "元\n" +
|
||||
"成熟时间: " + time_str + "\n" +
|
||||
"收获收益: " + str(crop["收益"]) + "元\n" +
|
||||
"需求等级: " + str(crop["等级"]) + "\n" +
|
||||
"耐候性: " + str(crop["耐候性"]) + "\n" +
|
||||
"经验: " + str(crop["经验"]) + "点\n" +
|
||||
"描述: " + str(crop["描述"])
|
||||
)
|
||||
|
||||
# 添加按钮事件
|
||||
button.pressed.connect(func(): _on_store_buy_pressed(crop_name))
|
||||
|
||||
# 更新按钮的作物图片
|
||||
_update_button_crop_image(button, crop_name)
|
||||
|
||||
# 如果按钮有标题标签,设置标题
|
||||
if button.has_node("Title"):
|
||||
match crop_quality:
|
||||
"普通":
|
||||
button.get_node("Title").modulate = Color.HONEYDEW#白色
|
||||
"优良":
|
||||
button.get_node("Title").modulate =Color.DODGER_BLUE#深蓝色
|
||||
"稀有":
|
||||
button.get_node("Title").modulate =Color.HOT_PINK#品红色
|
||||
"史诗":
|
||||
button.get_node("Title").modulate =Color.YELLOW#黄色
|
||||
"传奇":
|
||||
button.get_node("Title").modulate =Color.ORANGE_RED#红色
|
||||
|
||||
return button
|
||||
|
||||
# 购买种子事件处理
|
||||
func _on_store_buy_pressed(crop_name: String):
|
||||
print("购买种子: " + crop_name)
|
||||
var crop = main_game.can_planted_crop[crop_name]
|
||||
|
||||
# 检查等级要求
|
||||
if main_game.level < crop["等级"]:
|
||||
Toast.show("等级不足,无法购买此种子", Color.RED)
|
||||
return
|
||||
|
||||
# 检查金钱是否足够
|
||||
if main_game.money < crop["花费"]:
|
||||
Toast.show("金钱不足,无法购买种子", Color.RED)
|
||||
return
|
||||
|
||||
# 发送购买请求到服务器
|
||||
if network_manager and network_manager.sendBuySeed(crop_name):
|
||||
|
||||
# 将种子添加到背包
|
||||
var found = false
|
||||
for seed_item in main_game.player_bag:
|
||||
if seed_item["name"] == crop_name:
|
||||
seed_item["count"] += 1
|
||||
found = true
|
||||
break
|
||||
|
||||
if not found:
|
||||
main_game.player_bag.append({
|
||||
"name": crop_name,
|
||||
"quality": crop["品质"],
|
||||
"count": 1
|
||||
})
|
||||
|
||||
# 显示购买成功消息
|
||||
Toast.show("购买了" + crop["品质"] + "-" + crop_name + "种子", Color.GREEN)
|
||||
|
||||
# 更新背包UI
|
||||
crop_store_panel.update_player_bag_ui()
|
||||
|
||||
# 更新金钱显示
|
||||
_update_money_display()
|
||||
|
||||
# 关闭面板
|
||||
func _on_quit_button_pressed():
|
||||
print("关闭商店面板")
|
||||
self.hide()
|
||||
|
||||
# 按品质过滤作物
|
||||
func _filter_by_quality(quality: String):
|
||||
current_filter_quality = quality
|
||||
print("过滤作物,品质: " + (quality if quality != "" else "全部"))
|
||||
_apply_filter_and_sort()
|
||||
|
||||
# 按指定键排序
|
||||
func _sort_by(sort_key: String):
|
||||
# 切换排序方向或设置新排序键
|
||||
if current_sort_key == sort_key:
|
||||
current_sort_ascending = !current_sort_ascending
|
||||
else:
|
||||
current_sort_key = sort_key
|
||||
current_sort_ascending = true
|
||||
|
||||
print("排序作物,键: " + sort_key + ",升序: " + str(current_sort_ascending))
|
||||
_apply_filter_and_sort()
|
||||
|
||||
# 应用过滤和排序
|
||||
func _apply_filter_and_sort():
|
||||
# 清空现有按钮
|
||||
for child in crop_grid_container.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 收集符合条件的作物
|
||||
var filtered_crops = []
|
||||
for crop_name in main_game.can_planted_crop:
|
||||
var crop = main_game.can_planted_crop[crop_name]
|
||||
|
||||
# 检查是否可以购买
|
||||
if not crop.get("能否购买", true):
|
||||
continue
|
||||
|
||||
# 检查等级和品质过滤
|
||||
if crop["等级"] > main_game.level:
|
||||
continue
|
||||
|
||||
if current_filter_quality != "" and crop["品质"] != current_filter_quality:
|
||||
continue
|
||||
|
||||
# 添加到过滤后的列表
|
||||
filtered_crops.append({
|
||||
"name": crop_name,
|
||||
"data": crop
|
||||
})
|
||||
|
||||
# 如果有排序条件,进行排序
|
||||
if current_sort_key != "":
|
||||
filtered_crops.sort_custom(Callable(self, "_sort_crop_items"))
|
||||
|
||||
# 添加所有过滤和排序后的作物
|
||||
for crop in filtered_crops:
|
||||
var store_btn = _create_store_button(crop["name"], crop["data"]["品质"])
|
||||
crop_grid_container.add_child(store_btn)
|
||||
|
||||
# 更新金钱显示
|
||||
_update_money_display()
|
||||
|
||||
# 自定义排序函数
|
||||
func _sort_crop_items(a, b):
|
||||
if current_sort_ascending:
|
||||
return a["data"][current_sort_key] < b["data"][current_sort_key]
|
||||
else:
|
||||
return a["data"][current_sort_key] > b["data"][current_sort_key]
|
||||
|
||||
# 更新金钱显示
|
||||
func _update_money_display():
|
||||
var money_label = get_node_or_null("MoneyLabel")
|
||||
if money_label == null:
|
||||
# 创建金钱显示标签
|
||||
money_label = Label.new()
|
||||
money_label.name = "MoneyLabel"
|
||||
money_label.position = Vector2(10, 10)
|
||||
money_label.size = Vector2(300, 45)
|
||||
|
||||
# 设置标签样式
|
||||
money_label.add_theme_color_override("font_color", Color(1, 0.647, 0, 1)) # 橙色
|
||||
money_label.add_theme_font_size_override("font_size", 24)
|
||||
|
||||
add_child(money_label)
|
||||
|
||||
# 更新金钱显示
|
||||
money_label.text = "当前金钱:" + str(main_game.money) + " 元"
|
||||
print("更新商店金钱显示:" + str(main_game.money))
|
||||
|
||||
# 刷新商店内容,可以在金钱变化或等级提升后调用
|
||||
func refresh_store():
|
||||
# 清空并重新创建商店按钮
|
||||
init_store()
|
||||
|
||||
# 尝试创建过滤按钮(如果商店面板中没有这些按钮)
|
||||
_create_filter_buttons_if_needed()
|
||||
|
||||
# 如果需要,动态创建过滤按钮
|
||||
func _create_filter_buttons_if_needed():
|
||||
# 检查是否已存在过滤器容器
|
||||
var filter_container = get_node_or_null("FilterContainer")
|
||||
if filter_container == null:
|
||||
# 创建过滤器容器
|
||||
filter_container = HBoxContainer.new()
|
||||
filter_container.name = "FilterContainer"
|
||||
|
||||
# 设置容器位置和大小
|
||||
filter_container.position = Vector2(320, 10)
|
||||
filter_container.size = Vector2(770, 45)
|
||||
|
||||
add_child(filter_container)
|
||||
|
||||
# 添加过滤按钮
|
||||
_add_filter_button(filter_container, "全部", func(): _filter_by_quality(""))
|
||||
_add_filter_button(filter_container, "普通", func(): _filter_by_quality("普通"))
|
||||
_add_filter_button(filter_container, "优良", func(): _filter_by_quality("优良"))
|
||||
_add_filter_button(filter_container, "稀有", func(): _filter_by_quality("稀有"))
|
||||
_add_filter_button(filter_container, "史诗", func(): _filter_by_quality("史诗"))
|
||||
_add_filter_button(filter_container, "传奇", func(): _filter_by_quality("传奇"))
|
||||
|
||||
# 检查是否已存在排序容器
|
||||
var sort_container = get_node_or_null("SortContainer")
|
||||
if sort_container == null:
|
||||
# 创建排序容器
|
||||
sort_container = HBoxContainer.new()
|
||||
sort_container.name = "SortContainer"
|
||||
|
||||
# 设置容器位置和大小
|
||||
sort_container.position = Vector2(320, 55)
|
||||
sort_container.size = Vector2(770, 30)
|
||||
|
||||
add_child(sort_container)
|
||||
|
||||
# 添加排序按钮
|
||||
_add_filter_button(sort_container, "按价格", func(): _sort_by("花费"))
|
||||
_add_filter_button(sort_container, "按生长时间", func(): _sort_by("生长时间"))
|
||||
_add_filter_button(sort_container, "按收益", func(): _sort_by("收益"))
|
||||
_add_filter_button(sort_container, "按等级", func(): _sort_by("等级"))
|
||||
|
||||
# 添加过滤按钮
|
||||
func _add_filter_button(container, text, callback):
|
||||
var button = Button.new()
|
||||
button.text = text
|
||||
button.custom_minimum_size = Vector2(100, 0)
|
||||
button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
container.add_child(button)
|
||||
button.pressed.connect(callback)
|
||||
|
||||
# 获取作物的最后一帧图片(用于商店显示)
|
||||
func _get_crop_final_texture(crop_name: String) -> Texture2D:
|
||||
"""
|
||||
获取作物的最后一帧图片,用于商店和背包显示
|
||||
如果作物图片不存在,使用默认图片的最后一帧
|
||||
"""
|
||||
# 先尝试从主游戏的缓存中获取
|
||||
if main_game and main_game.crop_textures_cache.has(crop_name):
|
||||
var textures = main_game.crop_textures_cache[crop_name]
|
||||
if textures.size() > 0:
|
||||
return textures[textures.size() - 1] # 返回最后一帧
|
||||
|
||||
# 如果主游戏缓存中没有,自己加载
|
||||
var textures = _load_crop_textures(crop_name)
|
||||
if textures.size() > 0:
|
||||
return textures[textures.size() - 1] # 返回最后一帧
|
||||
|
||||
return null
|
||||
|
||||
# 加载作物图片序列帧(复用主游戏的逻辑)
|
||||
func _load_crop_textures(crop_name: String) -> Array:
|
||||
"""
|
||||
加载指定作物的所有序列帧图片
|
||||
"""
|
||||
if crop_textures_cache.has(crop_name):
|
||||
return crop_textures_cache[crop_name]
|
||||
|
||||
var textures = []
|
||||
var crop_path = "res://assets/作物/" + crop_name + "/"
|
||||
var default_path = "res://assets/作物/默认/"
|
||||
|
||||
# 检查作物文件夹是否存在
|
||||
if DirAccess.dir_exists_absolute(crop_path):
|
||||
# 尝试加载作物的序列帧(从0开始)
|
||||
var frame_index = 0
|
||||
while true:
|
||||
var texture_path = crop_path + str(frame_index) + ".webp"
|
||||
if ResourceLoader.exists(texture_path):
|
||||
var texture = load(texture_path)
|
||||
if texture:
|
||||
textures.append(texture)
|
||||
frame_index += 1
|
||||
else:
|
||||
break
|
||||
else:
|
||||
break
|
||||
|
||||
if textures.size() > 0:
|
||||
print("商店加载作物 ", crop_name, " 的 ", textures.size(), " 帧图片")
|
||||
else:
|
||||
print("商店:作物 ", crop_name, " 文件夹存在但没有找到有效图片,使用默认图片")
|
||||
textures = _load_default_textures()
|
||||
else:
|
||||
print("商店:作物 ", crop_name, " 的文件夹不存在,使用默认图片")
|
||||
textures = _load_default_textures()
|
||||
|
||||
# 缓存结果
|
||||
crop_textures_cache[crop_name] = textures
|
||||
crop_frame_counts[crop_name] = textures.size()
|
||||
|
||||
return textures
|
||||
|
||||
# 加载默认图片
|
||||
func _load_default_textures() -> Array:
|
||||
"""
|
||||
加载默认作物图片
|
||||
"""
|
||||
if crop_textures_cache.has("默认"):
|
||||
return crop_textures_cache["默认"]
|
||||
|
||||
var textures = []
|
||||
var default_path = "res://assets/作物/默认/"
|
||||
|
||||
# 尝试加载默认图片序列帧
|
||||
var frame_index = 0
|
||||
while true:
|
||||
var texture_path = default_path + str(frame_index) + ".webp"
|
||||
if ResourceLoader.exists(texture_path):
|
||||
var texture = load(texture_path)
|
||||
if texture:
|
||||
textures.append(texture)
|
||||
frame_index += 1
|
||||
else:
|
||||
break
|
||||
else:
|
||||
break
|
||||
|
||||
# 如果没有找到序列帧,尝试加载单个默认图片
|
||||
if textures.size() == 0:
|
||||
var single_texture_path = default_path + "0.webp"
|
||||
if ResourceLoader.exists(single_texture_path):
|
||||
var texture = load(single_texture_path)
|
||||
if texture:
|
||||
textures.append(texture)
|
||||
|
||||
# 缓存默认图片
|
||||
crop_textures_cache["默认"] = textures
|
||||
crop_frame_counts["默认"] = textures.size()
|
||||
|
||||
print("商店加载了 ", textures.size(), " 个默认作物图片")
|
||||
return textures
|
||||
|
||||
# 更新按钮的作物图片
|
||||
func _update_button_crop_image(button: Button, crop_name: String):
|
||||
"""
|
||||
更新按钮中的作物图片
|
||||
"""
|
||||
# 检查按钮是否有CropImage节点
|
||||
var crop_image = button.get_node_or_null("CropImage")
|
||||
if not crop_image:
|
||||
print("商店按钮没有找到CropImage节点:", button.name)
|
||||
return
|
||||
|
||||
# 获取作物的最后一帧图片
|
||||
var texture = _get_crop_final_texture(crop_name)
|
||||
|
||||
if texture:
|
||||
# CropImage是Sprite2D,直接设置texture属性
|
||||
crop_image.texture = texture
|
||||
crop_image.visible = true
|
||||
print("商店更新作物图片:", crop_name)
|
||||
else:
|
||||
crop_image.visible = false
|
||||
print("商店无法获取作物图片:", crop_name)
|
||||
|
||||
# 兼容MainGame.gd中的调用,转发到_on_store_buy_pressed
|
||||
func _on_crop_selected(crop_name: String):
|
||||
_on_store_buy_pressed(crop_name)
|
||||
@@ -1 +0,0 @@
|
||||
uid://mtfp0ct42nrx
|
||||
@@ -1,431 +0,0 @@
|
||||
extends Panel
|
||||
|
||||
#获取玩家要操作的地块序号
|
||||
var selected_lot_index = 0
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
@onready var quit_button :Button = $Quit_Button
|
||||
@onready var dig_button: Button = $Grid/Dig_Button
|
||||
@onready var water_button: Button = $Grid/Water_Button
|
||||
@onready var fertilize_button: Button = $Grid/Fertilize_Button
|
||||
@onready var upgrade_button: Button = $Grid/Upgrade_Button
|
||||
@onready var plant_button: Button = $Grid/Plant_Button
|
||||
@onready var remove_button: Button = $Grid/Remove_Button
|
||||
@onready var harvest_button: Button = $Grid/Harvest_Button
|
||||
|
||||
|
||||
func _ready():
|
||||
self.hide()
|
||||
quit_button.pressed.connect(self._on_quit_button_pressed)
|
||||
dig_button.pressed.connect(self._on_dig_button_pressed)
|
||||
water_button.pressed.connect(self._on_water_button_pressed)
|
||||
fertilize_button.pressed.connect(self._on_fertilize_button_pressed)
|
||||
upgrade_button.pressed.connect(self._on_upgrade_button_pressed)
|
||||
plant_button.pressed.connect(self._on_plant_button_pressed)
|
||||
remove_button.pressed.connect(self._on_remove_button_pressed)
|
||||
harvest_button.pressed.connect(self._on_harvest_button_pressed)
|
||||
|
||||
# 显示浇水、施肥、升级按钮
|
||||
water_button.visible = true
|
||||
fertilize_button.visible = true
|
||||
upgrade_button.visible = true
|
||||
|
||||
_update_button_texts()
|
||||
|
||||
# 显示面板时更新按钮状态
|
||||
func show_panel():
|
||||
self.show()
|
||||
_update_button_texts()
|
||||
_update_button_availability()
|
||||
|
||||
# 更新按钮可用性
|
||||
func _update_button_availability():
|
||||
if main_game.is_visiting_mode:
|
||||
# 访问模式下禁用一些按钮
|
||||
dig_button.hide()
|
||||
remove_button.hide()
|
||||
upgrade_button.hide()
|
||||
plant_button.hide()
|
||||
|
||||
# 启用允许的按钮
|
||||
water_button.show()
|
||||
fertilize_button.show()
|
||||
harvest_button.show()
|
||||
else:
|
||||
# 自己农场模式下启用所有按钮
|
||||
dig_button.show()
|
||||
remove_button.show()
|
||||
upgrade_button.show()
|
||||
plant_button.show()
|
||||
water_button.show()
|
||||
fertilize_button.show()
|
||||
harvest_button.show()
|
||||
|
||||
# 更新按钮文本
|
||||
func _update_button_texts():
|
||||
# 根据是否访问模式显示不同的按钮文本
|
||||
if main_game.is_visiting_mode:
|
||||
water_button.text = "帮助浇水"+"\n¥50"
|
||||
fertilize_button.text = "帮助施肥"+"\n¥150"
|
||||
harvest_button.text = "偷菜"
|
||||
else:
|
||||
dig_button.text = "开垦"+"\n¥"+str(main_game.dig_money)
|
||||
remove_button.text = "铲除"+"\n¥500"
|
||||
water_button.text = "浇水"+"\n¥50"
|
||||
fertilize_button.text = "施肥"+"\n¥150"
|
||||
|
||||
# 升级按钮动态显示
|
||||
_update_upgrade_button_text()
|
||||
|
||||
harvest_button.text = "收获"
|
||||
|
||||
# 更新升级按钮文本
|
||||
func _update_upgrade_button_text():
|
||||
if not main_game or not main_game.farm_lots:
|
||||
upgrade_button.text = "升级\n¥1000"
|
||||
return
|
||||
|
||||
if selected_lot_index >= 0 and selected_lot_index < main_game.farm_lots.size():
|
||||
var lot = main_game.farm_lots[selected_lot_index]
|
||||
var current_level = int(lot.get("土地等级", 0)) # 确保是整数
|
||||
|
||||
var upgrade_config = {
|
||||
0: {"cost": 1000, "name": "黄土地"},
|
||||
1: {"cost": 2000, "name": "红土地"},
|
||||
2: {"cost": 4000, "name": "紫土地"},
|
||||
3: {"cost": 8000, "name": "黑土地"}
|
||||
}
|
||||
|
||||
if current_level >= 4:
|
||||
upgrade_button.text = "已满级"
|
||||
elif upgrade_config.has(current_level):
|
||||
var config = upgrade_config[current_level]
|
||||
upgrade_button.text = "升级到\n" + config["name"] + "\n¥" + str(config["cost"])
|
||||
else:
|
||||
upgrade_button.text = "等级异常\n" + str(current_level)
|
||||
else:
|
||||
upgrade_button.text = "选择地块"
|
||||
|
||||
#开垦
|
||||
func _on_dig_button_pressed():
|
||||
# 检查是否处于访问模式
|
||||
if main_game.is_visiting_mode:
|
||||
Toast.show("访问模式下无法开垦土地", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查玩家金钱是否足够
|
||||
var dig_cost = main_game.dig_money
|
||||
if main_game.money < dig_cost:
|
||||
Toast.show("金钱不足,开垦土地需要 " + str(dig_cost) + " 金钱", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查地块是否已经开垦
|
||||
var lot = main_game.farm_lots[selected_lot_index]
|
||||
if lot.get("is_diged", false):
|
||||
Toast.show("此地块已经开垦过了", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 发送开垦土地请求到服务器
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
if network_manager.sendDigGround(selected_lot_index):
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("发送开垦请求失败", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("网络未连接,无法开垦土地", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
|
||||
#浇水
|
||||
func _on_water_button_pressed():
|
||||
# 检查玩家金钱是否足够(无论是否访问模式都检查自己的钱)
|
||||
var water_cost = 50
|
||||
var my_money = main_game.money
|
||||
|
||||
# 如果是访问模式,需要检查自己的原始金钱数据
|
||||
if main_game.is_visiting_mode:
|
||||
my_money = main_game.original_player_data.get("money", 0)
|
||||
|
||||
if my_money < water_cost:
|
||||
var action_text = "帮助浇水" if main_game.is_visiting_mode else "浇水"
|
||||
Toast.show("金钱不足," + action_text + "需要 " + str(water_cost) + " 金钱", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查地块状态
|
||||
var lot = main_game.farm_lots[selected_lot_index]
|
||||
if not lot.get("is_planted", false) or lot.get("crop_type", "") == "":
|
||||
Toast.show("此地块没有种植作物", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查作物是否已死亡
|
||||
if lot.get("is_dead", false):
|
||||
Toast.show("死亡的作物无法浇水", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查是否已经成熟
|
||||
if lot.get("grow_time", 0) >= lot.get("max_grow_time", 1):
|
||||
Toast.show("作物已经成熟,无需浇水", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查是否已经浇过水
|
||||
var current_time = Time.get_unix_time_from_system()
|
||||
var last_water_time = lot.get("浇水时间", 0)
|
||||
var water_cooldown = 3600 # 1小时冷却时间
|
||||
|
||||
if current_time - last_water_time < water_cooldown:
|
||||
var remaining_time = water_cooldown - (current_time - last_water_time)
|
||||
var remaining_minutes = int(remaining_time / 60)
|
||||
var remaining_seconds = int(remaining_time) % 60
|
||||
Toast.show("浇水冷却中,还需等待 " + str(remaining_minutes) + " 分钟 " + str(remaining_seconds) + " 秒", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 发送浇水请求到服务器
|
||||
var target_username = ""
|
||||
if main_game.is_visiting_mode:
|
||||
target_username = main_game.visited_player_data.get("user_name", "")
|
||||
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
if network_manager.sendWaterCrop(selected_lot_index, target_username):
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("发送浇水请求失败", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
else:
|
||||
var action_text = "帮助浇水" if main_game.is_visiting_mode else "浇水"
|
||||
Toast.show("网络未连接,无法" + action_text, Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
|
||||
#施肥
|
||||
func _on_fertilize_button_pressed():
|
||||
# 检查玩家金钱是否足够(无论是否访问模式都检查自己的钱)
|
||||
var fertilize_cost = 150
|
||||
var my_money = main_game.money
|
||||
|
||||
# 如果是访问模式,需要检查自己的原始金钱数据
|
||||
if main_game.is_visiting_mode:
|
||||
my_money = main_game.original_player_data.get("money", 0)
|
||||
|
||||
if my_money < fertilize_cost:
|
||||
var action_text = "帮助施肥" if main_game.is_visiting_mode else "施肥"
|
||||
Toast.show("金钱不足," + action_text + "需要 " + str(fertilize_cost) + " 金钱", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查地块状态
|
||||
var lot = main_game.farm_lots[selected_lot_index]
|
||||
if not lot.get("is_planted", false) or lot.get("crop_type", "") == "":
|
||||
Toast.show("此地块没有种植作物", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查作物是否已死亡
|
||||
if lot.get("is_dead", false):
|
||||
Toast.show("死亡的作物无法施肥", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查是否已经成熟
|
||||
if lot.get("grow_time", 0) >= lot.get("max_grow_time", 1):
|
||||
Toast.show("作物已经成熟,无需施肥", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查是否已经施过肥
|
||||
if lot.get("已施肥", false):
|
||||
Toast.show("此作物已经施过肥了", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 发送施肥请求到服务器
|
||||
var target_username = ""
|
||||
if main_game.is_visiting_mode:
|
||||
target_username = main_game.visited_player_data.get("user_name", "")
|
||||
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
if network_manager.sendFertilizeCrop(selected_lot_index, target_username):
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("发送施肥请求失败", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
else:
|
||||
var action_text = "帮助施肥" if main_game.is_visiting_mode else "施肥"
|
||||
Toast.show("网络未连接,无法" + action_text, Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
|
||||
#升级
|
||||
func _on_upgrade_button_pressed():
|
||||
# 检查是否处于访问模式
|
||||
if main_game.is_visiting_mode:
|
||||
Toast.show("访问模式下无法升级", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查地块索引是否有效
|
||||
if selected_lot_index < 0 or selected_lot_index >= main_game.farm_lots.size():
|
||||
Toast.show("无效的地块选择", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 获取地块数据
|
||||
var lot = main_game.farm_lots[selected_lot_index]
|
||||
|
||||
# 检查地块是否已开垦
|
||||
if not lot.get("is_diged", false):
|
||||
Toast.show("此地块尚未开垦", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 获取当前土地等级和升级配置
|
||||
var current_level = int(lot.get("土地等级", 0)) # 确保是整数
|
||||
print("当前选择地块索引: ", selected_lot_index)
|
||||
print("当前土地等级: ", current_level, " (类型: ", typeof(current_level), ")")
|
||||
|
||||
var upgrade_config = {
|
||||
0: {"cost": 1000, "name": "黄土地", "speed": "2倍"},
|
||||
1: {"cost": 2000, "name": "红土地", "speed": "4倍"},
|
||||
2: {"cost": 4000, "name": "紫土地", "speed": "6倍"},
|
||||
3: {"cost": 8000, "name": "黑土地", "speed": "10倍"}
|
||||
}
|
||||
|
||||
# 检查是否已达到最高等级
|
||||
if current_level >= 4:
|
||||
Toast.show("此土地已达到最高等级(黑土地)", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查土地等级是否有效
|
||||
if not upgrade_config.has(current_level):
|
||||
Toast.show("土地等级数据异常,当前等级: " + str(current_level), Color.RED, 2.0, 1.0)
|
||||
print("土地等级异常,当前等级: ", current_level, ",可用等级: ", upgrade_config.keys())
|
||||
self.hide()
|
||||
return
|
||||
|
||||
var config = upgrade_config[current_level]
|
||||
var upgrade_cost = config["cost"]
|
||||
var next_name = config["name"]
|
||||
var speed_info = config["speed"]
|
||||
|
||||
# 检查玩家金钱是否足够
|
||||
if main_game.money < upgrade_cost:
|
||||
Toast.show("金钱不足,升级到" + next_name + "需要 " + str(upgrade_cost) + " 金钱", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 发送升级请求到服务器
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
print("发送升级请求,地块索引: ", selected_lot_index, ",当前等级: ", current_level)
|
||||
if network_manager.sendUpgradeLand(selected_lot_index):
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("发送升级请求失败", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("网络未连接,无法升级土地", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
|
||||
#种植
|
||||
func _on_plant_button_pressed():
|
||||
# 检查是否处于访问模式
|
||||
if main_game.is_visiting_mode:
|
||||
Toast.show("访问模式下无法种植", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
player_bag_panel.show()
|
||||
self.hide()
|
||||
pass
|
||||
#铲除
|
||||
func _on_remove_button_pressed():
|
||||
# 检查是否处于访问模式
|
||||
if main_game.is_visiting_mode:
|
||||
Toast.show("访问模式下无法铲除作物", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查玩家金钱是否足够
|
||||
var removal_cost = 500
|
||||
if main_game.money < removal_cost:
|
||||
Toast.show("金钱不足,铲除作物需要 " + str(removal_cost) + " 金钱", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查地块是否有作物
|
||||
var lot = main_game.farm_lots[selected_lot_index]
|
||||
if not lot.get("is_planted", false) or lot.get("crop_type", "") == "":
|
||||
Toast.show("此地块没有种植作物", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 发送铲除作物请求到服务器
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
if network_manager.sendRemoveCrop(selected_lot_index):
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("发送铲除请求失败", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("网络未连接,无法铲除作物", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
pass
|
||||
|
||||
#收获
|
||||
func _on_harvest_button_pressed():
|
||||
# 检查地块状态
|
||||
var lot = main_game.farm_lots[selected_lot_index]
|
||||
if not lot.get("is_planted", false) or lot.get("crop_type", "") == "":
|
||||
Toast.show("此地块没有种植作物", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 检查作物是否成熟
|
||||
if lot.get("grow_time", 0) < lot.get("max_grow_time", 1) and not lot.get("is_dead", false):
|
||||
Toast.show("作物尚未成熟", Color.ORANGE, 2.0, 1.0)
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 发送收获请求到服务器
|
||||
var target_username = ""
|
||||
if main_game.is_visiting_mode:
|
||||
target_username = main_game.visited_player_data.get("user_name", "")
|
||||
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
if network_manager.sendHarvestCrop(selected_lot_index, target_username):
|
||||
self.hide()
|
||||
else:
|
||||
Toast.show("发送收获请求失败", Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
else:
|
||||
var action_text = "偷菜" if main_game.is_visiting_mode else "收获"
|
||||
Toast.show("网络未连接,无法" + action_text, Color.RED, 2.0, 1.0)
|
||||
self.hide()
|
||||
pass
|
||||
|
||||
#退出
|
||||
func _on_quit_button_pressed():
|
||||
self.hide()
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
uid://bljtkxil64h14
|
||||
@@ -1,468 +0,0 @@
|
||||
#玩家登录注册面板
|
||||
extends PanelContainer
|
||||
|
||||
#玩家登录账号,用QQ号代替
|
||||
@onready var username_input : LineEdit = $VBox/UserName/username_input
|
||||
#用户登录密码
|
||||
@onready var password_input : LineEdit = $VBox/Password1/password_input
|
||||
#登录按钮
|
||||
@onready var login_button : Button = $VBox/LoginRegister/login_button
|
||||
|
||||
#下面是注册相关的
|
||||
#注册按钮
|
||||
@onready var register_button : Button = $VBox/LoginRegister/register_button
|
||||
#注册账号时二次确认密码
|
||||
@onready var password_input_2 : LineEdit = $VBox/Password2/password_input2
|
||||
#农场名称
|
||||
@onready var farmname_input : LineEdit = $VBox/FarmName/farmname_input
|
||||
#玩家昵称
|
||||
@onready var playername_input :LineEdit = $VBox/PlayerName/playername_input
|
||||
#邮箱验证码
|
||||
@onready var verificationcode_input :LineEdit = $VBox/VerificationCode/verificationcode_input
|
||||
#发送验证码按钮
|
||||
@onready var send_button :Button = $VBox/VerificationCode/SendButton
|
||||
#状态提示标签
|
||||
@onready var status_label : Label = $VBox/status_label
|
||||
|
||||
# 记住密码选项
|
||||
var remember_password : bool = true # 默认记住密码
|
||||
|
||||
# 引用主场景和全局函数
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var tcp_network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
|
||||
# 连接按钮信号
|
||||
login_button.pressed.connect(self._on_login_button_pressed)
|
||||
register_button.pressed.connect(self._on_register_button_pressed)
|
||||
send_button.pressed.connect(self._on_send_button_pressed)
|
||||
|
||||
# 加载保存的登录信息
|
||||
_load_login_info()
|
||||
|
||||
# 显示客户端版本号
|
||||
_display_version_info()
|
||||
|
||||
# 处理登录按钮点击
|
||||
func _on_login_button_pressed():
|
||||
var user_name = username_input.text.strip_edges() # 修剪前后的空格
|
||||
var user_password = password_input.text.strip_edges()
|
||||
var farmname = farmname_input.text.strip_edges()
|
||||
|
||||
if user_name == "" or user_password == "":
|
||||
status_label.text = "用户名或密码不能为空!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
|
||||
# 检查网络连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
status_label.text = "未连接到服务器,正在尝试连接..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 尝试自动连接到服务器
|
||||
tcp_network_manager.connect_to_current_server()
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
|
||||
# 再次检查连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
status_label.text = "连接服务器失败,正在尝试其他服务器..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 等待自动服务器切换完成
|
||||
await get_tree().create_timer(3.0).timeout
|
||||
|
||||
|
||||
# 禁用按钮,防止重复点击
|
||||
login_button.disabled = true
|
||||
|
||||
status_label.text = "正在登录,请稍候..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
|
||||
# 如果启用了记住密码,保存登录信息
|
||||
if remember_password:
|
||||
_save_login_info(user_name, user_password)
|
||||
|
||||
tcp_network_manager.sendLoginInfo(user_name, user_password)
|
||||
|
||||
# 更新主游戏数据
|
||||
main_game.user_name = user_name
|
||||
main_game.user_password = user_password
|
||||
|
||||
# 5秒后重新启用按钮(如果没有收到响应)
|
||||
await get_tree().create_timer(5.0).timeout
|
||||
if login_button.disabled:
|
||||
login_button.disabled = false
|
||||
status_label.text = "登录超时,请重试!"
|
||||
status_label.modulate = Color.RED
|
||||
|
||||
# 处理验证码发送按钮点击
|
||||
func _on_send_button_pressed():
|
||||
var user_name = username_input.text.strip_edges()
|
||||
|
||||
if user_name == "":
|
||||
status_label.text = "请输入QQ号以接收验证码!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
|
||||
if !is_valid_qq_number(user_name):
|
||||
status_label.text = "请输入正确的QQ号码(5-12位数字)!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
|
||||
# 检查网络连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
status_label.text = "未连接到服务器,正在尝试连接..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 尝试自动连接到服务器
|
||||
tcp_network_manager.connect_to_current_server()
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
|
||||
# 再次检查连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
status_label.text = "连接服务器失败,正在尝试其他服务器..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 等待自动服务器切换完成
|
||||
await get_tree().create_timer(3.0).timeout
|
||||
|
||||
|
||||
# 禁用按钮,防止重复点击
|
||||
send_button.disabled = true
|
||||
|
||||
status_label.text = "正在发送验证码,请稍候..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
|
||||
# 发送验证码请求
|
||||
tcp_network_manager.sendVerificationCodeRequest(user_name)
|
||||
|
||||
# 60秒后重新启用按钮(或收到响应后提前启用)
|
||||
var timer = 60
|
||||
while timer > 0 and send_button.disabled:
|
||||
send_button.text = "重新发送(%d)" % timer
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
timer -= 1
|
||||
|
||||
if send_button.disabled:
|
||||
send_button.disabled = false
|
||||
send_button.text = "发送验证码"
|
||||
|
||||
if status_label.text == "正在发送验证码,请稍候...":
|
||||
status_label.text = "验证码发送超时,请重试!"
|
||||
status_label.modulate = Color.RED
|
||||
|
||||
# 处理注册按钮点击
|
||||
func _on_register_button_pressed():
|
||||
var user_name = username_input.text.strip_edges()
|
||||
var user_password = password_input.text.strip_edges()
|
||||
var user_password_2 = password_input_2.text.strip_edges()
|
||||
var farmname = farmname_input.text.strip_edges()
|
||||
var player_name = playername_input.text.strip_edges()
|
||||
var verification_code = verificationcode_input.text.strip_edges()
|
||||
|
||||
# 检查密码格式(只允许数字和字母)
|
||||
if not is_valid_password(user_password):
|
||||
status_label.text = "密码只能包含数字和字母!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
|
||||
if user_name == "" or user_password == "":
|
||||
status_label.text = "用户名或密码不能为空!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
if farmname == "":
|
||||
status_label.text = "农场名称不能为空!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
if user_password != user_password_2:
|
||||
status_label.text = "两次输入的密码不一致!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
|
||||
if !is_valid_qq_number(user_name):
|
||||
status_label.text = "请输入正确的QQ号码(5-12位数字)!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
|
||||
if verification_code == "":
|
||||
status_label.text = "请输入验证码!"
|
||||
status_label.modulate = Color.RED
|
||||
return
|
||||
|
||||
# 检查网络连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
status_label.text = "未连接到服务器,正在尝试连接..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 尝试自动连接到服务器
|
||||
tcp_network_manager.connect_to_current_server()
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
|
||||
# 再次检查连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
status_label.text = "连接服务器失败,正在尝试其他服务器..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 等待自动服务器切换完成
|
||||
await get_tree().create_timer(3.0).timeout
|
||||
|
||||
|
||||
# 禁用按钮,防止重复点击
|
||||
register_button.disabled = true
|
||||
|
||||
status_label.text = "正在注册,请稍候..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
|
||||
# 发送注册请求
|
||||
tcp_network_manager.sendRegisterInfo(user_name, user_password, farmname, player_name, verification_code)
|
||||
|
||||
# 更新主游戏数据
|
||||
main_game.user_name = user_name
|
||||
main_game.user_password = user_password
|
||||
main_game.farmname = farmname
|
||||
|
||||
# 5秒后重新启用按钮(如果没有收到响应)
|
||||
await get_tree().create_timer(5.0).timeout
|
||||
if register_button.disabled:
|
||||
register_button.disabled = false
|
||||
status_label.text = "注册超时,请重试!"
|
||||
status_label.modulate = Color.RED
|
||||
|
||||
# 处理验证码发送响应
|
||||
func _on_verification_code_response(success: bool, message: String):
|
||||
if success:
|
||||
status_label.text = message
|
||||
status_label.modulate = Color.GREEN
|
||||
else:
|
||||
status_label.text = message
|
||||
status_label.modulate = Color.RED
|
||||
send_button.disabled = false
|
||||
send_button.text = "发送验证码"
|
||||
|
||||
# 处理验证码验证响应
|
||||
func _on_verify_code_response(success: bool, message: String):
|
||||
if success:
|
||||
status_label.text = message
|
||||
status_label.modulate = Color.GREEN
|
||||
else:
|
||||
status_label.text = message
|
||||
status_label.modulate = Color.RED
|
||||
|
||||
# 验证QQ号是否有效
|
||||
func is_valid_qq_number(qq_number: String) -> bool:
|
||||
# QQ号的标准格式是5到12位的数字
|
||||
var qq_regex = RegEx.new()
|
||||
var pattern = r"^\d{5,12}$"
|
||||
|
||||
var error = qq_regex.compile(pattern)
|
||||
if error != OK:
|
||||
status_label.text = "QQ号验证失败部错误"
|
||||
status_label.modulate = Color.RED
|
||||
return false
|
||||
|
||||
return qq_regex.search(qq_number) != null
|
||||
|
||||
# 添加密码验证函数
|
||||
func is_valid_password(password: String) -> bool:
|
||||
# 使用正则表达式检查是否只包含数字和字母
|
||||
var pattern = r"^[a-zA-Z0-9]+$"
|
||||
return password.match(pattern) != null
|
||||
|
||||
# 处理登录响应
|
||||
func _on_login_response_received(success: bool, message: String, user_data: Dictionary):
|
||||
# 启用按钮
|
||||
login_button.disabled = false
|
||||
|
||||
if success:
|
||||
status_label.text = "登录成功!正在加载游戏..."
|
||||
status_label.modulate = Color.GREEN
|
||||
|
||||
# 保存登录数据到主游戏
|
||||
main_game.login_data = user_data.duplicate()
|
||||
|
||||
# 更新主游戏数据
|
||||
main_game.experience = user_data.get("experience", 0)
|
||||
main_game.farm_lots = user_data.get("farm_lots", [])
|
||||
main_game.level = user_data.get("level", 1)
|
||||
main_game.money = user_data.get("money", 0)
|
||||
main_game.stamina = user_data.get("体力值", 20)
|
||||
main_game.show_farm_name.text = "农场名称:"+user_data.get("farm_name", "")
|
||||
main_game.show_player_name.text = "玩家昵称:"+user_data.get("player_name", "")
|
||||
farmname_input.text = user_data.get("farm_name", "")
|
||||
|
||||
# 加载玩家背包数据
|
||||
if user_data.has("player_bag"):
|
||||
main_game.player_bag = user_data.get("player_bag", [])
|
||||
else:
|
||||
main_game.player_bag = []
|
||||
|
||||
main_game.start_game = true
|
||||
self.hide()
|
||||
|
||||
# 确保在更新数据后调用主游戏的 UI 更新函数
|
||||
main_game._update_ui()
|
||||
main_game._refresh_farm_lots()
|
||||
player_bag_panel.update_player_bag_ui()
|
||||
|
||||
# 调用主游戏的登录成功处理函数
|
||||
main_game.handle_login_success(user_data)
|
||||
else:
|
||||
status_label.text = "登录失败:" + message
|
||||
status_label.modulate = Color.RED
|
||||
|
||||
# 如果登录失败且是密码错误,可以选择清除保存的信息
|
||||
if "密码" in message or "password" in message.to_lower():
|
||||
print("登录失败,可能是密码错误。如需清除保存的登录信息,请调用_clear_login_info()")
|
||||
|
||||
# 处理注册响应
|
||||
func _on_register_response_received(success: bool, message: String):
|
||||
# 启用按钮
|
||||
register_button.disabled = false
|
||||
|
||||
if success:
|
||||
status_label.text = "注册成功!请登录游戏"
|
||||
status_label.modulate = Color.GREEN
|
||||
|
||||
# 注册成功后,如果启用了记住密码,保存登录信息
|
||||
if remember_password:
|
||||
var user_name = username_input.text.strip_edges()
|
||||
var user_password = password_input.text.strip_edges()
|
||||
_save_login_info(user_name, user_password)
|
||||
|
||||
# 清除注册相关的输入框
|
||||
password_input_2.text = ""
|
||||
verificationcode_input.text = ""
|
||||
else:
|
||||
status_label.text = "注册失败:" + message
|
||||
status_label.modulate = Color.RED
|
||||
|
||||
# 保存登录信息到JSON文件
|
||||
func _save_login_info(user_name: String, password: String):
|
||||
var login_data = {
|
||||
"user_name": user_name,
|
||||
"password": password
|
||||
}
|
||||
|
||||
var file = FileAccess.open("user://login.json", FileAccess.WRITE)
|
||||
if file:
|
||||
var json_string = JSON.stringify(login_data, "\t")
|
||||
file.store_string(json_string)
|
||||
file.close()
|
||||
print("登录信息已保存")
|
||||
else:
|
||||
print("无法保存登录信息")
|
||||
|
||||
# 从JSON文件加载登录信息
|
||||
func _load_login_info():
|
||||
var file = FileAccess.open("user://login.json", FileAccess.READ)
|
||||
if file:
|
||||
var json_text = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_text)
|
||||
if parse_result == OK:
|
||||
var login_data = json.get_data()
|
||||
if login_data.has("user_name") and login_data.has("password"):
|
||||
var saved_username = login_data.get("user_name", "")
|
||||
var saved_password = login_data.get("password", "")
|
||||
|
||||
if saved_username != "" and saved_password != "":
|
||||
username_input.text = saved_username
|
||||
password_input.text = saved_password
|
||||
status_label.text = "已加载保存的登录信息"
|
||||
status_label.modulate = Color.CYAN
|
||||
print("登录信息已加载:用户名 =", saved_username)
|
||||
else:
|
||||
status_label.text = "欢迎使用萌芽农场"
|
||||
status_label.modulate = Color.WHITE
|
||||
print("没有有效的保存登录信息")
|
||||
else:
|
||||
print("登录信息格式错误")
|
||||
else:
|
||||
print("登录信息JSON解析错误:", json.get_error_message())
|
||||
else:
|
||||
# 创建默认的登录信息文件
|
||||
_save_login_info("", "")
|
||||
status_label.text = "欢迎使用萌芽农场"
|
||||
status_label.modulate = Color.WHITE
|
||||
print("没有找到保存的登录信息,已创建默认文件")
|
||||
|
||||
# 清除保存的登录信息
|
||||
func _clear_login_info():
|
||||
var file = FileAccess.open("user://login.json", FileAccess.WRITE)
|
||||
if file:
|
||||
var empty_data = {
|
||||
"user_name": "",
|
||||
"password": ""
|
||||
}
|
||||
var json_string = JSON.stringify(empty_data, "\t")
|
||||
file.store_string(json_string)
|
||||
file.close()
|
||||
print("登录信息已清除")
|
||||
else:
|
||||
print("无法清除登录信息")
|
||||
|
||||
# 切换记住密码选项
|
||||
func toggle_remember_password():
|
||||
remember_password = !remember_password
|
||||
print("记住密码选项:", "开启" if remember_password else "关闭")
|
||||
|
||||
# 如果关闭了记住密码,清除已保存的信息
|
||||
if not remember_password:
|
||||
_clear_login_info()
|
||||
|
||||
# 检查是否有保存的登录信息
|
||||
func has_saved_login_info() -> bool:
|
||||
var file = FileAccess.open("user://login.json", FileAccess.READ)
|
||||
if file:
|
||||
var json_text = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_text)
|
||||
if parse_result == OK:
|
||||
var login_data = json.get_data()
|
||||
var user_name = login_data.get("user_name", "")
|
||||
var password = login_data.get("password", "")
|
||||
return user_name != "" and password != ""
|
||||
|
||||
return false
|
||||
|
||||
# 快捷登录(使用保存的登录信息)
|
||||
func quick_login():
|
||||
if has_saved_login_info():
|
||||
var user_name = username_input.text.strip_edges()
|
||||
var user_password = password_input.text.strip_edges()
|
||||
|
||||
if user_name != "" and user_password != "":
|
||||
print("执行快捷登录...")
|
||||
_on_login_button_pressed()
|
||||
else:
|
||||
status_label.text = "保存的登录信息不完整"
|
||||
status_label.modulate = Color.ORANGE
|
||||
else:
|
||||
status_label.text = "没有保存的登录信息"
|
||||
status_label.modulate = Color.ORANGE
|
||||
|
||||
# 获取保存的用户名(用于调试或显示)
|
||||
func get_saved_username() -> String:
|
||||
var file = FileAccess.open("user://login.json", FileAccess.READ)
|
||||
if file:
|
||||
var json_text = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_text)
|
||||
if parse_result == OK:
|
||||
var login_data = json.get_data()
|
||||
return login_data.get("user_name", "")
|
||||
|
||||
return ""
|
||||
|
||||
# 显示版本信息
|
||||
func _display_version_info():
|
||||
# 在状态标签中显示客户端版本信息
|
||||
if status_label.text == "欢迎使用萌芽农场" or status_label.text == "连接状态":
|
||||
status_label.text = "萌芽农场 v" + main_game.client_version + " - 欢迎使用"
|
||||
status_label.modulate = Color.CYAN
|
||||
@@ -1 +0,0 @@
|
||||
uid://cka0r4g8tbf0
|
||||
@@ -1,509 +0,0 @@
|
||||
extends Panel
|
||||
|
||||
# 背包格子容器
|
||||
@onready var player_bag_grid_container : GridContainer = $ScrollContainer/Bag_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
|
||||
#各种排序过滤按钮
|
||||
@onready var sort_all_button : Button = $SortContainer/Sort_All#全部
|
||||
@onready var sort_common_button : Button = $SortContainer/Sort_Common#普通
|
||||
@onready var sort_superior_button : Button = $SortContainer/Sort_Superior#优良
|
||||
@onready var sort_rare_button : Button = $SortContainer/Sort_Rare#稀有
|
||||
@onready var sort_epic_button : Button = $SortContainer/Sort_Epic#史诗
|
||||
@onready var sort_legendary_button : Button = $SortContainer/Sort_Legendary#传奇
|
||||
@onready var sort_price_button : Button = $SortContainer/Sort_Price#价格
|
||||
@onready var sort_growtime_button : Button = $SortContainer/Sort_GrowTime#生长时间
|
||||
@onready var sort_profit_button : Button = $SortContainer/Sort_Profit#收益
|
||||
@onready var sort_level_button : Button = $SortContainer/Sort_Level#等级
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
# 作物图片缓存(复用主游戏的缓存系统)
|
||||
var crop_textures_cache : Dictionary = {}
|
||||
var crop_frame_counts : Dictionary = {}
|
||||
|
||||
# 当前选择的地块索引,从MainGame获取
|
||||
var selected_lot_index : int = -1
|
||||
|
||||
# 当前过滤和排序设置
|
||||
var current_filter_quality = ""
|
||||
var current_sort_key = ""
|
||||
var current_sort_ascending = true
|
||||
|
||||
# 一键种植模式相关变量
|
||||
var is_planting_mode = false
|
||||
var planting_type = ""
|
||||
var one_click_plant_panel = null
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
# 连接按钮信号
|
||||
_connect_buttons()
|
||||
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
# 连接所有按钮信号
|
||||
func _connect_buttons():
|
||||
# 关闭按钮
|
||||
quit_button.pressed.connect(self._on_quit_button_pressed)
|
||||
|
||||
# 过滤按钮
|
||||
sort_all_button.pressed.connect(func(): _filter_by_quality(""))
|
||||
sort_common_button.pressed.connect(func(): _filter_by_quality("普通"))
|
||||
sort_superior_button.pressed.connect(func(): _filter_by_quality("优良"))
|
||||
sort_rare_button.pressed.connect(func(): _filter_by_quality("稀有"))
|
||||
sort_epic_button.pressed.connect(func(): _filter_by_quality("史诗"))
|
||||
sort_legendary_button.pressed.connect(func(): _filter_by_quality("传奇"))
|
||||
|
||||
# 排序按钮
|
||||
sort_price_button.pressed.connect(func(): _sort_by("花费"))
|
||||
sort_growtime_button.pressed.connect(func(): _sort_by("生长时间"))
|
||||
sort_profit_button.pressed.connect(func(): _sort_by("收益"))
|
||||
sort_level_button.pressed.connect(func(): _sort_by("等级"))
|
||||
|
||||
# 初始化玩家背包
|
||||
func init_player_bag():
|
||||
# 清空玩家背包格子
|
||||
for child in player_bag_grid_container.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 显示背包中的种子
|
||||
update_player_bag_ui()
|
||||
|
||||
# 更新玩家背包UI
|
||||
func update_player_bag_ui():
|
||||
# 清空玩家背包格子
|
||||
for child in player_bag_grid_container.get_children():
|
||||
child.queue_free()
|
||||
#print("更新背包UI,背包中物品数量:", main_game.player_bag.size())
|
||||
|
||||
# 应用过滤和排序
|
||||
var filtered_seeds = _get_filtered_and_sorted_seeds()
|
||||
|
||||
# 为背包中的每个过滤后的种子创建按钮
|
||||
for seed_item in filtered_seeds:
|
||||
var crop_name = seed_item["name"]
|
||||
var crop_quality = seed_item["quality"]
|
||||
var crop_count = seed_item["count"]
|
||||
#print("背包物品:", crop_name, " 数量:", crop_count)
|
||||
# 创建种子按钮
|
||||
var button = _create_crop_button(crop_name, crop_quality)
|
||||
# 更新按钮文本显示数量
|
||||
button.text = str(crop_quality + "-" + crop_name + "\n数量:" + str(crop_count))
|
||||
|
||||
# 根据是否处于访问模式连接不同的事件
|
||||
if main_game.is_visiting_mode:
|
||||
# 访问模式下,点击种子只显示信息,不能种植
|
||||
button.pressed.connect(func(): _on_visit_seed_selected(crop_name, crop_count))
|
||||
else:
|
||||
# 正常模式下,连接种植事件
|
||||
button.pressed.connect(func(): _on_bag_seed_selected(crop_name))
|
||||
|
||||
player_bag_grid_container.add_child(button)
|
||||
|
||||
# 获取过滤和排序后的种子列表
|
||||
func _get_filtered_and_sorted_seeds():
|
||||
var filtered_seeds = []
|
||||
|
||||
# 收集符合条件的种子
|
||||
for seed_item in main_game.player_bag:
|
||||
# 品质过滤
|
||||
if current_filter_quality != "" and seed_item["quality"] != current_filter_quality:
|
||||
continue
|
||||
|
||||
# 获取种子对应的作物数据
|
||||
var crop_data = null
|
||||
if main_game.can_planted_crop.has(seed_item["name"]):
|
||||
crop_data = main_game.can_planted_crop[seed_item["name"]]
|
||||
|
||||
# 添加到过滤后的列表
|
||||
filtered_seeds.append({
|
||||
"name": seed_item["name"],
|
||||
"quality": seed_item["quality"],
|
||||
"count": seed_item["count"],
|
||||
"data": crop_data
|
||||
})
|
||||
|
||||
# 如果有排序条件且数据可用,进行排序
|
||||
if current_sort_key != "":
|
||||
filtered_seeds.sort_custom(Callable(self, "_sort_seed_items"))
|
||||
|
||||
return filtered_seeds
|
||||
|
||||
# 自定义排序函数
|
||||
func _sort_seed_items(a, b):
|
||||
# 检查是否有有效数据用于排序
|
||||
if a["data"] == null or b["data"] == null:
|
||||
# 如果某一项没有数据,将其排在后面
|
||||
if a["data"] == null and b["data"] != null:
|
||||
return false
|
||||
if a["data"] != null and b["data"] == null:
|
||||
return true
|
||||
# 如果都没有数据,按名称排序
|
||||
return a["name"] < b["name"]
|
||||
|
||||
# 确保排序键存在于数据中
|
||||
if !a["data"].has(current_sort_key) or !b["data"].has(current_sort_key):
|
||||
print("警告: 排序键 ", current_sort_key, " 在某些种子数据中不存在")
|
||||
return false
|
||||
|
||||
# 执行排序
|
||||
if current_sort_ascending:
|
||||
return a["data"][current_sort_key] < b["data"][current_sort_key]
|
||||
else:
|
||||
return a["data"][current_sort_key] > b["data"][current_sort_key]
|
||||
|
||||
# 按品质过滤种子
|
||||
func _filter_by_quality(quality: String):
|
||||
current_filter_quality = quality
|
||||
print("过滤种子,品质: " + (quality if quality != "" else "全部"))
|
||||
update_player_bag_ui()
|
||||
|
||||
# 按指定键排序
|
||||
func _sort_by(sort_key: String):
|
||||
# 切换排序方向或设置新排序键
|
||||
if current_sort_key == sort_key:
|
||||
current_sort_ascending = !current_sort_ascending
|
||||
else:
|
||||
current_sort_key = sort_key
|
||||
current_sort_ascending = true
|
||||
|
||||
print("排序种子,键: " + sort_key + ",升序: " + str(current_sort_ascending))
|
||||
update_player_bag_ui()
|
||||
|
||||
# 创建作物按钮
|
||||
func _create_crop_button(crop_name: String, crop_quality: String) -> Button:
|
||||
# 根据品质选择相应的进度条
|
||||
var button = null
|
||||
#普通 Color.HONEYDEW#白色
|
||||
#优良 Color.DODGER_BLUE#深蓝色
|
||||
#稀有 Color.HOT_PINK#品红色
|
||||
#史诗 Color.YELLOW#黄色
|
||||
#传奇 Color.ORANGE_RED#红色
|
||||
#空地 Color.GREEN#绿色
|
||||
#未开垦 Color.WEB_GRAY#深褐色
|
||||
match crop_quality:
|
||||
"普通":
|
||||
button = main_game.green_bar.duplicate()
|
||||
"优良":
|
||||
button = main_game.orange_bar.duplicate()
|
||||
"稀有":
|
||||
button = main_game.white_blue_bar.duplicate()
|
||||
"史诗":
|
||||
button = main_game.pink_bar.duplicate()
|
||||
"传奇":
|
||||
button = main_game.black_blue_bar.duplicate()
|
||||
_: # 默认情况
|
||||
button = main_game.green_bar.duplicate()
|
||||
|
||||
# 确保按钮可见并可点击
|
||||
button.visible = true
|
||||
button.disabled = false
|
||||
button.focus_mode = Control.FOCUS_ALL
|
||||
|
||||
# 设置按钮文本
|
||||
button.text = str(crop_quality + "-" + crop_name)
|
||||
|
||||
# 添加工具提示 (tooltip)
|
||||
if main_game.can_planted_crop.has(crop_name):
|
||||
var crop = main_game.can_planted_crop[crop_name]
|
||||
|
||||
# 将成熟时间从秒转换为天时分秒格式
|
||||
var total_seconds = int(crop["生长时间"])
|
||||
|
||||
# 定义时间单位换算
|
||||
var SECONDS_PER_MINUTE = 60
|
||||
var SECONDS_PER_HOUR = 3600
|
||||
var SECONDS_PER_DAY = 86400
|
||||
|
||||
# 计算各时间单位
|
||||
var days = total_seconds / SECONDS_PER_DAY
|
||||
total_seconds %= SECONDS_PER_DAY
|
||||
|
||||
var hours = total_seconds / SECONDS_PER_HOUR
|
||||
total_seconds %= SECONDS_PER_HOUR
|
||||
|
||||
var minutes = total_seconds / SECONDS_PER_MINUTE
|
||||
var seconds = total_seconds % SECONDS_PER_MINUTE
|
||||
|
||||
# 构建时间字符串(只显示有值的单位)
|
||||
var time_str = ""
|
||||
if days > 0:
|
||||
time_str += str(days) + "天"
|
||||
if hours > 0:
|
||||
time_str += str(hours) + "小时"
|
||||
if minutes > 0:
|
||||
time_str += str(minutes) + "分钟"
|
||||
if seconds > 0:
|
||||
time_str += str(seconds) + "秒"
|
||||
|
||||
button.tooltip_text = str(
|
||||
"作物: " + crop_name + "\n" +
|
||||
"品质: " + crop_quality + "\n" +
|
||||
"价格: " + str(crop["花费"]) + "元\n" +
|
||||
"成熟时间: " + time_str + "\n" +
|
||||
"收获收益: " + str(crop["收益"]) + "元\n" +
|
||||
"需求等级: " + str(crop["等级"]) + "\n" +
|
||||
"耐候性: " + str(crop["耐候性"]) + "\n" +
|
||||
"经验: " + str(crop["经验"]) + "点\n" +
|
||||
"描述: " + str(crop["描述"])
|
||||
)
|
||||
|
||||
# 如果按钮有标题标签,设置标题
|
||||
if button.has_node("Title"):
|
||||
button.get_node("Title").text = crop_quality
|
||||
match crop_quality:
|
||||
"普通":
|
||||
button.get_node("Title").modulate = Color.HONEYDEW#白色
|
||||
"优良":
|
||||
button.get_node("Title").modulate =Color.DODGER_BLUE#深蓝色
|
||||
"稀有":
|
||||
button.get_node("Title").modulate =Color.HOT_PINK#品红色
|
||||
"史诗":
|
||||
button.get_node("Title").modulate =Color.YELLOW#黄色
|
||||
"传奇":
|
||||
button.get_node("Title").modulate =Color.ORANGE_RED#红色
|
||||
|
||||
# 更新按钮的作物图片
|
||||
_update_button_crop_image(button, crop_name)
|
||||
|
||||
return button
|
||||
|
||||
# 从背包中选择种子并种植
|
||||
func _on_bag_seed_selected(crop_name):
|
||||
# 检查是否处于访问模式
|
||||
if main_game.is_visiting_mode:
|
||||
Toast.show("访问模式下无法种植", Color.ORANGE, 2.0, 1.0)
|
||||
return
|
||||
|
||||
# 检查是否是一键种植模式
|
||||
if is_planting_mode:
|
||||
# 一键种植模式下,回调给一键种植面板
|
||||
if one_click_plant_panel and one_click_plant_panel.has_method("on_crop_selected"):
|
||||
one_click_plant_panel.on_crop_selected(crop_name, planting_type)
|
||||
# 退出种植模式
|
||||
_exit_planting_mode()
|
||||
self.hide()
|
||||
return
|
||||
|
||||
# 从主场景获取当前选择的地块索引
|
||||
selected_lot_index = main_game.selected_lot_index
|
||||
|
||||
if selected_lot_index != -1:
|
||||
# 检查背包中是否有这个种子
|
||||
var seed_index = -1
|
||||
for i in range(len(main_game.player_bag)):
|
||||
if main_game.player_bag[i]["name"] == crop_name:
|
||||
seed_index = i
|
||||
break
|
||||
#print("选择种子:", crop_name, ",背包索引:", seed_index)
|
||||
|
||||
if seed_index != -1 and main_game.player_bag[seed_index]["count"] > 0:
|
||||
# 种植种子并从背包中减少数量
|
||||
_plant_crop_from_bag(selected_lot_index, crop_name, seed_index)
|
||||
main_game.selected_lot_index = -1
|
||||
self.hide()
|
||||
|
||||
# 访问模式下的种子点击处理
|
||||
func _on_visit_seed_selected(crop_name, crop_count):
|
||||
# 显示种子信息
|
||||
var info_text = ""
|
||||
|
||||
if main_game.can_planted_crop.has(crop_name):
|
||||
var crop = main_game.can_planted_crop[crop_name]
|
||||
var quality = crop.get("品质", "未知")
|
||||
var price = crop.get("花费", 0)
|
||||
var grow_time = crop.get("生长时间", 0)
|
||||
var profit = crop.get("收益", 0)
|
||||
var level_req = crop.get("等级", 1)
|
||||
|
||||
# 将成熟时间转换为可读格式
|
||||
var time_str = ""
|
||||
var total_seconds = int(grow_time)
|
||||
var hours = total_seconds / 3600
|
||||
var minutes = (total_seconds % 3600) / 60
|
||||
var seconds = total_seconds % 60
|
||||
|
||||
if hours > 0:
|
||||
time_str += str(hours) + "小时"
|
||||
if minutes > 0:
|
||||
time_str += str(minutes) + "分钟"
|
||||
if seconds > 0:
|
||||
time_str += str(seconds) + "秒"
|
||||
|
||||
info_text = quality + "-" + crop_name + " (数量: " + str(crop_count) + ")\n"
|
||||
info_text += "价格: " + str(price) + "元, 收益: " + str(profit) + "元\n"
|
||||
info_text += "成熟时间: " + time_str + ", 需求等级: " + str(level_req)
|
||||
else:
|
||||
info_text = crop_name + " (数量: " + str(crop_count) + ")"
|
||||
|
||||
Toast.show(info_text, Color.CYAN, 3.0, 1.0)
|
||||
print("查看种子信息: ", info_text)
|
||||
|
||||
# 从背包种植作物
|
||||
func _plant_crop_from_bag(index, crop_name, seed_index):
|
||||
var crop = main_game.can_planted_crop[crop_name]
|
||||
|
||||
# 检查是否有效的种子索引,防止越界访问
|
||||
if seed_index < 0 or seed_index >= main_game.player_bag.size():
|
||||
#print("错误:无效的种子索引 ", seed_index)
|
||||
return
|
||||
|
||||
# 发送种植请求到服务器
|
||||
|
||||
if network_manager and network_manager.sendPlantCrop(index, crop_name):
|
||||
# 关闭背包面板
|
||||
hide()
|
||||
|
||||
# 设置种植模式
|
||||
func set_planting_mode(plant_type: String, plant_panel):
|
||||
is_planting_mode = true
|
||||
planting_type = plant_type
|
||||
one_click_plant_panel = plant_panel
|
||||
print("进入种植模式:", plant_type)
|
||||
|
||||
# 退出种植模式
|
||||
func _exit_planting_mode():
|
||||
is_planting_mode = false
|
||||
planting_type = ""
|
||||
one_click_plant_panel = null
|
||||
print("退出种植模式")
|
||||
|
||||
# 关闭面板
|
||||
func _on_quit_button_pressed():
|
||||
# 退出种植模式(如果当前在种植模式下)
|
||||
if is_planting_mode:
|
||||
_exit_planting_mode()
|
||||
self.hide()
|
||||
|
||||
# 获取作物的最后一帧图片(用于背包显示)
|
||||
func _get_crop_final_texture(crop_name: String) -> Texture2D:
|
||||
"""
|
||||
获取作物的最后一帧图片,用于背包显示
|
||||
如果作物图片不存在,使用默认图片的最后一帧
|
||||
"""
|
||||
# 先尝试从主游戏的缓存中获取
|
||||
if main_game and main_game.crop_textures_cache.has(crop_name):
|
||||
var textures = main_game.crop_textures_cache[crop_name]
|
||||
if textures.size() > 0:
|
||||
return textures[textures.size() - 1] # 返回最后一帧
|
||||
|
||||
# 如果主游戏缓存中没有,自己加载
|
||||
var textures = _load_crop_textures(crop_name)
|
||||
if textures.size() > 0:
|
||||
return textures[textures.size() - 1] # 返回最后一帧
|
||||
|
||||
return null
|
||||
|
||||
# 加载作物图片序列帧(复用主游戏的逻辑)
|
||||
func _load_crop_textures(crop_name: String) -> Array:
|
||||
"""
|
||||
加载指定作物的所有序列帧图片
|
||||
"""
|
||||
if crop_textures_cache.has(crop_name):
|
||||
return crop_textures_cache[crop_name]
|
||||
|
||||
var textures = []
|
||||
var crop_path = "res://assets/作物/" + crop_name + "/"
|
||||
var default_path = "res://assets/作物/默认/"
|
||||
|
||||
# 检查作物文件夹是否存在
|
||||
if DirAccess.dir_exists_absolute(crop_path):
|
||||
# 尝试加载作物的序列帧(从0开始)
|
||||
var frame_index = 0
|
||||
while true:
|
||||
var texture_path = crop_path + str(frame_index) + ".webp"
|
||||
if ResourceLoader.exists(texture_path):
|
||||
var texture = load(texture_path)
|
||||
if texture:
|
||||
textures.append(texture)
|
||||
frame_index += 1
|
||||
else:
|
||||
break
|
||||
else:
|
||||
break
|
||||
|
||||
if textures.size() > 0:
|
||||
print("背包加载作物 ", crop_name, " 的 ", textures.size(), " 帧图片")
|
||||
else:
|
||||
print("背包:作物 ", crop_name, " 文件夹存在但没有找到有效图片,使用默认图片")
|
||||
textures = _load_default_textures()
|
||||
else:
|
||||
print("背包:作物 ", crop_name, " 的文件夹不存在,使用默认图片")
|
||||
textures = _load_default_textures()
|
||||
|
||||
# 缓存结果
|
||||
crop_textures_cache[crop_name] = textures
|
||||
crop_frame_counts[crop_name] = textures.size()
|
||||
|
||||
return textures
|
||||
|
||||
# 加载默认图片
|
||||
func _load_default_textures() -> Array:
|
||||
"""
|
||||
加载默认作物图片
|
||||
"""
|
||||
if crop_textures_cache.has("默认"):
|
||||
return crop_textures_cache["默认"]
|
||||
|
||||
var textures = []
|
||||
var default_path = "res://assets/作物/默认/"
|
||||
|
||||
# 尝试加载默认图片序列帧
|
||||
var frame_index = 0
|
||||
while true:
|
||||
var texture_path = default_path + str(frame_index) + ".webp"
|
||||
if ResourceLoader.exists(texture_path):
|
||||
var texture = load(texture_path)
|
||||
if texture:
|
||||
textures.append(texture)
|
||||
frame_index += 1
|
||||
else:
|
||||
break
|
||||
else:
|
||||
break
|
||||
|
||||
# 如果没有找到序列帧,尝试加载单个默认图片
|
||||
if textures.size() == 0:
|
||||
var single_texture_path = default_path + ".webp"
|
||||
if ResourceLoader.exists(single_texture_path):
|
||||
var texture = load(single_texture_path)
|
||||
if texture:
|
||||
textures.append(texture)
|
||||
|
||||
# 缓存默认图片
|
||||
crop_textures_cache["默认"] = textures
|
||||
crop_frame_counts["默认"] = textures.size()
|
||||
|
||||
print("背包加载了 ", textures.size(), " 个默认作物图片")
|
||||
return textures
|
||||
|
||||
# 更新按钮的作物图片
|
||||
func _update_button_crop_image(button: Button, crop_name: String):
|
||||
"""
|
||||
更新按钮中的作物图片
|
||||
"""
|
||||
# 检查按钮是否有CropImage节点
|
||||
var crop_image = button.get_node_or_null("CropImage")
|
||||
if not crop_image:
|
||||
print("背包按钮没有找到CropImage节点:", button.name)
|
||||
return
|
||||
|
||||
# 获取作物的最后一帧图片
|
||||
var texture = _get_crop_final_texture(crop_name)
|
||||
|
||||
if texture:
|
||||
# CropImage是Sprite2D,直接设置texture属性
|
||||
crop_image.texture = texture
|
||||
crop_image.visible = true
|
||||
print("背包更新作物图片:", crop_name)
|
||||
else:
|
||||
crop_image.visible = false
|
||||
print("背包无法获取作物图片:", crop_name)
|
||||
@@ -1 +0,0 @@
|
||||
uid://cgr332wsx63a8
|
||||
@@ -1,80 +0,0 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://crd28qnymob7"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c3vng0nal1wr8" path="res://assets/Test/g.png" id="1_sgoxp"]
|
||||
[ext_resource type="Script" uid="uid://0d2j5m6j2ema" path="res://Components/HTTPTextureRect.gd" id="2_ky0k8"]
|
||||
|
||||
[node name="player_ranking_item" type="VBoxContainer"]
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 82.0
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SerialNumber" type="Label" parent="HBox"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "1."
|
||||
|
||||
[node name="PlayerAvatar" type="TextureRect" parent="HBox"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_sgoxp")
|
||||
expand_mode = 3
|
||||
script = ExtResource("2_ky0k8")
|
||||
metadata/_custom_type_script = "uid://0d2j5m6j2ema"
|
||||
|
||||
[node name="PlayerName" type="Label" parent="HBox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "树萌芽"
|
||||
|
||||
[node name="PlayerMoney" type="Label" parent="HBox"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "钱币:999"
|
||||
|
||||
[node name="SeedNum" type="Label" parent="HBox"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "种子数:999"
|
||||
|
||||
[node name="PlayerLevel" type="Label" parent="HBox"]
|
||||
modulate = Color(0, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "等级:999"
|
||||
|
||||
[node name="VisitButton" type="Button" parent="HBox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "访问"
|
||||
|
||||
[node name="HBox2" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LastLoginTime" type="Label" parent="HBox2"]
|
||||
modulate = Color(0.811765, 1, 0.811765, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "最后在线:2025年12时09分35秒"
|
||||
|
||||
[node name="OnlineTime" type="Label" parent="HBox2"]
|
||||
modulate = Color(0.784314, 0.733333, 0.521569, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "累计在线时长:99时60分60秒"
|
||||
|
||||
[node name="IsOnlineTime" type="Label" parent="HBox2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "正在检测中..."
|
||||
@@ -1,192 +0,0 @@
|
||||
extends Panel
|
||||
|
||||
@onready var player_ranking_list : VBoxContainer = $Scroll/PlayerList
|
||||
@onready var refresh_button : Button = $RefreshButton
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
@onready var register_player_num: Label = $RegisterPlayerNum #显示注册总人数
|
||||
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
#下面这是每个玩家要展示的信息,直接获取服务器玩家数据json文件来实现
|
||||
#模板用于复制创建新的玩家条目
|
||||
@onready var player_info_template : VBoxContainer = $Scroll/PlayerList/player_ranking_item
|
||||
|
||||
func _ready() -> void:
|
||||
# 隐藏模板
|
||||
player_info_template.visible = false
|
||||
|
||||
# 连接按钮信号
|
||||
refresh_button.pressed.connect(_on_refresh_button_pressed)
|
||||
quit_button.pressed.connect(_on_quit_button_pressed)
|
||||
|
||||
|
||||
# 请求玩家排行榜数据
|
||||
func request_player_rankings():
|
||||
if not network_manager:
|
||||
print("网络管理器不可用")
|
||||
register_player_num.text = "网络管理器不可用"
|
||||
register_player_num.modulate = Color.RED
|
||||
return false
|
||||
|
||||
if not network_manager.is_connected_to_server():
|
||||
print("未连接到服务器")
|
||||
register_player_num.text = "未连接服务器"
|
||||
register_player_num.modulate = Color.RED
|
||||
return false
|
||||
|
||||
var success = network_manager.sendGetPlayerRankings()
|
||||
if not success:
|
||||
print("发送排行榜请求失败")
|
||||
register_player_num.text = "请求发送失败"
|
||||
register_player_num.modulate = Color.RED
|
||||
return false
|
||||
|
||||
return true
|
||||
|
||||
# 处理玩家排行榜响应
|
||||
func handle_player_rankings_response(data):
|
||||
# 重新启用刷新按钮
|
||||
refresh_button.disabled = false
|
||||
refresh_button.text = "刷新"
|
||||
|
||||
# 检查响应是否成功
|
||||
if not data.get("success", false):
|
||||
print("获取玩家排行榜失败:", data.get("message", "未知错误"))
|
||||
register_player_num.text = "获取注册人数失败"
|
||||
register_player_num.modulate = Color.RED
|
||||
Toast.show("获取排行榜失败:" + data.get("message", "未知错误"), Color.RED)
|
||||
return
|
||||
|
||||
# 显示注册总人数和在线人数
|
||||
var total_registered = data.get("total_registered_players", 0)
|
||||
var players_list = data.get("players", [])
|
||||
var online_count = 0
|
||||
for player in players_list:
|
||||
if player.get("is_online", false):
|
||||
online_count += 1
|
||||
|
||||
register_player_num.text = "总人数:" + str(int(total_registered)) + "| 在线:" + str(online_count)
|
||||
register_player_num.modulate = Color.CYAN
|
||||
|
||||
# 清除现有的玩家条目(除了模板)
|
||||
for child in player_ranking_list.get_children():
|
||||
if child != player_info_template:
|
||||
child.queue_free()
|
||||
|
||||
# 添加玩家条目
|
||||
var players = players_list
|
||||
for player_data in players:
|
||||
add_player_entry(player_data)
|
||||
|
||||
print("排行榜数据已更新,显示", players.size(), "个玩家,注册总人数:", total_registered)
|
||||
Toast.show("排行榜已刷新!显示 " + str(players.size()) + " 个玩家", Color.GREEN)
|
||||
|
||||
# 添加单个玩家条目
|
||||
func add_player_entry(player_data):
|
||||
# 复制模板
|
||||
var player_entry = player_info_template.duplicate()
|
||||
player_entry.visible = true
|
||||
player_ranking_list.add_child(player_entry)
|
||||
|
||||
# 设置玩家信息
|
||||
var player_name = player_entry.get_node("HBox/PlayerName")
|
||||
var player_level = player_entry.get_node("HBox/PlayerLevel")
|
||||
var player_money = player_entry.get_node("HBox/PlayerMoney")
|
||||
var player_seed_num = player_entry.get_node("HBox/SeedNum")
|
||||
var player_online_time = player_entry.get_node("HBox2/OnlineTime")
|
||||
var player_last_login_time = player_entry.get_node("HBox2/LastLoginTime")
|
||||
var player_avatar = player_entry.get_node("HBox/PlayerAvatar")
|
||||
var visit_button = player_entry.get_node("HBox/VisitButton")
|
||||
var player_is_online_time = player_entry.get_node("HBox2/IsOnlineTime")
|
||||
|
||||
# 填充数据
|
||||
var username = player_data.get("user_name", "未知")
|
||||
var display_name = player_data.get("player_name", username)
|
||||
player_name.text = display_name
|
||||
#都是整数,不要乱用浮点数
|
||||
player_level.text = "等级: " + str(int(player_data.get("level", 0)))
|
||||
player_money.text = "金币: " + str(int(player_data.get("money", 0)))
|
||||
player_seed_num.text = "种子: " + str(int(player_data.get("seed_count", 0)))
|
||||
player_online_time.text = "游玩时间: " + player_data.get("total_login_time", "0时0分0秒")
|
||||
player_last_login_time.text = "最后登录: " + player_data.get("last_login_time", "未知")
|
||||
|
||||
# 设置在线状态显示
|
||||
var is_online = player_data.get("is_online", false)
|
||||
if is_online:
|
||||
player_is_online_time.text = "🟢 在线"
|
||||
player_is_online_time.modulate = Color.GREEN
|
||||
else:
|
||||
player_is_online_time.text = "🔴 离线"
|
||||
player_is_online_time.modulate = Color.GRAY
|
||||
|
||||
# 尝试加载玩家头像(使用用户名/QQ号加载头像,而不是显示名)
|
||||
if username.is_valid_int():
|
||||
player_avatar.load_from_url("http://q1.qlogo.cn/g?b=qq&nk=" + username + "&s=100")
|
||||
|
||||
# 设置访问按钮
|
||||
visit_button.pressed.connect(func(): _on_visit_player_pressed(username))
|
||||
|
||||
# 访问玩家按钮点击
|
||||
func _on_visit_player_pressed(username):
|
||||
print("访问玩家:", username)
|
||||
|
||||
# 检查网络连接
|
||||
if not network_manager or not network_manager.is_connected_to_server():
|
||||
Toast.show("未连接服务器,无法访问玩家", Color.RED)
|
||||
return
|
||||
|
||||
# 检查是否尝试访问自己
|
||||
if main_game and main_game.user_name == username:
|
||||
Toast.show("不能访问自己的农场", Color.ORANGE)
|
||||
return
|
||||
|
||||
# 发送访问玩家请求
|
||||
if network_manager and network_manager.has_method("sendVisitPlayer"):
|
||||
var success = network_manager.sendVisitPlayer(username)
|
||||
if success:
|
||||
Toast.show("正在访问 " + username + " 的农场...", Color.YELLOW)
|
||||
print("已发送访问玩家请求:", username)
|
||||
else:
|
||||
Toast.show("发送访问请求失败", Color.RED)
|
||||
print("发送访问玩家请求失败,网络未连接")
|
||||
else:
|
||||
Toast.show("网络管理器不可用", Color.RED)
|
||||
print("网络管理器不可用")
|
||||
|
||||
# 刷新按钮点击
|
||||
func _on_refresh_button_pressed():
|
||||
# 检查网络连接
|
||||
if not network_manager or not network_manager.is_connected_to_server():
|
||||
register_player_num.text = "未连接服务器,无法刷新"
|
||||
register_player_num.modulate = Color.RED
|
||||
Toast.show("未连接服务器,无法刷新排行榜", Color.RED)
|
||||
return
|
||||
|
||||
# 显示加载状态
|
||||
register_player_num.text = "正在刷新注册人数..."
|
||||
register_player_num.modulate = Color.YELLOW
|
||||
refresh_button.disabled = true
|
||||
refresh_button.text = "刷新中..."
|
||||
|
||||
# 请求排行榜数据
|
||||
request_player_rankings()
|
||||
|
||||
# 5秒后重新启用按钮(防止卡住)
|
||||
await get_tree().create_timer(5.0).timeout
|
||||
if refresh_button.disabled:
|
||||
refresh_button.disabled = false
|
||||
refresh_button.text = "刷新"
|
||||
if register_player_num.text == "正在刷新注册人数...":
|
||||
register_player_num.text = "刷新超时,请重试"
|
||||
register_player_num.modulate = Color.RED
|
||||
|
||||
# 退出按钮点击
|
||||
func _on_quit_button_pressed():
|
||||
self.hide()
|
||||
@@ -1 +0,0 @@
|
||||
uid://fk4q3x6uqydd
|
||||
142
GameCamera2D.gd
142
GameCamera2D.gd
@@ -1,142 +0,0 @@
|
||||
extends Camera2D
|
||||
|
||||
# 相机移动速度
|
||||
@export var move_speed: float = 400.0 # 每秒移动的像素数
|
||||
@export var zoom_speed: float = 0.02 # 缩放速度
|
||||
@export var min_zoom: float = 0.7 # 最小缩放值
|
||||
@export var max_zoom: float = 1.2 # 最大缩放值
|
||||
|
||||
# 移动端触摸设置
|
||||
@export var touch_sensitivity: float = 1.0 # 触摸灵敏度
|
||||
@export var enable_touch_zoom: bool = true # 是否启用双指缩放
|
||||
|
||||
# 移动边界(可选)
|
||||
@export var bounds_enabled: bool = false
|
||||
@export var bounds_min: Vector2 = Vector2(-1000, -1000)
|
||||
@export var bounds_max: Vector2 = Vector2(1000, 1000)
|
||||
|
||||
@export var current_zoom_level: float = 1.0
|
||||
|
||||
# 触摸相关变量
|
||||
var is_dragging: bool = false
|
||||
var last_touch_position: Vector2
|
||||
var touch_points: Dictionary = {} # 存储多点触摸信息
|
||||
var initial_zoom_distance: float = 0.0
|
||||
|
||||
func _ready():
|
||||
# 初始化相机
|
||||
zoom = Vector2(current_zoom_level, current_zoom_level)
|
||||
|
||||
|
||||
|
||||
func _process(delta):
|
||||
#其他地方可通过这个方法来禁用相机功能
|
||||
if GlobalVariables.isZoomDisabled == true:
|
||||
return
|
||||
|
||||
# 处理相机移动
|
||||
var input_dir = Vector2.ZERO
|
||||
|
||||
# WASD 键移动
|
||||
if Input.is_action_pressed("ui_up") or Input.is_key_pressed(KEY_W):
|
||||
input_dir.y -= 1
|
||||
if Input.is_action_pressed("ui_down") or Input.is_key_pressed(KEY_S):
|
||||
input_dir.y += 1
|
||||
if Input.is_action_pressed("ui_left") or Input.is_key_pressed(KEY_A):
|
||||
input_dir.x -= 1
|
||||
if Input.is_action_pressed("ui_right") or Input.is_key_pressed(KEY_D):
|
||||
input_dir.x += 1
|
||||
|
||||
# 归一化移动向量,确保对角线移动不会更快
|
||||
if input_dir.length() > 0:
|
||||
input_dir = input_dir.normalized()
|
||||
|
||||
# 相机移动
|
||||
position += input_dir * move_speed * delta / current_zoom_level
|
||||
|
||||
# 如果启用了边界限制,确保相机在边界内
|
||||
if bounds_enabled:
|
||||
position.x = clamp(position.x, bounds_min.x, bounds_max.x)
|
||||
position.y = clamp(position.y, bounds_min.y, bounds_max.y)
|
||||
|
||||
# 处理相机缩放KEY_EQUAL
|
||||
if Input.is_key_pressed(KEY_EQUAL) or Input.is_key_pressed(KEY_KP_ADD): # + 键放大
|
||||
zoom_camera(-zoom_speed)
|
||||
if Input.is_key_pressed(KEY_MINUS) or Input.is_key_pressed(KEY_KP_SUBTRACT): # - 键缩小
|
||||
zoom_camera(zoom_speed)
|
||||
|
||||
# 处理输入事件(包括触摸和鼠标)
|
||||
func _input(event):
|
||||
|
||||
#其他地方可通过这个方法来禁用相机功能
|
||||
if GlobalVariables.isZoomDisabled == true:
|
||||
return
|
||||
|
||||
# 鼠标滚轮缩放
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
zoom_camera(-zoom_speed)
|
||||
elif event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
zoom_camera(zoom_speed)
|
||||
|
||||
# 触摸开始
|
||||
elif event is InputEventScreenTouch:
|
||||
if event.pressed:
|
||||
# 记录触摸点
|
||||
touch_points[event.index] = event.position
|
||||
|
||||
if len(touch_points) == 1:
|
||||
# 单指触摸,开始拖动
|
||||
is_dragging = true
|
||||
last_touch_position = event.position
|
||||
elif len(touch_points) == 2 and enable_touch_zoom:
|
||||
# 双指触摸,准备缩放
|
||||
is_dragging = false
|
||||
var touches = touch_points.values()
|
||||
initial_zoom_distance = touches[0].distance_to(touches[1])
|
||||
else:
|
||||
# 触摸结束
|
||||
if touch_points.has(event.index):
|
||||
touch_points.erase(event.index)
|
||||
|
||||
if len(touch_points) == 0:
|
||||
is_dragging = false
|
||||
elif len(touch_points) == 1:
|
||||
# 从双指回到单指,重新开始拖动
|
||||
is_dragging = true
|
||||
last_touch_position = touch_points.values()[0]
|
||||
|
||||
# 触摸拖动
|
||||
elif event is InputEventScreenDrag:
|
||||
if touch_points.has(event.index):
|
||||
touch_points[event.index] = event.position
|
||||
|
||||
if len(touch_points) == 1 and is_dragging:
|
||||
# 单指拖动,移动相机
|
||||
var drag_delta = last_touch_position - event.position
|
||||
# 根据当前缩放级别调整移动距离
|
||||
position += drag_delta * touch_sensitivity / current_zoom_level
|
||||
|
||||
# 应用边界限制
|
||||
if bounds_enabled:
|
||||
position.x = clamp(position.x, bounds_min.x, bounds_max.x)
|
||||
position.y = clamp(position.y, bounds_min.y, bounds_max.y)
|
||||
|
||||
last_touch_position = event.position
|
||||
|
||||
elif len(touch_points) == 2 and enable_touch_zoom:
|
||||
# 双指缩放
|
||||
var touches = touch_points.values()
|
||||
var current_distance = touches[0].distance_to(touches[1])
|
||||
|
||||
if initial_zoom_distance > 0:
|
||||
var zoom_factor = current_distance / initial_zoom_distance
|
||||
var zoom_change = (zoom_factor - 1.0) * zoom_speed * 10
|
||||
zoom_camera(zoom_change)
|
||||
|
||||
initial_zoom_distance = current_distance
|
||||
|
||||
# 缩放相机
|
||||
func zoom_camera(zoom_amount):
|
||||
current_zoom_level = clamp(current_zoom_level + zoom_amount, min_zoom, max_zoom)
|
||||
zoom = Vector2(current_zoom_level, current_zoom_level)
|
||||
@@ -1 +0,0 @@
|
||||
uid://c7bxje0wvvgo4
|
||||
@@ -1,5 +1,13 @@
|
||||
extends Node
|
||||
|
||||
const client_version :String = "1.0.5" #记录客户端版本
|
||||
const client_version :String = "2.0.1" #记录客户端版本
|
||||
|
||||
var isZoomDisabled :bool = false
|
||||
|
||||
const server_configs = [
|
||||
{"host": "127.0.0.1", "port": 6060, "name": "本地"},
|
||||
#{"host": "192.168.31.233", "port": 6060, "name": "家里面局域网"},
|
||||
#{"host": "192.168.1.110", "port": 4040, "name": "萌芽局域网"},
|
||||
#{"host": "47.108.90.0", "port": 4040, "name": "成都内网穿透"}#成都内网穿透
|
||||
#{"host": "47.108.90.0", "port": 6060, "name": "成都公网"}#成都服务器
|
||||
]
|
||||
|
||||
239
GlobalScript/ResourceLoadingDebugger.gd
Normal file
239
GlobalScript/ResourceLoadingDebugger.gd
Normal file
@@ -0,0 +1,239 @@
|
||||
extends Node
|
||||
|
||||
## 资源加载调试器
|
||||
## 用于诊断和监控资源加载问题
|
||||
|
||||
class_name ResourceLoadingDebugger
|
||||
|
||||
# 调试信息收集
|
||||
var loading_stats: Dictionary = {}
|
||||
var failed_resources: Array = []
|
||||
var performance_metrics: Dictionary = {}
|
||||
|
||||
## 初始化调试器
|
||||
func _ready():
|
||||
print("[ResourceLoadingDebugger] 资源加载调试器已启动")
|
||||
_init_performance_monitoring()
|
||||
|
||||
## 初始化性能监控
|
||||
func _init_performance_monitoring():
|
||||
performance_metrics = {
|
||||
"total_load_time": 0.0,
|
||||
"average_load_time": 0.0,
|
||||
"peak_memory_usage": 0,
|
||||
"current_memory_usage": 0,
|
||||
"successful_loads": 0,
|
||||
"failed_loads": 0
|
||||
}
|
||||
|
||||
## 记录资源加载开始
|
||||
func start_loading_resource(resource_path: String) -> int:
|
||||
var start_time = Time.get_ticks_msec()
|
||||
var load_id = randi()
|
||||
|
||||
loading_stats[load_id] = {
|
||||
"path": resource_path,
|
||||
"start_time": start_time,
|
||||
"status": "loading"
|
||||
}
|
||||
|
||||
return load_id
|
||||
|
||||
## 记录资源加载完成
|
||||
func finish_loading_resource(load_id: int, success: bool, resource: Resource = null):
|
||||
if not loading_stats.has(load_id):
|
||||
return
|
||||
|
||||
var end_time = Time.get_ticks_msec()
|
||||
var load_info = loading_stats[load_id]
|
||||
var load_time = end_time - load_info["start_time"]
|
||||
|
||||
load_info["end_time"] = end_time
|
||||
load_info["load_time"] = load_time
|
||||
load_info["success"] = success
|
||||
load_info["status"] = "completed"
|
||||
|
||||
# 更新性能指标
|
||||
performance_metrics["total_load_time"] += load_time
|
||||
if success:
|
||||
performance_metrics["successful_loads"] += 1
|
||||
if resource:
|
||||
load_info["resource_size"] = _get_resource_memory_size(resource)
|
||||
else:
|
||||
performance_metrics["failed_loads"] += 1
|
||||
failed_resources.append(load_info["path"])
|
||||
|
||||
# 计算平均加载时间
|
||||
var total_loads = performance_metrics["successful_loads"] + performance_metrics["failed_loads"]
|
||||
if total_loads > 0:
|
||||
performance_metrics["average_load_time"] = performance_metrics["total_load_time"] / total_loads
|
||||
|
||||
# 更新内存使用情况
|
||||
_update_memory_usage()
|
||||
|
||||
## 获取资源内存大小估算
|
||||
func _get_resource_memory_size(resource: Resource) -> int:
|
||||
if resource is Texture2D:
|
||||
var texture = resource as Texture2D
|
||||
var size = texture.get_size()
|
||||
# 估算:RGBA * 宽 * 高 * 4字节
|
||||
return size.x * size.y * 4
|
||||
return 0
|
||||
|
||||
## 更新内存使用情况
|
||||
func _update_memory_usage():
|
||||
var current_memory = OS.get_static_memory_usage()
|
||||
performance_metrics["current_memory_usage"] = current_memory
|
||||
|
||||
if current_memory > performance_metrics["peak_memory_usage"]:
|
||||
performance_metrics["peak_memory_usage"] = current_memory
|
||||
|
||||
## 检测设备资源加载能力
|
||||
func detect_device_capabilities() -> Dictionary:
|
||||
var capabilities = {}
|
||||
|
||||
# 设备基本信息
|
||||
capabilities["platform"] = OS.get_name()
|
||||
capabilities["processor_count"] = OS.get_processor_count()
|
||||
capabilities["memory_total"] = OS.get_static_memory_usage()
|
||||
|
||||
# 图形信息
|
||||
var rendering_device = RenderingServer.get_rendering_device()
|
||||
if rendering_device:
|
||||
capabilities["gpu_name"] = rendering_device.get_device_name()
|
||||
capabilities["gpu_vendor"] = rendering_device.get_device_vendor_name()
|
||||
|
||||
# 存储信息
|
||||
capabilities["user_data_dir"] = OS.get_user_data_dir()
|
||||
|
||||
# 性能测试
|
||||
capabilities["texture_loading_speed"] = _benchmark_texture_loading()
|
||||
|
||||
return capabilities
|
||||
|
||||
## 基准测试纹理加载速度
|
||||
func _benchmark_texture_loading() -> float:
|
||||
var test_path = "res://assets/作物/默认/0.webp"
|
||||
if not ResourceLoader.exists(test_path):
|
||||
return -1.0
|
||||
|
||||
var start_time = Time.get_ticks_msec()
|
||||
var iterations = 10
|
||||
|
||||
for i in range(iterations):
|
||||
var texture = ResourceLoader.load(test_path)
|
||||
if not texture:
|
||||
return -1.0
|
||||
|
||||
var end_time = Time.get_ticks_msec()
|
||||
return float(end_time - start_time) / iterations
|
||||
|
||||
## 诊断资源加载问题
|
||||
func diagnose_loading_issues() -> Dictionary:
|
||||
var diagnosis = {
|
||||
"issues_found": [],
|
||||
"recommendations": [],
|
||||
"severity": "normal"
|
||||
}
|
||||
|
||||
# 检查失败率
|
||||
var total_loads = performance_metrics["successful_loads"] + performance_metrics["failed_loads"]
|
||||
if total_loads > 0:
|
||||
var failure_rate = float(performance_metrics["failed_loads"]) / total_loads
|
||||
if failure_rate > 0.1: # 失败率超过10%
|
||||
diagnosis["issues_found"].append("资源加载失败率过高: %.1f%%" % (failure_rate * 100))
|
||||
diagnosis["recommendations"].append("检查资源文件完整性和路径正确性")
|
||||
diagnosis["severity"] = "warning"
|
||||
|
||||
if failure_rate > 0.3: # 失败率超过30%
|
||||
diagnosis["severity"] = "critical"
|
||||
diagnosis["recommendations"].append("考虑降低资源质量或减少同时加载的资源数量")
|
||||
|
||||
# 检查加载速度
|
||||
if performance_metrics["average_load_time"] > 100: # 平均加载时间超过100ms
|
||||
diagnosis["issues_found"].append("资源加载速度较慢: %.1fms" % performance_metrics["average_load_time"])
|
||||
diagnosis["recommendations"].append("考虑使用多线程加载或预加载常用资源")
|
||||
if diagnosis["severity"] == "normal":
|
||||
diagnosis["severity"] = "warning"
|
||||
|
||||
# 检查内存使用
|
||||
var memory_mb = performance_metrics["peak_memory_usage"] / (1024 * 1024)
|
||||
if memory_mb > 500: # 峰值内存使用超过500MB
|
||||
diagnosis["issues_found"].append("内存使用过高: %.1fMB" % memory_mb)
|
||||
diagnosis["recommendations"].append("实施LRU缓存清理或降低缓存大小")
|
||||
if diagnosis["severity"] == "normal":
|
||||
diagnosis["severity"] = "warning"
|
||||
|
||||
# 检查平台特定问题
|
||||
var platform = OS.get_name()
|
||||
if platform in ["Android", "iOS"]:
|
||||
if performance_metrics["failed_loads"] > 5:
|
||||
diagnosis["issues_found"].append("移动设备上资源加载失败较多")
|
||||
diagnosis["recommendations"].append("移动设备内存有限,建议降低资源质量或实施更积极的缓存清理")
|
||||
|
||||
return diagnosis
|
||||
|
||||
## 生成资源加载报告
|
||||
func generate_loading_report() -> String:
|
||||
var report = "=== 资源加载调试报告 ===\n\n"
|
||||
|
||||
# 基本统计
|
||||
report += "基本统计:\n"
|
||||
report += " 成功加载: %d\n" % performance_metrics["successful_loads"]
|
||||
report += " 失败加载: %d\n" % performance_metrics["failed_loads"]
|
||||
report += " 平均加载时间: %.1fms\n" % performance_metrics["average_load_time"]
|
||||
report += " 总加载时间: %.1fs\n" % (performance_metrics["total_load_time"] / 1000.0)
|
||||
report += " 峰值内存使用: %.1fMB\n\n" % (performance_metrics["peak_memory_usage"] / (1024 * 1024))
|
||||
|
||||
# 设备信息
|
||||
var capabilities = detect_device_capabilities()
|
||||
report += "设备信息:\n"
|
||||
report += " 平台: %s\n" % capabilities.get("platform", "未知")
|
||||
report += " CPU核心数: %d\n" % capabilities.get("processor_count", 0)
|
||||
report += " 纹理加载速度: %.1fms\n\n" % capabilities.get("texture_loading_speed", -1)
|
||||
|
||||
# 失败的资源
|
||||
if failed_resources.size() > 0:
|
||||
report += "加载失败的资源:\n"
|
||||
for i in range(min(10, failed_resources.size())): # 只显示前10个
|
||||
report += " - %s\n" % failed_resources[i]
|
||||
if failed_resources.size() > 10:
|
||||
report += " ... 还有 %d 个失败的资源\n" % (failed_resources.size() - 10)
|
||||
report += "\n"
|
||||
|
||||
# 诊断结果
|
||||
var diagnosis = diagnose_loading_issues()
|
||||
report += "诊断结果 [%s]:\n" % diagnosis["severity"].to_upper()
|
||||
for issue in diagnosis["issues_found"]:
|
||||
report += " 问题: %s\n" % issue
|
||||
for recommendation in diagnosis["recommendations"]:
|
||||
report += " 建议: %s\n" % recommendation
|
||||
|
||||
return report
|
||||
|
||||
## 清理调试数据
|
||||
func clear_debug_data():
|
||||
loading_stats.clear()
|
||||
failed_resources.clear()
|
||||
_init_performance_monitoring()
|
||||
print("[ResourceLoadingDebugger] 调试数据已清理")
|
||||
|
||||
## 导出调试数据到文件
|
||||
func export_debug_data_to_file():
|
||||
var report = generate_loading_report()
|
||||
var datetime = Time.get_datetime_dict_from_system()
|
||||
var filename = "resource_loading_debug_%04d%02d%02d_%02d%02d%02d.txt" % [
|
||||
datetime.year, datetime.month, datetime.day,
|
||||
datetime.hour, datetime.minute, datetime.second
|
||||
]
|
||||
|
||||
var file_path = OS.get_user_data_dir() + "/" + filename
|
||||
var file = FileAccess.open(file_path, FileAccess.WRITE)
|
||||
if file:
|
||||
file.store_string(report)
|
||||
file.close()
|
||||
print("[ResourceLoadingDebugger] 调试报告已导出到: ", file_path)
|
||||
return file_path
|
||||
else:
|
||||
print("[ResourceLoadingDebugger] 导出调试报告失败")
|
||||
return ""
|
||||
1
GlobalScript/ResourceLoadingDebugger.gd.uid
Normal file
1
GlobalScript/ResourceLoadingDebugger.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dk6uoldjqtc0p
|
||||
2502
MainGame.gd
2502
MainGame.gd
File diff suppressed because it is too large
Load Diff
3671
MainGame.tscn
3671
MainGame.tscn
File diff suppressed because it is too large
Load Diff
579
MainGame.tscn166226414114.tmp
Normal file
579
MainGame.tscn166226414114.tmp
Normal file
@@ -0,0 +1,579 @@
|
||||
[gd_scene load_steps=36 format=3 uid="uid://dgh61dttaas5a"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://2pt11sfcaxf7" path="res://MainGame.gd" id="1_v3yaj"]
|
||||
[ext_resource type="Texture2D" uid="uid://du2pyiojliasy" path="res://assets/游戏UI/经验球.webp" id="2_6jgly"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkivlkirrx6u8" path="res://CopyItems/crop_item.tscn" id="3_isiom"]
|
||||
[ext_resource type="Texture2D" uid="uid://ftv231igtdoq" path="res://assets/游戏UI/等级.webp" id="3_y1hsh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqib5y8uwg6hx" path="res://assets/游戏UI/钱币.webp" id="4_ql8k3"]
|
||||
[ext_resource type="Texture2D" uid="uid://waqbwo2r33j3" path="res://assets/游戏UI/小提示.webp" id="5_5b81d"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnhyqsw8yjekh" path="res://assets/游戏UI/体力值图标.webp" id="5_n03md"]
|
||||
[ext_resource type="Texture2D" uid="uid://cj0qac0wmm0q8" path="res://assets/游戏UI/点赞图标.webp" id="6_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpxiaqh0y6a5d" path="res://Network/TCPNetworkManager.tscn" id="7_401ut"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3pev0nbt8sjd" path="res://assets/游戏UI/玩家昵称.webp" id="7_n03md"]
|
||||
[ext_resource type="Texture2D" uid="uid://cxm72d5t4dn0q" path="res://assets/游戏UI/农场名称.webp" id="8_uhubb"]
|
||||
[ext_resource type="Texture2D" uid="uid://b665dc0ye72lg" path="res://assets/游戏UI/服务器连接状态.webp" id="9_uc6q1"]
|
||||
[ext_resource type="Script" uid="uid://c7bxje0wvvgo4" path="res://game_camera.gd" id="10_o8l48"]
|
||||
[ext_resource type="Texture2D" uid="uid://dsuaw8kcdtrst" path="res://assets/游戏UI/FPS图标.webp" id="10_uhubb"]
|
||||
[ext_resource type="Texture2D" uid="uid://bso5fyjavdien" path="res://assets/游戏UI/玩家数图标.webp" id="10_vygm6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbhitturvihqj" path="res://GUI/LoginPanel.tscn" id="11_6jgly"]
|
||||
[ext_resource type="PackedScene" uid="uid://dckc8nrn7p425" path="res://GUI/LandPanel.tscn" id="12_y1hsh"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpiy0aim20n2h" path="res://Scene/SmallPanel/OnlineGiftPanel.tscn" id="14_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://4rwitowdt4h" path="res://Scene/SmallPanel/OneClickPlantPanel.tscn" id="15_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://btp1h6hic2sin" path="res://GUI/AcceptDialog.tscn" id="16_0igvr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbfqu87627yg6" path="res://Scene/BigPanel/PlayerRankingPanel.tscn" id="16_n03md"]
|
||||
[ext_resource type="Script" uid="uid://dckw8dskfbnkp" path="res://background.gd" id="17_0igvr"]
|
||||
[ext_resource type="PackedScene" uid="uid://bndf1e4sgdjr6" path="res://GUI/LuckyDrawPanel.tscn" id="17_f21le"]
|
||||
[ext_resource type="PackedScene" uid="uid://hesp70n3ondo" path="res://Scene/BigPanel/CropStorePanel.tscn" id="17_ql8k3"]
|
||||
[ext_resource type="PackedScene" uid="uid://drw18a6mcr2of" path="res://Scene/BigPanel/CropWarehousePanel.tscn" id="18_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://smypui0vyso5" path="res://GUI/DailyCheckInPanel.tscn" id="18_m6fch"]
|
||||
[ext_resource type="PackedScene" uid="uid://bseuwniienrqy" path="res://Scene/BigPanel/PlayerBagPanel.tscn" id="19_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://cehw5sx5pgmmc" path="res://Scene/BigPanel/ItemBagPanel.tscn" id="20_n03md"]
|
||||
[ext_resource type="Script" uid="uid://mtfp0ct42nrx" path="res://GUI/CropStorePanel.gd" id="21_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://j4ft87o7jk14" path="res://Scene/BigPanel/ItemStorePanel.tscn" id="21_uhubb"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3i0l6ysrde6o" path="res://Scene/SmallPanel/AccountSettingPanel.tscn" id="26_uc6q1"]
|
||||
[ext_resource type="PackedScene" uid="uid://d1lu2yg4xl382" path="res://Scene/SmallPanel/LoadProgressPanel.tscn" id="27_vygm6"]
|
||||
[ext_resource type="Script" uid="uid://ca2chgx5w3g1y" path="res://Components/GameBGMPlayer.gd" id="28_m6fch"]
|
||||
[ext_resource type="PackedScene" uid="uid://ibl5wbbw3pwc" path="res://CopyItems/item_button.tscn" id="39_cdkxt"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_m6fch"]
|
||||
background_mode = 3
|
||||
ambient_light_energy = 0.0
|
||||
glow_enabled = true
|
||||
glow_bloom = 0.3
|
||||
glow_blend_mode = 0
|
||||
|
||||
[node name="main" type="Node"]
|
||||
script = ExtResource("1_v3yaj")
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GUI" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="GameInfoHBox1" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 35.0
|
||||
|
||||
[node name="experience_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
self_modulate = Color(0.498039, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_6jgly")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="experience" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "经验:999"
|
||||
|
||||
[node name="level_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_y1hsh")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="level" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "等级:100"
|
||||
|
||||
[node name="money_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_ql8k3")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="money" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "钱币:999"
|
||||
|
||||
[node name="hungervalue_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_n03md")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="hunger_value" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0.88617, 0.748355, 0.764238, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "体力值:20"
|
||||
|
||||
[node name="like_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_8kysg")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="like" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.992157, 0.482353, 0.482353, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "点赞数:0"
|
||||
|
||||
[node name="GameInfoHBox2" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_top = 35.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 70.0
|
||||
|
||||
[node name="player_name_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("7_n03md")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="player_name" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
modulate = Color(1, 0.670588, 0.490196, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "玩家昵称:树萌芽"
|
||||
|
||||
[node name="farm_name_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("8_uhubb")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="farm_name" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
modulate = Color(1, 0.858824, 0.623529, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "农场名称:树萌芽的农场"
|
||||
|
||||
[node name="status_label_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("9_uc6q1")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "服务器状态:正在检测中"
|
||||
|
||||
[node name="FPS_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("10_uhubb")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="FPS" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.68755, 0.948041, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "FPS:0"
|
||||
|
||||
[node name="onlineplayer_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("10_vygm6")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="onlineplayer" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.423529, 1, 0.533333, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "检测中..."
|
||||
|
||||
[node name="GameInfoHBox3" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_top = 70.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 105.0
|
||||
|
||||
[node name="tip_image" type="TextureRect" parent="UI/GUI/GameInfoHBox3"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_5b81d")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="tip" type="Label" parent="UI/GUI/GameInfoHBox3"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.564706, 1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "游戏小提示"
|
||||
|
||||
[node name="FarmVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 263.0
|
||||
offset_right = 252.0
|
||||
offset_bottom = 795.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="SeedStoreButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.564706, 0.647059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种子商店"
|
||||
|
||||
[node name="SeedWarehouseButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种子仓库"
|
||||
|
||||
[node name="CropWarehouseButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.772549, 0.219608, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "作物仓库"
|
||||
|
||||
[node name="ItemStoreButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.231373, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "道具商店"
|
||||
|
||||
[node name="ItemBagButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.639216, 0.984314, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "道具背包"
|
||||
|
||||
[node name="OneClickHarvestButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.841258, 0.700703, 0.325362, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键收获"
|
||||
|
||||
[node name="OneClickPlantButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.513945, 0.818793, 3.85046e-07, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键种植"
|
||||
|
||||
[node name="AddNewGroundButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.803922, 0.729412, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "添加新土地"
|
||||
|
||||
[node name="VisitVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 115.0
|
||||
offset_right = 252.0
|
||||
offset_bottom = 245.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="LikeButton" type="Button" parent="UI/GUI/VisitVBox"]
|
||||
modulate = Color(0.992157, 0.482353, 0.482353, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "点赞"
|
||||
|
||||
[node name="ReturnMyFarmButton" type="Button" parent="UI/GUI/VisitVBox"]
|
||||
modulate = Color(1, 1, 0.721569, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "返回我的农场"
|
||||
|
||||
[node name="OtherVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 1198.0
|
||||
offset_top = 77.0
|
||||
offset_right = 1446.0
|
||||
offset_bottom = 408.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="AccountSettingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.843137, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "账户设置"
|
||||
|
||||
[node name="OnlineGiftButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(1, 0.615686, 0.447059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "在线礼包"
|
||||
|
||||
[node name="NewPlayerGiftButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(1, 1, 0.447059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "新手礼包"
|
||||
|
||||
[node name="OneClickScreenShot" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.407843, 0.796078, 0.996078, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键截图"
|
||||
|
||||
[node name="LuckyDrawButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.729412, 0.764706, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "幸运抽奖"
|
||||
|
||||
[node name="PlayerRankingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.717647, 1, 0.576471, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "玩家排行榜"
|
||||
|
||||
[node name="DailyCheckInButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.807843, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "每日签到"
|
||||
|
||||
[node name="ReturnMainMenuButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.639216, 0.482353, 0.870588, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "返回主菜单"
|
||||
|
||||
[node name="SmallGameButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.513726, 0.615686, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "游玩小游戏"
|
||||
|
||||
[node name="SettingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.345098, 0.764706, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "设置"
|
||||
|
||||
[node name="WisdomTreeButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.345098, 0.764706, 0.611765, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "智慧树"
|
||||
|
||||
[node name="MyPetButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.992157, 0.482353, 0.870588, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "我的宠物"
|
||||
|
||||
[node name="ScareCrowButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.937381, 0.612088, 0.36654, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "稻草人"
|
||||
|
||||
[node name="BigPanel" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="LuckyDrawPanel" parent="UI/BigPanel" instance=ExtResource("17_f21le")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_right = 1042.0
|
||||
|
||||
[node name="DailyCheckInPanel" parent="UI/BigPanel" instance=ExtResource("18_m6fch")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_top = 3.0
|
||||
offset_right = 1042.0
|
||||
offset_bottom = 723.0
|
||||
|
||||
[node name="TCPNetworkManagerPanel" parent="UI/BigPanel" instance=ExtResource("7_401ut")]
|
||||
visible = false
|
||||
offset_left = 2.00012
|
||||
offset_top = 143.0
|
||||
offset_right = 2.00012
|
||||
offset_bottom = 143.0
|
||||
scale = Vector2(0.7, 0.7)
|
||||
|
||||
[node name="ItemStorePanel" parent="UI/BigPanel" instance=ExtResource("21_uhubb")]
|
||||
|
||||
[node name="ItemBagPanel" parent="UI/BigPanel" instance=ExtResource("20_n03md")]
|
||||
|
||||
[node name="PlayerBagPanel" parent="UI/BigPanel" instance=ExtResource("19_8kysg")]
|
||||
|
||||
[node name="CropWarehousePanel" parent="UI/BigPanel" instance=ExtResource("18_5b81d")]
|
||||
|
||||
[node name="CropStorePanel" parent="UI/BigPanel" instance=ExtResource("17_ql8k3")]
|
||||
script = ExtResource("21_5b81d")
|
||||
|
||||
[node name="PlayerRankingPanel" parent="UI/BigPanel" instance=ExtResource("16_n03md")]
|
||||
|
||||
[node name="LoginPanel" parent="UI/BigPanel" instance=ExtResource("11_6jgly")]
|
||||
|
||||
[node name="SmallPanel" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="LandPanel" parent="UI/SmallPanel" instance=ExtResource("12_y1hsh")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_top = 77.0
|
||||
offset_right = 958.0
|
||||
offset_bottom = 548.0
|
||||
|
||||
[node name="LoadProgressPanel" parent="UI/SmallPanel" instance=ExtResource("27_vygm6")]
|
||||
|
||||
[node name="AccountSettingPanel" parent="UI/SmallPanel" instance=ExtResource("26_uc6q1")]
|
||||
|
||||
[node name="OneClickPlantPanel" parent="UI/SmallPanel" instance=ExtResource("15_8kysg")]
|
||||
|
||||
[node name="OnlineGiftPanel" parent="UI/SmallPanel" instance=ExtResource("14_5b81d")]
|
||||
|
||||
[node name="DiaLog" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="AcceptDialog" parent="UI/DiaLog" instance=ExtResource("16_0igvr")]
|
||||
visible = false
|
||||
|
||||
[node name="BackgroundUI" type="CanvasLayer" parent="."]
|
||||
layer = -1
|
||||
|
||||
[node name="BackgroundSwitcher" type="Sprite2D" parent="BackgroundUI"]
|
||||
self_modulate = Color(0.5, 0.5, 0.5, 1)
|
||||
show_behind_parent = true
|
||||
z_index = -100
|
||||
z_as_relative = false
|
||||
position = Vector2(703, 360)
|
||||
scale = Vector2(0.92, 0.92)
|
||||
script = ExtResource("17_0igvr")
|
||||
|
||||
[node name="Background2" type="Sprite2D" parent="BackgroundUI/BackgroundSwitcher"]
|
||||
self_modulate = Color(0.5, 0.5, 0.5, 1)
|
||||
|
||||
[node name="Timer" type="Timer" parent="BackgroundUI/BackgroundSwitcher"]
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="."]
|
||||
z_as_relative = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
offset_left = -2.0
|
||||
offset_top = 2.0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 722.0
|
||||
columns = 10
|
||||
|
||||
[node name="CopyNodes" type="Node2D" parent="."]
|
||||
position = Vector2(-1000, 0)
|
||||
|
||||
[node name="CropItem" parent="CopyNodes" instance=ExtResource("3_isiom")]
|
||||
z_index = 2
|
||||
z_as_relative = false
|
||||
offset_left = -1433.0
|
||||
offset_top = -161.0
|
||||
offset_right = -1333.0
|
||||
offset_bottom = -61.0
|
||||
|
||||
[node name="item_button" parent="CopyNodes" instance=ExtResource("39_cdkxt")]
|
||||
|
||||
[node name="GameCamera" type="Camera2D" parent="."]
|
||||
anchor_mode = 0
|
||||
position_smoothing_enabled = true
|
||||
script = ExtResource("10_o8l48")
|
||||
max_zoom = 1.1
|
||||
bounds_enabled = true
|
||||
bounds_min = Vector2(-500, -500)
|
||||
bounds_max = Vector2(500, 500)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_m6fch")
|
||||
|
||||
[node name="GameManager" type="Node" parent="."]
|
||||
|
||||
[node name="GameBGMPlayer" type="Node" parent="."]
|
||||
script = ExtResource("28_m6fch")
|
||||
play_mode = 1
|
||||
music_files_list = Array[String](["res://assets/音乐/Anibli&RelaxingPianoMusic-StrollThroughtheSky.ogg", "res://assets/音乐/BanAM-Futatabi.ogg", "res://assets/音乐/MCMZebra-AlwaysandManyTimes.ogg", "res://assets/音乐/MicMusicbox-Ashitakasekki.ogg", "res://assets/音乐/Nemuネム-PromiseoftheWorld.ogg", "res://assets/音乐/α-WaveRelaxationHealingMusicLab-いつも何度でも[「千と千尋の神隠し」より][ピアノ].ogg", "res://assets/音乐/久石让-ふたたび.ogg", "res://assets/音乐/广桥真纪子-いのちの名前(生命之名).ogg", "res://assets/音乐/日本群星-PromiseoftheWorld.ogg"])
|
||||
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/SeedStoreButton" to="." method="_on_open_store_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/SeedWarehouseButton" to="." method="_on_seed_warehouse_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/CropWarehouseButton" to="." method="_on_crop_warehouse_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/ItemStoreButton" to="." method="_on_item_store_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/ItemBagButton" to="." method="_on_item_bag_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/OneClickHarvestButton" to="." method="_on_one_click_harvestbutton_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/OneClickPlantButton" to="." method="_on_one_click_plant_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/AddNewGroundButton" to="." method="_on_add_new_ground_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/VisitVBox/LikeButton" to="." method="_on_like_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/VisitVBox/ReturnMyFarmButton" to="." method="_on_return_my_farm_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/AccountSettingButton" to="." method="_on_account_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/OnlineGiftButton" to="." method="_on_online_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/NewPlayerGiftButton" to="." method="_on_new_player_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/OneClickScreenShot" to="." method="_on_one_click_screen_shot_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/LuckyDrawButton" to="." method="_on_lucky_draw_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/PlayerRankingButton" to="." method="_on_player_ranking_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/DailyCheckInButton" to="." method="_on_daily_check_in_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/ReturnMainMenuButton" to="." method="_on_return_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/SmallGameButton" to="." method="_on_online_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/SettingButton" to="." method="_on_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/WisdomTreeButton" to="." method="_on_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/MyPetButton" to="." method="_on_my_pet_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/ScareCrowButton" to="." method="_on_my_pet_button_pressed"]
|
||||
579
MainGame.tscn166255147325.tmp
Normal file
579
MainGame.tscn166255147325.tmp
Normal file
@@ -0,0 +1,579 @@
|
||||
[gd_scene load_steps=36 format=3 uid="uid://dgh61dttaas5a"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://2pt11sfcaxf7" path="res://MainGame.gd" id="1_v3yaj"]
|
||||
[ext_resource type="Texture2D" uid="uid://du2pyiojliasy" path="res://assets/游戏UI/经验球.webp" id="2_6jgly"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkivlkirrx6u8" path="res://CopyItems/crop_item.tscn" id="3_isiom"]
|
||||
[ext_resource type="Texture2D" uid="uid://ftv231igtdoq" path="res://assets/游戏UI/等级.webp" id="3_y1hsh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqib5y8uwg6hx" path="res://assets/游戏UI/钱币.webp" id="4_ql8k3"]
|
||||
[ext_resource type="Texture2D" uid="uid://waqbwo2r33j3" path="res://assets/游戏UI/小提示.webp" id="5_5b81d"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnhyqsw8yjekh" path="res://assets/游戏UI/体力值图标.webp" id="5_n03md"]
|
||||
[ext_resource type="Texture2D" uid="uid://cj0qac0wmm0q8" path="res://assets/游戏UI/点赞图标.webp" id="6_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpxiaqh0y6a5d" path="res://Network/TCPNetworkManager.tscn" id="7_401ut"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3pev0nbt8sjd" path="res://assets/游戏UI/玩家昵称.webp" id="7_n03md"]
|
||||
[ext_resource type="Texture2D" uid="uid://cxm72d5t4dn0q" path="res://assets/游戏UI/农场名称.webp" id="8_uhubb"]
|
||||
[ext_resource type="Texture2D" uid="uid://b665dc0ye72lg" path="res://assets/游戏UI/服务器连接状态.webp" id="9_uc6q1"]
|
||||
[ext_resource type="Script" uid="uid://c7bxje0wvvgo4" path="res://game_camera.gd" id="10_o8l48"]
|
||||
[ext_resource type="Texture2D" uid="uid://dsuaw8kcdtrst" path="res://assets/游戏UI/FPS图标.webp" id="10_uhubb"]
|
||||
[ext_resource type="Texture2D" uid="uid://bso5fyjavdien" path="res://assets/游戏UI/玩家数图标.webp" id="10_vygm6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbhitturvihqj" path="res://GUI/LoginPanel.tscn" id="11_6jgly"]
|
||||
[ext_resource type="PackedScene" uid="uid://dckc8nrn7p425" path="res://GUI/LandPanel.tscn" id="12_y1hsh"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpiy0aim20n2h" path="res://Scene/SmallPanel/OnlineGiftPanel.tscn" id="14_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://4rwitowdt4h" path="res://Scene/SmallPanel/OneClickPlantPanel.tscn" id="15_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://btp1h6hic2sin" path="res://GUI/AcceptDialog.tscn" id="16_0igvr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbfqu87627yg6" path="res://Scene/BigPanel/PlayerRankingPanel.tscn" id="16_n03md"]
|
||||
[ext_resource type="Script" uid="uid://dckw8dskfbnkp" path="res://background.gd" id="17_0igvr"]
|
||||
[ext_resource type="PackedScene" uid="uid://bndf1e4sgdjr6" path="res://GUI/LuckyDrawPanel.tscn" id="17_f21le"]
|
||||
[ext_resource type="PackedScene" uid="uid://hesp70n3ondo" path="res://Scene/BigPanel/CropStorePanel.tscn" id="17_ql8k3"]
|
||||
[ext_resource type="PackedScene" uid="uid://drw18a6mcr2of" path="res://Scene/BigPanel/CropWarehousePanel.tscn" id="18_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://smypui0vyso5" path="res://GUI/DailyCheckInPanel.tscn" id="18_m6fch"]
|
||||
[ext_resource type="PackedScene" uid="uid://bseuwniienrqy" path="res://Scene/BigPanel/PlayerBagPanel.tscn" id="19_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://cehw5sx5pgmmc" path="res://Scene/BigPanel/ItemBagPanel.tscn" id="20_n03md"]
|
||||
[ext_resource type="Script" uid="uid://mtfp0ct42nrx" path="res://GUI/CropStorePanel.gd" id="21_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://j4ft87o7jk14" path="res://Scene/BigPanel/ItemStorePanel.tscn" id="21_uhubb"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3i0l6ysrde6o" path="res://Scene/SmallPanel/AccountSettingPanel.tscn" id="26_uc6q1"]
|
||||
[ext_resource type="PackedScene" uid="uid://d1lu2yg4xl382" path="res://Scene/SmallPanel/LoadProgressPanel.tscn" id="27_vygm6"]
|
||||
[ext_resource type="Script" uid="uid://ca2chgx5w3g1y" path="res://Components/GameBGMPlayer.gd" id="28_m6fch"]
|
||||
[ext_resource type="PackedScene" uid="uid://ibl5wbbw3pwc" path="res://CopyItems/item_button.tscn" id="39_cdkxt"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_m6fch"]
|
||||
background_mode = 3
|
||||
ambient_light_energy = 0.0
|
||||
glow_enabled = true
|
||||
glow_bloom = 0.3
|
||||
glow_blend_mode = 0
|
||||
|
||||
[node name="main" type="Node"]
|
||||
script = ExtResource("1_v3yaj")
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GUI" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="GameInfoHBox1" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 35.0
|
||||
|
||||
[node name="experience_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
self_modulate = Color(0.498039, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_6jgly")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="experience" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "经验:999"
|
||||
|
||||
[node name="level_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_y1hsh")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="level" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "等级:100"
|
||||
|
||||
[node name="money_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_ql8k3")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="money" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "钱币:999"
|
||||
|
||||
[node name="hungervalue_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_n03md")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="hunger_value" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0.88617, 0.748355, 0.764238, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "体力值:20"
|
||||
|
||||
[node name="like_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_8kysg")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="like" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.992157, 0.482353, 0.482353, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "点赞数:0"
|
||||
|
||||
[node name="GameInfoHBox2" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_top = 35.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 70.0
|
||||
|
||||
[node name="player_name_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("7_n03md")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="player_name" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
modulate = Color(1, 0.670588, 0.490196, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "玩家昵称:树萌芽"
|
||||
|
||||
[node name="farm_name_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("8_uhubb")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="farm_name" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
modulate = Color(1, 0.858824, 0.623529, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "农场名称:树萌芽的农场"
|
||||
|
||||
[node name="status_label_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("9_uc6q1")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "服务器状态:正在检测中"
|
||||
|
||||
[node name="FPS_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("10_uhubb")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="FPS" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.68755, 0.948041, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "FPS:0"
|
||||
|
||||
[node name="onlineplayer_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("10_vygm6")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="onlineplayer" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.423529, 1, 0.533333, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "检测中..."
|
||||
|
||||
[node name="GameInfoHBox3" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_top = 70.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 105.0
|
||||
|
||||
[node name="tip_image" type="TextureRect" parent="UI/GUI/GameInfoHBox3"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_5b81d")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="tip" type="Label" parent="UI/GUI/GameInfoHBox3"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.564706, 1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "游戏小提示"
|
||||
|
||||
[node name="FarmVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 263.0
|
||||
offset_right = 252.0
|
||||
offset_bottom = 795.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="SeedStoreButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.564706, 0.647059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种子商店"
|
||||
|
||||
[node name="SeedWarehouseButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种子仓库"
|
||||
|
||||
[node name="CropWarehouseButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.772549, 0.219608, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "作物仓库"
|
||||
|
||||
[node name="ItemStoreButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.231373, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "道具商店"
|
||||
|
||||
[node name="ItemBagButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.639216, 0.984314, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "道具背包"
|
||||
|
||||
[node name="OneClickHarvestButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.841258, 0.700703, 0.325362, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键收获"
|
||||
|
||||
[node name="OneClickPlantButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.513945, 0.818793, 3.85046e-07, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键种植"
|
||||
|
||||
[node name="AddNewGroundButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.803922, 0.729412, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "添加新土地"
|
||||
|
||||
[node name="VisitVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 115.0
|
||||
offset_right = 252.0
|
||||
offset_bottom = 245.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="LikeButton" type="Button" parent="UI/GUI/VisitVBox"]
|
||||
modulate = Color(0.992157, 0.482353, 0.482353, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "点赞"
|
||||
|
||||
[node name="ReturnMyFarmButton" type="Button" parent="UI/GUI/VisitVBox"]
|
||||
modulate = Color(1, 1, 0.721569, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "返回我的农场"
|
||||
|
||||
[node name="OtherVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 1198.0
|
||||
offset_top = 77.0
|
||||
offset_right = 1446.0
|
||||
offset_bottom = 408.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="AccountSettingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.843137, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "账户设置"
|
||||
|
||||
[node name="OnlineGiftButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(1, 0.615686, 0.447059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "在线礼包"
|
||||
|
||||
[node name="NewPlayerGiftButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(1, 1, 0.447059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "新手礼包"
|
||||
|
||||
[node name="OneClickScreenShot" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.407843, 0.796078, 0.996078, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键截图"
|
||||
|
||||
[node name="LuckyDrawButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.729412, 0.764706, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "幸运抽奖"
|
||||
|
||||
[node name="PlayerRankingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.717647, 1, 0.576471, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "玩家排行榜"
|
||||
|
||||
[node name="DailyCheckInButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.807843, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "每日签到"
|
||||
|
||||
[node name="ReturnMainMenuButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.639216, 0.482353, 0.870588, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "返回主菜单"
|
||||
|
||||
[node name="SmallGameButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.513726, 0.615686, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "游玩小游戏"
|
||||
|
||||
[node name="SettingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.345098, 0.764706, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "设置"
|
||||
|
||||
[node name="WisdomTreeButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.345098, 0.764706, 0.611765, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "智慧树"
|
||||
|
||||
[node name="MyPetButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.992157, 0.482353, 0.870588, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "我的宠物"
|
||||
|
||||
[node name="ScareCrowButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.937381, 0.612088, 0.36654, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "稻草人"
|
||||
|
||||
[node name="BigPanel" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="LuckyDrawPanel" parent="UI/BigPanel" instance=ExtResource("17_f21le")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_right = 1042.0
|
||||
|
||||
[node name="DailyCheckInPanel" parent="UI/BigPanel" instance=ExtResource("18_m6fch")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_top = 3.0
|
||||
offset_right = 1042.0
|
||||
offset_bottom = 723.0
|
||||
|
||||
[node name="TCPNetworkManagerPanel" parent="UI/BigPanel" instance=ExtResource("7_401ut")]
|
||||
visible = false
|
||||
offset_left = 2.00012
|
||||
offset_top = 143.0
|
||||
offset_right = 2.00012
|
||||
offset_bottom = 143.0
|
||||
scale = Vector2(0.7, 0.7)
|
||||
|
||||
[node name="ItemStorePanel" parent="UI/BigPanel" instance=ExtResource("21_uhubb")]
|
||||
|
||||
[node name="ItemBagPanel" parent="UI/BigPanel" instance=ExtResource("20_n03md")]
|
||||
|
||||
[node name="PlayerBagPanel" parent="UI/BigPanel" instance=ExtResource("19_8kysg")]
|
||||
|
||||
[node name="CropWarehousePanel" parent="UI/BigPanel" instance=ExtResource("18_5b81d")]
|
||||
|
||||
[node name="CropStorePanel" parent="UI/BigPanel" instance=ExtResource("17_ql8k3")]
|
||||
script = ExtResource("21_5b81d")
|
||||
|
||||
[node name="PlayerRankingPanel" parent="UI/BigPanel" instance=ExtResource("16_n03md")]
|
||||
|
||||
[node name="LoginPanel" parent="UI/BigPanel" instance=ExtResource("11_6jgly")]
|
||||
|
||||
[node name="SmallPanel" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="LandPanel" parent="UI/SmallPanel" instance=ExtResource("12_y1hsh")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_top = 77.0
|
||||
offset_right = 958.0
|
||||
offset_bottom = 548.0
|
||||
|
||||
[node name="LoadProgressPanel" parent="UI/SmallPanel" instance=ExtResource("27_vygm6")]
|
||||
|
||||
[node name="AccountSettingPanel" parent="UI/SmallPanel" instance=ExtResource("26_uc6q1")]
|
||||
|
||||
[node name="OneClickPlantPanel" parent="UI/SmallPanel" instance=ExtResource("15_8kysg")]
|
||||
|
||||
[node name="OnlineGiftPanel" parent="UI/SmallPanel" instance=ExtResource("14_5b81d")]
|
||||
|
||||
[node name="DiaLog" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="AcceptDialog" parent="UI/DiaLog" instance=ExtResource("16_0igvr")]
|
||||
visible = false
|
||||
|
||||
[node name="BackgroundUI" type="CanvasLayer" parent="."]
|
||||
layer = -1
|
||||
|
||||
[node name="BackgroundSwitcher" type="Sprite2D" parent="BackgroundUI"]
|
||||
self_modulate = Color(0.5, 0.5, 0.5, 1)
|
||||
show_behind_parent = true
|
||||
z_index = -100
|
||||
z_as_relative = false
|
||||
position = Vector2(703, 360)
|
||||
scale = Vector2(0.92, 0.92)
|
||||
script = ExtResource("17_0igvr")
|
||||
|
||||
[node name="Background2" type="Sprite2D" parent="BackgroundUI/BackgroundSwitcher"]
|
||||
self_modulate = Color(0.5, 0.5, 0.5, 1)
|
||||
|
||||
[node name="Timer" type="Timer" parent="BackgroundUI/BackgroundSwitcher"]
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="."]
|
||||
z_as_relative = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
offset_left = -2.0
|
||||
offset_top = 2.0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 722.0
|
||||
columns = 10
|
||||
|
||||
[node name="CopyNodes" type="Node2D" parent="."]
|
||||
position = Vector2(-1000, 0)
|
||||
|
||||
[node name="CropItem" parent="CopyNodes" instance=ExtResource("3_isiom")]
|
||||
z_index = 2
|
||||
z_as_relative = false
|
||||
offset_left = -1433.0
|
||||
offset_top = -161.0
|
||||
offset_right = -1333.0
|
||||
offset_bottom = -61.0
|
||||
|
||||
[node name="item_button" parent="CopyNodes" instance=ExtResource("39_cdkxt")]
|
||||
|
||||
[node name="GameCamera" type="Camera2D" parent="."]
|
||||
anchor_mode = 0
|
||||
position_smoothing_enabled = true
|
||||
script = ExtResource("10_o8l48")
|
||||
max_zoom = 1.1
|
||||
bounds_enabled = true
|
||||
bounds_min = Vector2(-500, -500)
|
||||
bounds_max = Vector2(500, 500)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_m6fch")
|
||||
|
||||
[node name="GameManager" type="Node" parent="."]
|
||||
|
||||
[node name="GameBGMPlayer" type="Node" parent="."]
|
||||
script = ExtResource("28_m6fch")
|
||||
play_mode = 1
|
||||
music_files_list = Array[String](["res://assets/音乐/Anibli&RelaxingPianoMusic-StrollThroughtheSky.ogg", "res://assets/音乐/BanAM-Futatabi.ogg", "res://assets/音乐/MCMZebra-AlwaysandManyTimes.ogg", "res://assets/音乐/MicMusicbox-Ashitakasekki.ogg", "res://assets/音乐/Nemuネム-PromiseoftheWorld.ogg", "res://assets/音乐/α-WaveRelaxationHealingMusicLab-いつも何度でも[「千と千尋の神隠し」より][ピアノ].ogg", "res://assets/音乐/久石让-ふたたび.ogg", "res://assets/音乐/广桥真纪子-いのちの名前(生命之名).ogg", "res://assets/音乐/日本群星-PromiseoftheWorld.ogg"])
|
||||
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/SeedStoreButton" to="." method="_on_open_store_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/SeedWarehouseButton" to="." method="_on_seed_warehouse_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/CropWarehouseButton" to="." method="_on_crop_warehouse_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/ItemStoreButton" to="." method="_on_item_store_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/ItemBagButton" to="." method="_on_item_bag_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/OneClickHarvestButton" to="." method="_on_one_click_harvestbutton_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/OneClickPlantButton" to="." method="_on_one_click_plant_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/AddNewGroundButton" to="." method="_on_add_new_ground_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/VisitVBox/LikeButton" to="." method="_on_like_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/VisitVBox/ReturnMyFarmButton" to="." method="_on_return_my_farm_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/AccountSettingButton" to="." method="_on_account_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/OnlineGiftButton" to="." method="_on_online_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/NewPlayerGiftButton" to="." method="_on_new_player_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/OneClickScreenShot" to="." method="_on_one_click_screen_shot_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/LuckyDrawButton" to="." method="_on_lucky_draw_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/PlayerRankingButton" to="." method="_on_player_ranking_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/DailyCheckInButton" to="." method="_on_daily_check_in_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/ReturnMainMenuButton" to="." method="_on_return_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/SmallGameButton" to="." method="_on_online_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/SettingButton" to="." method="_on_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/WisdomTreeButton" to="." method="_on_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/MyPetButton" to="." method="_on_my_pet_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/ScareCrowButton" to="." method="_on_my_pet_button_pressed"]
|
||||
579
MainGame.tscn166426675922.tmp
Normal file
579
MainGame.tscn166426675922.tmp
Normal file
@@ -0,0 +1,579 @@
|
||||
[gd_scene load_steps=36 format=3 uid="uid://dgh61dttaas5a"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://2pt11sfcaxf7" path="res://MainGame.gd" id="1_v3yaj"]
|
||||
[ext_resource type="Texture2D" uid="uid://du2pyiojliasy" path="res://assets/游戏UI/经验球.webp" id="2_6jgly"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkivlkirrx6u8" path="res://CopyItems/crop_item.tscn" id="3_isiom"]
|
||||
[ext_resource type="Texture2D" uid="uid://ftv231igtdoq" path="res://assets/游戏UI/等级.webp" id="3_y1hsh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqib5y8uwg6hx" path="res://assets/游戏UI/钱币.webp" id="4_ql8k3"]
|
||||
[ext_resource type="Texture2D" uid="uid://waqbwo2r33j3" path="res://assets/游戏UI/小提示.webp" id="5_5b81d"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnhyqsw8yjekh" path="res://assets/游戏UI/体力值图标.webp" id="5_n03md"]
|
||||
[ext_resource type="Texture2D" uid="uid://cj0qac0wmm0q8" path="res://assets/游戏UI/点赞图标.webp" id="6_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpxiaqh0y6a5d" path="res://Network/TCPNetworkManager.tscn" id="7_401ut"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3pev0nbt8sjd" path="res://assets/游戏UI/玩家昵称.webp" id="7_n03md"]
|
||||
[ext_resource type="Texture2D" uid="uid://cxm72d5t4dn0q" path="res://assets/游戏UI/农场名称.webp" id="8_uhubb"]
|
||||
[ext_resource type="Texture2D" uid="uid://b665dc0ye72lg" path="res://assets/游戏UI/服务器连接状态.webp" id="9_uc6q1"]
|
||||
[ext_resource type="Script" uid="uid://c7bxje0wvvgo4" path="res://game_camera.gd" id="10_o8l48"]
|
||||
[ext_resource type="Texture2D" uid="uid://dsuaw8kcdtrst" path="res://assets/游戏UI/FPS图标.webp" id="10_uhubb"]
|
||||
[ext_resource type="Texture2D" uid="uid://bso5fyjavdien" path="res://assets/游戏UI/玩家数图标.webp" id="10_vygm6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbhitturvihqj" path="res://GUI/LoginPanel.tscn" id="11_6jgly"]
|
||||
[ext_resource type="PackedScene" uid="uid://dckc8nrn7p425" path="res://GUI/LandPanel.tscn" id="12_y1hsh"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpiy0aim20n2h" path="res://Scene/SmallPanel/OnlineGiftPanel.tscn" id="14_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://4rwitowdt4h" path="res://Scene/SmallPanel/OneClickPlantPanel.tscn" id="15_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://btp1h6hic2sin" path="res://GUI/AcceptDialog.tscn" id="16_0igvr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbfqu87627yg6" path="res://Scene/BigPanel/PlayerRankingPanel.tscn" id="16_n03md"]
|
||||
[ext_resource type="Script" uid="uid://dckw8dskfbnkp" path="res://background.gd" id="17_0igvr"]
|
||||
[ext_resource type="PackedScene" uid="uid://bndf1e4sgdjr6" path="res://GUI/LuckyDrawPanel.tscn" id="17_f21le"]
|
||||
[ext_resource type="PackedScene" uid="uid://hesp70n3ondo" path="res://Scene/BigPanel/CropStorePanel.tscn" id="17_ql8k3"]
|
||||
[ext_resource type="PackedScene" uid="uid://drw18a6mcr2of" path="res://Scene/BigPanel/CropWarehousePanel.tscn" id="18_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://smypui0vyso5" path="res://GUI/DailyCheckInPanel.tscn" id="18_m6fch"]
|
||||
[ext_resource type="PackedScene" uid="uid://bseuwniienrqy" path="res://Scene/BigPanel/PlayerBagPanel.tscn" id="19_8kysg"]
|
||||
[ext_resource type="PackedScene" uid="uid://cehw5sx5pgmmc" path="res://Scene/BigPanel/ItemBagPanel.tscn" id="20_n03md"]
|
||||
[ext_resource type="Script" uid="uid://mtfp0ct42nrx" path="res://GUI/CropStorePanel.gd" id="21_5b81d"]
|
||||
[ext_resource type="PackedScene" uid="uid://j4ft87o7jk14" path="res://Scene/BigPanel/ItemStorePanel.tscn" id="21_uhubb"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3i0l6ysrde6o" path="res://Scene/SmallPanel/AccountSettingPanel.tscn" id="26_uc6q1"]
|
||||
[ext_resource type="PackedScene" uid="uid://d1lu2yg4xl382" path="res://Scene/SmallPanel/LoadProgressPanel.tscn" id="27_vygm6"]
|
||||
[ext_resource type="Script" uid="uid://ca2chgx5w3g1y" path="res://Components/GameBGMPlayer.gd" id="28_m6fch"]
|
||||
[ext_resource type="PackedScene" uid="uid://ibl5wbbw3pwc" path="res://CopyItems/item_button.tscn" id="39_cdkxt"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_m6fch"]
|
||||
background_mode = 3
|
||||
ambient_light_energy = 0.0
|
||||
glow_enabled = true
|
||||
glow_bloom = 0.3
|
||||
glow_blend_mode = 0
|
||||
|
||||
[node name="main" type="Node"]
|
||||
script = ExtResource("1_v3yaj")
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="GUI" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="GameInfoHBox1" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 35.0
|
||||
|
||||
[node name="experience_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
self_modulate = Color(0.498039, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_6jgly")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="experience" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "经验:999"
|
||||
|
||||
[node name="level_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_y1hsh")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="level" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "等级:100"
|
||||
|
||||
[node name="money_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_ql8k3")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="money" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "钱币:999"
|
||||
|
||||
[node name="hungervalue_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_n03md")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="hunger_value" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
modulate = Color(0.88617, 0.748355, 0.764238, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "体力值:20"
|
||||
|
||||
[node name="like_image" type="TextureRect" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_8kysg")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="like" type="Label" parent="UI/GUI/GameInfoHBox1"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.992157, 0.482353, 0.482353, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0.372549, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "点赞数:0"
|
||||
|
||||
[node name="GameInfoHBox2" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_top = 35.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 70.0
|
||||
|
||||
[node name="player_name_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("7_n03md")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="player_name" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
modulate = Color(1, 0.670588, 0.490196, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "玩家昵称:树萌芽"
|
||||
|
||||
[node name="farm_name_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("8_uhubb")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="farm_name" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
modulate = Color(1, 0.858824, 0.623529, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "农场名称:树萌芽的农场"
|
||||
|
||||
[node name="status_label_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("9_uc6q1")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "服务器状态:正在检测中"
|
||||
|
||||
[node name="FPS_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("10_uhubb")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="FPS" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.68755, 0.948041, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "FPS:0"
|
||||
|
||||
[node name="onlineplayer_image" type="TextureRect" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("10_vygm6")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="onlineplayer" type="Label" parent="UI/GUI/GameInfoHBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.423529, 1, 0.533333, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "检测中..."
|
||||
|
||||
[node name="GameInfoHBox3" type="HBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_top = 70.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 105.0
|
||||
|
||||
[node name="tip_image" type="TextureRect" parent="UI/GUI/GameInfoHBox3"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_5b81d")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="tip" type="Label" parent="UI/GUI/GameInfoHBox3"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.564706, 1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "游戏小提示"
|
||||
|
||||
[node name="FarmVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 263.0
|
||||
offset_right = 252.0
|
||||
offset_bottom = 795.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="SeedStoreButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.564706, 0.647059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种子商店"
|
||||
|
||||
[node name="SeedWarehouseButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种子仓库"
|
||||
|
||||
[node name="CropWarehouseButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.772549, 0.219608, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "作物仓库"
|
||||
|
||||
[node name="ItemStoreButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.231373, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "道具商店"
|
||||
|
||||
[node name="ItemBagButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.639216, 0.984314, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "道具背包"
|
||||
|
||||
[node name="OneClickHarvestButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.841258, 0.700703, 0.325362, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键收获"
|
||||
|
||||
[node name="OneClickPlantButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(0.513945, 0.818793, 3.85046e-07, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键种植"
|
||||
|
||||
[node name="AddNewGroundButton" type="Button" parent="UI/GUI/FarmVBox"]
|
||||
modulate = Color(1, 0.803922, 0.729412, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "添加新土地"
|
||||
|
||||
[node name="VisitVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 115.0
|
||||
offset_right = 252.0
|
||||
offset_bottom = 245.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="LikeButton" type="Button" parent="UI/GUI/VisitVBox"]
|
||||
modulate = Color(0.992157, 0.482353, 0.482353, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "点赞"
|
||||
|
||||
[node name="ReturnMyFarmButton" type="Button" parent="UI/GUI/VisitVBox"]
|
||||
modulate = Color(1, 1, 0.721569, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "返回我的农场"
|
||||
|
||||
[node name="OtherVBox" type="VBoxContainer" parent="UI/GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 1198.0
|
||||
offset_top = 77.0
|
||||
offset_right = 1446.0
|
||||
offset_bottom = 408.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
alignment = 2
|
||||
|
||||
[node name="AccountSettingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.843137, 0.772549, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "账户设置"
|
||||
|
||||
[node name="OnlineGiftButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(1, 0.615686, 0.447059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "在线礼包"
|
||||
|
||||
[node name="NewPlayerGiftButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(1, 1, 0.447059, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "新手礼包"
|
||||
|
||||
[node name="OneClickScreenShot" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.407843, 0.796078, 0.996078, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "一键截图"
|
||||
|
||||
[node name="LuckyDrawButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.729412, 0.764706, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "幸运抽奖"
|
||||
|
||||
[node name="PlayerRankingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.717647, 1, 0.576471, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "玩家排行榜"
|
||||
|
||||
[node name="DailyCheckInButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.807843, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "每日签到"
|
||||
|
||||
[node name="ReturnMainMenuButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
modulate = Color(0.639216, 0.482353, 0.870588, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "返回主菜单"
|
||||
|
||||
[node name="SmallGameButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.513726, 0.615686, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "游玩小游戏"
|
||||
|
||||
[node name="SettingButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.345098, 0.764706, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "设置"
|
||||
|
||||
[node name="WisdomTreeButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.345098, 0.764706, 0.611765, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "智慧树"
|
||||
|
||||
[node name="MyPetButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.992157, 0.482353, 0.870588, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "我的宠物"
|
||||
|
||||
[node name="ScareCrowButton" type="Button" parent="UI/GUI/OtherVBox"]
|
||||
visible = false
|
||||
modulate = Color(0.937381, 0.612088, 0.36654, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "稻草人"
|
||||
|
||||
[node name="BigPanel" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="LuckyDrawPanel" parent="UI/BigPanel" instance=ExtResource("17_f21le")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_right = 1042.0
|
||||
|
||||
[node name="DailyCheckInPanel" parent="UI/BigPanel" instance=ExtResource("18_m6fch")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_top = 3.0
|
||||
offset_right = 1042.0
|
||||
offset_bottom = 723.0
|
||||
|
||||
[node name="TCPNetworkManagerPanel" parent="UI/BigPanel" instance=ExtResource("7_401ut")]
|
||||
visible = false
|
||||
offset_left = 2.00012
|
||||
offset_top = 143.0
|
||||
offset_right = 2.00012
|
||||
offset_bottom = 143.0
|
||||
scale = Vector2(0.7, 0.7)
|
||||
|
||||
[node name="ItemStorePanel" parent="UI/BigPanel" instance=ExtResource("21_uhubb")]
|
||||
|
||||
[node name="ItemBagPanel" parent="UI/BigPanel" instance=ExtResource("20_n03md")]
|
||||
|
||||
[node name="PlayerBagPanel" parent="UI/BigPanel" instance=ExtResource("19_8kysg")]
|
||||
|
||||
[node name="CropWarehousePanel" parent="UI/BigPanel" instance=ExtResource("18_5b81d")]
|
||||
|
||||
[node name="CropStorePanel" parent="UI/BigPanel" instance=ExtResource("17_ql8k3")]
|
||||
script = ExtResource("21_5b81d")
|
||||
|
||||
[node name="PlayerRankingPanel" parent="UI/BigPanel" instance=ExtResource("16_n03md")]
|
||||
|
||||
[node name="LoginPanel" parent="UI/BigPanel" instance=ExtResource("11_6jgly")]
|
||||
|
||||
[node name="SmallPanel" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="LandPanel" parent="UI/SmallPanel" instance=ExtResource("12_y1hsh")]
|
||||
visible = false
|
||||
offset_left = 442.0
|
||||
offset_top = 77.0
|
||||
offset_right = 958.0
|
||||
offset_bottom = 548.0
|
||||
|
||||
[node name="LoadProgressPanel" parent="UI/SmallPanel" instance=ExtResource("27_vygm6")]
|
||||
|
||||
[node name="AccountSettingPanel" parent="UI/SmallPanel" instance=ExtResource("26_uc6q1")]
|
||||
|
||||
[node name="OneClickPlantPanel" parent="UI/SmallPanel" instance=ExtResource("15_8kysg")]
|
||||
|
||||
[node name="OnlineGiftPanel" parent="UI/SmallPanel" instance=ExtResource("14_5b81d")]
|
||||
|
||||
[node name="DiaLog" type="Control" parent="UI"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="AcceptDialog" parent="UI/DiaLog" instance=ExtResource("16_0igvr")]
|
||||
visible = false
|
||||
|
||||
[node name="BackgroundUI" type="CanvasLayer" parent="."]
|
||||
layer = -1
|
||||
|
||||
[node name="BackgroundSwitcher" type="Sprite2D" parent="BackgroundUI"]
|
||||
self_modulate = Color(0.5, 0.5, 0.5, 1)
|
||||
show_behind_parent = true
|
||||
z_index = -100
|
||||
z_as_relative = false
|
||||
position = Vector2(703, 360)
|
||||
scale = Vector2(0.92, 0.92)
|
||||
script = ExtResource("17_0igvr")
|
||||
|
||||
[node name="Background2" type="Sprite2D" parent="BackgroundUI/BackgroundSwitcher"]
|
||||
self_modulate = Color(0.5, 0.5, 0.5, 1)
|
||||
|
||||
[node name="Timer" type="Timer" parent="BackgroundUI/BackgroundSwitcher"]
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="."]
|
||||
z_as_relative = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
offset_left = -2.0
|
||||
offset_top = 2.0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 722.0
|
||||
columns = 10
|
||||
|
||||
[node name="CopyNodes" type="Node2D" parent="."]
|
||||
position = Vector2(-1000, 0)
|
||||
|
||||
[node name="CropItem" parent="CopyNodes" instance=ExtResource("3_isiom")]
|
||||
z_index = 2
|
||||
z_as_relative = false
|
||||
offset_left = -1433.0
|
||||
offset_top = -161.0
|
||||
offset_right = -1333.0
|
||||
offset_bottom = -61.0
|
||||
|
||||
[node name="item_button" parent="CopyNodes" instance=ExtResource("39_cdkxt")]
|
||||
|
||||
[node name="GameCamera" type="Camera2D" parent="."]
|
||||
anchor_mode = 0
|
||||
position_smoothing_enabled = true
|
||||
script = ExtResource("10_o8l48")
|
||||
max_zoom = 1.1
|
||||
bounds_enabled = true
|
||||
bounds_min = Vector2(-500, -500)
|
||||
bounds_max = Vector2(500, 500)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_m6fch")
|
||||
|
||||
[node name="GameManager" type="Node" parent="."]
|
||||
|
||||
[node name="GameBGMPlayer" type="Node" parent="."]
|
||||
script = ExtResource("28_m6fch")
|
||||
play_mode = 1
|
||||
music_files_list = Array[String](["res://assets/音乐/Anibli&RelaxingPianoMusic-StrollThroughtheSky.ogg", "res://assets/音乐/BanAM-Futatabi.ogg", "res://assets/音乐/MCMZebra-AlwaysandManyTimes.ogg", "res://assets/音乐/MicMusicbox-Ashitakasekki.ogg", "res://assets/音乐/Nemuネム-PromiseoftheWorld.ogg", "res://assets/音乐/α-WaveRelaxationHealingMusicLab-いつも何度でも[「千と千尋の神隠し」より][ピアノ].ogg", "res://assets/音乐/久石让-ふたたび.ogg", "res://assets/音乐/广桥真纪子-いのちの名前(生命之名).ogg", "res://assets/音乐/日本群星-PromiseoftheWorld.ogg"])
|
||||
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/SeedStoreButton" to="." method="_on_open_store_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/SeedWarehouseButton" to="." method="_on_seed_warehouse_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/CropWarehouseButton" to="." method="_on_crop_warehouse_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/ItemStoreButton" to="." method="_on_item_store_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/ItemBagButton" to="." method="_on_item_bag_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/OneClickHarvestButton" to="." method="_on_one_click_harvestbutton_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/OneClickPlantButton" to="." method="_on_one_click_plant_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/FarmVBox/AddNewGroundButton" to="." method="_on_add_new_ground_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/VisitVBox/LikeButton" to="." method="_on_like_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/VisitVBox/ReturnMyFarmButton" to="." method="_on_return_my_farm_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/AccountSettingButton" to="." method="_on_account_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/OnlineGiftButton" to="." method="_on_online_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/NewPlayerGiftButton" to="." method="_on_new_player_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/OneClickScreenShot" to="." method="_on_one_click_screen_shot_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/LuckyDrawButton" to="." method="_on_lucky_draw_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/PlayerRankingButton" to="." method="_on_player_ranking_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/DailyCheckInButton" to="." method="_on_daily_check_in_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/ReturnMainMenuButton" to="." method="_on_return_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/SmallGameButton" to="." method="_on_online_gift_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/SettingButton" to="." method="_on_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/WisdomTreeButton" to="." method="_on_setting_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/MyPetButton" to="." method="_on_my_pet_button_pressed"]
|
||||
[connection signal="pressed" from="UI/GUI/OtherVBox/ScareCrowButton" to="." method="_on_my_pet_button_pressed"]
|
||||
@@ -1,7 +1,6 @@
|
||||
extends Panel
|
||||
|
||||
# TCP客户端演示
|
||||
# 这个脚本展示如何在UI中使用TCPClient类
|
||||
# TCP客户端通信处理
|
||||
|
||||
# UI组件引用
|
||||
@onready var status_label = $StatusLabel
|
||||
@@ -9,19 +8,27 @@ extends Panel
|
||||
@onready var send_button = $SendButton
|
||||
@onready var response_label = $Scroll/ResponseLabel
|
||||
@onready var connection_button = $ConnectionButton
|
||||
@onready var login_panel = $"/root/main/UI/LoginPanel"
|
||||
|
||||
#所有面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
@onready var wisdom_tree_panel: Panel = $'../../SmallPanel/WisdomTreePanel'
|
||||
|
||||
|
||||
|
||||
# TCP客户端
|
||||
var client: TCPClient = TCPClient.new()
|
||||
|
||||
# 服务器配置 - 支持多个服务器地址
|
||||
var server_configs = [
|
||||
{"host": "127.0.0.1", "port": 4040, "name": "本地"},
|
||||
#{"host": "192.168.1.110", "port": 4040, "name": "局域网"},
|
||||
#{"host": "47.108.90.0", "port": 4040, "name": "成都内网穿透"}#成都内网穿透
|
||||
#{"host": "47.108.90.0", "port": 6060, "name": "成都公网"}#成都服务器
|
||||
]
|
||||
var server_configs = GlobalVariables.server_configs
|
||||
|
||||
var current_server_index = 0
|
||||
var auto_retry = true
|
||||
@@ -60,11 +67,6 @@ func _ready():
|
||||
response_label.text = "等待响应..."
|
||||
connection_button.text = "连接"
|
||||
|
||||
# 初始化延迟测量变量
|
||||
current_ping = -1
|
||||
is_measuring_ping = false
|
||||
ping_timer = 0.0
|
||||
|
||||
# 每帧检查连接状态和超时
|
||||
func _process(delta):
|
||||
# 检查连接超时
|
||||
@@ -132,6 +134,9 @@ func _on_connected():
|
||||
# 连接成功后立即请求在线人数
|
||||
sendGetOnlinePlayers()
|
||||
|
||||
# 请求智慧树配置
|
||||
send_get_wisdom_tree_config()
|
||||
|
||||
# 立即开始第一次ping测量
|
||||
send_ping()
|
||||
|
||||
@@ -281,6 +286,59 @@ func _on_data_received(data):
|
||||
Toast.show(message, Color.GREEN)
|
||||
else:
|
||||
Toast.show(message, Color.RED)
|
||||
"buy_pet":#处理购买宠物响应
|
||||
if success:
|
||||
# 更新玩家数据
|
||||
if updated_data.has("money"):
|
||||
main_game.money = updated_data["money"]
|
||||
if updated_data.has("宠物背包"):
|
||||
main_game.pet_bag = updated_data["宠物背包"]
|
||||
|
||||
# 更新UI
|
||||
main_game._update_ui()
|
||||
if main_game.pet_bag_panel:
|
||||
main_game.pet_bag_panel.update_pet_bag_ui()
|
||||
Toast.show(message, Color.MAGENTA)
|
||||
else:
|
||||
Toast.show(message, Color.RED)
|
||||
"rename_pet":#处理重命名宠物响应
|
||||
if success:
|
||||
# 更新玩家数据
|
||||
if updated_data.has("宠物背包"):
|
||||
main_game.pet_bag = updated_data["宠物背包"]
|
||||
|
||||
# 更新UI
|
||||
if main_game.pet_bag_panel:
|
||||
main_game.pet_bag_panel.update_pet_bag_ui()
|
||||
|
||||
# 通知宠物信息面板更新
|
||||
var pet_inform_panel = get_node_or_null("/root/main/BigPanel/SmallPanel/PetInformPanel")
|
||||
if pet_inform_panel and pet_inform_panel.has_method("on_rename_pet_success"):
|
||||
var pet_id = data.get("pet_id", "")
|
||||
var new_name = data.get("new_name", "")
|
||||
pet_inform_panel.on_rename_pet_success(pet_id, new_name)
|
||||
|
||||
Toast.show(message, Color.GREEN)
|
||||
else:
|
||||
Toast.show(message, Color.RED)
|
||||
"set_patrol_pet":#处理设置巡逻宠物响应
|
||||
if success:
|
||||
# 更新巡逻宠物数据
|
||||
if updated_data.has("巡逻宠物"):
|
||||
main_game.patrol_pets = updated_data["巡逻宠物"]
|
||||
|
||||
# 更新巡逻宠物显示
|
||||
if main_game.has_method("update_patrol_pets"):
|
||||
main_game.update_patrol_pets()
|
||||
|
||||
# 更新巡逻按钮状态
|
||||
var pet_inform_panel = get_node_or_null("/root/main/BigPanel/SmallPanel/PetInformPanel")
|
||||
if pet_inform_panel and pet_inform_panel.has_method("_refresh_patrol_button"):
|
||||
pet_inform_panel._refresh_patrol_button()
|
||||
|
||||
Toast.show(message, Color.GREEN)
|
||||
else:
|
||||
Toast.show(message, Color.RED)
|
||||
"use_item":#处理使用道具响应
|
||||
print("调试:收到道具使用响应")
|
||||
print(" - success: ", success)
|
||||
@@ -425,6 +483,9 @@ func _on_data_received(data):
|
||||
"crop_data_response": #作物数据更新响应
|
||||
if main_game and main_game.has_method("_handle_crop_data_response"):
|
||||
main_game._handle_crop_data_response(data)
|
||||
"item_config_response": #道具配置数据响应
|
||||
if main_game and main_game.has_method("_handle_item_config_response"):
|
||||
main_game._handle_item_config_response(data)
|
||||
"visit_player_response": #访问玩家响应
|
||||
if main_game and main_game.has_method("_handle_visit_player_response"):
|
||||
main_game._handle_visit_player_response(data)
|
||||
@@ -466,6 +527,51 @@ func _on_data_received(data):
|
||||
"refresh_player_info_response": #刷新玩家信息响应
|
||||
if main_game and main_game.has_method("_handle_account_setting_response"):
|
||||
main_game._handle_account_setting_response(data)
|
||||
"steal_caught": #偷菜被发现响应
|
||||
if main_game and main_game.has_method("_handle_steal_caught_response"):
|
||||
main_game._handle_steal_caught_response(data)
|
||||
"global_broadcast_message": #全服大喇叭消息
|
||||
if main_game and main_game.has_method("_handle_global_broadcast_message"):
|
||||
main_game._handle_global_broadcast_message(data)
|
||||
"global_broadcast_response": #全服大喇叭发送响应
|
||||
if main_game and main_game.has_method("_handle_global_broadcast_response"):
|
||||
main_game._handle_global_broadcast_response(data)
|
||||
"broadcast_history_response": #全服大喇叭历史消息响应
|
||||
if main_game and main_game.has_method("_handle_broadcast_history_response"):
|
||||
main_game._handle_broadcast_history_response(data)
|
||||
"use_pet_item_response": #宠物使用道具响应
|
||||
if main_game and main_game.has_method("_handle_use_pet_item_response"):
|
||||
main_game._handle_use_pet_item_response(data)
|
||||
"use_farm_item_response": #农场道具使用响应
|
||||
if main_game and main_game.has_method("_handle_use_farm_item_response"):
|
||||
main_game._handle_use_farm_item_response(data)
|
||||
"buy_scare_crow_response": #购买稻草人响应
|
||||
if main_game and main_game.has_method("_handle_buy_scare_crow_response"):
|
||||
main_game._handle_buy_scare_crow_response(data)
|
||||
"modify_scare_crow_config_response": #修改稻草人配置响应
|
||||
if main_game and main_game.has_method("_handle_modify_scare_crow_config_response"):
|
||||
main_game._handle_modify_scare_crow_config_response(data)
|
||||
"get_scare_crow_config_response": #获取稻草人配置响应
|
||||
if main_game and main_game.has_method("_handle_get_scare_crow_config_response"):
|
||||
main_game._handle_get_scare_crow_config_response(data)
|
||||
"wisdom_tree_operation_response": #智慧树操作响应
|
||||
var success = data.get("success", false)
|
||||
var message = data.get("message", "")
|
||||
var operation_type = data.get("operation_type", "")
|
||||
var updated_data = data.get("updated_data", {})
|
||||
|
||||
if wisdom_tree_panel and wisdom_tree_panel.has_method("handle_wisdom_tree_operation_response"):
|
||||
wisdom_tree_panel.handle_wisdom_tree_operation_response(success, message, operation_type, updated_data)
|
||||
"wisdom_tree_message_response": #智慧树消息发送响应
|
||||
var success = data.get("success", false)
|
||||
var message = data.get("message", "")
|
||||
var updated_data = data.get("updated_data", {})
|
||||
|
||||
if wisdom_tree_panel and wisdom_tree_panel.has_method("handle_wisdom_tree_message_response"):
|
||||
wisdom_tree_panel.handle_wisdom_tree_message_response(success, message, updated_data)
|
||||
"wisdom_tree_config_response": #智慧树配置响应
|
||||
if main_game and main_game.has_method("_handle_wisdom_tree_config_response"):
|
||||
main_game._handle_wisdom_tree_config_response(data)
|
||||
_:
|
||||
# 显示其他类型的消息
|
||||
return
|
||||
@@ -603,19 +709,20 @@ func sendRemoveCrop(lot_index):
|
||||
return true
|
||||
|
||||
#发送购买种子信息
|
||||
func sendBuySeed(crop_name):
|
||||
func sendBuySeed(crop_name, quantity = 1):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "buy_seed",
|
||||
"crop_name": crop_name,
|
||||
"quantity": quantity,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送购买道具信息
|
||||
func sendBuyItem(item_name, item_cost):
|
||||
func sendBuyItem(item_name, item_cost, quantity = 1):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
@@ -623,6 +730,59 @@ func sendBuyItem(item_name, item_cost):
|
||||
"type": "buy_item",
|
||||
"item_name": item_name,
|
||||
"item_cost": item_cost,
|
||||
"quantity": quantity,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送购买宠物信息
|
||||
func sendBuyPet(pet_name, pet_cost):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "buy_pet",
|
||||
"pet_name": pet_name,
|
||||
"pet_cost": pet_cost,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送重命名宠物信息
|
||||
func sendRenamePet(pet_id, new_name):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "rename_pet",
|
||||
"pet_id": pet_id,
|
||||
"new_name": new_name,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送设置巡逻宠物信息
|
||||
func sendSetPatrolPet(pet_id, is_patrolling):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "set_patrol_pet",
|
||||
"pet_id": pet_id,
|
||||
"is_patrolling": is_patrolling,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送设置出战宠物信息
|
||||
func sendSetBattlePet(pet_id, is_battle):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "set_battle_pet",
|
||||
"pet_id": pet_id,
|
||||
"is_battle": is_battle,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
@@ -631,8 +791,8 @@ func sendBuyItem(item_name, item_cost):
|
||||
func sendUseItem(lot_index, item_name, use_type, target_username = ""):
|
||||
|
||||
if not client.is_client_connected():
|
||||
print("错误:客户端未连接")
|
||||
return false
|
||||
|
||||
var message = {
|
||||
"type": "use_item",
|
||||
"lot_index": lot_index,
|
||||
@@ -713,6 +873,16 @@ func sendGetCropData():
|
||||
})
|
||||
return true
|
||||
|
||||
#发送获取道具配置数据请求
|
||||
func sendGetItemConfig():
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "request_item_config"
|
||||
})
|
||||
return true
|
||||
|
||||
#发送访问玩家请求
|
||||
func sendVisitPlayer(target_username):
|
||||
if not client.is_client_connected():
|
||||
@@ -876,6 +1046,78 @@ func sendClaimOnlineGift(gift_name: String):
|
||||
})
|
||||
return true
|
||||
|
||||
#发送购买稻草人请求
|
||||
func send_buy_scare_crow(scare_crow_type: String, price: int):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "buy_scare_crow",
|
||||
"scare_crow_type": scare_crow_type,
|
||||
"price": price,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送修改稻草人配置请求
|
||||
func send_modify_scare_crow_config(config_data: Dictionary, modify_cost: int):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "modify_scare_crow_config",
|
||||
"config_data": config_data,
|
||||
"modify_cost": modify_cost,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送获取稻草人配置请求
|
||||
func send_get_scare_crow_config():
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "get_scare_crow_config",
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送智慧树操作请求
|
||||
func send_wisdom_tree_operation(operation_type: String):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "wisdom_tree_operation",
|
||||
"operation_type": operation_type,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送智慧树消息
|
||||
func send_wisdom_tree_message(message: String):
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "wisdom_tree_message",
|
||||
"message": message,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#发送获取智慧树配置请求
|
||||
func send_get_wisdom_tree_config():
|
||||
if not client.is_client_connected():
|
||||
return false
|
||||
|
||||
client.send_data({
|
||||
"type": "get_wisdom_tree_config",
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
})
|
||||
return true
|
||||
|
||||
#检查是否连接到服务器
|
||||
func is_connected_to_server():
|
||||
return client.is_client_connected()
|
||||
|
||||
167
Scene/BigPanel/CropStorePanel.tscn
Normal file
167
Scene/BigPanel/CropStorePanel.tscn
Normal file
@@ -0,0 +1,167 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://hesp70n3ondo"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://mtfp0ct42nrx" path="res://Script/BigPanel/CropStorePanel.gd" id="1_ehof8"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 5
|
||||
shadow_size = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
corner_detail = 20
|
||||
|
||||
[node name="CropStorePanel" type="Panel"]
|
||||
offset_left = 79.0
|
||||
offset_top = 70.0
|
||||
offset_right = 1598.0
|
||||
offset_bottom = 790.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
|
||||
script = ExtResource("1_ehof8")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -101.0
|
||||
offset_top = -87.0
|
||||
offset_right = 1655.0
|
||||
offset_bottom = 811.0
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1519.0
|
||||
offset_bottom = 69.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 0.964706, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 5
|
||||
theme_override_constants/shadow_offset_y = 5
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "种子商店"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SortContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 78.0
|
||||
offset_right = 1519.0
|
||||
offset_bottom = 141.0
|
||||
alignment = 1
|
||||
|
||||
[node name="FilterLabel" type="Label" parent="SortContainer"]
|
||||
self_modulate = Color(0.607843, 0.647059, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "筛选:"
|
||||
|
||||
[node name="Sort_All" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "全部"
|
||||
|
||||
[node name="Sort_Common" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "普通"
|
||||
|
||||
[node name="Sort_Superior" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "优良"
|
||||
|
||||
[node name="Sort_Rare" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "稀有"
|
||||
|
||||
[node name="Sort_Epic" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "史诗"
|
||||
|
||||
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "传奇"
|
||||
|
||||
[node name="SortLabel" type="Label" parent="SortContainer"]
|
||||
self_modulate = Color(0.607843, 0.647059, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "排序:"
|
||||
|
||||
[node name="Sort_Price" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按价格"
|
||||
|
||||
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按生长时间"
|
||||
|
||||
[node name="Sort_Profit" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按收益"
|
||||
|
||||
[node name="Sort_Level" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按等级"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 13.0
|
||||
offset_top = 144.0
|
||||
offset_right = 3727.0
|
||||
offset_bottom = 1551.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
|
||||
horizontal_scroll_mode = 0
|
||||
vertical_scroll_mode = 2
|
||||
scroll_deadzone = -10
|
||||
|
||||
[node name="Crop_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1438.75
|
||||
offset_top = 11.25
|
||||
offset_right = 1498.75
|
||||
offset_bottom = 74.25
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 13.0
|
||||
offset_top = 11.0
|
||||
offset_right = 101.0
|
||||
offset_bottom = 74.0
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
166
Scene/BigPanel/CropWarehousePanel.tscn
Normal file
166
Scene/BigPanel/CropWarehousePanel.tscn
Normal file
@@ -0,0 +1,166 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://drw18a6mcr2of"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ptdj0qmobihd" path="res://Script/BigPanel/CropWarehousePanel.gd" id="1_24g1t"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 5
|
||||
shadow_size = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
corner_detail = 20
|
||||
|
||||
[node name="CropWarehousePanel" type="Panel"]
|
||||
visible = false
|
||||
offset_left = 58.0
|
||||
offset_top = 77.0
|
||||
offset_right = 1624.0
|
||||
offset_bottom = 797.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
|
||||
script = ExtResource("1_24g1t")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -72.0
|
||||
offset_top = -95.0
|
||||
offset_right = 1678.0
|
||||
offset_bottom = 804.0
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 55.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 0.964706, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "作物仓库"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SortContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 58.0
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 121.0
|
||||
alignment = 1
|
||||
|
||||
[node name="FilterLabel" type="Label" parent="SortContainer"]
|
||||
self_modulate = Color(0.607843, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "筛选:"
|
||||
|
||||
[node name="Sort_All" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "全部"
|
||||
|
||||
[node name="Sort_Common" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "普通"
|
||||
|
||||
[node name="Sort_Superior" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "优良"
|
||||
|
||||
[node name="Sort_Rare" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "稀有"
|
||||
|
||||
[node name="Sort_Epic" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "史诗"
|
||||
|
||||
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "传奇"
|
||||
|
||||
[node name="SortLabel" type="Label" parent="SortContainer"]
|
||||
self_modulate = Color(0.607843, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "排序:"
|
||||
|
||||
[node name="Sort_Price" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按价格"
|
||||
|
||||
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按生长时间"
|
||||
|
||||
[node name="Sort_Profit" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按收益"
|
||||
|
||||
[node name="Sort_Level" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按等级"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 9.0
|
||||
offset_top = 121.0
|
||||
offset_right = 3890.0
|
||||
offset_bottom = 1588.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
|
||||
horizontal_scroll_mode = 0
|
||||
vertical_scroll_mode = 2
|
||||
scroll_deadzone = -10
|
||||
|
||||
[node name="Warehouse_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1495.0
|
||||
offset_top = 12.5
|
||||
offset_right = 1555.0
|
||||
offset_bottom = 75.5
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 12.5001
|
||||
offset_top = 12.5
|
||||
offset_right = 100.5
|
||||
offset_bottom = 75.5
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://smypui0vyso5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c0jfbtkh0mj5b" path="res://GUI/DailyCheckInPanel.gd" id="1_fj7a7"]
|
||||
[ext_resource type="Script" uid="uid://c0jfbtkh0mj5b" path="res://Script/BigPanel/DailyCheckInPanel.gd" id="1_fj7a7"]
|
||||
|
||||
[node name="DailyCheckInPanel" type="Panel"]
|
||||
offset_right = 600.0
|
||||
89
Scene/BigPanel/ItemBagPanel.tscn
Normal file
89
Scene/BigPanel/ItemBagPanel.tscn
Normal file
@@ -0,0 +1,89 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cehw5sx5pgmmc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b701r833vse3u" path="res://Script/BigPanel/ItemBagPanel.gd" id="1_ixe68"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n03md"]
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[node name="ItemBagPanel" type="Panel"]
|
||||
offset_left = 69.0
|
||||
offset_top = 56.0
|
||||
offset_right = 1635.0
|
||||
offset_bottom = 836.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n03md")
|
||||
script = ExtResource("1_ixe68")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -90.0
|
||||
offset_top = -71.0
|
||||
offset_right = 1672.0
|
||||
offset_bottom = 831.0
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 28.0
|
||||
offset_top = 95.0
|
||||
offset_right = 3805.0
|
||||
offset_bottom = 1723.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Bag_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 69.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 1, 0.807843, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 4
|
||||
theme_override_constants/shadow_offset_y = 4
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "道具背包"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1478.75
|
||||
offset_top = 20.0
|
||||
offset_right = 1538.75
|
||||
offset_bottom = 83.0
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 27.5
|
||||
offset_top = 16.25
|
||||
offset_right = 115.5
|
||||
offset_bottom = 79.25
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
|
||||
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
90
Scene/BigPanel/ItemStorePanel.tscn
Normal file
90
Scene/BigPanel/ItemStorePanel.tscn
Normal file
@@ -0,0 +1,90 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://j4ft87o7jk14"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bruqwi63myl1m" path="res://Script/BigPanel/ItemStorePanel.gd" id="1_vx1qn"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n03md"]
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[node name="ItemStorePanel" type="Panel"]
|
||||
visible = false
|
||||
offset_left = 58.0
|
||||
offset_top = 79.0
|
||||
offset_right = 1598.0
|
||||
offset_bottom = 799.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n03md")
|
||||
script = ExtResource("1_vx1qn")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -184.0
|
||||
offset_top = -100.0
|
||||
offset_right = 1571.0
|
||||
offset_bottom = 804.0
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 15.0
|
||||
offset_top = 88.0
|
||||
offset_right = 3799.0
|
||||
offset_bottom = 1626.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Store_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1540.0
|
||||
offset_bottom = 75.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 1, 0.807843, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 4
|
||||
theme_override_constants/shadow_offset_y = 4
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "道具商店"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1457.5
|
||||
offset_top = 13.75
|
||||
offset_right = 1517.5
|
||||
offset_bottom = 76.75
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 12.5
|
||||
offset_top = 12.5
|
||||
offset_right = 100.5
|
||||
offset_bottom = 75.5
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
@@ -1,12 +1,12 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cbhitturvihqj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cka0r4g8tbf0" path="res://GUI/LoginPanel.gd" id="1_xnwaq"]
|
||||
[ext_resource type="Script" uid="uid://cka0r4g8tbf0" path="res://Script/BigPanel/LoginPanel.gd" id="1_xnwaq"]
|
||||
|
||||
[node name="LoginPanel" type="PanelContainer"]
|
||||
offset_left = 449.0
|
||||
offset_top = 77.0
|
||||
offset_right = 952.0
|
||||
offset_bottom = 550.0
|
||||
offset_left = 343.0
|
||||
offset_top = 36.0
|
||||
offset_right = 1071.0
|
||||
offset_bottom = 667.0
|
||||
script = ExtResource("1_xnwaq")
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="."]
|
||||
@@ -21,7 +21,7 @@ theme_override_constants/shadow_offset_x = 5
|
||||
theme_override_constants/shadow_offset_y = 5
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "登录/注册面板"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -31,7 +31,7 @@ layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBox/UserName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "账号"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -39,7 +39,7 @@ vertical_alignment = 1
|
||||
[node name="username_input" type="LineEdit" parent="VBox/UserName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入QQ号"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
@@ -48,7 +48,7 @@ layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="VBox/Password1"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "密码"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -56,16 +56,15 @@ vertical_alignment = 1
|
||||
[node name="password_input" type="LineEdit" parent="VBox/Password1"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入密码"
|
||||
|
||||
[node name="Password2" type="HBoxContainer" parent="VBox"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="VBox/Password2"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "确认密码"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -73,16 +72,15 @@ vertical_alignment = 1
|
||||
[node name="password_input2" type="LineEdit" parent="VBox/Password2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请再次输入密码"
|
||||
|
||||
[node name="VerificationCode" type="HBoxContainer" parent="VBox"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBox/VerificationCode"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "验证码"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -90,22 +88,21 @@ vertical_alignment = 1
|
||||
[node name="verificationcode_input" type="LineEdit" parent="VBox/VerificationCode"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入您的QQ邮箱收到的验证码"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="SendButton" type="Button" parent="VBox/VerificationCode"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "发送验证码"
|
||||
|
||||
[node name="PlayerName" type="HBoxContainer" parent="VBox"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="VBox/PlayerName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "玩家昵称"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -113,16 +110,15 @@ vertical_alignment = 1
|
||||
[node name="playername_input" type="LineEdit" parent="VBox/PlayerName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入您的玩家昵称"
|
||||
|
||||
[node name="FarmName" type="HBoxContainer" parent="VBox"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBox/FarmName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "农场名称"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -130,7 +126,7 @@ vertical_alignment = 1
|
||||
[node name="farmname_input" type="LineEdit" parent="VBox/FarmName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入您的农场名称"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
@@ -140,13 +136,13 @@ layout_mode = 2
|
||||
[node name="login_button" type="Button" parent="VBox/LoginRegister"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "登录"
|
||||
|
||||
[node name="register_button" type="Button" parent="VBox/LoginRegister"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "注册"
|
||||
|
||||
[node name="Password3" type="HBoxContainer" parent="VBox"]
|
||||
@@ -175,7 +171,7 @@ placeholder_text = "请输入QQ邮箱验证码"
|
||||
[node name="Note" type="Label" parent="VBox"]
|
||||
modulate = Color(1, 0.552941, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "注意:首次游玩游戏需要注册账号,
|
||||
账号请直接输入您的QQ号,系统会直接向您的QQ
|
||||
邮箱发送一串验证码进行注册验证,密码请设置的复杂一
|
||||
@@ -185,6 +181,6 @@ vertical_alignment = 1
|
||||
|
||||
[node name="status_label" type="Label" parent="VBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "连接状态"
|
||||
horizontal_alignment = 1
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bndf1e4sgdjr6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://65e0rl31fx0i" path="res://GUI/LuckyDrawPanel.gd" id="1_dcmen"]
|
||||
[ext_resource type="Script" uid="uid://65e0rl31fx0i" path="res://Script/BigPanel/LuckyDrawPanel.gd" id="1_dcmen"]
|
||||
|
||||
[node name="LuckyDrawPanel" type="Panel"]
|
||||
offset_right = 600.0
|
||||
86
Scene/BigPanel/PetBagPanel.tscn
Normal file
86
Scene/BigPanel/PetBagPanel.tscn
Normal file
@@ -0,0 +1,86 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bnf1u6re1r1if"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bdhwvqsmakna2" path="res://Script/BigPanel/PetBagPanel.gd" id="1_m60ti"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n03md"]
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[node name="PetBagPanel" type="Panel"]
|
||||
offset_left = 69.0
|
||||
offset_top = 56.0
|
||||
offset_right = 1635.0
|
||||
offset_bottom = 836.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n03md")
|
||||
script = ExtResource("1_m60ti")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -90.0
|
||||
offset_top = -71.0
|
||||
offset_right = 1672.0
|
||||
offset_bottom = 831.0
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 28.0
|
||||
offset_top = 95.0
|
||||
offset_right = 3805.0
|
||||
offset_bottom = 1723.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Bag_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 69.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 1, 0.807843, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 4
|
||||
theme_override_constants/shadow_offset_y = 4
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "宠物背包"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1478.75
|
||||
offset_top = 20.0
|
||||
offset_right = 1538.75
|
||||
offset_bottom = 83.0
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 27.5
|
||||
offset_top = 16.25
|
||||
offset_right = 115.5
|
||||
offset_bottom = 79.25
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
86
Scene/BigPanel/PetStorePanel.tscn
Normal file
86
Scene/BigPanel/PetStorePanel.tscn
Normal file
@@ -0,0 +1,86 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cnjidcwuv4nn4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dc1pmi1ubd2cf" path="res://Script/BigPanel/PetStorePanel.gd" id="1_pfdc7"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n03md"]
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[node name="PetStorePanel" type="Panel"]
|
||||
offset_left = 69.0
|
||||
offset_top = 56.0
|
||||
offset_right = 1635.0
|
||||
offset_bottom = 836.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n03md")
|
||||
script = ExtResource("1_pfdc7")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -90.0
|
||||
offset_top = -71.0
|
||||
offset_right = 1672.0
|
||||
offset_bottom = 831.0
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 28.0
|
||||
offset_top = 95.0
|
||||
offset_right = 3805.0
|
||||
offset_bottom = 1723.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Store_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 69.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 1, 0.807843, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 4
|
||||
theme_override_constants/shadow_offset_y = 4
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "宠物商店"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1478.75
|
||||
offset_top = 20.0
|
||||
offset_right = 1538.75
|
||||
offset_bottom = 83.0
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 27.5
|
||||
offset_top = 16.25
|
||||
offset_right = 115.5
|
||||
offset_bottom = 79.25
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
157
Scene/BigPanel/PlayerBagPanel.tscn
Normal file
157
Scene/BigPanel/PlayerBagPanel.tscn
Normal file
@@ -0,0 +1,157 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bseuwniienrqy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cgr332wsx63a8" path="res://Script/BigPanel/PlayerBagPanel.gd" id="1_srags"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n03md"]
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
|
||||
[node name="PlayerBagPanel" type="Panel"]
|
||||
offset_left = 63.0
|
||||
offset_top = 79.0
|
||||
offset_right = 1620.0
|
||||
offset_bottom = 799.0
|
||||
scale = Vector2(0.8, 0.8)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n03md")
|
||||
script = ExtResource("1_srags")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -81.0
|
||||
offset_top = -96.0
|
||||
offset_right = 1677.0
|
||||
offset_bottom = 802.0
|
||||
color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="SortContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 58.0
|
||||
offset_right = 1557.0
|
||||
offset_bottom = 121.0
|
||||
alignment = 1
|
||||
|
||||
[node name="FilterLabel" type="Label" parent="SortContainer"]
|
||||
modulate = Color(0.439216, 0.560784, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "排序:"
|
||||
|
||||
[node name="Sort_All" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "全部"
|
||||
|
||||
[node name="Sort_Common" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "普通"
|
||||
|
||||
[node name="Sort_Superior" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "优良"
|
||||
|
||||
[node name="Sort_Rare" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "稀有"
|
||||
|
||||
[node name="Sort_Epic" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "史诗"
|
||||
|
||||
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "传奇"
|
||||
|
||||
[node name="SortLabel" type="Label" parent="SortContainer"]
|
||||
modulate = Color(0.439216, 0.560784, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "排序:"
|
||||
|
||||
[node name="Sort_Price" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按价格"
|
||||
|
||||
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按生长时间"
|
||||
|
||||
[node name="Sort_Profit" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按收益"
|
||||
|
||||
[node name="Sort_Level" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "按等级"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 11.0
|
||||
offset_top = 121.0
|
||||
offset_right = 3877.0
|
||||
offset_bottom = 1592.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Bag_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_right = 1557.0
|
||||
offset_bottom = 55.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种子仓库"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1478.75
|
||||
offset_top = 13.75
|
||||
offset_right = 1538.75
|
||||
offset_bottom = 76.75
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 15.0001
|
||||
offset_top = 13.75
|
||||
offset_right = 75.0001
|
||||
offset_bottom = 76.75
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
152
Scene/BigPanel/PlayerRankingPanel.tscn
Normal file
152
Scene/BigPanel/PlayerRankingPanel.tscn
Normal file
@@ -0,0 +1,152 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dbfqu87627yg6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://fk4q3x6uqydd" path="res://Script/BigPanel/PlayerRankingPanel.gd" id="1_efhd6"]
|
||||
[ext_resource type="PackedScene" uid="uid://crd28qnymob7" path="res://GUI/PlayerRankingItem.tscn" id="1_xwp76"]
|
||||
|
||||
[node name="PlayerRankingPanel" type="Panel"]
|
||||
offset_left = 2.0
|
||||
offset_right = 1402.0
|
||||
offset_bottom = 720.0
|
||||
script = ExtResource("1_efhd6")
|
||||
|
||||
[node name="RegisterPlayerNum" type="Label" parent="."]
|
||||
self_modulate = Color(1, 0.701961, 1, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 864.0
|
||||
offset_right = 1014.0
|
||||
offset_bottom = 42.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "注册人数:"
|
||||
|
||||
[node name="Title" type="RichTextLabel" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 2.0
|
||||
offset_right = 1395.0
|
||||
offset_bottom = 56.0
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/normal_font_size = 40
|
||||
bbcode_enabled = true
|
||||
text = "玩家排行榜"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SearchLineEdit" type="LineEdit" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 143.0
|
||||
offset_top = 3.0
|
||||
offset_right = 426.0
|
||||
offset_bottom = 60.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "输入要搜索的人"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_top = 3.0
|
||||
offset_right = 78.0
|
||||
offset_bottom = 60.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "刷新"
|
||||
|
||||
[node name="SearchButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_left = 425.0
|
||||
offset_top = 3.0
|
||||
offset_right = 503.0
|
||||
offset_bottom = 60.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "搜索"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_left = 1338.0
|
||||
offset_top = 3.0
|
||||
offset_right = 1395.0
|
||||
offset_bottom = 60.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "X"
|
||||
|
||||
[node name="FiterAndSortHBox" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 63.0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 120.0
|
||||
|
||||
[node name="SortLabel" type="Label" parent="FiterAndSortHBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "排序:"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MoneySortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(1, 1, 0.321569, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "钱币"
|
||||
|
||||
[node name="SeedSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.329412, 1, 0.345098, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "种子数"
|
||||
|
||||
[node name="LevelSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0, 1, 1, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "等级"
|
||||
|
||||
[node name="OnlineTimeSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.784314, 0.733333, 0.521569, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "在线时长"
|
||||
|
||||
[node name="LoginTimeSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.811765, 1, 0.811765, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "登录时间"
|
||||
|
||||
[node name="LikeNumSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(1, 0.513726, 1, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "点赞数"
|
||||
|
||||
[node name="IsOnlineSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.691357, 0.691357, 0.691357, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "在线情况"
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 121.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="PlayerList" type="VBoxContainer" parent="Scroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="PlayerRankingItem" parent="Scroll/PlayerList" instance=ExtResource("1_xwp76")]
|
||||
layout_mode = 2
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://btp1h6hic2sin"]
|
||||
|
||||
[ext_resource type="Script" path="res://GUI/AcceptDialog.gd" id="1_yc5jp"]
|
||||
[ext_resource type="Script" uid="uid://ce8xcp770tolo" path="res://Script/Dialog/AcceptDialog.gd" id="1_yc5jp"]
|
||||
|
||||
[node name="AcceptDialog" type="AcceptDialog"]
|
||||
auto_translate_mode = 1
|
||||
61
Scene/Pet/BigBeetle.tscn
Normal file
61
Scene/Pet/BigBeetle.tscn
Normal file
@@ -0,0 +1,61 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://bd111pvwvdwv5"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_op7i3"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_c36rm"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_op7i3"]
|
||||
atlas = ExtResource("2_c36rm")
|
||||
region = Rect2(72, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c36rm"]
|
||||
atlas = ExtResource("2_c36rm")
|
||||
region = Rect2(120, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
|
||||
atlas = ExtResource("2_c36rm")
|
||||
region = Rect2(72, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q454c"]
|
||||
atlas = ExtResource("2_c36rm")
|
||||
region = Rect2(96, 48, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_op7i3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_c36rm")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"sleep",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mjdfm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_q454c")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="BigBeetle" instance=ExtResource("1_op7i3")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_b73qu")
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
|
||||
[node name="VolumeCollision" parent="." index="1"]
|
||||
position = Vector2(0.5, 5.5)
|
||||
57
Scene/Pet/FlyingBird.tscn
Normal file
57
Scene/Pet/FlyingBird.tscn
Normal file
@@ -0,0 +1,57 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dia4sld41ne72"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_lgi35"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_wn6km"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lgi35"]
|
||||
atlas = ExtResource("2_wn6km")
|
||||
region = Rect2(192, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wn6km"]
|
||||
atlas = ExtResource("2_wn6km")
|
||||
region = Rect2(144, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qmpjj"]
|
||||
atlas = ExtResource("2_wn6km")
|
||||
region = Rect2(168, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1mpkc"]
|
||||
atlas = ExtResource("2_wn6km")
|
||||
region = Rect2(192, 48, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_lgi35")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wn6km")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qmpjj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1mpkc")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="FlyingBird" instance=ExtResource("1_lgi35")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_b73qu")
|
||||
frame_progress = 0.111287
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
|
||||
[node name="VolumeCollision" parent="." index="1"]
|
||||
position = Vector2(1.5, 1.5)
|
||||
95
Scene/Pet/GreenSlime.tscn
Normal file
95
Scene/Pet/GreenSlime.tscn
Normal file
@@ -0,0 +1,95 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dqv5q1xhouipa"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_saxlb"]
|
||||
[ext_resource type="Texture2D" uid="uid://b75oytao5cgjo" path="res://assets/宠物图片/绿色史莱姆.png" id="2_saxlb"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ou315"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_saxlb"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(72, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bxslx"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(48, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dvhl1"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(24, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0t1ns"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sbjn0"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(72, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qvnbx"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(48, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n0kjo"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(24, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_obu0n"]
|
||||
atlas = ExtResource("2_saxlb")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ou315")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_saxlb")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bxslx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dvhl1")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0t1ns")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"wake",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sbjn0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qvnbx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_n0kjo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_obu0n")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="GreenSlime" instance=ExtResource("1_saxlb")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
animation = &"idle"
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
position = Vector2(-11.25, 3.25)
|
||||
167
Scene/Pet/LittleKnight.tscn
Normal file
167
Scene/Pet/LittleKnight.tscn
Normal file
@@ -0,0 +1,167 @@
|
||||
[gd_scene load_steps=24 format=3 uid="uid://xcigvfp1hms"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_rjt8u"]
|
||||
[ext_resource type="Texture2D" uid="uid://bal78ts2eq4yu" path="res://assets/宠物图片/护卫.png" id="3_81r1q"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rjt8u"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(224, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_81r1q"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(192, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nliwy"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(160, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kbr5d"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(128, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yhrjc"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(224, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2dbgw"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(192, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h0n46"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(160, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1tk7r"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(128, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ogy1e"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(96, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mygjj"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(64, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rkj0j"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(32, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j7anc"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(0, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cxgnv"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(224, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2itrd"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(192, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c7ofb"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(160, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_aa4e4"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(128, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jx5oo"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(96, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_umo24"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(64, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_853s8"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(32, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6x5xm"]
|
||||
atlas = ExtResource("3_81r1q")
|
||||
region = Rect2(0, 96, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rjt8u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_81r1q")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nliwy")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kbr5d")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_yhrjc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2dbgw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h0n46")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1tk7r")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ogy1e")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mygjj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rkj0j")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j7anc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cxgnv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2itrd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_c7ofb")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_aa4e4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jx5oo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_umo24")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_853s8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6x5xm")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="LittleKnight" instance=ExtResource("1_rjt8u")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
frame_progress = 0.272604
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
position = Vector2(-8, 4)
|
||||
123
Scene/Pet/PetBase.tscn
Normal file
123
Scene/Pet/PetBase.tscn
Normal file
@@ -0,0 +1,123 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://h66an0p6pl53"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hucuy8guuj6w" path="res://Script/Pet/PetBase.gd" id="1_xpyyb"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_5si3e"]
|
||||
[ext_resource type="Texture2D" uid="uid://cdhf25ktn3jp3" path="res://assets/我的世界图片/武器工具/钻石剑.png" id="3_5si3e"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h4hw6"]
|
||||
atlas = ExtResource("2_5si3e")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_51c25"]
|
||||
atlas = ExtResource("2_5si3e")
|
||||
region = Rect2(24, 0, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_wmdx5"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h4hw6")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h4hw6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_51c25")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_h4hw6"]
|
||||
size = Vector2(79, 92)
|
||||
|
||||
[node name="PetBase" type="CharacterBody2D"]
|
||||
motion_mode = 1
|
||||
slide_on_ceiling = false
|
||||
floor_stop_on_slope = false
|
||||
floor_block_on_wall = false
|
||||
script = ExtResource("1_xpyyb")
|
||||
|
||||
[node name="PetImage" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_wmdx5")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="PetToolImage" type="Sprite2D" parent="PetImage"]
|
||||
visible = false
|
||||
position = Vector2(-10, 0)
|
||||
texture = ExtResource("3_5si3e")
|
||||
flip_h = true
|
||||
|
||||
[node name="VolumeCollision" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0.5, 2)
|
||||
shape = SubResource("RectangleShape2D_h4hw6")
|
||||
|
||||
[node name="PetInformVBox" type="VBoxContainer" parent="."]
|
||||
offset_left = -72.0
|
||||
offset_top = -261.0
|
||||
offset_right = 430.0
|
||||
offset_bottom = 453.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
alignment = 2
|
||||
|
||||
[node name="PetNameRichText" type="RichTextLabel" parent="PetInformVBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/normal_font_size = 40
|
||||
bbcode_enabled = true
|
||||
text = "萌芽小绿人"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="ArmorBar" type="ProgressBar" parent="PetInformVBox"]
|
||||
modulate = Color(0.758192, 0.758192, 0.758192, 1)
|
||||
custom_minimum_size = Vector2(0, 60)
|
||||
layout_mode = 2
|
||||
show_percentage = false
|
||||
|
||||
[node name="ArmorLabel" type="Label" parent="PetInformVBox/ArmorBar"]
|
||||
layout_mode = 0
|
||||
offset_right = 502.0
|
||||
offset_bottom = 60.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "盔甲值:100/100"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ShieldBar" type="ProgressBar" parent="PetInformVBox"]
|
||||
modulate = Color(0, 1, 1, 1)
|
||||
custom_minimum_size = Vector2(0, 60)
|
||||
layout_mode = 2
|
||||
show_percentage = false
|
||||
|
||||
[node name="ShieldLabel" type="Label" parent="PetInformVBox/ShieldBar"]
|
||||
layout_mode = 0
|
||||
offset_right = 502.0
|
||||
offset_bottom = 60.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "护盾值:100/100"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="PetInformVBox"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
custom_minimum_size = Vector2(0, 60)
|
||||
layout_mode = 2
|
||||
show_percentage = false
|
||||
|
||||
[node name="HealthLabel" type="Label" parent="PetInformVBox/HealthBar"]
|
||||
layout_mode = 0
|
||||
offset_right = 502.0
|
||||
offset_bottom = 60.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "生命值:100/100"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
102
Scene/Pet/PetFightPanel.tscn
Normal file
102
Scene/Pet/PetFightPanel.tscn
Normal file
@@ -0,0 +1,102 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cw8am7nnbgca5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ke4moxwg1gfd" path="res://Script/Pet/PetFightPanel.gd" id="1_h4hw6"]
|
||||
[ext_resource type="Texture2D" uid="uid://dh0dsw3jr0gra" path="res://assets/宠物对战背景图片/背景2.webp" id="2_h4hw6"]
|
||||
|
||||
[node name="PetFightPanel" type="Panel"]
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
script = ExtResource("1_h4hw6")
|
||||
|
||||
[node name="MapBackGround" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 1557.0
|
||||
offset_bottom = 867.0
|
||||
scale = Vector2(0.9, 0.9)
|
||||
texture = ExtResource("2_h4hw6")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_colors/font_color = Color(0.623819, 1, 0.593898, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 5
|
||||
theme_override_constants/shadow_offset_y = 5
|
||||
theme_override_constants/outline_size = 20
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "宠物对战"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="team1" type="Node" parent="."]
|
||||
|
||||
[node name="team2" type="Node" parent="."]
|
||||
|
||||
[node name="neutral" type="Node" parent="."]
|
||||
|
||||
[node name="BattleEndPanel" type="Panel" parent="."]
|
||||
top_level = true
|
||||
layout_mode = 0
|
||||
offset_left = 294.0
|
||||
offset_right = 1071.0
|
||||
offset_bottom = 720.0
|
||||
|
||||
[node name="Title" type="Label" parent="BattleEndPanel"]
|
||||
layout_mode = 0
|
||||
offset_right = 777.0
|
||||
offset_bottom = 104.0
|
||||
theme_override_colors/font_color = Color(0.991435, 0.798103, 0.357309, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 5
|
||||
theme_override_constants/shadow_offset_y = 5
|
||||
theme_override_constants/outline_size = 20
|
||||
theme_override_constants/shadow_outline_size = 20
|
||||
theme_override_font_sizes/font_size = 60
|
||||
text = "战斗结束"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Contents" type="Label" parent="BattleEndPanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 104.0
|
||||
offset_right = 777.0
|
||||
offset_bottom = 567.0
|
||||
theme_override_colors/font_color = Color(0, 1, 0, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "[宠物名字]获得300经验,
|
||||
增加200亲密度"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ReturnFarmButton" type="Button" parent="BattleEndPanel"]
|
||||
layout_mode = 0
|
||||
offset_left = 294.0
|
||||
offset_top = 567.0
|
||||
offset_right = 502.0
|
||||
offset_bottom = 644.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "返回农场"
|
||||
|
||||
[node name="PetBattleDetailsPanel" type="Panel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 257.0
|
||||
offset_bottom = 720.0
|
||||
|
||||
[node name="Title" type="Label" parent="PetBattleDetailsPanel"]
|
||||
layout_mode = 0
|
||||
offset_right = 257.0
|
||||
offset_bottom = 23.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "战斗细节"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="BattleDetails" type="RichTextLabel" parent="PetBattleDetailsPanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 42.0
|
||||
offset_right = 257.0
|
||||
offset_bottom = 720.0
|
||||
bbcode_enabled = true
|
||||
20
Scene/Pet/Projectile.tscn
Normal file
20
Scene/Pet/Projectile.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bvqkm1n2p6xty"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cbhhx6st14pse" path="res://Script/Pet/Projectile.gd" id="1_vqkm1"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_1"]
|
||||
radius = 5.0
|
||||
|
||||
[node name="Projectile" type="Area2D"]
|
||||
script = ExtResource("1_vqkm1")
|
||||
|
||||
[node name="ProjectileSprite" type="Sprite2D" parent="."]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_1")
|
||||
|
||||
[node name="Trail" type="Line2D" parent="."]
|
||||
width = 2.0
|
||||
default_color = Color(1, 1, 0, 0.5)
|
||||
96
Scene/Pet/RedSlime.tscn
Normal file
96
Scene/Pet/RedSlime.tscn
Normal file
@@ -0,0 +1,96 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://cqfa6ng6x2s8q"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_ff7pm"]
|
||||
[ext_resource type="Texture2D" uid="uid://cvpsjlje7q3to" path="res://assets/宠物图片/红色史莱姆.png" id="2_ff7pm"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s7ip1"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ff7pm"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(72, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_53j2r"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(48, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0ij01"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(24, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_20513"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3f8fr"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(72, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kbexh"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(48, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_njkpw"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(24, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xbspe"]
|
||||
atlas = ExtResource("2_ff7pm")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s7ip1")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ff7pm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_53j2r")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0ij01")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_20513")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"wake",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_3f8fr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kbexh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_njkpw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xbspe")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="RedSlime" instance=ExtResource("1_ff7pm")]
|
||||
position = Vector2(0, -1)
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
frame_progress = 0.528863
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
position = Vector2(-11.25, 3.25)
|
||||
57
Scene/Pet/SmallBeetle.tscn
Normal file
57
Scene/Pet/SmallBeetle.tscn
Normal file
@@ -0,0 +1,57 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://ckvagocpiudyu"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_nswws"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_1eo38"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nswws"]
|
||||
atlas = ExtResource("2_1eo38")
|
||||
region = Rect2(0, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
|
||||
atlas = ExtResource("2_1eo38")
|
||||
region = Rect2(48, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1eo38"]
|
||||
atlas = ExtResource("2_1eo38")
|
||||
region = Rect2(24, 48, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nswws")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mjdfm")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"sleep",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nswws")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1eo38")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="SmallBeetle" instance=ExtResource("1_nswws")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_b73qu")
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
|
||||
[node name="VolumeCollision" parent="." index="1"]
|
||||
position = Vector2(2, 26)
|
||||
45
Scene/Pet/SmallBlue.tscn
Normal file
45
Scene/Pet/SmallBlue.tscn
Normal file
@@ -0,0 +1,45 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://coryhl8jl4xfg"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_4ggjc"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_stamd"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_stamd"]
|
||||
atlas = ExtResource("2_stamd")
|
||||
region = Rect2(48, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v0b4v"]
|
||||
atlas = ExtResource("2_stamd")
|
||||
region = Rect2(72, 0, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_stamd")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_stamd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v0b4v")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="SmallBlue" instance=ExtResource("1_4ggjc")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_b2ss3")
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
|
||||
[node name="VolumeCollision" parent="." index="1"]
|
||||
position = Vector2(0, 1)
|
||||
57
Scene/Pet/SmallDrillBit.tscn
Normal file
57
Scene/Pet/SmallDrillBit.tscn
Normal file
@@ -0,0 +1,57 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cb4spsrxunrrh"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_j2fq3"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_xvdwk"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j2fq3"]
|
||||
atlas = ExtResource("2_xvdwk")
|
||||
region = Rect2(144, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6q1oc"]
|
||||
atlas = ExtResource("2_xvdwk")
|
||||
region = Rect2(192, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xvdwk"]
|
||||
atlas = ExtResource("2_xvdwk")
|
||||
region = Rect2(168, 24, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_6q1oc"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j2fq3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6q1oc")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"sleep",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j2fq3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xvdwk")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="SmallDrillBit" instance=ExtResource("1_j2fq3")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_6q1oc")
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
|
||||
[node name="VolumeCollision" parent="." index="1"]
|
||||
position = Vector2(-1.5, 10.5)
|
||||
47
Scene/Pet/SmallGreen.tscn
Normal file
47
Scene/Pet/SmallGreen.tscn
Normal file
@@ -0,0 +1,47 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://v8bx7hhl5st6"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_5igge"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_5gxwu"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5gxwu"]
|
||||
atlas = ExtResource("2_5gxwu")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pxsqn"]
|
||||
atlas = ExtResource("2_5gxwu")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xxlll"]
|
||||
atlas = ExtResource("2_5gxwu")
|
||||
region = Rect2(24, 0, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_k25pl"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5gxwu")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pxsqn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xxlll")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="SmallGreen" instance=ExtResource("1_5igge")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_k25pl")
|
||||
animation = &"idle"
|
||||
|
||||
[node name="VolumeCollision" parent="." index="1"]
|
||||
position = Vector2(-0.5, 3)
|
||||
42
Scene/Pet/SmallOrange.tscn
Normal file
42
Scene/Pet/SmallOrange.tscn
Normal file
@@ -0,0 +1,42 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://c2u0gl7ym1v2e"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_tdtxh"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_5rxf3"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tdtxh"]
|
||||
atlas = ExtResource("2_5rxf3")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5rxf3"]
|
||||
atlas = ExtResource("2_5rxf3")
|
||||
region = Rect2(24, 24, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_ujsmd"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tdtxh")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tdtxh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5rxf3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="SmallOrange" instance=ExtResource("1_tdtxh")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_ujsmd")
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
47
Scene/Pet/SmallPink.tscn
Normal file
47
Scene/Pet/SmallPink.tscn
Normal file
@@ -0,0 +1,47 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cf76wr07xbxvy"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_cxnqb"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_auciw"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cxnqb"]
|
||||
atlas = ExtResource("2_auciw")
|
||||
region = Rect2(96, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_auciw"]
|
||||
atlas = ExtResource("2_auciw")
|
||||
region = Rect2(96, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nrp4g"]
|
||||
atlas = ExtResource("2_auciw")
|
||||
region = Rect2(120, 0, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cxnqb")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 8.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_auciw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nrp4g")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="SmallPink" instance=ExtResource("1_cxnqb")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_b2ss3")
|
||||
animation = &"idle"
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
42
Scene/Pet/SmallYellow.tscn
Normal file
42
Scene/Pet/SmallYellow.tscn
Normal file
@@ -0,0 +1,42 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://i7pgirkgv1u1"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_trhvc"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_k5jn7"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_trhvc"]
|
||||
atlas = ExtResource("2_k5jn7")
|
||||
region = Rect2(144, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_k5jn7"]
|
||||
atlas = ExtResource("2_k5jn7")
|
||||
region = Rect2(168, 0, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_trhvc")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_trhvc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_k5jn7")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 8.0
|
||||
}]
|
||||
|
||||
[node name="SmallYellow" instance=ExtResource("1_trhvc")]
|
||||
|
||||
[node name="PetImage" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
|
||||
[node name="PetToolImage" parent="PetImage" index="0"]
|
||||
visible = false
|
||||
157
Scene/SmallPanel/AccountSettingPanel.tscn
Normal file
157
Scene/SmallPanel/AccountSettingPanel.tscn
Normal file
@@ -0,0 +1,157 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://d3i0l6ysrde6o"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dinrduqwsf5k5" path="res://Script/SmallPanel/AccountSettingPanel.gd" id="1_xfiot"]
|
||||
[ext_resource type="Texture2D" uid="uid://dsln1w1aqgf1k" path="res://assets/游戏UI/玩家默认头像.webp" id="2_a2cah"]
|
||||
[ext_resource type="Script" uid="uid://0d2j5m6j2ema" path="res://Components/HTTPTextureRect.gd" id="3_wibl7"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y1hsh"]
|
||||
border_color = Color(2.98411e-06, 0.95982, 0.386903, 1)
|
||||
border_blend = true
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
corner_detail = 20
|
||||
shadow_size = 20
|
||||
shadow_offset = Vector2(10, 10)
|
||||
anti_aliasing = false
|
||||
anti_aliasing_size = 5.0
|
||||
|
||||
[node name="AccountSettingPanel" type="Panel"]
|
||||
visible = false
|
||||
offset_left = 243.0
|
||||
offset_top = 42.0
|
||||
offset_right = 1154.0
|
||||
offset_bottom = 689.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_y1hsh")
|
||||
script = ExtResource("1_xfiot")
|
||||
|
||||
[node name="Title" type="RichTextLabel" parent="."]
|
||||
modulate = Color(1, 0.745098, 0.54902, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 2.0
|
||||
offset_right = 911.0
|
||||
offset_bottom = 56.0
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/normal_font_size = 40
|
||||
bbcode_enabled = true
|
||||
text = "玩家信息设置"
|
||||
horizontal_alignment = 1
|
||||
threaded = true
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_left = 854.0
|
||||
offset_right = 911.0
|
||||
offset_bottom = 57.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "X"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_left = 2.0
|
||||
offset_right = 80.0
|
||||
offset_bottom = 57.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "刷新"
|
||||
|
||||
[node name="VBox1" type="VBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 58.0
|
||||
offset_right = 911.0
|
||||
offset_bottom = 647.0
|
||||
|
||||
[node name="HBox1" type="HBoxContainer" parent="VBox1"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="HTTPTextureRect" type="TextureRect" parent="VBox1/HBox1"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_a2cah")
|
||||
script = ExtResource("3_wibl7")
|
||||
metadata/_custom_type_script = "uid://0d2j5m6j2ema"
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="VBox1"]
|
||||
layout_mode = 2
|
||||
columns = 2
|
||||
|
||||
[node name="User_Name" type="Label" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "账户:"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="User_Name_Input" type="Label" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "74074091740"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="User_Password" type="Label" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "密码:"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="User_Password_Input" type="LineEdit" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入密码"
|
||||
|
||||
[node name="Player_Name" type="Label" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "玩家昵称:"
|
||||
|
||||
[node name="Player_Name_Input" type="LineEdit" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入玩家昵称"
|
||||
|
||||
[node name="Farm_Name" type="Label" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "农场名称:"
|
||||
|
||||
[node name="Farm_Name_Input" type="LineEdit" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入农场名称"
|
||||
|
||||
[node name="Personal_Profile" type="Label" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "个人简介:"
|
||||
|
||||
[node name="Personal_Profile_Input" type="LineEdit" parent="VBox1/Grid"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入个人简介"
|
||||
|
||||
[node name="HBox2" type="HBoxContainer" parent="VBox1"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Remove_Account_Btn" type="Button" parent="VBox1/HBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "删除账号"
|
||||
|
||||
[node name="Confirm_Btn" type="Button" parent="VBox1/HBox2"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "确认修改"
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dckc8nrn7p425"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bljtkxil64h14" path="res://GUI/LandPanel.gd" id="1_nmy5p"]
|
||||
[ext_resource type="Script" uid="uid://bljtkxil64h14" path="res://Script/SmallPanel/LandPanel.gd" id="1_nmy5p"]
|
||||
[ext_resource type="Texture2D" uid="uid://2sdfbvf1isif" path="res://icon.svg" id="2_07q41"]
|
||||
|
||||
[node name="LandPanel" type="Panel"]
|
||||
@@ -18,6 +18,13 @@ offset_bottom = 43.0
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "X"
|
||||
|
||||
[node name="Refresh_Button" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 58.0
|
||||
offset_bottom = 43.0
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "刷新"
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
self_modulate = Color(0, 0.87451, 1, 1)
|
||||
layout_mode = 2
|
||||
@@ -34,114 +41,18 @@ text = "土地面板"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 224.0
|
||||
offset_top = 249.0
|
||||
offset_right = 352.0
|
||||
offset_bottom = 377.0
|
||||
scale = Vector2(0.5, 0.5)
|
||||
size_flags_horizontal = 4
|
||||
texture = ExtResource("2_07q41")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 313.0
|
||||
offset_right = 1287.0
|
||||
offset_bottom = 700.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="VBox"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
|
||||
[node name="HBox1" type="HBoxContainer" parent="VBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="cost" type="Label" parent="VBox/HBox1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "花费:999"
|
||||
|
||||
[node name="earn" type="Label" parent="VBox/HBox1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "收益:999"
|
||||
|
||||
[node name="growthtime" type="Label" parent="VBox/HBox1"]
|
||||
modulate = Color(1, 0.635294, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "生长时间:999"
|
||||
|
||||
[node name="experience" type="Label" parent="VBox/HBox1"]
|
||||
modulate = Color(0.164706, 1, 0.341176, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "收获经验:999"
|
||||
|
||||
[node name="HBox2" type="HBoxContainer" parent="VBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="canbuy" type="Label" parent="VBox/HBox2"]
|
||||
modulate = Color(0.466667, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "能否购买:是"
|
||||
|
||||
[node name="quality" type="Label" parent="VBox/HBox2"]
|
||||
modulate = Color(1, 0.607843, 0.239216, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "品质:传奇"
|
||||
|
||||
[node name="weatherability" type="Label" parent="VBox/HBox2"]
|
||||
modulate = Color(0.784314, 0.647059, 0.498039, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "耐候性:999"
|
||||
|
||||
[node name="level" type="Label" parent="VBox/HBox2"]
|
||||
modulate = Color(0.394367, 0.644385, 0.816557, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种植等级:999"
|
||||
|
||||
[node name="HBox3" type="HBoxContainer" parent="VBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="description" type="Label" parent="VBox/HBox3"]
|
||||
modulate = Color(0.988235, 0.831373, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "描述:啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊"
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="."]
|
||||
[node name="GroundFunctionGrid" type="GridContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 42.0
|
||||
offset_right = 516.0
|
||||
offset_bottom = 249.0
|
||||
offset_bottom = 142.0
|
||||
columns = 5
|
||||
|
||||
[node name="Dig_Button" type="Button" parent="Grid"]
|
||||
[node name="Dig_Button" type="Button" parent="GroundFunctionGrid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
@@ -154,9 +65,11 @@ text = "开垦"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Plant_Button" type="Button" parent="Grid"]
|
||||
[node name="Plant_Button" type="Button" parent="GroundFunctionGrid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
@@ -168,24 +81,11 @@ text = "种植"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Remove_Button" type="Button" parent="Grid"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_color = Color(0.870588, 0.870588, 0, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "铲除"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Harvest_Button" type="Button" parent="Grid"]
|
||||
[node name="Harvest_Button" type="Button" parent="GroundFunctionGrid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
@@ -197,37 +97,11 @@ text = "收获"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Water_Button" type="Button" parent="Grid"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_color = Color(0, 0.87451, 0.87451, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "浇水"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Fertilize_Button" type="Button" parent="Grid"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(80, 80)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.509804, 0.301961, 0.85098, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "施肥"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Upgrade_Button" type="Button" parent="Grid"]
|
||||
[node name="Upgrade_Button" type="Button" parent="GroundFunctionGrid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
theme_override_colors/font_color = Color(0.0705882, 0.411765, 0.87451, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
@@ -236,21 +110,127 @@ text = "升级"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="KillInsect_Button" type="Button" parent="Grid"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
[node name="CropImageVBox" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.988235, 0.929412, 0.760784, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "杀虫"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
offset_top = 280.0
|
||||
offset_right = 512.0
|
||||
offset_bottom = 408.0
|
||||
alignment = 1
|
||||
|
||||
[node name="Grid2" type="GridContainer" parent="."]
|
||||
[node name="CropTextureRect" type="TextureRect" parent="CropImageVBox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_07q41")
|
||||
expand_mode = 2
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="InformVBox" type="VBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 345.0
|
||||
offset_right = 515.0
|
||||
offset_bottom = 468.0
|
||||
columns = 3
|
||||
offset_top = 142.0
|
||||
offset_right = 1280.0
|
||||
offset_bottom = 483.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
|
||||
[node name="GroundInformVBox" type="VBoxContainer" parent="InformVBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="GroundLevel" type="Label" parent="InformVBox/GroundInformVBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "土地等级:"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="GroundFunction" type="Label" parent="InformVBox/GroundInformVBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "土地功能:"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CropInformVBox" type="VBoxContainer" parent="InformVBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="InformVBox/CropInformVBox"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
|
||||
[node name="HBox1" type="HBoxContainer" parent="InformVBox/CropInformVBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="cost" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "花费:999"
|
||||
|
||||
[node name="earn" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "收益:999"
|
||||
|
||||
[node name="growthtime" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
|
||||
modulate = Color(1, 0.635294, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "生长时间:999"
|
||||
|
||||
[node name="experience" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
|
||||
modulate = Color(0.164706, 1, 0.341176, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "收获经验:999"
|
||||
|
||||
[node name="HBox2" type="HBoxContainer" parent="InformVBox/CropInformVBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="canbuy" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
|
||||
modulate = Color(0.466667, 1, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "能否购买:是"
|
||||
|
||||
[node name="quality" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
|
||||
modulate = Color(1, 0.607843, 0.239216, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "品质:传奇"
|
||||
|
||||
[node name="weatherability" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
|
||||
modulate = Color(0.784314, 0.647059, 0.498039, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "耐候性:999"
|
||||
|
||||
[node name="level" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
|
||||
modulate = Color(0.394367, 0.644385, 0.816557, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "种植等级:999"
|
||||
|
||||
[node name="HBox3" type="HBoxContainer" parent="InformVBox/CropInformVBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="description" type="Label" parent="InformVBox/CropInformVBox/HBox3"]
|
||||
modulate = Color(0.988235, 0.831373, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "描述:啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊"
|
||||
|
||||
[connection signal="pressed" from="Quit_Button" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="Refresh_Button" to="." method="_on_refresh_button_pressed"]
|
||||
40
Scene/SmallPanel/LoadProgressPanel.tscn
Normal file
40
Scene/SmallPanel/LoadProgressPanel.tscn
Normal file
@@ -0,0 +1,40 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://d1lu2yg4xl382"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uhubb"]
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
|
||||
[node name="LoadProgressPanel" type="Panel"]
|
||||
visible = false
|
||||
offset_right = 1402.0
|
||||
offset_bottom = 719.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_uhubb")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 1402.0
|
||||
offset_bottom = 550.0
|
||||
theme_override_colors/font_color = Color(0.966397, 0.970739, 0.632937, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 5
|
||||
theme_override_constants/shadow_offset_y = 5
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "正在加载资源中,请稍后..."
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="LoadProgressBar" type="ProgressBar" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 8.0
|
||||
offset_top = 430.0
|
||||
offset_right = 1396.0
|
||||
offset_bottom = 489.0
|
||||
theme_override_colors/font_color = Color(0, 1, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 7
|
||||
theme_override_font_sizes/font_size = 40
|
||||
100
Scene/SmallPanel/OneClickPlantPanel.tscn
Normal file
100
Scene/SmallPanel/OneClickPlantPanel.tscn
Normal file
@@ -0,0 +1,100 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://4rwitowdt4h"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://rlk8e51pibtm" path="res://Script/SmallPanel/OneClickPlantPanel.gd" id="1_cvoer"]
|
||||
|
||||
[node name="OneClickPlantPanel" type="Panel"]
|
||||
visible = false
|
||||
offset_left = 450.0
|
||||
offset_top = 77.0
|
||||
offset_right = 966.0
|
||||
offset_bottom = 327.0
|
||||
script = ExtResource("1_cvoer")
|
||||
|
||||
[node name="Quit_Button" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 465.0
|
||||
offset_right = 515.0
|
||||
offset_bottom = 50.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "X"
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
self_modulate = Color(0.431373, 0.498039, 1, 1)
|
||||
layout_mode = 2
|
||||
offset_right = 516.0
|
||||
offset_bottom = 42.0
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "一键种植面板"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 46.0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 210.0
|
||||
columns = 5
|
||||
|
||||
[node name="FullScreenPlantBtn" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "全屏种植"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="OneRowPlantBtn" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.972549, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "行种植"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="OneColumnPlantBtn" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 1, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "列种植"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="NineSquarePlantBtn" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "九宫格
|
||||
种植"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="CrossPlantBtn" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.54902, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "十字法
|
||||
种植"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="RandomPlantBtn" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.49586, 0.63552, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "随机种植"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[connection signal="pressed" from="Quit_Button" to="." method="_on_quit_button_pressed"]
|
||||
149
Scene/SmallPanel/OnlineGiftPanel.tscn
Normal file
149
Scene/SmallPanel/OnlineGiftPanel.tscn
Normal file
@@ -0,0 +1,149 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dpiy0aim20n2h"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ccaqrb6sdwbux" path="res://Script/SmallPanel/OnlineGiftPanel.gd" id="1_i0ga4"]
|
||||
|
||||
[node name="OnlineGiftPanel" type="Panel"]
|
||||
visible = false
|
||||
offset_left = 449.0
|
||||
offset_top = 77.0
|
||||
offset_right = 970.0
|
||||
offset_bottom = 327.0
|
||||
script = ExtResource("1_i0ga4")
|
||||
|
||||
[node name="Quit_Button" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 465.0
|
||||
offset_right = 515.0
|
||||
offset_bottom = 50.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "X"
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
modulate = Color(0.996846, 0.629335, 1, 1)
|
||||
layout_mode = 2
|
||||
offset_right = 516.0
|
||||
offset_bottom = 42.0
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 10
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "在线礼包"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 46.0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 210.0
|
||||
columns = 5
|
||||
|
||||
[node name="OneMinute" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_color = Color(1, 0, 0, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
1分钟"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="ThreeMinutes" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_color = Color(0.995313, 0.515623, 0.748044, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
3分钟"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="FiveMinutes" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_color = Color(0.635294, 0.827451, 0.537255, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
5分钟"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="TenMinutes" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.760784, 0.533333, 0.160784, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
10分钟"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="ThirtyMinutes" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.870588, 0.870588, 0, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
30分钟"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="OneHour" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.188235, 0.839216, 0.243137, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
1小时"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="ThreeHours" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_color = Color(0, 0.87451, 0.87451, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
3小时"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="FiveHours" type="Button" parent="Grid"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.509804, 0.301961, 0.85098, 1)
|
||||
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "在线
|
||||
5小时"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[connection signal="pressed" from="Quit_Button" to="." method="_on_quit_button_pressed"]
|
||||
@@ -4,6 +4,7 @@ extends Panel
|
||||
#种子商店格子
|
||||
@onready var crop_grid_container : GridContainer = $ScrollContainer/Crop_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
@onready var refresh_button : Button = $RefreshButton
|
||||
|
||||
#各种排序过滤按钮
|
||||
@onready var sort_all_button : Button = $SortContainer/Sort_All#全部
|
||||
@@ -19,11 +20,19 @@ extends Panel
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
@onready var batch_buy_popup: PanelContainer = $'../../DiaLog/BatchBuyPopup'
|
||||
|
||||
|
||||
|
||||
# 作物图片缓存(复用主游戏的缓存系统)
|
||||
var crop_textures_cache : Dictionary = {}
|
||||
@@ -38,9 +47,24 @@ var current_sort_ascending = true
|
||||
func _ready():
|
||||
# 连接按钮信号
|
||||
_connect_buttons()
|
||||
|
||||
# 连接可见性改变信号
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
# 面板显示时的处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
# 面板显示时自动刷新数据
|
||||
init_store()
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
|
||||
# 连接所有按钮信号
|
||||
func _connect_buttons():
|
||||
# 关闭按钮
|
||||
@@ -79,7 +103,6 @@ func init_store():
|
||||
if crop["等级"] <= main_game.level:
|
||||
var store_btn = _create_store_button(crop_name, crop["品质"])
|
||||
crop_grid_container.add_child(store_btn)
|
||||
#print("添加商店按钮: " + crop_name)
|
||||
|
||||
print("商店初始化完成,共添加按钮: " + str(crop_grid_container.get_child_count()) + "个")
|
||||
|
||||
@@ -173,35 +196,49 @@ func _on_store_buy_pressed(crop_name: String):
|
||||
Toast.show("等级不足,无法购买此种子", Color.RED)
|
||||
return
|
||||
|
||||
# 检查金钱是否足够
|
||||
# 检查金钱是否足够(至少能买1个)
|
||||
if main_game.money < crop["花费"]:
|
||||
Toast.show("金钱不足,无法购买种子", Color.RED)
|
||||
return
|
||||
|
||||
# 发送购买请求到服务器
|
||||
if network_manager and network_manager.sendBuySeed(crop_name):
|
||||
# 显示批量购买弹窗
|
||||
if batch_buy_popup:
|
||||
var crop_desc = crop.get("描述", "暂无描述")
|
||||
batch_buy_popup.show_buy_popup(
|
||||
crop_name,
|
||||
crop["花费"],
|
||||
crop_desc,
|
||||
"seed",
|
||||
_on_confirm_buy_seed,
|
||||
_on_cancel_buy_seed
|
||||
)
|
||||
else:
|
||||
print("批量购买弹窗未找到")
|
||||
|
||||
# 将种子添加到背包
|
||||
var found = false
|
||||
for seed_item in main_game.player_bag:
|
||||
if seed_item["name"] == crop_name:
|
||||
seed_item["count"] += 1
|
||||
found = true
|
||||
break
|
||||
# 确认购买种子回调
|
||||
func _on_confirm_buy_seed(crop_name: String, unit_cost: int, quantity: int, buy_type: String):
|
||||
var total_cost = unit_cost * quantity
|
||||
|
||||
if not found:
|
||||
main_game.player_bag.append({
|
||||
"name": crop_name,
|
||||
"quality": crop["品质"],
|
||||
"count": 1
|
||||
})
|
||||
# 再次检查金钱是否足够
|
||||
if main_game.money < total_cost:
|
||||
Toast.show("金钱不足!需要 " + str(total_cost) + " 元,当前只有 " + str(main_game.money) + " 元", Color.RED, 3.0, 1.0)
|
||||
return
|
||||
|
||||
# 发送批量购买请求到服务器
|
||||
_send_batch_buy_seed_request(crop_name, quantity)
|
||||
|
||||
# 更新背包UI
|
||||
crop_store_panel.update_player_bag_ui()
|
||||
# 取消购买种子回调
|
||||
func _on_cancel_buy_seed():
|
||||
print("取消购买种子")
|
||||
|
||||
# 更新金钱显示
|
||||
_update_money_display()
|
||||
# 发送批量购买种子请求
|
||||
func _send_batch_buy_seed_request(crop_name: String, quantity: int):
|
||||
# 发送批量购买请求到服务器
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.sendBuySeed(crop_name, quantity):
|
||||
# 服务器会处理批量购买逻辑,客户端等待响应
|
||||
print("已发送批量购买种子请求:", crop_name, " 数量:", quantity)
|
||||
else:
|
||||
Toast.show("购买请求发送失败", Color.RED, 2.0, 1.0)
|
||||
|
||||
|
||||
# 按品质过滤作物
|
||||
@@ -493,8 +530,5 @@ func _on_refresh_button_pressed() -> void:
|
||||
|
||||
#关闭种子商店面板
|
||||
func _on_quit_button_pressed():
|
||||
#打开面板后暂时禁用相机功能
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
|
||||
self.hide()
|
||||
#=========================面板通用处理=========================
|
||||
@@ -4,6 +4,7 @@ extends Panel
|
||||
# 作物仓库格子容器
|
||||
@onready var crop_warehouse_grid_container : GridContainer = $ScrollContainer/Warehouse_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
@onready var refresh_button : Button = $RefreshButton
|
||||
|
||||
#各种排序过滤按钮
|
||||
@onready var sort_all_button : Button = $SortContainer/Sort_All#全部
|
||||
@@ -19,11 +20,17 @@ extends Panel
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
|
||||
|
||||
# 作物图片缓存(复用主游戏的缓存系统)
|
||||
var crop_textures_cache : Dictionary = {}
|
||||
@@ -34,18 +41,26 @@ var current_filter_quality = ""
|
||||
var current_sort_key = ""
|
||||
var current_sort_ascending = true
|
||||
|
||||
# 宠物喂食模式相关变量
|
||||
var is_pet_feeding_mode = false
|
||||
var current_pet_data = {}
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
# 连接按钮信号
|
||||
_connect_buttons()
|
||||
|
||||
# 连接可见性改变信号
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
|
||||
# 连接所有按钮信号
|
||||
func _connect_buttons():
|
||||
# 关闭按钮
|
||||
quit_button.pressed.connect(self._on_quit_button_pressed)
|
||||
refresh_button.pressed.connect(self._on_refresh_button_pressed)
|
||||
|
||||
# 过滤按钮
|
||||
sort_all_button.pressed.connect(func(): _filter_by_quality(""))
|
||||
@@ -61,12 +76,28 @@ func _connect_buttons():
|
||||
sort_profit_button.pressed.connect(func(): _sort_by("收益"))
|
||||
sort_level_button.pressed.connect(func(): _sort_by("等级"))
|
||||
|
||||
# 设置宠物喂食模式
|
||||
func set_pet_feeding_mode(feeding_mode: bool, pet_data: Dictionary = {}):
|
||||
is_pet_feeding_mode = feeding_mode
|
||||
current_pet_data = pet_data
|
||||
|
||||
# 更新UI以反映当前模式
|
||||
if is_pet_feeding_mode:
|
||||
# 宠物喂食模式下,只显示有喂养效果的作物
|
||||
var pet_name = pet_data.get("基本信息", {}).get("宠物名称", "未知宠物")
|
||||
Toast.show("宠物喂食模式:选择要喂给 " + pet_name + " 的作物", Color.CYAN, 3.0, 1.0)
|
||||
else:
|
||||
# 普通模式
|
||||
Toast.show("普通模式:查看作物仓库", Color.GREEN, 2.0, 1.0)
|
||||
|
||||
# 刷新UI
|
||||
update_crop_warehouse_ui()
|
||||
|
||||
# 初始化作物仓库
|
||||
func init_crop_warehouse():
|
||||
# 清空作物仓库格子
|
||||
for child in crop_warehouse_grid_container.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 显示仓库中的成熟物
|
||||
update_crop_warehouse_ui()
|
||||
|
||||
@@ -75,7 +106,6 @@ func update_crop_warehouse_ui():
|
||||
# 清空作物仓库格子
|
||||
for child in crop_warehouse_grid_container.get_children():
|
||||
child.queue_free()
|
||||
#print("更新作物仓库UI,仓库中物品数量:", main_game.crop_warehouse.size())
|
||||
|
||||
# 应用过滤和排序
|
||||
var filtered_crops = _get_filtered_and_sorted_crops()
|
||||
@@ -85,21 +115,31 @@ func update_crop_warehouse_ui():
|
||||
var crop_name = crop_item["name"]
|
||||
var crop_quality = crop_item.get("quality", "普通")
|
||||
var crop_count = crop_item["count"]
|
||||
#print("仓库物品:", crop_name, " 数量:", crop_count)
|
||||
# 创建成熟物按钮
|
||||
var button = _create_crop_button(crop_name, crop_quality)
|
||||
# 更新按钮文本显示数量
|
||||
button.text = str(crop_quality + "-" + crop_name + "\n数量:" + str(crop_count))
|
||||
|
||||
# 根据是否处于访问模式连接不同的事件
|
||||
if main_game.is_visiting_mode:
|
||||
# 访问模式下,点击成熟物只显示信息,不能操作
|
||||
button.pressed.connect(func(): _on_visit_crop_selected(crop_name, crop_count))
|
||||
# 更新按钮文本显示数量
|
||||
if is_pet_feeding_mode:
|
||||
# 宠物喂食模式下显示喂养效果
|
||||
var crop_data = main_game.can_planted_crop.get(crop_name, {})
|
||||
var feed_effects = crop_data.get("喂养效果", {})
|
||||
|
||||
# 构建效果描述
|
||||
var effect_descriptions = []
|
||||
for effect_name in feed_effects:
|
||||
var effect_value = feed_effects[effect_name]
|
||||
if effect_value > 0:
|
||||
effect_descriptions.append(effect_name + "+" + str(effect_value))
|
||||
|
||||
var effect_text = " ".join(effect_descriptions) if effect_descriptions.size() > 0 else "无效果"
|
||||
button.text = str(crop_quality + "-" + crop_name + "\n数量:" + str(crop_count) )
|
||||
button.pressed.connect(func(): _on_crop_feed_selected(crop_name, crop_count))
|
||||
else:
|
||||
# 正常模式下,连接成熟物信息显示事件
|
||||
button.text = str(crop_quality + "-" + crop_name + "\n数量:" + str(crop_count))
|
||||
button.pressed.connect(func(): _on_crop_selected(crop_name, crop_count))
|
||||
|
||||
crop_warehouse_grid_container.add_child(button)
|
||||
print("作物仓库初始化完成,共添加按钮: " + str(crop_warehouse_grid_container.get_child_count()) + "个")
|
||||
|
||||
# 获取过滤和排序后的成熟物列表
|
||||
func _get_filtered_and_sorted_crops():
|
||||
@@ -119,6 +159,11 @@ func _get_filtered_and_sorted_crops():
|
||||
if main_game.can_planted_crop.has(crop_item["name"]):
|
||||
crop_data = main_game.can_planted_crop[crop_item["name"]]
|
||||
|
||||
# 宠物喂食模式过滤:只显示有喂养效果的作物
|
||||
if is_pet_feeding_mode:
|
||||
if crop_data == null or not crop_data.has("喂养效果"):
|
||||
continue
|
||||
|
||||
# 添加到过滤后的列表
|
||||
filtered_crops.append({
|
||||
"name": crop_item["name"],
|
||||
@@ -159,7 +204,6 @@ func _sort_crop_items(a, b):
|
||||
# 按品质过滤成熟物
|
||||
func _filter_by_quality(quality: String):
|
||||
current_filter_quality = quality
|
||||
print("过滤成熟物,品质: " + (quality if quality != "" else "全部"))
|
||||
update_crop_warehouse_ui()
|
||||
|
||||
# 按指定键排序
|
||||
@@ -171,21 +215,12 @@ func _sort_by(sort_key: String):
|
||||
current_sort_key = sort_key
|
||||
current_sort_ascending = true
|
||||
|
||||
print("排序成熟物,键: " + sort_key + ",升序: " + str(current_sort_ascending))
|
||||
update_crop_warehouse_ui()
|
||||
|
||||
# 创建作物按钮
|
||||
func _create_crop_button(crop_name: String, crop_quality: String) -> Button:
|
||||
# 根据品质选择相应的进度条
|
||||
var button = main_game.item_button.duplicate()
|
||||
#普通 Color.HONEYDEW#白色
|
||||
#优良 Color.DODGER_BLUE#深蓝色
|
||||
#稀有 Color.HOT_PINK#品红色
|
||||
#史诗 Color.YELLOW#黄色
|
||||
#传奇 Color.ORANGE_RED#红色
|
||||
#空地 Color.GREEN#绿色
|
||||
#未开垦 Color.WEB_GRAY#深褐色
|
||||
|
||||
|
||||
# 确保按钮可见并可点击
|
||||
button.visible = true
|
||||
@@ -295,7 +330,6 @@ func _on_crop_selected(crop_name, crop_count):
|
||||
info_text = crop_name + " (数量: " + str(crop_count) + ")"
|
||||
|
||||
Toast.show(info_text, Color.GOLD, 3.0, 1.0)
|
||||
print("查看成熟物信息: ", info_text)
|
||||
|
||||
# 访问模式下的成熟物点击处理
|
||||
func _on_visit_crop_selected(crop_name, crop_count):
|
||||
@@ -331,7 +365,97 @@ func _on_visit_crop_selected(crop_name, crop_count):
|
||||
info_text = crop_name + " (数量: " + str(crop_count) + ")"
|
||||
|
||||
Toast.show(info_text, Color.CYAN, 3.0, 1.0)
|
||||
print("查看成熟物信息: ", info_text)
|
||||
|
||||
# 宠物喂食模式下的作物选择处理
|
||||
func _on_crop_feed_selected(crop_name: String, crop_count: int):
|
||||
if not is_pet_feeding_mode or current_pet_data.is_empty():
|
||||
Toast.show("当前不在宠物喂食模式", Color.RED, 2.0, 1.0)
|
||||
return
|
||||
|
||||
# 检查作物是否有喂养效果
|
||||
var crop_data = main_game.can_planted_crop.get(crop_name, {})
|
||||
if not crop_data.has("喂养效果"):
|
||||
Toast.show("该作物没有喂养效果", Color.RED, 2.0, 1.0)
|
||||
return
|
||||
|
||||
# 获取喂养效果
|
||||
var feed_effects = crop_data.get("喂养效果", {})
|
||||
|
||||
# 获取宠物信息
|
||||
var pet_name = current_pet_data.get("基本信息", {}).get("宠物名称", "未知宠物")
|
||||
var pet_id = current_pet_data.get("基本信息", {}).get("宠物ID", "")
|
||||
|
||||
if pet_id == "":
|
||||
Toast.show("宠物ID无效", Color.RED, 2.0, 1.0)
|
||||
return
|
||||
|
||||
# 构建效果描述
|
||||
var effect_descriptions = []
|
||||
for effect_name in feed_effects:
|
||||
var effect_value = feed_effects[effect_name]
|
||||
if effect_value > 0:
|
||||
effect_descriptions.append(effect_name + "+" + str(effect_value))
|
||||
|
||||
var effect_text = ",".join(effect_descriptions) if effect_descriptions.size() > 0 else "无效果"
|
||||
|
||||
# 显示确认对话框
|
||||
var confirm_text = str(
|
||||
"确认喂食 " + pet_name + " 吗?\n\n" +
|
||||
"作物:" + crop_name + "\n" +
|
||||
"效果:" + effect_text + "\n\n" +
|
||||
"确认后将消耗1个" + crop_name
|
||||
)
|
||||
|
||||
_show_feed_confirmation_dialog(confirm_text, crop_name, pet_id, feed_effects)
|
||||
|
||||
# 显示喂食确认对话框
|
||||
func _show_feed_confirmation_dialog(confirm_text: String, crop_name: String, pet_id: String, feed_effects: Dictionary):
|
||||
var confirm_dialog = AcceptDialog.new()
|
||||
confirm_dialog.dialog_text = confirm_text
|
||||
confirm_dialog.title = "宠物喂食确认"
|
||||
confirm_dialog.ok_button_text = "确认喂食"
|
||||
confirm_dialog.add_cancel_button("取消")
|
||||
|
||||
# 添加到场景
|
||||
add_child(confirm_dialog)
|
||||
|
||||
# 连接信号
|
||||
confirm_dialog.confirmed.connect(_on_confirm_feed_pet.bind(crop_name, pet_id, feed_effects, confirm_dialog))
|
||||
confirm_dialog.canceled.connect(_on_cancel_feed_pet.bind(confirm_dialog))
|
||||
|
||||
# 显示对话框
|
||||
confirm_dialog.popup_centered()
|
||||
|
||||
# 确认喂食宠物
|
||||
func _on_confirm_feed_pet(crop_name: String, pet_id: String, feed_effects: Dictionary, dialog: AcceptDialog):
|
||||
# 发送喂食请求到服务器
|
||||
_send_feed_pet_request(crop_name, pet_id, feed_effects)
|
||||
dialog.queue_free()
|
||||
|
||||
# 取消喂食宠物
|
||||
func _on_cancel_feed_pet(dialog: AcceptDialog):
|
||||
dialog.queue_free()
|
||||
|
||||
# 发送喂食宠物请求
|
||||
func _send_feed_pet_request(crop_name: String, pet_id: String, feed_effects: Dictionary):
|
||||
if not tcp_network_manager_panel or not tcp_network_manager_panel.has_method("send_message"):
|
||||
Toast.show("网络功能不可用", Color.RED, 2.0, 1.0)
|
||||
return
|
||||
|
||||
# 构建喂食请求消息
|
||||
var message = {
|
||||
"type": "feed_pet",
|
||||
"pet_id": pet_id,
|
||||
"crop_name": crop_name,
|
||||
"feed_effects": feed_effects
|
||||
}
|
||||
|
||||
# 发送请求
|
||||
tcp_network_manager_panel.send_message(message)
|
||||
|
||||
# 退出喂食模式
|
||||
set_pet_feeding_mode(false)
|
||||
self.hide()
|
||||
|
||||
|
||||
|
||||
@@ -347,13 +471,6 @@ func _get_crop_harvest_texture(crop_name: String) -> Texture2D:
|
||||
print("仓库加载作物收获物图片:", crop_name)
|
||||
return texture
|
||||
|
||||
# 如果没有找到收获物图片,使用成熟图片作为后备
|
||||
var mature_texture_path = crop_path + "成熟.webp"
|
||||
if ResourceLoader.exists(mature_texture_path):
|
||||
var texture = load(mature_texture_path)
|
||||
if texture:
|
||||
print("仓库使用成熟图片作为收获物:", crop_name)
|
||||
return texture
|
||||
|
||||
# 如果都没有找到,使用默认的收获物图片
|
||||
var default_harvest_path = "res://assets/作物/默认/收获物.webp"
|
||||
@@ -363,14 +480,6 @@ func _get_crop_harvest_texture(crop_name: String) -> Texture2D:
|
||||
print("仓库使用默认收获物图片:", crop_name)
|
||||
return texture
|
||||
|
||||
# 最后尝试默认成熟图片
|
||||
var default_mature_path = "res://assets/作物/默认/成熟.webp"
|
||||
if ResourceLoader.exists(default_mature_path):
|
||||
var texture = load(default_mature_path)
|
||||
if texture:
|
||||
print("仓库使用默认成熟图片:", crop_name)
|
||||
return texture
|
||||
|
||||
return null
|
||||
|
||||
# 更新按钮的作物图片
|
||||
@@ -402,7 +511,21 @@ func _on_refresh_button_pressed() -> void:
|
||||
|
||||
# 关闭作物仓库面板
|
||||
func _on_quit_button_pressed():
|
||||
#打开面板后暂时禁用相机功能
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
|
||||
# 如果是宠物喂食模式,退出该模式
|
||||
if is_pet_feeding_mode:
|
||||
set_pet_feeding_mode(false)
|
||||
|
||||
self.hide()
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
update_crop_warehouse_ui()
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
|
||||
#=========================面板通用处理=========================
|
||||
@@ -29,8 +29,19 @@ var consecutive_days: int = 0
|
||||
var has_checked_in_today: bool = false
|
||||
|
||||
# 网络管理器引用
|
||||
var network_manager
|
||||
var main_game
|
||||
@onready var main_game = get_node("/root/main")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'.'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# 奖励配置系统 - 根据 crop_data.json 平衡调整
|
||||
@@ -106,16 +117,14 @@ func _initialize_system() -> void:
|
||||
daily_check_in_reward.hide()
|
||||
today_date = Time.get_date_string_from_system()
|
||||
|
||||
# 获取网络管理器和主游戏引用
|
||||
network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
main_game = get_node("/root/main")
|
||||
|
||||
|
||||
_update_display()
|
||||
_check_daily_status()
|
||||
|
||||
# 从服务器加载签到数据
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
network_manager.sendGetCheckInData()
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.is_connected_to_server():
|
||||
tcp_network_manager_panel.sendGetCheckInData()
|
||||
|
||||
# =============================================================================
|
||||
# 网络后端交互方法
|
||||
@@ -201,12 +210,12 @@ func execute_check_in() -> void:
|
||||
Toast.show("今日已签到,请明日再来", Color.ORANGE)
|
||||
return
|
||||
|
||||
if not network_manager or not network_manager.is_connected_to_server():
|
||||
if not tcp_network_manager_panel or not tcp_network_manager_panel.is_connected_to_server():
|
||||
Toast.show("未连接到服务器,无法签到", Color.RED)
|
||||
return
|
||||
|
||||
# 发送签到请求到服务器
|
||||
network_manager.sendDailyCheckIn()
|
||||
tcp_network_manager_panel.sendDailyCheckIn()
|
||||
daily_check_in_button.disabled = true
|
||||
daily_check_in_button.text = "签到中..."
|
||||
|
||||
@@ -402,14 +411,23 @@ func _on_quit_button_pressed() -> void:
|
||||
func _on_daily_check_in_button_pressed() -> void:
|
||||
execute_check_in()
|
||||
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
# =============================================================================
|
||||
# 公共接口方法 - 供主游戏调用
|
||||
# =============================================================================
|
||||
|
||||
## 刷新签到数据
|
||||
func refresh_check_in_data() -> void:
|
||||
if network_manager and network_manager.is_connected_to_server():
|
||||
network_manager.sendGetCheckInData()
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.is_connected_to_server():
|
||||
tcp_network_manager_panel.sendGetCheckInData()
|
||||
|
||||
## 获取当前签到状态
|
||||
func get_check_in_status() -> Dictionary:
|
||||
519
Script/BigPanel/ItemBagPanel.gd
Normal file
519
Script/BigPanel/ItemBagPanel.gd
Normal file
@@ -0,0 +1,519 @@
|
||||
extends Panel
|
||||
# 这是道具背包面板,用来显示玩家获得的道具
|
||||
|
||||
# 道具背包格子容器
|
||||
@onready var bag_grid: GridContainer = $ScrollContainer/Bag_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
@onready var refresh_button : Button = $RefreshButton
|
||||
|
||||
# 预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
|
||||
|
||||
# 道具使用状态
|
||||
var selected_item_name: String = ""
|
||||
var selected_item_button: Button = null
|
||||
var is_item_selected: bool = false
|
||||
|
||||
# 宠物使用道具模式
|
||||
var is_pet_item_mode: bool = false
|
||||
var current_pet_data: Dictionary = {}
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
# 连接可见性改变信号
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
|
||||
# 异步更新道具背包UI
|
||||
func _update_item_bag_ui_async():
|
||||
# 清空道具背包格子
|
||||
for child in bag_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 等待一帧确保子节点被清理
|
||||
await get_tree().process_frame
|
||||
|
||||
# 为背包中的每个道具创建按钮
|
||||
for item_data in main_game.item_bag:
|
||||
var item_name = item_data["name"]
|
||||
var item_count = item_data["count"]
|
||||
|
||||
# 创建道具按钮
|
||||
var button = _create_item_button(item_name)
|
||||
|
||||
# 更新按钮文本显示数量
|
||||
button.text = str(item_name + "\n数量:" + str(item_count))
|
||||
|
||||
# 根据是否处于访问模式连接不同的事件
|
||||
if main_game.is_visiting_mode:
|
||||
# 访问模式下,点击道具只显示信息,不能使用
|
||||
button.pressed.connect(func(): _on_visit_item_selected(item_name, item_count))
|
||||
else:
|
||||
# 正常模式下,连接道具选择事件
|
||||
button.pressed.connect(func(): _on_item_selected(item_name, item_count, button))
|
||||
|
||||
bag_grid.add_child(button)
|
||||
|
||||
# 初始化道具背包
|
||||
func init_item_bag():
|
||||
# 清空道具背包格子
|
||||
for child in bag_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 显示背包中的道具
|
||||
update_item_bag_ui()
|
||||
|
||||
# 更新道具背包UI(同步版本,用于刷新按钮)
|
||||
func update_item_bag_ui():
|
||||
# 清空道具背包格子
|
||||
for child in bag_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 获取过滤后的道具列表
|
||||
var filtered_items = _get_filtered_items()
|
||||
|
||||
# 为背包中的每个道具创建按钮
|
||||
for item_data in filtered_items:
|
||||
var item_name = item_data["name"]
|
||||
var item_count = item_data["count"]
|
||||
|
||||
# 创建道具按钮
|
||||
var button = _create_item_button(item_name)
|
||||
|
||||
# 更新按钮文本显示数量
|
||||
button.text = str(item_name + "\n数量:" + str(item_count))
|
||||
|
||||
# 根据模式连接不同的事件
|
||||
if main_game.is_visiting_mode:
|
||||
# 访问模式下,点击道具只显示信息,不能使用
|
||||
button.pressed.connect(func(): _on_visit_item_selected(item_name, item_count))
|
||||
elif is_pet_item_mode:
|
||||
# 宠物使用道具模式下,连接宠物道具选择事件
|
||||
button.pressed.connect(func(): _on_pet_item_selected(item_name, item_count))
|
||||
else:
|
||||
# 正常模式下,连接道具选择事件
|
||||
button.pressed.connect(func(): _on_item_selected(item_name, item_count, button))
|
||||
|
||||
bag_grid.add_child(button)
|
||||
|
||||
# 创建道具按钮
|
||||
func _create_item_button(item_name: String) -> Button:
|
||||
# 使用绿色按钮作为道具按钮的默认样式
|
||||
var button = main_game.item_button.duplicate()
|
||||
|
||||
# 确保按钮可见并可点击
|
||||
button.visible = true
|
||||
button.disabled = false
|
||||
button.focus_mode = Control.FOCUS_ALL
|
||||
|
||||
# 设置按钮文本
|
||||
button.text = item_name
|
||||
|
||||
# 添加工具提示,从item_config.json获取道具信息
|
||||
var item_config = _load_item_config()
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var description = item_info.get("描述", "暂无描述")
|
||||
var cost = item_info.get("花费", 0)
|
||||
|
||||
button.tooltip_text = str(
|
||||
"道具: " + item_name + "\n" +
|
||||
"价格: " + str(cost) + "元\n" +
|
||||
"描述: " + description + "\n" +
|
||||
"点击选择道具,然后对地块使用"
|
||||
)
|
||||
else:
|
||||
button.tooltip_text = str("道具: " + item_name + "\n描述: 暂无信息")
|
||||
|
||||
# 如果按钮有标题标签,设置标题
|
||||
if button.has_node("Title"):
|
||||
button.get_node("Title").text = "道具"
|
||||
button.get_node("Title").modulate = Color.CYAN # 道具标题使用青色
|
||||
|
||||
# 更新按钮的道具图片
|
||||
_update_button_item_image(button, item_name)
|
||||
|
||||
return button
|
||||
|
||||
# 从主游戏脚本获取道具配置数据
|
||||
func _load_item_config() -> Dictionary:
|
||||
# 从主游戏脚本的全局变量获取道具配置数据
|
||||
if main_game.item_config_data.size() > 0:
|
||||
return main_game.item_config_data
|
||||
else:
|
||||
print("道具背包:主游戏脚本中没有道具配置数据")
|
||||
return {}
|
||||
|
||||
# 设置宠物使用道具模式
|
||||
func set_pet_item_mode(enabled: bool, pet_data: Dictionary = {}):
|
||||
is_pet_item_mode = enabled
|
||||
current_pet_data = pet_data
|
||||
|
||||
# 刷新UI以应用新的模式
|
||||
update_item_bag_ui()
|
||||
|
||||
# 获取过滤后的道具列表
|
||||
func _get_filtered_items() -> Array:
|
||||
var filtered_items = []
|
||||
|
||||
for item_data in main_game.item_bag:
|
||||
var item_name = item_data["name"]
|
||||
|
||||
# 如果是宠物使用道具模式,只显示宠物道具
|
||||
if is_pet_item_mode:
|
||||
if _is_pet_item(item_name):
|
||||
filtered_items.append(item_data)
|
||||
else:
|
||||
# 正常模式显示所有道具
|
||||
filtered_items.append(item_data)
|
||||
|
||||
return filtered_items
|
||||
|
||||
# 检查是否为宠物道具
|
||||
func _is_pet_item(item_name: String) -> bool:
|
||||
var item_config = _load_item_config()
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var item_type = item_info.get("类型", "")
|
||||
return item_type == "宠物道具"
|
||||
return false
|
||||
|
||||
|
||||
# 正常模式下的道具点击处理 - 选择道具
|
||||
func _on_item_selected(item_name: String, item_count: int, button: Button):
|
||||
# 检查道具是否可以使用
|
||||
if not _is_item_usable(item_name):
|
||||
# 显示道具信息
|
||||
_show_item_info(item_name, item_count)
|
||||
return
|
||||
|
||||
# 检查是否为农场道具(直接使用类型)
|
||||
if _is_farm_item(item_name):
|
||||
# 农场道具直接使用,显示确认对话框
|
||||
_show_farm_item_confirmation_dialog(item_name, item_count)
|
||||
return
|
||||
|
||||
# 取消之前选择的道具
|
||||
if selected_item_button and selected_item_button != button:
|
||||
_deselect_item()
|
||||
|
||||
if selected_item_name == item_name:
|
||||
# 如果点击的是已选择的道具,取消选择
|
||||
_deselect_item()
|
||||
Toast.show("已取消选择道具", Color.YELLOW, 2.0, 1.0)
|
||||
else:
|
||||
# 选择新道具
|
||||
_select_item(item_name, button)
|
||||
#点击后关闭玩家道具面板
|
||||
_on_quit_button_pressed()
|
||||
Toast.show("已选择 " + item_name + ",点击地块使用道具", Color.CYAN, 3.0, 1.0)
|
||||
|
||||
# 选择道具
|
||||
func _select_item(item_name: String, button: Button):
|
||||
selected_item_name = item_name
|
||||
selected_item_button = button
|
||||
is_item_selected = true
|
||||
|
||||
# 设置全局选择状态
|
||||
main_game.selected_item_name = item_name
|
||||
main_game.is_item_selected = true
|
||||
|
||||
# 更改按钮样式表示选中
|
||||
if button.has_node("Title"):
|
||||
button.get_node("Title").modulate = Color.YELLOW # 选中时使用黄色
|
||||
|
||||
# 取消选择道具
|
||||
func _deselect_item():
|
||||
selected_item_name = ""
|
||||
is_item_selected = false
|
||||
|
||||
# 清除全局选择状态
|
||||
main_game.selected_item_name = ""
|
||||
main_game.is_item_selected = false
|
||||
|
||||
# 恢复按钮样式
|
||||
if selected_item_button and selected_item_button.has_node("Title"):
|
||||
selected_item_button.get_node("Title").modulate = Color.CYAN
|
||||
|
||||
selected_item_button = null
|
||||
|
||||
# 检查道具是否可以使用
|
||||
func _is_item_usable(item_name: String) -> bool:
|
||||
# 根据道具类型判断是否可以使用
|
||||
match item_name:
|
||||
"农家肥", "金坷垃", "生长素":
|
||||
return true # 施肥道具
|
||||
"水壶", "水桶":
|
||||
return true # 浇水道具
|
||||
"铲子","除草剂":
|
||||
return true # 铲除道具
|
||||
"精准采集锄", "时运锄":
|
||||
return true # 采集道具
|
||||
"小额经验卡", "小额金币卡":
|
||||
return true # 农场道具(直接使用)
|
||||
"杀虫剂":
|
||||
return false # 其他道具(暂不实现)
|
||||
_:
|
||||
return false
|
||||
|
||||
# 检查道具是否为农场道具(直接使用类型)
|
||||
func _is_farm_item(item_name: String) -> bool:
|
||||
var item_config = _load_item_config()
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var item_type = item_info.get("类型", "")
|
||||
return item_type == "农场道具"
|
||||
return false
|
||||
|
||||
# 显示道具信息
|
||||
func _show_item_info(item_name: String, item_count: int):
|
||||
var info_text = ""
|
||||
|
||||
var item_config = _load_item_config()
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var description = item_info.get("描述", "暂无描述")
|
||||
var cost = item_info.get("花费", 0)
|
||||
|
||||
info_text = item_name + " (数量: " + str(item_count) + ")\n"
|
||||
info_text += "价格: " + str(cost) + "元\n"
|
||||
info_text += "描述: " + description
|
||||
|
||||
if not _is_item_usable(item_name):
|
||||
info_text += "\n注意: 此道具功能暂未实现"
|
||||
else:
|
||||
info_text = item_name + " (数量: " + str(item_count) + ")\n描述: 暂无信息"
|
||||
|
||||
Toast.show(info_text, Color.CYAN, 3.0, 1.0)
|
||||
|
||||
# 访问模式下的道具点击处理
|
||||
func _on_visit_item_selected(item_name: String, item_count: int):
|
||||
# 显示道具信息
|
||||
_show_item_info(item_name, item_count)
|
||||
|
||||
# 宠物使用道具模式下的道具选择处理
|
||||
func _on_pet_item_selected(item_name: String, item_count: int):
|
||||
# 显示确认对话框
|
||||
_show_pet_item_confirmation_dialog(item_name, item_count)
|
||||
|
||||
# 显示农场道具确认对话框
|
||||
func _show_farm_item_confirmation_dialog(item_name: String, item_count: int):
|
||||
# 获取道具信息
|
||||
var item_config = _load_item_config()
|
||||
var item_description = "未知效果"
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
item_description = item_info.get("描述", "未知效果")
|
||||
|
||||
var confirmation_text = str(
|
||||
"确定要使用道具 " + item_name + " 吗?\n\n" +
|
||||
"道具效果:" + item_description + "\n\n" +
|
||||
"使用后道具数量将减少1个"
|
||||
)
|
||||
|
||||
# 使用自定义的AcceptDialog
|
||||
var dialog = preload("res://Script/Dialog/AcceptDialog.gd").new()
|
||||
|
||||
# 添加到场景(这会触发_ready函数)
|
||||
add_child(dialog)
|
||||
|
||||
# 在_ready执行后设置内容
|
||||
dialog.set_dialog_title("确认使用道具")
|
||||
dialog.set_dialog_content(confirmation_text)
|
||||
dialog.set_ok_text("确认使用")
|
||||
dialog.set_cancel_text("取消")
|
||||
|
||||
# 连接信号
|
||||
dialog.confirmed.connect(_on_confirm_farm_item_use.bind(item_name, dialog))
|
||||
dialog.canceled.connect(_on_cancel_farm_item_use.bind(dialog))
|
||||
|
||||
# 显示对话框
|
||||
dialog.popup_centered()
|
||||
|
||||
# 确认使用农场道具
|
||||
func _on_confirm_farm_item_use(item_name: String, dialog: AcceptDialog):
|
||||
_send_farm_item_use_request(item_name)
|
||||
dialog.queue_free()
|
||||
self.hide()
|
||||
|
||||
# 取消使用农场道具
|
||||
func _on_cancel_farm_item_use(dialog: AcceptDialog):
|
||||
dialog.queue_free()
|
||||
|
||||
# 发送农场道具使用请求
|
||||
func _send_farm_item_use_request(item_name: String):
|
||||
var message = {
|
||||
"type": "use_farm_item",
|
||||
"item_name": item_name
|
||||
}
|
||||
|
||||
# 发送请求
|
||||
tcp_network_manager_panel.send_message(message)
|
||||
|
||||
Toast.show("正在使用道具...", Color.BLUE, 2.0, 1.0)
|
||||
|
||||
# 显示宠物使用道具确认对话框
|
||||
func _show_pet_item_confirmation_dialog(item_name: String, item_count: int):
|
||||
if current_pet_data.is_empty():
|
||||
Toast.show("宠物数据丢失,请重新选择宠物", Color.RED, 2.0, 1.0)
|
||||
return
|
||||
|
||||
var pet_name = current_pet_data.get("基本信息", {}).get("宠物名称", "未知宠物")
|
||||
var pet_id = current_pet_data.get("基本信息", {}).get("宠物ID", "")
|
||||
|
||||
# 获取道具信息
|
||||
var item_config = _load_item_config()
|
||||
var item_description = "未知效果"
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
item_description = item_info.get("描述", "未知效果")
|
||||
|
||||
var confirmation_text = str(
|
||||
"确定要对宠物 " + pet_name + " 使用道具 " + item_name + " 吗?\n\n" +
|
||||
"道具效果:" + item_description + "\n\n" +
|
||||
"使用后道具数量将减少1个"
|
||||
)
|
||||
|
||||
# 使用自定义的AcceptDialog
|
||||
var dialog = preload("res://Script/Dialog/AcceptDialog.gd").new()
|
||||
|
||||
# 添加到场景(这会触发_ready函数)
|
||||
add_child(dialog)
|
||||
|
||||
# 在_ready执行后设置内容
|
||||
dialog.set_dialog_title("确认使用道具")
|
||||
dialog.set_dialog_content(confirmation_text)
|
||||
dialog.set_ok_text("确认使用")
|
||||
dialog.set_cancel_text("取消")
|
||||
|
||||
# 连接信号
|
||||
dialog.confirmed.connect(_on_confirm_pet_item_use.bind(item_name, pet_id, dialog))
|
||||
dialog.canceled.connect(_on_cancel_pet_item_use.bind(dialog))
|
||||
|
||||
# 显示对话框
|
||||
dialog.popup_centered()
|
||||
|
||||
# 确认使用宠物道具
|
||||
func _on_confirm_pet_item_use(item_name: String, pet_id: String, dialog: AcceptDialog):
|
||||
_send_pet_item_use_request(item_name, pet_id)
|
||||
dialog.queue_free()
|
||||
self.hide()
|
||||
|
||||
# 取消使用宠物道具
|
||||
func _on_cancel_pet_item_use(dialog: AcceptDialog):
|
||||
dialog.queue_free()
|
||||
self.hide()
|
||||
|
||||
# 发送宠物使用道具请求
|
||||
func _send_pet_item_use_request(item_name: String, pet_id: String):
|
||||
var message = {
|
||||
"type": "use_pet_item",
|
||||
"item_name": item_name,
|
||||
"pet_id": pet_id
|
||||
}
|
||||
|
||||
# 发送请求
|
||||
tcp_network_manager_panel.send_message(message)
|
||||
|
||||
# 退出宠物使用道具模式
|
||||
_exit_pet_item_mode()
|
||||
|
||||
Toast.show("正在使用道具...", Color.BLUE, 2.0, 1.0)
|
||||
|
||||
# 退出宠物使用道具模式
|
||||
func _exit_pet_item_mode():
|
||||
is_pet_item_mode = false
|
||||
current_pet_data = {}
|
||||
|
||||
# 刷新UI
|
||||
update_item_bag_ui()
|
||||
|
||||
# 更新按钮的道具图片
|
||||
func _update_button_item_image(button: Button, item_name: String):
|
||||
# 检查按钮是否有CropImage节点
|
||||
var item_image = button.get_node_or_null("CropImage")
|
||||
if not item_image:
|
||||
return
|
||||
|
||||
# 从配置文件获取道具图片路径
|
||||
var item_config = _load_item_config()
|
||||
var texture = null
|
||||
|
||||
if item_config and item_config.has(item_name):
|
||||
var item_info = item_config[item_name]
|
||||
var image_path = item_info.get("道具图片", "")
|
||||
|
||||
if image_path != "" and ResourceLoader.exists(image_path):
|
||||
# 尝试加载道具图片
|
||||
texture = load(image_path)
|
||||
if texture:
|
||||
pass
|
||||
else:
|
||||
print("加载道具图片失败:", item_name, " -> ", image_path)
|
||||
else:
|
||||
print("道具图片路径无效或不存在:", item_name, " -> ", image_path)
|
||||
|
||||
# 如果没有找到道具图片,尝试使用默认道具图片
|
||||
if not texture:
|
||||
var default_item_path = "res://assets/道具图片/默认道具.webp"
|
||||
if ResourceLoader.exists(default_item_path):
|
||||
texture = load(default_item_path)
|
||||
if texture:
|
||||
print("使用默认道具图片:", item_name)
|
||||
|
||||
# 设置图片
|
||||
if texture:
|
||||
# CropImage是Sprite2D,直接设置texture属性
|
||||
item_image.texture = texture
|
||||
item_image.visible = true
|
||||
else:
|
||||
# 如果没有图片,隐藏图片节点
|
||||
item_image.visible = false
|
||||
|
||||
#=========================面板通用处理=========================
|
||||
# 关闭道具背包面板
|
||||
func _on_quit_button_pressed() -> void:
|
||||
# 如果是宠物使用道具模式,退出该模式
|
||||
if is_pet_item_mode:
|
||||
_exit_pet_item_mode()
|
||||
|
||||
self.hide()
|
||||
|
||||
#手动刷新道具背包面板
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
# 刷新道具背包UI
|
||||
update_item_bag_ui()
|
||||
Toast.show("道具背包已刷新", Color.GREEN, 2.0, 1.0)
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
# 面板显示时自动刷新数据
|
||||
update_item_bag_ui()
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
#=========================面板通用处理=========================
|
||||
|
||||
# 获取当前选择的道具名称
|
||||
func get_selected_item_name() -> String:
|
||||
return selected_item_name
|
||||
|
||||
# 检查是否有道具被选择
|
||||
func is_item_currently_selected() -> bool:
|
||||
return is_item_selected
|
||||
@@ -4,10 +4,22 @@ extends Panel
|
||||
# 道具商店格子容器
|
||||
@onready var store_grid: GridContainer = $ScrollContainer/Store_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
@onready var refresh_button : Button = $RefreshButton
|
||||
|
||||
# 预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
@onready var batch_buy_popup: PanelContainer = $'../../DiaLog/BatchBuyPopup'
|
||||
|
||||
|
||||
# 道具配置数据
|
||||
var item_config : Dictionary = {}
|
||||
@@ -16,20 +28,16 @@ var item_config : Dictionary = {}
|
||||
func _ready():
|
||||
# 连接关闭按钮信号
|
||||
quit_button.pressed.connect(self._on_quit_button_pressed)
|
||||
# 连接可见性改变信号
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
# 初始化道具商店
|
||||
func init_item_store():
|
||||
# 加载道具配置数据
|
||||
_load_item_config()
|
||||
|
||||
# 清空道具商店格子
|
||||
for child in store_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 显示商店中的道具
|
||||
# 从主游戏脚本获取道具配置数据
|
||||
_load_item_config_from_main()
|
||||
update_item_store_ui()
|
||||
|
||||
# 更新道具商店UI
|
||||
@@ -88,37 +96,36 @@ func _create_item_button(item_name: String, item_cost: int, item_desc: String) -
|
||||
|
||||
return button
|
||||
|
||||
# 加载道具配置数据
|
||||
func _load_item_config():
|
||||
# 从item_config.json加载道具配置数据
|
||||
var file = FileAccess.open("res://Server/config/item_config.json", FileAccess.READ)
|
||||
if not file:
|
||||
print("无法读取道具配置文件!")
|
||||
# 从主游戏脚本获取道具配置数据
|
||||
func _load_item_config_from_main():
|
||||
# 从主游戏脚本的全局变量获取道具配置数据
|
||||
if main_game.item_config_data.size() > 0:
|
||||
item_config = main_game.item_config_data
|
||||
print("道具商店:从主游戏脚本获取道具配置数据,道具种类:", item_config.size())
|
||||
else:
|
||||
print("道具商店:主游戏脚本中没有道具配置数据,使用空配置")
|
||||
item_config = {}
|
||||
return
|
||||
|
||||
var json_text = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_text)
|
||||
if parse_result != OK:
|
||||
print("道具配置JSON解析错误:", json.get_error_message())
|
||||
item_config = {}
|
||||
return
|
||||
|
||||
item_config = json.get_data()
|
||||
print("成功加载道具配置,道具种类:", item_config.size())
|
||||
|
||||
# 商店道具点击处理 - 购买道具
|
||||
func _on_store_item_selected(item_name: String, item_cost: int, item_desc: String):
|
||||
# 检查玩家金钱是否足够
|
||||
# 检查玩家金钱是否足够(至少能买1个)
|
||||
if main_game.money < item_cost:
|
||||
Toast.show("金钱不足!需要 " + str(item_cost) + " 元,当前只有 " + str(main_game.money) + " 元", Color.RED, 3.0, 1.0)
|
||||
return
|
||||
|
||||
# 显示购买确认对话框
|
||||
_show_buy_confirmation_dialog(item_name, item_cost, item_desc)
|
||||
# 显示批量购买弹窗
|
||||
if batch_buy_popup:
|
||||
batch_buy_popup.show_buy_popup(
|
||||
item_name,
|
||||
item_cost,
|
||||
item_desc,
|
||||
"item",
|
||||
_on_confirm_buy_item,
|
||||
_on_cancel_buy_item
|
||||
)
|
||||
else:
|
||||
print("批量购买弹窗未找到")
|
||||
|
||||
# 显示购买确认对话框
|
||||
func _show_buy_confirmation_dialog(item_name: String, item_cost: int, item_desc: String):
|
||||
@@ -146,24 +153,54 @@ func _show_buy_confirmation_dialog(item_name: String, item_cost: int, item_desc:
|
||||
# 显示对话框
|
||||
confirm_dialog.popup_centered()
|
||||
|
||||
# 确认购买道具
|
||||
func _on_confirm_buy_item(item_name: String, item_cost: int, dialog: AcceptDialog):
|
||||
if network_manager and network_manager.has_method("sendBuyItem"):
|
||||
if network_manager.sendBuyItem(item_name, item_cost):
|
||||
Toast.show("正在购买 " + item_name + "...", Color.YELLOW, 2.0, 1.0)
|
||||
# 确认购买道具(批量购买版本)
|
||||
func _on_confirm_buy_item(item_name: String, unit_cost: int, quantity: int, buy_type: String):
|
||||
var total_cost = unit_cost * quantity
|
||||
|
||||
# 再次检查金钱是否足够
|
||||
if main_game.money < total_cost:
|
||||
Toast.show("金钱不足!需要 " + str(total_cost) + " 元,当前只有 " + str(main_game.money) + " 元", Color.RED, 3.0, 1.0)
|
||||
return
|
||||
|
||||
# 发送批量购买请求到服务器
|
||||
_send_batch_buy_item_request(item_name, unit_cost, quantity)
|
||||
|
||||
# 取消购买道具(批量购买版本)
|
||||
func _on_cancel_buy_item():
|
||||
print("取消购买道具")
|
||||
|
||||
# 发送批量购买道具请求
|
||||
func _send_batch_buy_item_request(item_name: String, unit_cost: int, quantity: int):
|
||||
# 发送批量购买请求到服务器
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.has_method("sendBuyItem"):
|
||||
if tcp_network_manager_panel.sendBuyItem(item_name, unit_cost, quantity):
|
||||
# 服务器会处理批量购买逻辑,客户端等待响应
|
||||
print("已发送批量购买道具请求:", item_name, " 数量:", quantity)
|
||||
else:
|
||||
Toast.show("发送购买请求失败", Color.RED, 2.0, 1.0)
|
||||
Toast.show("购买请求发送失败", Color.RED, 2.0, 1.0)
|
||||
else:
|
||||
Toast.show("网络管理器不可用", Color.RED, 2.0, 1.0)
|
||||
|
||||
# 清理对话框
|
||||
if dialog:
|
||||
dialog.queue_free()
|
||||
# 将道具添加到道具背包(客户端同步)
|
||||
func _add_item_to_bag(item_name: String):
|
||||
# 确保道具背包存在
|
||||
if "道具背包" not in main_game:
|
||||
main_game["道具背包"] = []
|
||||
|
||||
# 取消购买道具
|
||||
func _on_cancel_buy_item(dialog: AcceptDialog):
|
||||
if dialog:
|
||||
dialog.queue_free()
|
||||
# 查找是否已存在该道具
|
||||
var found = false
|
||||
for item in main_game["道具背包"]:
|
||||
if item.get("name") == item_name:
|
||||
item["count"] += 1
|
||||
found = true
|
||||
break
|
||||
|
||||
# 如果不存在,添加新道具
|
||||
if not found:
|
||||
main_game["道具背包"].append({
|
||||
"name": item_name,
|
||||
"count": 1
|
||||
})
|
||||
|
||||
# 更新按钮的道具图片
|
||||
func _update_button_item_image(button: Button, item_name: String):
|
||||
@@ -184,7 +221,7 @@ func _update_button_item_image(button: Button, item_name: String):
|
||||
# 尝试加载道具图片
|
||||
texture = load(image_path)
|
||||
if texture:
|
||||
print("成功加载道具图片:", item_name, " -> ", image_path)
|
||||
pass
|
||||
else:
|
||||
print("加载道具图片失败:", item_name, " -> ", image_path)
|
||||
else:
|
||||
@@ -217,11 +254,22 @@ func _on_refresh_button_pressed() -> void:
|
||||
init_item_store()
|
||||
Toast.show("道具商店已刷新", Color.GREEN, 2.0, 1.0)
|
||||
|
||||
|
||||
|
||||
# 关闭道具商店面板
|
||||
func _on_quit_button_pressed() -> void:
|
||||
# 打开面板后暂时禁用相机功能
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
self.hide()
|
||||
pass
|
||||
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
# 面板显示时自动刷新数据
|
||||
init_item_store()
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
#=========================面板通用处理=========================
|
||||
@@ -24,7 +24,7 @@ extends PanelContainer
|
||||
#状态提示标签
|
||||
@onready var status_label : Label = $VBox/status_label
|
||||
|
||||
#隐藏注册相关
|
||||
|
||||
@onready var password_2: HBoxContainer = $VBox/Password2
|
||||
@onready var verification_code: HBoxContainer = $VBox/VerificationCode
|
||||
@onready var player_name: HBoxContainer = $VBox/PlayerName
|
||||
@@ -37,16 +37,27 @@ var remember_password : bool = true # 默认记住密码
|
||||
|
||||
# 引用主场景和全局函数
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var tcp_network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var pet_bag_panel: Panel = $'../PetBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
|
||||
|
||||
self.show()
|
||||
#隐藏注册相关UI
|
||||
password_2.hide()
|
||||
verification_code.hide()
|
||||
player_name.hide()
|
||||
farm_name.hide()
|
||||
|
||||
# 连接按钮信号
|
||||
login_button.pressed.connect(self._on_login_button_pressed)
|
||||
@@ -61,6 +72,13 @@ func _ready():
|
||||
|
||||
# 处理登录按钮点击
|
||||
func _on_login_button_pressed():
|
||||
password_2.hide()
|
||||
verification_code.hide()
|
||||
player_name.hide()
|
||||
farm_name.hide()
|
||||
|
||||
|
||||
|
||||
var user_name = username_input.text.strip_edges() # 修剪前后的空格
|
||||
var user_password = password_input.text.strip_edges()
|
||||
var farmname = farmname_input.text.strip_edges()
|
||||
@@ -71,13 +89,19 @@ func _on_login_button_pressed():
|
||||
return
|
||||
|
||||
# 检查网络连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
if !tcp_network_manager_panel.client.is_client_connected():
|
||||
status_label.text = "未连接到服务器,正在尝试连接..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 尝试自动连接到服务器
|
||||
tcp_network_manager.connect_to_current_server()
|
||||
tcp_network_manager_panel.connect_to_current_server()
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
|
||||
# 再次检查连接状态
|
||||
if !tcp_network_manager_panel.client.is_client_connected():
|
||||
status_label.text = "连接服务器失败,正在尝试其他服务器..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 等待自动服务器切换完成
|
||||
await get_tree().create_timer(3.0).timeout
|
||||
|
||||
|
||||
# 禁用按钮,防止重复点击
|
||||
@@ -90,7 +114,7 @@ func _on_login_button_pressed():
|
||||
if remember_password:
|
||||
_save_login_info(user_name, user_password)
|
||||
|
||||
tcp_network_manager.sendLoginInfo(user_name, user_password)
|
||||
tcp_network_manager_panel.sendLoginInfo(user_name, user_password)
|
||||
|
||||
# 更新主游戏数据
|
||||
main_game.user_name = user_name
|
||||
@@ -105,6 +129,8 @@ func _on_login_button_pressed():
|
||||
|
||||
# 处理验证码发送按钮点击
|
||||
func _on_send_button_pressed():
|
||||
|
||||
|
||||
var user_name = username_input.text.strip_edges()
|
||||
|
||||
if user_name == "":
|
||||
@@ -118,15 +144,15 @@ func _on_send_button_pressed():
|
||||
return
|
||||
|
||||
# 检查网络连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
if !tcp_network_manager_panel.client.is_client_connected():
|
||||
status_label.text = "未连接到服务器,正在尝试连接..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 尝试自动连接到服务器
|
||||
tcp_network_manager.connect_to_current_server()
|
||||
tcp_network_manager_panel.connect_to_current_server()
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
|
||||
# 再次检查连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
if !tcp_network_manager_panel.client.is_client_connected():
|
||||
status_label.text = "连接服务器失败,正在尝试其他服务器..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 等待自动服务器切换完成
|
||||
@@ -140,7 +166,7 @@ func _on_send_button_pressed():
|
||||
status_label.modulate = Color.YELLOW
|
||||
|
||||
# 发送验证码请求
|
||||
tcp_network_manager.sendVerificationCodeRequest(user_name)
|
||||
tcp_network_manager_panel.sendVerificationCodeRequest(user_name)
|
||||
|
||||
# 60秒后重新启用按钮(或收到响应后提前启用)
|
||||
var timer = 60
|
||||
@@ -201,15 +227,15 @@ func _on_register_button_pressed():
|
||||
return
|
||||
|
||||
# 检查网络连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
if !tcp_network_manager_panel.client.is_client_connected():
|
||||
status_label.text = "未连接到服务器,正在尝试连接..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 尝试自动连接到服务器
|
||||
tcp_network_manager.connect_to_current_server()
|
||||
tcp_network_manager_panel.connect_to_current_server()
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
|
||||
# 再次检查连接状态
|
||||
if !tcp_network_manager.client.is_client_connected():
|
||||
if !tcp_network_manager_panel.client.is_client_connected():
|
||||
status_label.text = "连接服务器失败,正在尝试其他服务器..."
|
||||
status_label.modulate = Color.YELLOW
|
||||
# 等待自动服务器切换完成
|
||||
@@ -223,12 +249,12 @@ func _on_register_button_pressed():
|
||||
status_label.modulate = Color.YELLOW
|
||||
|
||||
# 发送注册请求
|
||||
tcp_network_manager.sendRegisterInfo(user_name, user_password, farmname, player_name, verification_code)
|
||||
tcp_network_manager_panel.sendRegisterInfo(user_name, user_password, farmname, player_name, verification_code)
|
||||
|
||||
# 更新主游戏数据
|
||||
#main_game.user_name = user_name
|
||||
#main_game.user_password = user_password
|
||||
#main_game.farmname = farmname
|
||||
main_game.user_name = user_name
|
||||
main_game.user_password = user_password
|
||||
main_game.farmname = farmname
|
||||
|
||||
# 5秒后重新启用按钮(如果没有收到响应)
|
||||
await get_tree().create_timer(5.0).timeout
|
||||
@@ -273,30 +299,9 @@ func is_valid_qq_number(qq_number: String) -> bool:
|
||||
|
||||
# 添加密码验证函数
|
||||
func is_valid_password(password: String) -> bool:
|
||||
# 检查密码是否为空
|
||||
if password.length() == 0:
|
||||
return false
|
||||
|
||||
# 遍历密码中的每个字符
|
||||
for i in range(password.length()):
|
||||
var char = password[i]
|
||||
|
||||
# 检查字符是否为数字
|
||||
var is_digit = char >= "0" and char <= "9"
|
||||
|
||||
# 检查字符是否为大写字母
|
||||
var is_upper = char >= "A" and char <= "Z"
|
||||
|
||||
# 检查字符是否为小写字母
|
||||
var is_lower = char >= "a" and char <= "z"
|
||||
|
||||
# 如果字符既不是数字也不是字母,则返回false
|
||||
if not (is_digit or is_upper or is_lower):
|
||||
return false
|
||||
|
||||
# 如果所有字符都是字母或数字,则返回true
|
||||
return true
|
||||
|
||||
# 使用正则表达式检查是否只包含数字和字母
|
||||
var pattern = r"^[a-zA-Z0-9]+$"
|
||||
return password.match(pattern) != null
|
||||
|
||||
# 处理登录响应
|
||||
func _on_login_response_received(success: bool, message: String, user_data: Dictionary):
|
||||
@@ -338,19 +343,36 @@ func _on_login_response_received(success: bool, message: String, user_data: Dict
|
||||
else:
|
||||
main_game.item_bag = []
|
||||
|
||||
# 加载宠物背包数据
|
||||
if user_data.has("宠物背包"):
|
||||
main_game.pet_bag = user_data.get("宠物背包", [])
|
||||
else:
|
||||
main_game.pet_bag = []
|
||||
|
||||
# 加载巡逻宠物数据
|
||||
if user_data.has("巡逻宠物"):
|
||||
main_game.patrol_pets = user_data.get("巡逻宠物", [])
|
||||
else:
|
||||
main_game.patrol_pets = []
|
||||
|
||||
main_game.start_game = true
|
||||
self.hide()
|
||||
|
||||
# 确保在更新数据后调用主游戏的 UI 更新函数
|
||||
main_game._update_ui()
|
||||
main_game._refresh_farm_lots()
|
||||
player_bag_panel.update_player_bag_ui()
|
||||
|
||||
player_bag_panel.update_player_bag_ui()
|
||||
# 更新作物仓库和道具背包UI
|
||||
if main_game.crop_warehouse_panel and main_game.crop_warehouse_panel.has_method("update_crop_warehouse_ui"):
|
||||
main_game.crop_warehouse_panel.update_crop_warehouse_ui()
|
||||
if main_game.item_bag_panel and main_game.item_bag_panel.has_method("update_item_bag_ui"):
|
||||
main_game.item_bag_panel.update_item_bag_ui()
|
||||
crop_warehouse_panel.update_crop_warehouse_ui()
|
||||
item_bag_panel.update_item_bag_ui()
|
||||
# 更新宠物背包UI
|
||||
if pet_bag_panel and pet_bag_panel.has_method("update_pet_bag_ui"):
|
||||
pet_bag_panel.update_pet_bag_ui()
|
||||
|
||||
# 初始化巡逻宠物
|
||||
if main_game.has_method("init_patrol_pets"):
|
||||
main_game.init_patrol_pets()
|
||||
|
||||
# 调用主游戏的登录成功处理函数
|
||||
main_game.handle_login_success(user_data)
|
||||
@@ -515,16 +537,12 @@ func _display_version_info():
|
||||
status_label.text = "萌芽农场 v" + main_game.client_version + " - 欢迎使用"
|
||||
status_label.modulate = Color.CYAN
|
||||
|
||||
# 处理连接断开事件
|
||||
func _on_connection_lost():
|
||||
print("登录面板收到连接断开通知")
|
||||
|
||||
# 更新状态标签
|
||||
status_label.text = "与服务器连接已断开,请重新登录"
|
||||
status_label.modulate = Color.ORANGE
|
||||
|
||||
# 重新启用所有按钮
|
||||
login_button.disabled = false
|
||||
register_button.disabled = false
|
||||
send_button.disabled = false
|
||||
send_button.text = "发送验证码"
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
@@ -27,9 +27,19 @@ signal draw_failed(error_message: String) # 抽奖失败信号
|
||||
# =============================================================================
|
||||
var reward_templates: Array[RichTextLabel] = []
|
||||
var current_rewards: Array = []
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
@onready var main_game = get_node("/root/main")
|
||||
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
|
||||
|
||||
# 15种不同的模板颜色
|
||||
var template_colors: Array[Color] = [
|
||||
Color(1.0, 0.8, 0.8, 1.0), # 淡红色
|
||||
@@ -266,7 +276,7 @@ func _format_template_text(reward: Dictionary) -> String:
|
||||
|
||||
## 执行网络抽奖
|
||||
func _perform_network_draw(draw_type: String) -> void:
|
||||
if not network_manager or not network_manager.is_connected_to_server():
|
||||
if not tcp_network_manager_panel or not tcp_network_manager_panel.is_connected_to_server():
|
||||
_show_error_message("网络未连接,无法进行抽奖")
|
||||
return
|
||||
|
||||
@@ -277,7 +287,7 @@ func _perform_network_draw(draw_type: String) -> void:
|
||||
return
|
||||
|
||||
# 发送抽奖请求
|
||||
var success = network_manager.sendLuckyDraw(draw_type)
|
||||
var success = tcp_network_manager_panel.sendLuckyDraw(draw_type)
|
||||
if not success:
|
||||
_show_error_message("发送抽奖请求失败")
|
||||
return
|
||||
@@ -571,3 +581,13 @@ func clear_draw_results() -> void:
|
||||
func refresh_reward_display() -> void:
|
||||
_load_crop_data_and_build_rewards()
|
||||
_update_template_display()
|
||||
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
276
Script/BigPanel/PetBagPanel.gd
Normal file
276
Script/BigPanel/PetBagPanel.gd
Normal file
@@ -0,0 +1,276 @@
|
||||
extends Panel
|
||||
# 这是宠物背包面板,用来显示玩家获得的宠物
|
||||
|
||||
# 宠物背包格子容器
|
||||
@onready var bag_grid: GridContainer = $ScrollContainer/Bag_Grid
|
||||
@onready var quit_button: Button = $QuitButton
|
||||
@onready var refresh_button: Button = $RefreshButton
|
||||
@onready var scroll_container = $ScrollContainer
|
||||
|
||||
# 预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var pet_store_panel: Panel = $'../PetStorePanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
@onready var pet_inform_panel: Panel = $'../../SmallPanel/PetInformPanel'
|
||||
|
||||
# 宠物配置数据
|
||||
var pet_config: Dictionary = {}
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
# 连接关闭按钮信号
|
||||
quit_button.pressed.connect(self._on_quit_button_pressed)
|
||||
refresh_button.pressed.connect(self._on_refresh_button_pressed)
|
||||
# 连接可见性改变信号
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
# 初始化宠物背包
|
||||
func init_pet_bag():
|
||||
|
||||
# 显示背包中的宠物
|
||||
update_pet_bag_ui()
|
||||
|
||||
# 更新宠物背包UI(同步版本,用于刷新按钮)
|
||||
func update_pet_bag_ui():
|
||||
if scroll_container:
|
||||
scroll_container.clip_contents = false
|
||||
|
||||
# 设置GridContainer也不裁剪内容
|
||||
if bag_grid:
|
||||
bag_grid.clip_contents = false
|
||||
|
||||
# 清空宠物背包格子
|
||||
for child in bag_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# 确保宠物背包存在
|
||||
if not "pet_bag" in main_game or main_game.pet_bag == null:
|
||||
main_game.pet_bag = []
|
||||
|
||||
# 为背包中的每个宠物创建按钮
|
||||
for pet_data in main_game.pet_bag:
|
||||
var pet_name = pet_data.get("基本信息", {}).get("宠物类型", "未知宠物")
|
||||
var pet_level = pet_data.get("等级经验", {}).get("宠物等级", 1)
|
||||
var pet_owner_name = pet_data.get("基本信息", {}).get("宠物名称", pet_name)
|
||||
|
||||
# 创建宠物按钮
|
||||
var button = _create_pet_button(pet_name, pet_level, pet_owner_name)
|
||||
|
||||
# 更新按钮文本显示宠物信息
|
||||
button.text = str(pet_owner_name + "\n等级:" + str(pet_level))
|
||||
|
||||
# 根据是否处于访问模式连接不同的事件
|
||||
if main_game.is_visiting_mode:
|
||||
# 访问模式下,点击宠物只显示信息
|
||||
button.pressed.connect(func(): _on_visit_pet_selected(pet_name, pet_data))
|
||||
else:
|
||||
# 正常模式下,连接宠物选择事件
|
||||
button.pressed.connect(func(): _on_pet_selected(pet_name, pet_data, button))
|
||||
|
||||
bag_grid.add_child(button)
|
||||
|
||||
# 创建宠物按钮
|
||||
func _create_pet_button(pet_name: String, pet_level: int, pet_owner_name: String) -> Button:
|
||||
# 使用按钮作为宠物背包按钮的样式
|
||||
var button = main_game.item_button.duplicate()
|
||||
|
||||
# 确保按钮可见并可点击
|
||||
button.visible = true
|
||||
button.disabled = false
|
||||
button.focus_mode = Control.FOCUS_ALL
|
||||
|
||||
# 关闭按钮的内容裁剪,允许图片超出按钮边界
|
||||
button.clip_contents = false
|
||||
|
||||
|
||||
# 添加工具提示
|
||||
button.tooltip_text = str(
|
||||
"宠物: " + pet_name + "\n" +
|
||||
"名称: " + pet_owner_name + "\n" +
|
||||
"等级: " + str(pet_level) + "\n" +
|
||||
"点击查看宠物详情"
|
||||
)
|
||||
|
||||
# 如果按钮有标题标签,设置标题
|
||||
if button.has_node("Title"):
|
||||
button.get_node("Title").text = "宠物"
|
||||
button.get_node("Title").modulate = Color.MAGENTA # 宠物标题使用洋红色
|
||||
|
||||
# 更新按钮的宠物图片
|
||||
_update_button_pet_image(button, pet_name)
|
||||
|
||||
return button
|
||||
|
||||
# 更新按钮的宠物图片
|
||||
func _update_button_pet_image(button: Button, pet_name: String):
|
||||
# 检查按钮是否有CropImage节点
|
||||
var pet_image = button.get_node_or_null("CropImage")
|
||||
if not pet_image:
|
||||
return
|
||||
|
||||
# 从宠物配置获取场景路径
|
||||
var texture = null
|
||||
var pet_config = _load_pet_config()
|
||||
|
||||
if pet_config.has(pet_name):
|
||||
var pet_info = pet_config[pet_name]
|
||||
var scene_path = pet_info.get("场景路径", "")
|
||||
|
||||
if scene_path != "" and ResourceLoader.exists(scene_path):
|
||||
# 加载宠物场景并获取PetImage的纹理
|
||||
var pet_scene = load(scene_path)
|
||||
if pet_scene:
|
||||
var pet_instance = pet_scene.instantiate()
|
||||
var pet_image_node = pet_instance.get_node_or_null("PetImage")
|
||||
if pet_image_node and pet_image_node.sprite_frames:
|
||||
# 获取默认动画的第一帧
|
||||
var animation_names = pet_image_node.sprite_frames.get_animation_names()
|
||||
if animation_names.size() > 0:
|
||||
var default_animation = animation_names[0]
|
||||
var frame_count = pet_image_node.sprite_frames.get_frame_count(default_animation)
|
||||
if frame_count > 0:
|
||||
texture = pet_image_node.sprite_frames.get_frame_texture(default_animation, 0)
|
||||
pet_instance.queue_free()
|
||||
|
||||
# 设置图片
|
||||
if texture:
|
||||
pet_image.texture = texture
|
||||
pet_image.visible = true
|
||||
pet_image.scale = Vector2(10, 10)
|
||||
# 确保图片居中显示
|
||||
pet_image.centered = true
|
||||
else:
|
||||
pet_image.visible = false
|
||||
|
||||
# 加载宠物配置数据
|
||||
func _load_pet_config() -> Dictionary:
|
||||
var file = FileAccess.open("res://Data/pet_data.json", FileAccess.READ)
|
||||
if file == null:
|
||||
return {}
|
||||
|
||||
var json = JSON.new()
|
||||
var json_string = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var parse_result = json.parse(json_string)
|
||||
if parse_result != OK:
|
||||
return {}
|
||||
|
||||
return json.data
|
||||
|
||||
# 计算宠物年龄(以天为单位)
|
||||
func _calculate_pet_age(birthday: String) -> int:
|
||||
if birthday == "":
|
||||
return 0
|
||||
|
||||
# 解析生日字符串,格式:2025年7月5日10时7分25秒
|
||||
var birthday_parts = birthday.split("年")
|
||||
if birthday_parts.size() < 2:
|
||||
return 0
|
||||
|
||||
var year = int(birthday_parts[0])
|
||||
var rest = birthday_parts[1]
|
||||
|
||||
var month_parts = rest.split("月")
|
||||
if month_parts.size() < 2:
|
||||
return 0
|
||||
|
||||
var month = int(month_parts[0])
|
||||
var rest2 = month_parts[1]
|
||||
|
||||
var day_parts = rest2.split("日")
|
||||
if day_parts.size() < 2:
|
||||
return 0
|
||||
|
||||
var day = int(day_parts[0])
|
||||
var rest3 = day_parts[1]
|
||||
|
||||
var hour_parts = rest3.split("时")
|
||||
if hour_parts.size() < 2:
|
||||
return 0
|
||||
|
||||
var hour = int(hour_parts[0])
|
||||
var rest4 = hour_parts[1]
|
||||
|
||||
var minute_parts = rest4.split("分")
|
||||
if minute_parts.size() < 2:
|
||||
return 0
|
||||
|
||||
var minute = int(minute_parts[0])
|
||||
var rest5 = minute_parts[1]
|
||||
|
||||
var second_parts = rest5.split("秒")
|
||||
if second_parts.size() < 1:
|
||||
return 0
|
||||
|
||||
var second = int(second_parts[0])
|
||||
|
||||
# 将生日转换为Unix时间戳
|
||||
var birthday_dict = {
|
||||
"year": year,
|
||||
"month": month,
|
||||
"day": day,
|
||||
"hour": hour,
|
||||
"minute": minute,
|
||||
"second": second
|
||||
}
|
||||
|
||||
var birthday_timestamp = Time.get_unix_time_from_datetime_dict(birthday_dict)
|
||||
var current_timestamp = Time.get_unix_time_from_system()
|
||||
|
||||
# 计算天数差
|
||||
var age_seconds = current_timestamp - birthday_timestamp
|
||||
var age_days = int(age_seconds / (24 * 3600))
|
||||
|
||||
return max(0, age_days)
|
||||
|
||||
|
||||
# 正常模式下的宠物点击处理 - 查看宠物信息
|
||||
func _on_pet_selected(pet_name: String, pet_data: Dictionary, button: Button):
|
||||
# 显示宠物信息面板
|
||||
if pet_inform_panel:
|
||||
pet_inform_panel.show_pet_info(pet_name, pet_data)
|
||||
pet_inform_panel.show()
|
||||
|
||||
|
||||
# 访问模式下的宠物点击处理
|
||||
func _on_visit_pet_selected(pet_name: String, pet_data: Dictionary):
|
||||
# 显示宠物信息面板
|
||||
if pet_inform_panel:
|
||||
pet_inform_panel.show_pet_info(pet_name, pet_data)
|
||||
pet_inform_panel.show()
|
||||
|
||||
#=========================面板通用处理=========================
|
||||
# 关闭宠物背包面板
|
||||
func _on_quit_button_pressed() -> void:
|
||||
self.hide()
|
||||
|
||||
# 手动刷新宠物背包面板
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
# 刷新宠物背包UI
|
||||
update_pet_bag_ui()
|
||||
Toast.show("宠物背包已刷新", Color.GREEN, 2.0, 1.0)
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
# 面板显示时自动刷新数据
|
||||
update_pet_bag_ui()
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
#=========================面板通用处理=========================
|
||||
1
Script/BigPanel/PetBagPanel.gd.uid
Normal file
1
Script/BigPanel/PetBagPanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bdhwvqsmakna2
|
||||
292
Script/BigPanel/PetStorePanel.gd
Normal file
292
Script/BigPanel/PetStorePanel.gd
Normal file
@@ -0,0 +1,292 @@
|
||||
extends Panel
|
||||
# 这是宠物商店面板,用来展示各种宠物
|
||||
|
||||
# 宠物商店格子容器
|
||||
@onready var store_grid: GridContainer = $ScrollContainer/Store_Grid
|
||||
@onready var quit_button: Button = $QuitButton
|
||||
@onready var refresh_button: Button = $RefreshButton
|
||||
@onready var scroll_container = $ScrollContainer
|
||||
|
||||
# 预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var pet_bag_panel: Panel = $'../PetBagPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
@onready var batch_buy_popup: PanelContainer = $'../../DiaLog/BatchBuyPopup'
|
||||
|
||||
# 宠物配置数据
|
||||
var pet_config: Dictionary = {}
|
||||
|
||||
# 准备函数
|
||||
func _ready():
|
||||
# 连接关闭按钮信号
|
||||
quit_button.pressed.connect(self._on_quit_button_pressed)
|
||||
refresh_button.pressed.connect(self._on_refresh_button_pressed)
|
||||
# 连接可见性改变信号
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
|
||||
# 初始化宠物商店
|
||||
func init_pet_store():
|
||||
# 从主游戏脚本获取宠物配置数据
|
||||
_load_pet_config_from_main()
|
||||
update_pet_store_ui()
|
||||
|
||||
# 更新宠物商店UI
|
||||
func update_pet_store_ui():
|
||||
if scroll_container:
|
||||
scroll_container.clip_contents = false
|
||||
|
||||
# 设置GridContainer也不裁剪内容
|
||||
if store_grid:
|
||||
store_grid.clip_contents = false
|
||||
|
||||
# 清空宠物商店格子
|
||||
for child in store_grid.get_children():
|
||||
child.queue_free()
|
||||
|
||||
print("更新宠物商店UI,宠物种类:", pet_config.size())
|
||||
|
||||
# 为每个宠物配置创建按钮
|
||||
for pet_name in pet_config.keys():
|
||||
var pet_info = pet_config[pet_name]
|
||||
var purchase_info = pet_info.get("购买信息", {})
|
||||
var can_buy = purchase_info.get("能否购买", false)
|
||||
|
||||
# 只显示可购买的宠物
|
||||
if not can_buy:
|
||||
continue
|
||||
|
||||
var pet_cost = purchase_info.get("购买价格", 0)
|
||||
var basic_info = pet_info.get("基本信息", {})
|
||||
var pet_desc = basic_info.get("简介", "可爱的宠物伙伴")
|
||||
|
||||
# 检查玩家是否已购买该宠物
|
||||
var is_owned = _check_pet_owned(pet_name)
|
||||
|
||||
# 创建宠物按钮
|
||||
var button = _create_pet_button(pet_name, pet_cost, pet_desc, is_owned)
|
||||
|
||||
# 更新按钮文本显示价格和状态
|
||||
if is_owned:
|
||||
button.text = str(pet_name + "\n(已购买)")
|
||||
button.disabled = true
|
||||
else:
|
||||
button.text = str(pet_name + "\n价格:" + str(pet_cost) + "元")
|
||||
# 连接购买点击事件
|
||||
button.pressed.connect(func(): _on_store_pet_selected(pet_name, pet_cost, pet_desc))
|
||||
|
||||
store_grid.add_child(button)
|
||||
|
||||
# 检查玩家是否已拥有某种宠物
|
||||
func _check_pet_owned(pet_name: String) -> bool:
|
||||
if not main_game.pet_bag:
|
||||
return false
|
||||
|
||||
for pet_data in main_game.pet_bag:
|
||||
var basic_info = pet_data.get("基本信息", {})
|
||||
var pet_type = basic_info.get("宠物类型", "")
|
||||
if pet_type == pet_name:
|
||||
return true
|
||||
return false
|
||||
|
||||
# 创建宠物按钮
|
||||
func _create_pet_button(pet_name: String, pet_cost: int, pet_desc: String, is_owned: bool = false) -> Button:
|
||||
# 使用按钮作为宠物商店按钮的样式
|
||||
var button = main_game.item_button.duplicate()
|
||||
|
||||
# 确保按钮可见并可点击
|
||||
button.visible = true
|
||||
button.disabled = false
|
||||
button.focus_mode = Control.FOCUS_ALL
|
||||
|
||||
# 关闭按钮的内容裁剪,允许图片超出按钮边界
|
||||
button.clip_contents = false
|
||||
|
||||
# 设置按钮文本
|
||||
button.text = pet_name
|
||||
|
||||
# 添加工具提示
|
||||
button.tooltip_text = str(
|
||||
"宠物: " + pet_name + "\n" +
|
||||
"价格: " + str(pet_cost) + "元\n" +
|
||||
"描述: " + pet_desc + "\n" +
|
||||
"点击购买宠物"
|
||||
)
|
||||
|
||||
# 如果按钮有标题标签,设置标题
|
||||
if button.has_node("Title"):
|
||||
if is_owned:
|
||||
button.get_node("Title").text = "已购买"
|
||||
button.get_node("Title").modulate = Color.GRAY # 已购买使用灰色
|
||||
else:
|
||||
button.get_node("Title").text = "宠物商店"
|
||||
button.get_node("Title").modulate = Color.PINK # 宠物商店标题使用粉色
|
||||
|
||||
# 更新按钮的宠物图片
|
||||
_update_button_pet_image(button, pet_name)
|
||||
|
||||
return button
|
||||
|
||||
# 更新按钮的宠物图片
|
||||
func _update_button_pet_image(button: Button, pet_name: String):
|
||||
# 检查按钮是否有CropImage节点
|
||||
var pet_image = button.get_node_or_null("CropImage")
|
||||
if not pet_image:
|
||||
return
|
||||
|
||||
# 从宠物配置获取场景路径
|
||||
var texture = null
|
||||
if pet_config.has(pet_name):
|
||||
var pet_info = pet_config[pet_name]
|
||||
var scene_path = pet_info.get("场景路径", "")
|
||||
|
||||
if scene_path != "" and ResourceLoader.exists(scene_path):
|
||||
# 加载宠物场景并获取PetImage的纹理
|
||||
var pet_scene = load(scene_path)
|
||||
if pet_scene:
|
||||
var pet_instance = pet_scene.instantiate()
|
||||
var pet_image_node = pet_instance.get_node_or_null("PetImage")
|
||||
if pet_image_node and pet_image_node.sprite_frames:
|
||||
# 获取默认动画的第一帧
|
||||
var default_animation = pet_image_node.sprite_frames.get_animation_names()[0]
|
||||
var frame_count = pet_image_node.sprite_frames.get_frame_count(default_animation)
|
||||
if frame_count > 0:
|
||||
texture = pet_image_node.sprite_frames.get_frame_texture(default_animation, 0)
|
||||
pet_instance.queue_free()
|
||||
|
||||
|
||||
# 设置图片
|
||||
if texture:
|
||||
pet_image.texture = texture
|
||||
pet_image.visible = true
|
||||
pet_image.scale = Vector2(10, 10)
|
||||
# 确保图片居中显示
|
||||
pet_image.centered = true
|
||||
|
||||
else:
|
||||
pet_image.visible = false
|
||||
|
||||
# 从主游戏脚本获取宠物配置数据
|
||||
func _load_pet_config_from_main():
|
||||
# 从宠物数据文件加载配置
|
||||
var file = FileAccess.open("res://Data/pet_data.json", FileAccess.READ)
|
||||
if file == null:
|
||||
print("宠物商店:无法打开宠物配置文件")
|
||||
pet_config = {}
|
||||
return
|
||||
|
||||
var json = JSON.new()
|
||||
var json_string = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var parse_result = json.parse(json_string)
|
||||
if parse_result != OK:
|
||||
print("宠物商店:解析宠物配置文件失败")
|
||||
pet_config = {}
|
||||
return
|
||||
|
||||
pet_config = json.data
|
||||
print("宠物商店:成功加载宠物配置数据,宠物种类:", pet_config.size())
|
||||
|
||||
# 商店宠物点击处理 - 购买宠物
|
||||
func _on_store_pet_selected(pet_name: String, pet_cost: int, pet_desc: String):
|
||||
# 检查玩家金钱是否足够
|
||||
if main_game.money < pet_cost:
|
||||
Toast.show("金钱不足!需要 " + str(pet_cost) + " 元,当前只有 " + str(main_game.money) + " 元", Color.RED, 3.0, 1.0)
|
||||
return
|
||||
|
||||
# 显示购买确认对话框(宠物只能购买1只,不需要批量购买)
|
||||
_show_buy_confirmation_dialog(pet_name, pet_cost, pet_desc)
|
||||
|
||||
# 显示购买确认对话框
|
||||
func _show_buy_confirmation_dialog(pet_name: String, pet_cost: int, pet_desc: String):
|
||||
# 创建确认对话框
|
||||
var confirm_dialog = AcceptDialog.new()
|
||||
confirm_dialog.dialog_text = str(
|
||||
"确认购买宠物?\n\n" +
|
||||
"宠物名称: " + pet_name + "\n" +
|
||||
"购买价格: " + str(pet_cost) + " 元\n" +
|
||||
"宠物描述: " + pet_desc + "\n\n" +
|
||||
"当前金钱: " + str(main_game.money) + " 元\n" +
|
||||
"购买后余额: " + str(main_game.money - pet_cost) + " 元\n\n" +
|
||||
"注意:每种宠物只能购买一只!"
|
||||
)
|
||||
confirm_dialog.title = "购买宠物确认"
|
||||
confirm_dialog.ok_button_text = "确认购买"
|
||||
confirm_dialog.add_cancel_button("取消")
|
||||
|
||||
# 添加到场景
|
||||
add_child(confirm_dialog)
|
||||
|
||||
# 连接信号
|
||||
confirm_dialog.confirmed.connect(_on_confirm_buy_pet.bind(pet_name, pet_cost, confirm_dialog))
|
||||
confirm_dialog.canceled.connect(_on_cancel_buy_pet.bind(confirm_dialog))
|
||||
|
||||
# 显示对话框
|
||||
confirm_dialog.popup_centered()
|
||||
|
||||
# 确认购买宠物
|
||||
func _on_confirm_buy_pet(pet_name: String, pet_cost: int, dialog: AcceptDialog):
|
||||
# 再次检查金钱是否足够
|
||||
if main_game.money < pet_cost:
|
||||
Toast.show("金钱不足!需要 " + str(pet_cost) + " 元,当前只有 " + str(main_game.money) + " 元", Color.RED, 3.0, 1.0)
|
||||
dialog.queue_free()
|
||||
return
|
||||
|
||||
# 发送购买请求到服务器
|
||||
_send_buy_pet_request(pet_name, pet_cost)
|
||||
dialog.queue_free()
|
||||
|
||||
# 取消购买宠物
|
||||
func _on_cancel_buy_pet(dialog: AcceptDialog):
|
||||
print("取消购买宠物")
|
||||
dialog.queue_free()
|
||||
|
||||
# 发送购买宠物请求
|
||||
func _send_buy_pet_request(pet_name: String, pet_cost: int):
|
||||
# 发送购买请求到服务器
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.has_method("sendBuyPet"):
|
||||
if tcp_network_manager_panel.sendBuyPet(pet_name, pet_cost):
|
||||
# 服务器会处理购买逻辑,客户端等待响应
|
||||
print("已发送购买宠物请求:", pet_name)
|
||||
else:
|
||||
Toast.show("购买请求发送失败", Color.RED, 2.0, 1.0)
|
||||
else:
|
||||
Toast.show("网络管理器不可用", Color.RED, 2.0, 1.0)
|
||||
|
||||
#=========================面板通用处理=========================
|
||||
# 手动刷新宠物商店面板
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
# 重新初始化宠物商店
|
||||
init_pet_store()
|
||||
Toast.show("宠物商店已刷新", Color.GREEN, 2.0, 1.0)
|
||||
|
||||
# 关闭宠物商店面板
|
||||
func _on_quit_button_pressed() -> void:
|
||||
# 打开面板后暂时禁用相机功能
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
self.hide()
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
# 面板显示时自动刷新数据
|
||||
update_pet_store_ui()
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
#=========================面板通用处理=========================
|
||||
1
Script/BigPanel/PetStorePanel.gd.uid
Normal file
1
Script/BigPanel/PetStorePanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dc1pmi1ubd2cf
|
||||
@@ -3,6 +3,7 @@ extends Panel
|
||||
# 背包格子容器
|
||||
@onready var player_bag_grid_container : GridContainer = $ScrollContainer/Bag_Grid
|
||||
@onready var quit_button : Button = $QuitButton
|
||||
@onready var refresh_button : Button = $RefreshButton
|
||||
|
||||
#各种排序过滤按钮
|
||||
@onready var sort_all_button : Button = $SortContainer/Sort_All#全部
|
||||
@@ -18,11 +19,16 @@ extends Panel
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var player_ranking_panel: Panel = $'../PlayerRankingPanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
|
||||
|
||||
# 作物图片缓存(复用主游戏的缓存系统)
|
||||
var crop_textures_cache : Dictionary = {}
|
||||
@@ -46,9 +52,13 @@ func _ready():
|
||||
# 连接按钮信号
|
||||
_connect_buttons()
|
||||
|
||||
# 连接可见性改变信号
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
|
||||
# 隐藏面板(初始默认隐藏)
|
||||
self.hide()
|
||||
|
||||
|
||||
# 连接所有按钮信号
|
||||
func _connect_buttons():
|
||||
# 关闭按钮
|
||||
@@ -82,7 +92,6 @@ func update_player_bag_ui():
|
||||
# 清空玩家背包格子
|
||||
for child in player_bag_grid_container.get_children():
|
||||
child.queue_free()
|
||||
#print("更新背包UI,背包中物品数量:", main_game.player_bag.size())
|
||||
|
||||
# 应用过滤和排序
|
||||
var filtered_seeds = _get_filtered_and_sorted_seeds()
|
||||
@@ -336,7 +345,7 @@ func _plant_crop_from_bag(index, crop_name, seed_index):
|
||||
#print("错误:无效的种子索引 ", seed_index)
|
||||
return
|
||||
# 发送种植请求到服务器
|
||||
if network_manager and network_manager.sendPlantCrop(index, crop_name):
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.sendPlantCrop(index, crop_name):
|
||||
# 关闭背包面板
|
||||
hide()
|
||||
|
||||
@@ -345,14 +354,14 @@ func set_planting_mode(plant_type: String, plant_panel):
|
||||
is_planting_mode = true
|
||||
planting_type = plant_type
|
||||
one_click_plant_panel = plant_panel
|
||||
print("进入种植模式:", plant_type)
|
||||
Toast.show("进入种植模式:"+plant_type,Color.GREEN)
|
||||
|
||||
# 退出种植模式
|
||||
func _exit_planting_mode():
|
||||
is_planting_mode = false
|
||||
planting_type = ""
|
||||
one_click_plant_panel = null
|
||||
print("退出种植模式")
|
||||
Toast.show("退出种植模式",Color.GREEN)
|
||||
|
||||
|
||||
# 获取作物的成熟图片(用于背包显示)
|
||||
@@ -368,7 +377,6 @@ func _get_crop_final_texture(crop_name: String) -> Texture2D:
|
||||
if ResourceLoader.exists(mature_texture_path):
|
||||
var texture = load(mature_texture_path)
|
||||
if texture:
|
||||
print("背包加载作物成熟图片:", crop_name)
|
||||
# 如果主游戏存在,也缓存到主游戏中
|
||||
if main_game:
|
||||
main_game.crop_mature_textures_cache[crop_name] = texture
|
||||
@@ -421,7 +429,7 @@ func _load_crop_textures(crop_name: String) -> Array:
|
||||
break
|
||||
|
||||
if textures.size() > 0:
|
||||
print("背包加载作物 ", crop_name, " 的 ", textures.size(), " 帧图片")
|
||||
pass
|
||||
else:
|
||||
print("背包:作物 ", crop_name, " 文件夹存在但没有找到有效图片,使用默认图片")
|
||||
textures = _load_default_textures()
|
||||
@@ -487,7 +495,6 @@ func _update_button_crop_image(button: Button, crop_name: String):
|
||||
# CropImage是Sprite2D,直接设置texture属性
|
||||
crop_image.texture = texture
|
||||
crop_image.visible = true
|
||||
print("背包更新作物图片:", crop_name)
|
||||
else:
|
||||
crop_image.visible = false
|
||||
print("背包无法获取作物图片:", crop_name)
|
||||
@@ -497,7 +504,7 @@ func _update_button_crop_image(button: Button, crop_name: String):
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
# 刷新种子背包UI
|
||||
update_player_bag_ui()
|
||||
Toast.show("种子背包已刷新", Color.GREEN, 2.0, 1.0)
|
||||
Toast.show("种子仓库已刷新", Color.GREEN)
|
||||
|
||||
# 关闭面板
|
||||
func _on_quit_button_pressed():
|
||||
@@ -507,4 +514,15 @@ func _on_quit_button_pressed():
|
||||
if is_planting_mode:
|
||||
_exit_planting_mode()
|
||||
self.hide()
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
# 面板显示时自动刷新数据
|
||||
update_player_bag_ui()
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
#=========================面板通用处理=========================
|
||||
@@ -23,11 +23,17 @@ extends Panel
|
||||
|
||||
#预添加常用的面板
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var land_panel = get_node("/root/main/UI/LandPanel")
|
||||
@onready var crop_store_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var player_ranking_panel = get_node("/root/main/UI/PlayerRankingPanel")
|
||||
@onready var player_bag_panel = get_node("/root/main/UI/PlayerBagPanel")
|
||||
@onready var network_manager = get_node("/root/main/UI/TCPNetworkManager")
|
||||
|
||||
@onready var lucky_draw_panel: LuckyDrawPanel = $'../LuckyDrawPanel'
|
||||
@onready var daily_check_in_panel: DailyCheckInPanel = $'../DailyCheckInPanel'
|
||||
@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel'
|
||||
@onready var item_store_panel: Panel = $'../ItemStorePanel'
|
||||
@onready var crop_warehouse_panel: Panel = $'../CropWarehousePanel'
|
||||
@onready var login_panel: PanelContainer = $'../LoginPanel'
|
||||
@onready var player_bag_panel: Panel = $'../PlayerBagPanel'
|
||||
@onready var crop_store_panel: Panel = $'../CropStorePanel'
|
||||
@onready var item_bag_panel: Panel = $'../ItemBagPanel'
|
||||
|
||||
|
||||
# 排序状态管理
|
||||
var current_sort_by = "level" # 当前排序字段
|
||||
@@ -37,7 +43,8 @@ var current_search_qq = "" # 当前搜索的QQ号
|
||||
|
||||
#下面这是每个玩家要展示的信息,直接获取服务器玩家数据json文件来实现
|
||||
#模板用于复制创建新的玩家条目
|
||||
@onready var player_info_template : VBoxContainer = $Scroll/PlayerList/player_ranking_item
|
||||
@onready var player_info_template : VBoxContainer = $Scroll/PlayerList/PlayerRankingItem
|
||||
@onready var player_entry_scene : PackedScene = preload("res://GUI/PlayerRankingItem.tscn")
|
||||
|
||||
func _ready() -> void:
|
||||
# 隐藏模板
|
||||
@@ -114,17 +121,17 @@ func _update_button_states():
|
||||
|
||||
# 请求玩家排行榜数据
|
||||
func request_player_rankings():
|
||||
if not network_manager:
|
||||
if not tcp_network_manager_panel:
|
||||
register_player_num.text = "网络管理器不可用"
|
||||
register_player_num.modulate = Color.RED
|
||||
return false
|
||||
|
||||
if not network_manager.is_connected_to_server():
|
||||
if not tcp_network_manager_panel.is_connected_to_server():
|
||||
register_player_num.text = "未连接服务器"
|
||||
register_player_num.modulate = Color.RED
|
||||
return false
|
||||
|
||||
var success = network_manager.sendGetPlayerRankings(current_sort_by, current_sort_order, filter_online_only, current_search_qq)
|
||||
var success = tcp_network_manager_panel.sendGetPlayerRankings(current_sort_by, current_sort_order, filter_online_only, current_search_qq)
|
||||
if not success:
|
||||
register_player_num.text = "请求发送失败"
|
||||
register_player_num.modulate = Color.RED
|
||||
@@ -185,8 +192,8 @@ func handle_player_rankings_response(data):
|
||||
|
||||
# 添加单个玩家条目
|
||||
func add_player_entry(player_data):
|
||||
# 复制模板
|
||||
var player_entry = player_info_template.duplicate()
|
||||
# 实例化新的玩家条目场景,避免 duplicate 引发的复制错误
|
||||
var player_entry = player_entry_scene.instantiate()
|
||||
player_entry.visible = true
|
||||
player_ranking_list.add_child(player_entry)
|
||||
|
||||
@@ -240,7 +247,7 @@ func _on_visit_player_pressed(username):
|
||||
|
||||
|
||||
# 检查网络连接
|
||||
if not network_manager or not network_manager.is_connected_to_server():
|
||||
if not tcp_network_manager_panel or not tcp_network_manager_panel.is_connected_to_server():
|
||||
Toast.show("未连接服务器,无法访问玩家", Color.RED)
|
||||
return
|
||||
|
||||
@@ -250,8 +257,8 @@ func _on_visit_player_pressed(username):
|
||||
return
|
||||
|
||||
# 发送访问玩家请求
|
||||
if network_manager and network_manager.has_method("sendVisitPlayer"):
|
||||
var success = network_manager.sendVisitPlayer(username)
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.has_method("sendVisitPlayer"):
|
||||
var success = tcp_network_manager_panel.sendVisitPlayer(username)
|
||||
if success:
|
||||
Toast.show("正在访问 " + username + " 的农场...", Color.YELLOW)
|
||||
else:
|
||||
@@ -262,7 +269,7 @@ func _on_visit_player_pressed(username):
|
||||
# 刷新按钮点击
|
||||
func _on_refresh_button_pressed():
|
||||
# 检查网络连接
|
||||
if not network_manager or not network_manager.is_connected_to_server():
|
||||
if not tcp_network_manager_panel or not tcp_network_manager_panel.is_connected_to_server():
|
||||
register_player_num.text = "未连接服务器,无法刷新"
|
||||
register_player_num.modulate = Color.RED
|
||||
Toast.show("未连接服务器,无法刷新排行榜", Color.RED)
|
||||
143
Script/Dialog/BatchBuyPopup.gd
Normal file
143
Script/Dialog/BatchBuyPopup.gd
Normal file
@@ -0,0 +1,143 @@
|
||||
extends PanelContainer
|
||||
#这是批量购买弹窗
|
||||
@onready var title: Label = $VBox/Title #弹窗标题
|
||||
@onready var contents: Label = $VBox/Contents #弹窗内容
|
||||
@onready var buy_num_edit: LineEdit = $VBox/BuyNumEdit #购买数量
|
||||
@onready var sure_button: Button = $VBox/HBox/SureButton #确认购买
|
||||
@onready var cancel_button: Button = $VBox/HBox/CancelButton #取消购买
|
||||
|
||||
# 当前购买的商品信息
|
||||
var current_item_name: String = ""
|
||||
var current_item_cost: int = 0
|
||||
var current_item_desc: String = ""
|
||||
var current_buy_type: String = "" # "seed" 或 "item"
|
||||
|
||||
# 回调函数,用于处理确认购买
|
||||
var confirm_callback: Callable
|
||||
var cancel_callback: Callable
|
||||
|
||||
func _ready():
|
||||
# 连接按钮信号
|
||||
sure_button.pressed.connect(_on_sure_button_pressed)
|
||||
cancel_button.pressed.connect(_on_cancel_button_pressed)
|
||||
|
||||
# 设置数量输入框的默认值和限制
|
||||
buy_num_edit.text = "1"
|
||||
buy_num_edit.placeholder_text = "请输入购买数量"
|
||||
|
||||
# 只允许输入数字
|
||||
buy_num_edit.text_changed.connect(_on_buy_num_changed)
|
||||
|
||||
# 默认隐藏弹窗
|
||||
self.hide()
|
||||
|
||||
#面板显示与隐藏切换处理
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
pass
|
||||
else:
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
pass
|
||||
|
||||
# 显示批量购买弹窗
|
||||
func show_buy_popup(item_name: String, item_cost: int, item_desc: String, buy_type: String, on_confirm: Callable, on_cancel: Callable = Callable()):
|
||||
current_item_name = item_name
|
||||
current_item_cost = item_cost
|
||||
current_item_desc = item_desc
|
||||
current_buy_type = buy_type
|
||||
confirm_callback = on_confirm
|
||||
cancel_callback = on_cancel
|
||||
|
||||
# 设置弹窗内容
|
||||
if buy_type == "seed":
|
||||
title.text = "批量购买种子"
|
||||
else:
|
||||
title.text = "批量购买道具"
|
||||
|
||||
contents.text = str(
|
||||
"商品名称: " + item_name + "\n" +
|
||||
"单价: " + str(item_cost) + " 元\n" +
|
||||
"描述: " + item_desc + "\n\n" +
|
||||
"请输入购买数量:"
|
||||
)
|
||||
|
||||
# 重置购买数量为1
|
||||
buy_num_edit.text = "1"
|
||||
|
||||
# 显示弹窗并居中
|
||||
self.show()
|
||||
|
||||
|
||||
# 处理数量输入变化
|
||||
func _on_buy_num_changed(new_text: String):
|
||||
# 只允许输入数字
|
||||
var filtered_text = ""
|
||||
for char in new_text:
|
||||
if char.is_valid_int():
|
||||
filtered_text += char
|
||||
|
||||
if filtered_text != new_text:
|
||||
buy_num_edit.text = filtered_text
|
||||
buy_num_edit.caret_column = filtered_text.length()
|
||||
|
||||
# 更新总价显示
|
||||
_update_total_cost()
|
||||
|
||||
# 更新总价显示
|
||||
func _update_total_cost():
|
||||
var quantity = get_buy_quantity()
|
||||
var total_cost = quantity * current_item_cost
|
||||
|
||||
var cost_info = "\n总价: " + str(total_cost) + " 元"
|
||||
|
||||
# 更新内容显示
|
||||
var base_content = str(
|
||||
"商品名称: " + current_item_name + "\n" +
|
||||
"单价: " + str(current_item_cost) + " 元\n" +
|
||||
"描述: " + current_item_desc + "\n\n" +
|
||||
"请输入购买数量:"
|
||||
)
|
||||
|
||||
contents.text = base_content + cost_info
|
||||
|
||||
# 获取购买数量
|
||||
func get_buy_quantity() -> int:
|
||||
var text = buy_num_edit.text.strip_edges()
|
||||
if text.is_empty():
|
||||
return 1
|
||||
|
||||
var quantity = text.to_int()
|
||||
return max(1, quantity) # 至少购买1个
|
||||
|
||||
# 确认购买按钮处理
|
||||
func _on_sure_button_pressed():
|
||||
var quantity = get_buy_quantity()
|
||||
|
||||
if quantity <= 0:
|
||||
_show_error("购买数量必须大于0")
|
||||
return
|
||||
|
||||
# 调用确认回调函数
|
||||
if confirm_callback.is_valid():
|
||||
confirm_callback.call(current_item_name, current_item_cost, quantity, current_buy_type)
|
||||
|
||||
# 隐藏弹窗
|
||||
self.hide()
|
||||
|
||||
# 取消购买按钮处理
|
||||
func _on_cancel_button_pressed():
|
||||
# 调用取消回调函数
|
||||
if cancel_callback.is_valid():
|
||||
cancel_callback.call()
|
||||
|
||||
# 隐藏弹窗
|
||||
self.hide()
|
||||
|
||||
# 显示错误信息
|
||||
func _show_error(message: String):
|
||||
# 这里可以显示Toast或者其他错误提示
|
||||
if has_node("/root/Toast"):
|
||||
get_node("/root/Toast").show(message, Color.RED, 2.0, 1.0)
|
||||
else:
|
||||
print("批量购买弹窗错误: " + message)
|
||||
1
Script/Dialog/BatchBuyPopup.gd.uid
Normal file
1
Script/Dialog/BatchBuyPopup.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d4fvv2sjngajr
|
||||
1829
Script/Pet/PetBase.gd
Normal file
1829
Script/Pet/PetBase.gd
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user