优化项目架构
This commit is contained in:
2
SproutFarm-Frontend/.gitattributes
vendored
Normal file
2
SproutFarm-Frontend/.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
16
SproutFarm-Frontend/.gitignore
vendored
Normal file
16
SproutFarm-Frontend/.gitignore
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Godot-specific files
|
||||
.import/
|
||||
.godot/
|
||||
.mono/
|
||||
export.cfg
|
||||
export_presets.cfg
|
||||
android
|
||||
|
||||
# System-specific files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# IDE-specific files
|
||||
.vscode/
|
||||
.idea/
|
||||
.cursor/
|
||||
242
SproutFarm-Frontend/Components/GameBGMPlayer.gd
Normal file
242
SproutFarm-Frontend/Components/GameBGMPlayer.gd
Normal file
@@ -0,0 +1,242 @@
|
||||
extends Node
|
||||
|
||||
## 简单背景音乐播放器 - 支持多平台导出
|
||||
## 自动加载音乐文件,支持顺序和随机循环播放
|
||||
|
||||
# 播放模式
|
||||
enum PlayMode {
|
||||
SEQUENTIAL, # 顺序循环
|
||||
RANDOM # 随机循环
|
||||
}
|
||||
|
||||
# 配置
|
||||
@export var play_mode: PlayMode = PlayMode.SEQUENTIAL # 播放模式
|
||||
@export var auto_start: bool = true # 自动开始播放
|
||||
|
||||
# 预设音乐文件列表(用于导出版本)
|
||||
@export var music_files_list: Array[String] = [
|
||||
]
|
||||
|
||||
# 内部变量
|
||||
var audio_player: AudioStreamPlayer
|
||||
var music_files: Array[String] = []
|
||||
var current_index: int = 0
|
||||
var played_indices: Array[int] = [] # 随机模式已播放的索引
|
||||
|
||||
# 音量控制相关
|
||||
var current_volume: float = 1.0 # 当前音量 (0.0-1.0)
|
||||
var is_muted: bool = false # 是否静音
|
||||
var volume_before_mute: float = 1.0 # 静音前的音量
|
||||
|
||||
func _ready():
|
||||
# 创建音频播放器
|
||||
audio_player = AudioStreamPlayer.new()
|
||||
add_child(audio_player)
|
||||
audio_player.finished.connect(_on_music_finished)
|
||||
|
||||
# 从全局变量读取初始音量设置
|
||||
current_volume = GlobalVariables.BackgroundMusicVolume
|
||||
audio_player.volume_db = linear_to_db(current_volume)
|
||||
|
||||
# 加载音乐文件
|
||||
_load_music_files()
|
||||
|
||||
# 自动开始播放
|
||||
if auto_start and music_files.size() > 0:
|
||||
play_next()
|
||||
|
||||
func _load_music_files():
|
||||
"""加载音乐文件"""
|
||||
music_files.clear()
|
||||
|
||||
# 在编辑器中尝试动态加载文件夹
|
||||
if OS.has_feature("editor"):
|
||||
_load_from_folder()
|
||||
|
||||
# 如果没有找到文件或者是导出版本,使用预设列表
|
||||
if music_files.size() == 0:
|
||||
_load_from_preset_list()
|
||||
|
||||
func _load_from_folder():
|
||||
"""从文件夹动态加载(仅编辑器模式)"""
|
||||
var music_folder = "res://audio/music/"
|
||||
var dir = DirAccess.open(music_folder)
|
||||
|
||||
if dir:
|
||||
dir.list_dir_begin()
|
||||
var file_name = dir.get_next()
|
||||
|
||||
while file_name != "":
|
||||
if not dir.current_is_dir():
|
||||
var extension = file_name.get_extension().to_lower()
|
||||
# 支持常见音频格式
|
||||
if extension in ["mp3", "ogg", "wav"]:
|
||||
music_files.append(music_folder + file_name)
|
||||
print("动态加载音乐: ", file_name)
|
||||
file_name = dir.get_next()
|
||||
|
||||
print("动态加载了 ", music_files.size(), " 首音乐")
|
||||
|
||||
func _load_from_preset_list():
|
||||
"""从预设列表加载音乐"""
|
||||
for file_path in music_files_list:
|
||||
if ResourceLoader.exists(file_path):
|
||||
music_files.append(file_path)
|
||||
print("预设加载音乐: ", file_path.get_file())
|
||||
else:
|
||||
print("音乐文件不存在: ", file_path)
|
||||
|
||||
print("预设加载了 ", music_files.size(), " 首音乐")
|
||||
|
||||
func play_next():
|
||||
"""播放下一首音乐"""
|
||||
if music_files.size() == 0:
|
||||
print("没有音乐文件可播放")
|
||||
return
|
||||
|
||||
# 根据播放模式获取下一首音乐的索引
|
||||
match play_mode:
|
||||
PlayMode.SEQUENTIAL:
|
||||
current_index = (current_index + 1) % music_files.size()
|
||||
PlayMode.RANDOM:
|
||||
current_index = _get_random_index()
|
||||
|
||||
# 播放音乐
|
||||
_play_music(current_index)
|
||||
|
||||
func _get_random_index() -> int:
|
||||
"""获取随机音乐索引(避免重复直到所有歌曲都播放过)"""
|
||||
# 如果所有歌曲都播放过了,重置列表
|
||||
if played_indices.size() >= music_files.size():
|
||||
played_indices.clear()
|
||||
|
||||
# 获取未播放的歌曲索引
|
||||
var available_indices: Array[int] = []
|
||||
for i in range(music_files.size()):
|
||||
if i not in played_indices:
|
||||
available_indices.append(i)
|
||||
|
||||
# 随机选择一个
|
||||
if available_indices.size() > 0:
|
||||
var random_choice = available_indices[randi() % available_indices.size()]
|
||||
played_indices.append(random_choice)
|
||||
return random_choice
|
||||
|
||||
return 0
|
||||
|
||||
func _play_music(index: int):
|
||||
"""播放指定索引的音乐"""
|
||||
if index < 0 or index >= music_files.size():
|
||||
return
|
||||
|
||||
var music_path = music_files[index]
|
||||
var audio_stream = load(music_path)
|
||||
|
||||
if audio_stream:
|
||||
audio_player.stream = audio_stream
|
||||
audio_player.play()
|
||||
print("正在播放: ", music_path.get_file())
|
||||
else:
|
||||
print("加载音乐失败: ", music_path)
|
||||
|
||||
func _on_music_finished():
|
||||
"""音乐播放完成时自动播放下一首"""
|
||||
play_next()
|
||||
|
||||
# 公共接口方法
|
||||
func set_play_mode(mode: PlayMode):
|
||||
"""设置播放模式"""
|
||||
play_mode = mode
|
||||
played_indices.clear() # 重置随机播放历史
|
||||
print("播放模式设置为: ", "顺序循环" if mode == PlayMode.SEQUENTIAL else "随机循环")
|
||||
|
||||
func toggle_play_mode():
|
||||
"""切换播放模式"""
|
||||
if play_mode == PlayMode.SEQUENTIAL:
|
||||
set_play_mode(PlayMode.RANDOM)
|
||||
else:
|
||||
set_play_mode(PlayMode.SEQUENTIAL)
|
||||
|
||||
func get_current_music_name() -> String:
|
||||
"""获取当前播放的音乐名称"""
|
||||
if current_index >= 0 and current_index < music_files.size():
|
||||
return music_files[current_index].get_file()
|
||||
return ""
|
||||
|
||||
# 运行时添加音乐文件(用于用户自定义音乐)
|
||||
func add_music_file(file_path: String) -> bool:
|
||||
"""添加音乐文件到播放列表"""
|
||||
if ResourceLoader.exists(file_path):
|
||||
music_files.append(file_path)
|
||||
print("添加音乐: ", file_path.get_file())
|
||||
return true
|
||||
else:
|
||||
print("音乐文件不存在: ", file_path)
|
||||
return false
|
||||
|
||||
# ============================= 音量控制功能 =====================================
|
||||
|
||||
func set_volume(volume: float):
|
||||
"""设置音量 (0.0-1.0)"""
|
||||
current_volume = clamp(volume, 0.0, 1.0)
|
||||
if not is_muted:
|
||||
audio_player.volume_db = linear_to_db(current_volume)
|
||||
print("背景音乐音量设置为: ", current_volume)
|
||||
|
||||
func get_volume() -> float:
|
||||
"""获取当前音量"""
|
||||
return current_volume
|
||||
|
||||
func set_mute(muted: bool):
|
||||
"""设置静音状态"""
|
||||
if muted and not is_muted:
|
||||
# 静音
|
||||
volume_before_mute = current_volume
|
||||
audio_player.volume_db = -80.0 # 设置为最小音量
|
||||
is_muted = true
|
||||
print("背景音乐已静音")
|
||||
elif not muted and is_muted:
|
||||
# 取消静音
|
||||
audio_player.volume_db = linear_to_db(current_volume)
|
||||
is_muted = false
|
||||
print("背景音乐取消静音")
|
||||
|
||||
func toggle_mute():
|
||||
"""切换静音状态"""
|
||||
set_mute(not is_muted)
|
||||
|
||||
func is_music_muted() -> bool:
|
||||
"""获取静音状态"""
|
||||
return is_muted
|
||||
|
||||
func pause():
|
||||
"""暂停音乐"""
|
||||
if audio_player.playing:
|
||||
audio_player.stream_paused = true
|
||||
print("背景音乐已暂停")
|
||||
|
||||
func resume():
|
||||
"""恢复音乐"""
|
||||
if audio_player.stream_paused:
|
||||
audio_player.stream_paused = false
|
||||
print("背景音乐已恢复")
|
||||
|
||||
func stop():
|
||||
"""停止音乐"""
|
||||
if audio_player.playing:
|
||||
audio_player.stop()
|
||||
print("背景音乐已停止")
|
||||
|
||||
func is_playing() -> bool:
|
||||
"""检查是否正在播放"""
|
||||
return audio_player.playing and not audio_player.stream_paused
|
||||
|
||||
func get_current_position() -> float:
|
||||
"""获取当前播放位置(秒)"""
|
||||
return audio_player.get_playback_position()
|
||||
|
||||
func get_current_length() -> float:
|
||||
"""获取当前音乐总长度(秒)"""
|
||||
if audio_player.stream:
|
||||
return audio_player.stream.get_length()
|
||||
return 0.0
|
||||
1
SproutFarm-Frontend/Components/GameBGMPlayer.gd.uid
Normal file
1
SproutFarm-Frontend/Components/GameBGMPlayer.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ca2chgx5w3g1y
|
||||
106
SproutFarm-Frontend/Components/HTTPTextureRect.gd
Normal file
106
SproutFarm-Frontend/Components/HTTPTextureRect.gd
Normal file
@@ -0,0 +1,106 @@
|
||||
extends TextureRect
|
||||
class_name HTTPTextureRect
|
||||
|
||||
signal loading_started
|
||||
signal loading_finished(success: bool)
|
||||
|
||||
# HTTP请求节点
|
||||
var http_request: HTTPRequest
|
||||
|
||||
func _ready():
|
||||
# 创建HTTP请求节点
|
||||
http_request = HTTPRequest.new()
|
||||
add_child(http_request)
|
||||
|
||||
# 连接信号
|
||||
http_request.request_completed.connect(_on_request_completed)
|
||||
|
||||
# 从URL加载图像
|
||||
func load_from_url(url: String, custom_headers: Array = []) -> void:
|
||||
if url.is_empty():
|
||||
push_error("HTTPTextureRect: URL不能为空")
|
||||
loading_finished.emit(false)
|
||||
return
|
||||
|
||||
loading_started.emit()
|
||||
|
||||
# 发起HTTP请求
|
||||
var error = http_request.request(url, custom_headers)
|
||||
if error != OK:
|
||||
push_error("HTTPTextureRect: 发起HTTP请求失败,错误码: " + str(error))
|
||||
loading_finished.emit(false)
|
||||
|
||||
# HTTP请求完成的回调函数
|
||||
func _on_request_completed(result, response_code, headers, body):
|
||||
if result != HTTPRequest.RESULT_SUCCESS:
|
||||
push_error("HTTPTextureRect: HTTP请求失败,错误码: " + str(result))
|
||||
loading_finished.emit(false)
|
||||
return
|
||||
|
||||
if response_code != 200:
|
||||
push_error("HTTPTextureRect: HTTP请求返回非200状态码: " + str(response_code))
|
||||
loading_finished.emit(false)
|
||||
return
|
||||
|
||||
# 检查内容类型
|
||||
var content_type = ""
|
||||
for header in headers:
|
||||
if header.to_lower().begins_with("content-type:"):
|
||||
content_type = header.substr(13).strip_edges().to_lower()
|
||||
print("HTTPTextureRect: 内容类型: ", content_type)
|
||||
break
|
||||
|
||||
# 创建图像
|
||||
var image = Image.new()
|
||||
var error = ERR_INVALID_DATA
|
||||
|
||||
# 根据内容类型选择加载方法
|
||||
if content_type.begins_with("image/jpeg") or content_type.begins_with("image/jpg"):
|
||||
error = image.load_jpg_from_buffer(body)
|
||||
elif content_type.begins_with("image/png"):
|
||||
error = image.load_png_from_buffer(body)
|
||||
elif content_type.begins_with("image/webp"):
|
||||
error = image.load_webp_from_buffer(body)
|
||||
elif content_type.begins_with("image/bmp"):
|
||||
error = image.load_bmp_from_buffer(body)
|
||||
else:
|
||||
# 未知内容类型,尝试常见格式
|
||||
error = image.load_jpg_from_buffer(body)
|
||||
if error != OK:
|
||||
error = image.load_png_from_buffer(body)
|
||||
if error != OK:
|
||||
error = image.load_webp_from_buffer(body)
|
||||
if error != OK:
|
||||
error = image.load_bmp_from_buffer(body)
|
||||
|
||||
# 检查加载结果
|
||||
if error != OK:
|
||||
push_error("HTTPTextureRect: 无法加载图像,错误码: " + str(error))
|
||||
loading_finished.emit(false)
|
||||
return
|
||||
|
||||
# 创建纹理并应用
|
||||
var texture = ImageTexture.create_from_image(image)
|
||||
self.texture = texture
|
||||
print("HTTPTextureRect: 图像加载成功,尺寸: ", image.get_width(), "x", image.get_height())
|
||||
loading_finished.emit(true)
|
||||
|
||||
# 加载QQ头像的便捷方法
|
||||
func load_qq_avatar(qq_number: String) -> void:
|
||||
if not qq_number.is_valid_int():
|
||||
push_error("HTTPTextureRect: QQ号必须为纯数字")
|
||||
loading_finished.emit(false)
|
||||
return
|
||||
|
||||
# 使用QQ头像API
|
||||
#var url = "https://q.qlogo.cn/headimg_dl?dst_uin=" + qq_number + "&spec=640&img_type=png"
|
||||
var url = "http://q1.qlogo.cn/g?b=qq&nk="+qq_number+"&s=100"
|
||||
|
||||
# 添加浏览器模拟头
|
||||
var headers = [
|
||||
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
||||
"Accept: image/png,image/jpeg,image/webp,image/*,*/*;q=0.8"
|
||||
]
|
||||
|
||||
# 加载图像
|
||||
load_from_url(url, headers)
|
||||
1
SproutFarm-Frontend/Components/HTTPTextureRect.gd.uid
Normal file
1
SproutFarm-Frontend/Components/HTTPTextureRect.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://0d2j5m6j2ema
|
||||
1
SproutFarm-Frontend/Components/ToastShow.gd.uid
Normal file
1
SproutFarm-Frontend/Components/ToastShow.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://caly13tf4ni1d
|
||||
91
SproutFarm-Frontend/CopyItems/crop_item.tscn
Normal file
91
SproutFarm-Frontend/CopyItems/crop_item.tscn
Normal file
@@ -0,0 +1,91 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://bkivlkirrx6u8"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bt1i2yhhlor5e" path="res://assets/地块/土块1.webp" id="1_bns1c"]
|
||||
[ext_resource type="Shader" path="res://Shader/PlantSwayShader.gdshader" id="2_s5pb0"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_v46ok"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_s5pb0"]
|
||||
shader = ExtResource("2_s5pb0")
|
||||
shader_parameter/sway_strength = 0.05
|
||||
shader_parameter/sway_speed = 1.5
|
||||
shader_parameter/wind_direction = 0.0
|
||||
shader_parameter/sway_variation = 0.5
|
||||
shader_parameter/sway_start_height = 0.5
|
||||
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
|
||||
|
||||
[node name="ground_sprite" type="Sprite2D" parent="."]
|
||||
material = SubResource("ShaderMaterial_v46ok")
|
||||
position = Vector2(50, 63)
|
||||
scale = Vector2(0.135, 0.135)
|
||||
texture = ExtResource("1_bns1c")
|
||||
|
||||
[node name="crop_sprite" type="Sprite2D" parent="."]
|
||||
material = SubResource("ShaderMaterial_s5pb0")
|
||||
position = Vector2(51, 40)
|
||||
scale = Vector2(0.339844, 0.363281)
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="."]
|
||||
visible = false
|
||||
material = SubResource("ShaderMaterial_cyybs")
|
||||
layout_mode = 2
|
||||
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
|
||||
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 = 76.0
|
||||
offset_right = 250.0
|
||||
offset_bottom = 118.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
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 = 62.0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 131.0
|
||||
scale = Vector2(0.2, 0.2)
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 50
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
23
SproutFarm-Frontend/CopyItems/item_button.tscn
Normal file
23
SproutFarm-Frontend/CopyItems/item_button.tscn
Normal file
@@ -0,0 +1,23 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ibl5wbbw3pwc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6ylh1o2kgqth" path="res://CopyItems/item_crop.gd" id="1_e25nh"]
|
||||
|
||||
[node name="item_button" type="Button"]
|
||||
custom_minimum_size = Vector2(400, 400)
|
||||
offset_right = 400.0
|
||||
offset_bottom = 400.0
|
||||
theme_override_font_sizes/font_size = 1
|
||||
icon_alignment = 1
|
||||
script = ExtResource("1_e25nh")
|
||||
|
||||
[node name="CropImage" type="Sprite2D" parent="."]
|
||||
position = Vector2(200, 200)
|
||||
scale = Vector2(1.5625, 1.5625)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 55.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "普通"
|
||||
horizontal_alignment = 1
|
||||
9
SproutFarm-Frontend/CopyItems/item_crop.gd
Normal file
9
SproutFarm-Frontend/CopyItems/item_crop.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends Button
|
||||
|
||||
@onready var title :Label = $Title
|
||||
@onready var crop_image: Sprite2D = $CropImage
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
title.text = self.text
|
||||
pass
|
||||
1
SproutFarm-Frontend/CopyItems/item_crop.gd.uid
Normal file
1
SproutFarm-Frontend/CopyItems/item_crop.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c6ylh1o2kgqth
|
||||
12
SproutFarm-Frontend/Data/item_config.json
Normal file
12
SproutFarm-Frontend/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"}
|
||||
}
|
||||
87
SproutFarm-Frontend/Data/pet_data.json
Normal file
87
SproutFarm-Frontend/Data/pet_data.json
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "687cf59b8e77ba00a7414bab"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2025-07-20T22:13:38.521Z"
|
||||
},
|
||||
"烈焰鸟": {
|
||||
"pet_name": "烈焰鸟",
|
||||
"can_purchase":true,
|
||||
"cost":1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/flying_bird.tscn",
|
||||
"pet_id": "0001",
|
||||
"pet_type": "飞鸟",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 500,
|
||||
"pet_temperament": "勇猛",
|
||||
"pet_birthday": "2023-03-15",
|
||||
"pet_hobby": "喜欢战斗和烈火",
|
||||
"pet_introduction": "我爱吃虫子",
|
||||
"max_health": 300,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 150,
|
||||
"shield_regen": 1.5,
|
||||
"max_armor": 120,
|
||||
"base_attack_damage": 40,
|
||||
"crit_rate": 0.15,
|
||||
"crit_damage": 2,
|
||||
"armor_penetration": 10,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 2,
|
||||
"enable_berserker_skill": true,
|
||||
"berserker_bonus": 1.8,
|
||||
"berserker_duration": 6,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": false,
|
||||
"enable_death_respawn_skill": true,
|
||||
"respawn_health_percentage": 0.4,
|
||||
"move_speed": 180,
|
||||
"dodge_rate": 0.08,
|
||||
"element_type": "FIRE",
|
||||
"element_damage_bonus": 75,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"大蓝虫": {
|
||||
"pet_name": "大蓝虫",
|
||||
"can_purchase":true,
|
||||
"cost":1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/big_beetle.tscn",
|
||||
"pet_id": "0002",
|
||||
"pet_type": "大甲壳虫",
|
||||
"pet_level": 8,
|
||||
"pet_experience": 320,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和小甲壳虫玩",
|
||||
"pet_introduction": "我是大蓝虫,不是大懒虫!",
|
||||
"max_health": 180,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80,
|
||||
"base_attack_damage": 35,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"move_speed": 120,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
}
|
||||
}
|
||||
177
SproutFarm-Frontend/GUI/CheckUpdatePanel.gd
Normal file
177
SproutFarm-Frontend/GUI/CheckUpdatePanel.gd
Normal file
@@ -0,0 +1,177 @@
|
||||
extends Control
|
||||
|
||||
# 简化版更新检测器
|
||||
# 适用于萌芽农场游戏
|
||||
|
||||
# 配置
|
||||
const GAME_ID = "mengyafarm"
|
||||
const SERVER_URL = "https://app.shumengya.top"
|
||||
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("正在打开下载页面...")
|
||||
|
||||
|
||||
# 关闭更新面板
|
||||
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
SproutFarm-Frontend/GUI/CheckUpdatePanel.gd.uid
Normal file
1
SproutFarm-Frontend/GUI/CheckUpdatePanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ciwjx67wjubdy
|
||||
10
SproutFarm-Frontend/GUI/GameAboutPanel.gd
Normal file
10
SproutFarm-Frontend/GUI/GameAboutPanel.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Panel
|
||||
|
||||
func _ready() -> void:
|
||||
self.show()
|
||||
pass
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
self.hide()
|
||||
pass
|
||||
1
SproutFarm-Frontend/GUI/GameAboutPanel.gd.uid
Normal file
1
SproutFarm-Frontend/GUI/GameAboutPanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bob7a4vhw4nl3
|
||||
203
SproutFarm-Frontend/GUI/GameSettingPanel.gd
Normal file
203
SproutFarm-Frontend/GUI/GameSettingPanel.gd
Normal file
@@ -0,0 +1,203 @@
|
||||
extends Panel
|
||||
#游戏设置面板
|
||||
|
||||
# UI组件引用
|
||||
@onready var background_music_h_slider: HSlider = $Scroll/Panel/BackgroundMusicHSlider
|
||||
@onready var weather_system_check: CheckButton = $Scroll/Panel/WeatherSystemCheck
|
||||
@onready var quit_button: Button = $QuitButton
|
||||
@onready var sure_button: Button = $SureButton
|
||||
@onready var refresh_button: Button = $RefreshButton
|
||||
|
||||
# 引用主游戏和其他组件
|
||||
@onready var main_game = get_node("/root/main")
|
||||
@onready var tcp_network_manager_panel: Panel = get_node("/root/main/UI/BigPanel/TCPNetworkManagerPanel")
|
||||
|
||||
# 游戏设置数据
|
||||
var game_settings: Dictionary = {
|
||||
"背景音乐音量": 1.0,
|
||||
"天气显示": true
|
||||
}
|
||||
|
||||
# 临时设置数据(用户修改但未确认的设置)
|
||||
var temp_settings: Dictionary = {}
|
||||
|
||||
func _ready() -> void:
|
||||
self.hide()
|
||||
|
||||
# 连接信号
|
||||
quit_button.pressed.connect(_on_quit_button_pressed)
|
||||
sure_button.pressed.connect(_on_sure_button_pressed)
|
||||
refresh_button.pressed.connect(_on_refresh_button_pressed)
|
||||
|
||||
# 设置音量滑块范围为0-1
|
||||
background_music_h_slider.min_value = 0.0
|
||||
background_music_h_slider.max_value = 1.0
|
||||
background_music_h_slider.step = 0.01
|
||||
background_music_h_slider.value_changed.connect(_on_background_music_h_slider_value_changed)
|
||||
weather_system_check.toggled.connect(_on_weather_system_check_toggled)
|
||||
|
||||
# 初始化设置值
|
||||
_load_settings_from_global()
|
||||
|
||||
# 当面板可见性改变时
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
|
||||
func _on_visibility_changed():
|
||||
"""面板可见性改变时的处理"""
|
||||
if visible:
|
||||
# 面板显示时,刷新设置值
|
||||
_load_settings_from_global()
|
||||
_update_ui_from_settings()
|
||||
|
||||
# 禁用缩放功能
|
||||
GlobalVariables.isZoomDisabled = true
|
||||
else:
|
||||
# 面板隐藏时,恢复缩放功能
|
||||
GlobalVariables.isZoomDisabled = false
|
||||
|
||||
func _load_settings_from_global():
|
||||
"""从全局变量和玩家数据加载设置"""
|
||||
# 从GlobalVariables加载默认设置
|
||||
game_settings["背景音乐音量"] = GlobalVariables.BackgroundMusicVolume
|
||||
game_settings["天气显示"] = not GlobalVariables.DisableWeatherDisplay
|
||||
|
||||
# 如果主游戏已登录,尝试从玩家数据加载设置
|
||||
if main_game and main_game.login_data and main_game.login_data.has("游戏设置"):
|
||||
var player_settings = main_game.login_data["游戏设置"]
|
||||
if player_settings.has("背景音乐音量"):
|
||||
game_settings["背景音乐音量"] = player_settings["背景音乐音量"]
|
||||
if player_settings.has("天气显示"):
|
||||
game_settings["天气显示"] = player_settings["天气显示"]
|
||||
|
||||
# 初始化临时设置
|
||||
temp_settings = game_settings.duplicate()
|
||||
|
||||
func _update_ui_from_settings():
|
||||
"""根据设置数据更新UI"""
|
||||
# 更新音量滑块
|
||||
background_music_h_slider.value = temp_settings["背景音乐音量"]
|
||||
|
||||
# 更新天气显示复选框(注意:复选框表示"关闭天气显示")
|
||||
weather_system_check.button_pressed = not temp_settings["天气显示"]
|
||||
|
||||
func _apply_settings_immediately():
|
||||
"""立即应用设置(不保存到服务端)"""
|
||||
# 应用背景音乐音量设置
|
||||
_apply_music_volume_setting()
|
||||
|
||||
# 应用天气显示设置
|
||||
_apply_weather_display_setting()
|
||||
|
||||
func _save_settings_to_server():
|
||||
"""保存设置到服务端"""
|
||||
# 更新正式设置
|
||||
game_settings = temp_settings.duplicate()
|
||||
|
||||
# 应用设置
|
||||
_apply_settings_immediately()
|
||||
|
||||
# 如果已登录,保存到玩家数据并同步到服务端
|
||||
if main_game and main_game.login_data:
|
||||
main_game.login_data["游戏设置"] = game_settings.duplicate()
|
||||
|
||||
# 发送设置到服务端保存
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.has_method("is_connected_to_server") and tcp_network_manager_panel.is_connected_to_server():
|
||||
_send_settings_to_server()
|
||||
|
||||
func _apply_music_volume_setting():
|
||||
"""应用背景音乐音量设置"""
|
||||
var bgm_player = main_game.get_node_or_null("GameBGMPlayer")
|
||||
if bgm_player and bgm_player.has_method("set_volume"):
|
||||
bgm_player.set_volume(temp_settings["背景音乐音量"])
|
||||
|
||||
func _apply_weather_display_setting():
|
||||
"""应用天气显示设置"""
|
||||
var weather_system = main_game.get_node_or_null("WeatherSystem")
|
||||
if weather_system and weather_system.has_method("set_weather_display_enabled"):
|
||||
weather_system.set_weather_display_enabled(temp_settings["天气显示"])
|
||||
|
||||
func _send_settings_to_server():
|
||||
"""发送设置到服务端保存"""
|
||||
if tcp_network_manager_panel and tcp_network_manager_panel.has_method("send_message"):
|
||||
var message = {
|
||||
"type": "save_game_settings",
|
||||
"settings": game_settings,
|
||||
"timestamp": Time.get_unix_time_from_system()
|
||||
}
|
||||
|
||||
if tcp_network_manager_panel.send_message(message):
|
||||
print("游戏设置已发送到服务端保存")
|
||||
else:
|
||||
print("发送游戏设置到服务端失败")
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
"""关闭设置面板"""
|
||||
self.hide()
|
||||
|
||||
func _on_background_music_h_slider_value_changed(value: float) -> void:
|
||||
"""背景音乐音量滑块值改变"""
|
||||
temp_settings["背景音乐音量"] = value
|
||||
# 立即应用音量设置(不保存到服务端)
|
||||
_apply_music_volume_setting()
|
||||
|
||||
# 显示当前音量百分比
|
||||
var volume_percent = int(value * 100)
|
||||
|
||||
func _on_weather_system_check_toggled(toggled_on: bool) -> void:
|
||||
"""天气系统复选框切换"""
|
||||
# 复选框表示"关闭天气显示",所以需要取反
|
||||
temp_settings["天气显示"] = not toggled_on
|
||||
# 立即应用天气设置(不保存到服务端)
|
||||
_apply_weather_display_setting()
|
||||
|
||||
# 显示提示
|
||||
var status_text = "已开启" if temp_settings["天气显示"] else "已关闭"
|
||||
Toast.show("天气显示" + status_text, Color.YELLOW)
|
||||
|
||||
#确认修改设置按钮,点击这个才会发送数据到服务端
|
||||
func _on_sure_button_pressed() -> void:
|
||||
"""确认修改设置"""
|
||||
_save_settings_to_server()
|
||||
Toast.show("设置已保存!", Color.GREEN)
|
||||
|
||||
#刷新设置面板,从服务端加载游戏设置数据
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
"""刷新设置"""
|
||||
_load_settings_from_global()
|
||||
_update_ui_from_settings()
|
||||
_apply_settings_immediately()
|
||||
Toast.show("设置已刷新!", Color.CYAN)
|
||||
|
||||
# 移除原来的自动保存方法,避免循环调用
|
||||
func _on_background_music_h_slider_drag_ended(value_changed: bool) -> void:
|
||||
"""背景音乐音量滑块拖拽结束(保留以兼容场景连接)"""
|
||||
# 不再自动保存,只显示提示
|
||||
if value_changed:
|
||||
var volume_percent = int(background_music_h_slider.value * 100)
|
||||
|
||||
# 公共方法,供外部调用
|
||||
func refresh_settings():
|
||||
"""刷新设置(从服务端或本地重新加载)"""
|
||||
_load_settings_from_global()
|
||||
_update_ui_from_settings()
|
||||
_apply_settings_immediately()
|
||||
|
||||
func get_current_settings() -> Dictionary:
|
||||
"""获取当前设置"""
|
||||
return game_settings.duplicate()
|
||||
|
||||
func apply_settings_from_server(server_settings: Dictionary):
|
||||
"""应用从服务端接收到的设置(避免循环调用)"""
|
||||
if server_settings.has("背景音乐音量"):
|
||||
game_settings["背景音乐音量"] = server_settings["背景音乐音量"]
|
||||
temp_settings["背景音乐音量"] = server_settings["背景音乐音量"]
|
||||
if server_settings.has("天气显示"):
|
||||
game_settings["天气显示"] = server_settings["天气显示"]
|
||||
temp_settings["天气显示"] = server_settings["天气显示"]
|
||||
|
||||
# 只更新UI,不再触发保存
|
||||
if visible:
|
||||
_update_ui_from_settings()
|
||||
_apply_settings_immediately()
|
||||
|
||||
print("已应用来自服务端的游戏设置")
|
||||
1
SproutFarm-Frontend/GUI/GameSettingPanel.gd.uid
Normal file
1
SproutFarm-Frontend/GUI/GameSettingPanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ct7rhywlql4y4
|
||||
163
SproutFarm-Frontend/GUI/GameSettingPanel.tscn
Normal file
163
SproutFarm-Frontend/GUI/GameSettingPanel.tscn
Normal file
@@ -0,0 +1,163 @@
|
||||
[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_left = 151.0
|
||||
offset_top = 74.0
|
||||
offset_right = 1549.0
|
||||
offset_bottom = 794.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 = 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 = 55
|
||||
text = "游戏设置"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 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
|
||||
offset_right = 79.0
|
||||
offset_bottom = 57.0
|
||||
text = "打开网页"
|
||||
uri = "http://192.168.1.110:19132/site/python"
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="."]
|
||||
layout_mode = 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
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="BackgroundMusicLabel" type="Label" parent="Scroll/Panel"]
|
||||
layout_mode = 2
|
||||
offset_left = -1.52588e-05
|
||||
offset_right = 245.0
|
||||
offset_bottom = 49.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "背景音乐音量:"
|
||||
|
||||
[node name="BackgroundMusicHSlider" type="HSlider" parent="Scroll/Panel"]
|
||||
layout_mode = 2
|
||||
offset_left = 245.0
|
||||
offset_right = 574.0
|
||||
offset_bottom = 49.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
|
||||
[node name="WeatherSystemLabel" type="Label" parent="Scroll/Panel"]
|
||||
layout_mode = 2
|
||||
offset_left = -0.249969
|
||||
offset_top = 48.75
|
||||
offset_right = 209.75
|
||||
offset_bottom = 97.75
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "关闭天气显示:"
|
||||
|
||||
[node name="WeatherSystemCheck" type="CheckButton" parent="Scroll/Panel"]
|
||||
layout_mode = 2
|
||||
offset_left = 244.75
|
||||
offset_top = 48.75
|
||||
offset_right = 288.75
|
||||
offset_bottom = 72.75
|
||||
scale = Vector2(2, 2)
|
||||
theme_override_font_sizes/font_size = 100
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="Scroll/Panel"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_top = 97.0
|
||||
offset_right = 853.0
|
||||
offset_bottom = 154.0
|
||||
|
||||
[node name="ChangeServer" type="Label" parent="Scroll/Panel/HBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "切换服务器"
|
||||
|
||||
[node name="IPInput" type="LineEdit" parent="Scroll/Panel/HBox"]
|
||||
custom_minimum_size = Vector2(400, 0)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 35
|
||||
placeholder_text = "请输入服务器IP地址"
|
||||
|
||||
[node name="PortInput" type="LineEdit" parent="Scroll/Panel/HBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 35
|
||||
placeholder_text = "端口"
|
||||
alignment = 1
|
||||
|
||||
[node name="ChangeButton" type="Button" parent="Scroll/Panel/HBox"]
|
||||
custom_minimum_size = Vector2(120, 0)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "切换"
|
||||
|
||||
[node name="SureButton" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 647.5
|
||||
offset_top = 635.0
|
||||
offset_right = 815.5
|
||||
offset_bottom = 698.0
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "确认修改"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 27.5001
|
||||
offset_top = 25.0001
|
||||
offset_right = 195.5
|
||||
offset_bottom = 88.0001
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "刷新"
|
||||
159
SproutFarm-Frontend/GUI/GameUpdatePanel.gd
Normal file
159
SproutFarm-Frontend/GUI/GameUpdatePanel.gd
Normal file
@@ -0,0 +1,159 @@
|
||||
extends Panel
|
||||
|
||||
@onready var contents: RichTextLabel = $Scroll/Contents #更新内容
|
||||
@onready var refresh_button: Button = $RefreshButton #刷新按钮
|
||||
|
||||
# HTTP请求节点
|
||||
var http_request: HTTPRequest
|
||||
|
||||
# API配置
|
||||
const API_URL = "http://47.108.90.0:5003/api/game/mengyafarm/updates"
|
||||
|
||||
func _ready() -> void:
|
||||
self.hide()
|
||||
|
||||
# 创建HTTPRequest节点
|
||||
http_request = HTTPRequest.new()
|
||||
add_child(http_request)
|
||||
|
||||
# 连接HTTP请求完成信号
|
||||
http_request.request_completed.connect(_on_request_completed)
|
||||
|
||||
# 连接刷新按钮信号
|
||||
refresh_button.pressed.connect(_on_refresh_button_pressed)
|
||||
|
||||
# 初始加载更新数据
|
||||
load_updates()
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
HidePanel()
|
||||
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
load_updates()
|
||||
|
||||
func load_updates() -> void:
|
||||
# 禁用刷新按钮,防止重复请求
|
||||
refresh_button.disabled = true
|
||||
refresh_button.text = "刷新中..."
|
||||
|
||||
# 显示加载中
|
||||
contents.text = "[center][color=yellow]正在加载更新信息...[/color][/center]"
|
||||
|
||||
# 发起HTTP请求
|
||||
var error = http_request.request(API_URL)
|
||||
if error != OK:
|
||||
_show_error("网络请求失败,错误代码: " + str(error))
|
||||
|
||||
func _on_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||
# 恢复刷新按钮
|
||||
refresh_button.disabled = false
|
||||
refresh_button.text = "刷新"
|
||||
|
||||
# 检查请求结果
|
||||
if result != HTTPRequest.RESULT_SUCCESS:
|
||||
_show_error("网络连接失败")
|
||||
return
|
||||
|
||||
if response_code != 200:
|
||||
_show_error("服务器响应错误 (HTTP " + str(response_code) + ")")
|
||||
return
|
||||
|
||||
# 解析JSON数据
|
||||
var json_text = body.get_string_from_utf8()
|
||||
if json_text.is_empty():
|
||||
_show_error("服务器返回空数据")
|
||||
return
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_text)
|
||||
|
||||
if parse_result != OK:
|
||||
_show_error("数据解析失败")
|
||||
return
|
||||
|
||||
var data = json.data
|
||||
if not data.has("updates"):
|
||||
_show_error("数据格式错误")
|
||||
return
|
||||
|
||||
# 显示更新内容
|
||||
display_updates(data.updates)
|
||||
|
||||
func _show_error(error_message: String) -> void:
|
||||
refresh_button.disabled = false
|
||||
refresh_button.text = "刷新"
|
||||
contents.text = "[center][color=red]" + error_message + "\n\n请检查网络连接或稍后重试[/color][/center]"
|
||||
|
||||
func display_updates(updates: Array) -> void:
|
||||
if updates.is_empty():
|
||||
contents.text = "[center][color=gray]暂无更新信息[/color][/center]"
|
||||
return
|
||||
|
||||
var update_text = ""
|
||||
|
||||
for i in range(updates.size()):
|
||||
var update = updates[i]
|
||||
|
||||
# 检查必要字段
|
||||
if not update.has("title") or not update.has("version") or not update.has("content"):
|
||||
continue
|
||||
|
||||
# 更新标题
|
||||
update_text += "[color=cyan][font_size=22][b]" + str(update.title) + "[/b][/font_size][/color]\n"
|
||||
|
||||
# 版本和时间信息
|
||||
update_text += "[color=green]版本: " + str(update.version) + "[/color]"
|
||||
|
||||
if update.has("timestamp"):
|
||||
var formatted_time = _format_time(str(update.timestamp))
|
||||
update_text += " [color=gray]时间: " + formatted_time + "[/color]"
|
||||
|
||||
if update.has("game_name"):
|
||||
update_text += " [color=gray]游戏: " + str(update.game_name) + "[/color]"
|
||||
|
||||
update_text += "\n\n"
|
||||
|
||||
# 更新内容
|
||||
var content = str(update.content)
|
||||
# 处理换行符
|
||||
content = content.replace("\\r\\n", "\n").replace("\\n", "\n")
|
||||
# 高亮特殊符号
|
||||
#content = content.replace("✓", "[color=green]✓[/color]")
|
||||
|
||||
update_text += "[color=white]" + content + "[/color]\n"
|
||||
|
||||
# 添加分隔线(除了最后一个更新)
|
||||
if i < updates.size() - 1:
|
||||
update_text += "\n[color=gray]" + "─".repeat(60) + "[/color]\n\n"
|
||||
|
||||
contents.text = update_text
|
||||
|
||||
# 简单的时间格式化
|
||||
func _format_time(timestamp: String) -> String:
|
||||
var parts = timestamp.split(" ")
|
||||
if parts.size() >= 2:
|
||||
var date_parts = parts[0].split("-")
|
||||
var time_parts = parts[1].split(":")
|
||||
|
||||
if date_parts.size() >= 3 and time_parts.size() >= 2:
|
||||
return date_parts[1] + "月" + date_parts[2] + "日 " + time_parts[0] + ":" + time_parts[1]
|
||||
|
||||
return timestamp
|
||||
|
||||
# 显示面板时自动刷新
|
||||
func ShowPanel() -> void:
|
||||
self.show()
|
||||
load_updates()
|
||||
|
||||
# 隐藏面板时取消正在进行的请求
|
||||
func HidePanel() -> void:
|
||||
self.hide()
|
||||
if http_request and http_request.get_http_client_status() != HTTPClient.STATUS_DISCONNECTED:
|
||||
http_request.cancel_request()
|
||||
|
||||
# 恢复按钮状态
|
||||
if refresh_button:
|
||||
refresh_button.disabled = false
|
||||
refresh_button.text = "刷新"
|
||||
|
||||
|
||||
1
SproutFarm-Frontend/GUI/GameUpdatePanel.gd.uid
Normal file
1
SproutFarm-Frontend/GUI/GameUpdatePanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://kj7v1uxk2i6h
|
||||
43
SproutFarm-Frontend/GUI/MainMenuPanel.gd
Normal file
43
SproutFarm-Frontend/GUI/MainMenuPanel.gd
Normal file
@@ -0,0 +1,43 @@
|
||||
extends Control
|
||||
#各种面板
|
||||
@onready var game_about_panel: Panel = $GameAboutPanel
|
||||
@onready var game_update_panel: Panel = $GameUpdatePanel
|
||||
#@onready var game_setting_panel: Panel = $GameSettingPanel
|
||||
|
||||
@onready var game_version_label: Label = $GUI/GameVersionLabel
|
||||
|
||||
@export var smy :TextureRect
|
||||
|
||||
func _ready():
|
||||
game_version_label.text = "版本号:"+GlobalVariables.client_version
|
||||
pass
|
||||
|
||||
func SetGameVersionLabel(version :String):
|
||||
game_version_label.text = version
|
||||
pass
|
||||
|
||||
#开始游戏
|
||||
func _on_start_game_button_pressed() -> void:
|
||||
await get_tree().process_frame
|
||||
get_tree().change_scene_to_file('res://MainGame.tscn')
|
||||
pass
|
||||
|
||||
#游戏设置
|
||||
func _on_game_setting_button_pressed() -> void:
|
||||
#game_setting_panel.show()
|
||||
pass
|
||||
|
||||
#游戏更新
|
||||
func _on_game_update_button_pressed() -> void:
|
||||
game_update_panel.ShowPanel( )
|
||||
pass
|
||||
|
||||
#游戏关于
|
||||
func _on_game_about_button_pressed() -> void:
|
||||
game_about_panel.show()
|
||||
pass
|
||||
|
||||
#游戏结束
|
||||
func _on_exit_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
pass
|
||||
1
SproutFarm-Frontend/GUI/MainMenuPanel.gd.uid
Normal file
1
SproutFarm-Frontend/GUI/MainMenuPanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://badqjgdfhg7vt
|
||||
394
SproutFarm-Frontend/GUI/MainMenuPanel.tscn
Normal file
394
SproutFarm-Frontend/GUI/MainMenuPanel.tscn
Normal file
@@ -0,0 +1,394 @@
|
||||
[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"]
|
||||
[ext_resource type="Texture2D" uid="uid://h8tto256aww4" path="res://assets/菜单Logo/logo1.webp" id="3_eghpk"]
|
||||
[ext_resource type="Script" uid="uid://bob7a4vhw4nl3" path="res://GUI/GameAboutPanel.gd" id="3_y0inj"]
|
||||
[ext_resource type="Texture2D" uid="uid://dgdootc5bny5q" path="res://assets/菜单UI/QQ群.webp" id="4_eghpk"]
|
||||
[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="Texture2D" uid="uid://be4fa6qo525y1" path="res://assets/菜单UI/灵创招新群.png" id="5_m77al"]
|
||||
[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
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -2.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_wpehy")
|
||||
|
||||
[node name="Background" type="TextureRect" parent="."]
|
||||
self_modulate = Color(1, 1, 1, 0.34902)
|
||||
layout_mode = 0
|
||||
offset_left = -131.0
|
||||
offset_top = -24.0
|
||||
offset_right = 1568.0
|
||||
offset_bottom = 734.0
|
||||
texture = ExtResource("2_eghpk")
|
||||
|
||||
[node name="GUI" type="Control" parent="."]
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="GameLogo" type="TextureRect" parent="GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 450.0
|
||||
offset_top = -24.0
|
||||
offset_right = 1730.0
|
||||
offset_bottom = 696.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
texture = ExtResource("3_eghpk")
|
||||
stretch_mode = 2
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="GUI"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 88.0
|
||||
theme_override_font_sizes/normal_font_size = 40
|
||||
bbcode_enabled = true
|
||||
text = "萌芽农场"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="GameVersionLabel" type="Label" parent="GUI"]
|
||||
layout_mode = 0
|
||||
offset_top = 676.0
|
||||
offset_right = 188.0
|
||||
offset_bottom = 718.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "版本号:v1.0"
|
||||
|
||||
[node name="GameVersionLabel2" type="Label" parent="GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 575.0
|
||||
offset_top = 676.0
|
||||
offset_right = 875.0
|
||||
offset_bottom = 718.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "学习项目"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Developer" type="RichTextLabel" parent="GUI"]
|
||||
layout_mode = 0
|
||||
offset_left = 1194.0
|
||||
offset_top = 676.0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 718.0
|
||||
theme_override_font_sizes/normal_font_size = 30
|
||||
bbcode_enabled = true
|
||||
text = "[rainbow freq=1 sat=2 val=100]By-树萌芽[/rainbow]"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="AddGroupLabel" type="Label" parent="GUI"]
|
||||
visible = false
|
||||
self_modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 896.0
|
||||
offset_top = 205.0
|
||||
offset_right = 1226.0
|
||||
offset_bottom = 247.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 = 15
|
||||
theme_override_constants/shadow_outline_size = 0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "加群获取最新开发动态!"
|
||||
|
||||
[node name="QQGroupImage" type="TextureRect" parent="GUI/AddGroupLabel"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 17.0
|
||||
offset_top = 43.0
|
||||
offset_right = 952.0
|
||||
offset_bottom = 1229.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture = ExtResource("4_eghpk")
|
||||
|
||||
[node name="QQGroupImage2" type="TextureRect" parent="GUI/AddGroupLabel"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = -832.0
|
||||
offset_right = 103.0
|
||||
offset_bottom = 1186.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture = ExtResource("5_m77al")
|
||||
|
||||
[node name="YouXiaoQing" type="TextureRect" parent="GUI/AddGroupLabel"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 298.0
|
||||
offset_top = 82.0
|
||||
offset_right = 1233.0
|
||||
offset_bottom = 1268.0
|
||||
scale = Vector2(0.14, 0.14)
|
||||
texture = ExtResource("5_6jmhb")
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="GUI/AddGroupLabel"]
|
||||
visible = false
|
||||
self_modulate = Color(0.580392, 1, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_left = -896.0
|
||||
offset_top = -47.0
|
||||
offset_right = -420.0
|
||||
offset_bottom = -7.0
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_offset_y = 0
|
||||
theme_override_constants/shadow_offset_x = 0
|
||||
theme_override_constants/shadow_outline_size = 0
|
||||
theme_override_font_sizes/bold_italics_font_size = 0
|
||||
theme_override_font_sizes/italics_font_size = 0
|
||||
theme_override_font_sizes/mono_font_size = 0
|
||||
theme_override_font_sizes/normal_font_size = 30
|
||||
theme_override_font_sizes/bold_font_size = 0
|
||||
bbcode_enabled = true
|
||||
text = "欢迎了解灵创新媒实验室"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 248.0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 720.0
|
||||
|
||||
[node name="StartGameButton" type="Button" parent="VBox"]
|
||||
custom_minimum_size = Vector2(168, 63)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "开始游戏"
|
||||
|
||||
[node name="GameSettingButton" type="Button" parent="VBox"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(168, 63)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "设置"
|
||||
|
||||
[node name="GameUpdateButton" type="Button" parent="VBox"]
|
||||
custom_minimum_size = Vector2(168, 63)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "更新"
|
||||
|
||||
[node name="GameAboutButton" type="Button" parent="VBox"]
|
||||
custom_minimum_size = Vector2(168, 63)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "关于"
|
||||
|
||||
[node name="ExitButton" type="Button" parent="VBox"]
|
||||
custom_minimum_size = Vector2(168, 63)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_font_sizes/font_size = 40
|
||||
text = "退出游戏"
|
||||
|
||||
[node name="GameAboutPanel" type="Panel" parent="."]
|
||||
visible = false
|
||||
layout_mode = 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"]
|
||||
layout_mode = 0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 80.0
|
||||
theme_override_colors/font_color = Color(0.780392, 1, 0.905882, 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 = 45
|
||||
text = "关于"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="GameAboutPanel"]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 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 = 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_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 = 30
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/normal_font_size = 70
|
||||
bbcode_enabled = true
|
||||
text = "玩法介绍:
|
||||
1.版本要匹配,服务器版本一直在更新,请及时下载最新版客户端,否者无法登录游戏
|
||||
2.游戏目前适配Windows和安卓平台,未来也会适配Linux桌面版,IOS应该会有吧...?
|
||||
3.电脑Windows平台按住wsad或者方向键可以移动视角,鼠标滚轮可以缩放视角;安卓则为拖动和双指缩放
|
||||
3.注册账号一定一定要用QQ号,目前游戏的所有登录服务都是围绕着腾讯QQ来验证,注册时会向您输入的QQ号对应的QQ邮箱发送一封注册邮件。
|
||||
4.不要一上来就把钱用完了(比如某某人一上来就十连抽),可以去偷别人的菜
|
||||
5.玩家排行榜有一些特殊农场,可以直接搜索访问: 杂交农场(666) 花卉农场(520) 稻香(111) 小麦谷(222) 访问有惊喜
|
||||
6.全服大喇叭也有一些小彩蛋
|
||||
7.记得在小卖部向其他玩家出售你不需要的东西
|
||||
8.玩家太多无法找到你的好友的农场?试试直接搜索QQ号
|
||||
9.如果有条件尽量还是玩电脑版吧,毕竟电脑版优化是最好的,手机版或多或少有些问题(
|
||||
|
||||
致谢名单:
|
||||
程序牛马:(作物处理+抠图)
|
||||
虚空领主:(美术+抠图)
|
||||
豆包:(万能的美术)
|
||||
ChatGPT:(超级美术)"
|
||||
|
||||
[node name="GameUpdatePanel" type="Panel" parent="."]
|
||||
visible = false
|
||||
layout_mode = 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 = 1384.0
|
||||
offset_bottom = 705.0
|
||||
|
||||
[node name="Contents" type="RichTextLabel" parent="GameUpdatePanel/Scroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
bbcode_enabled = true
|
||||
|
||||
[node name="Title" type="Label" parent="GameUpdatePanel"]
|
||||
layout_mode = 0
|
||||
offset_right = 1398.0
|
||||
offset_bottom = 80.0
|
||||
theme_override_font_sizes/font_size = 45
|
||||
text = "游戏更新"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="GameUpdatePanel"]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 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_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"]
|
||||
[connection signal="pressed" from="VBox/GameAboutButton" to="." method="_on_game_about_button_pressed"]
|
||||
[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"]
|
||||
87
SproutFarm-Frontend/GUI/PlayerRankingItem.tscn
Normal file
87
SproutFarm-Frontend/GUI/PlayerRankingItem.tscn
Normal file
@@ -0,0 +1,87 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://crd28qnymob7"]
|
||||
|
||||
[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="PlayerRankingItem" 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 = "正在检测中..."
|
||||
|
||||
[node name="LikeNum" type="Label" parent="HBox2"]
|
||||
modulate = Color(1, 0.611765, 1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "点赞数:999"
|
||||
59
SproutFarm-Frontend/GameManager/DayNightSystem.gd
Normal file
59
SproutFarm-Frontend/GameManager/DayNightSystem.gd
Normal file
@@ -0,0 +1,59 @@
|
||||
extends Node2D
|
||||
#昼夜循环系统
|
||||
#时间直接获取现实世界时间
|
||||
#内容就是直接调节背景图片modulate的亮度HEX 白天最亮为c3c3c3 晚上最暗为131313 然后在这之间变化
|
||||
|
||||
# 背景节点引用
|
||||
@onready var background_node=$'../BackgroundUI/BackgroundSwitcher'
|
||||
|
||||
# 白天和夜晚的颜色值
|
||||
var day_color = Color("#c3c3c3")
|
||||
var night_color = Color("#131313")
|
||||
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if background_node == null:
|
||||
return
|
||||
|
||||
# 获取当前时间
|
||||
var current_time = Time.get_datetime_dict_from_system()
|
||||
var hour = current_time.hour
|
||||
var minute = current_time.minute
|
||||
|
||||
# 将时间转换为小数形式(0-24)
|
||||
var time_decimal = hour + minute / 60.0
|
||||
|
||||
# 计算亮度插值因子
|
||||
var brightness_factor = calculate_brightness_factor(time_decimal)
|
||||
|
||||
# 在白天和夜晚颜色之间插值
|
||||
var current_color = night_color.lerp(day_color, brightness_factor)
|
||||
|
||||
# 应用到背景节点
|
||||
background_node.modulate = current_color
|
||||
|
||||
# 计算亮度因子(0为夜晚,1为白天)
|
||||
func calculate_brightness_factor(time: float) -> float:
|
||||
# 定义关键时间点
|
||||
var sunrise = 6.0 # 日出时间 6:00
|
||||
var noon = 12.0 # 正午时间 12:00
|
||||
var sunset = 18.0 # 日落时间 18:00
|
||||
var midnight = 0.0 # 午夜时间 0:00
|
||||
|
||||
if time >= sunrise and time <= noon:
|
||||
# 日出到正午:从0.2逐渐变亮到1.0
|
||||
return 0.2 + 0.8 * (time - sunrise) / (noon - sunrise)
|
||||
elif time > noon and time <= sunset:
|
||||
# 正午到日落:从1.0逐渐变暗到0.2
|
||||
return 1.0 - 0.8 * (time - noon) / (sunset - noon)
|
||||
else:
|
||||
# 夜晚时间:保持较暗状态(0.0-0.2之间)
|
||||
if time > sunset:
|
||||
# 日落后到午夜
|
||||
var night_progress = (time - sunset) / (24.0 - sunset)
|
||||
return 0.2 - 0.2 * night_progress
|
||||
else:
|
||||
# 午夜到日出
|
||||
var dawn_progress = time / sunrise
|
||||
return 0.0 + 0.2 * dawn_progress
|
||||
1
SproutFarm-Frontend/GameManager/DayNightSystem.gd.uid
Normal file
1
SproutFarm-Frontend/GameManager/DayNightSystem.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://di8wjflimodb0
|
||||
72
SproutFarm-Frontend/GameManager/WeatherSystem.gd
Normal file
72
SproutFarm-Frontend/GameManager/WeatherSystem.gd
Normal file
@@ -0,0 +1,72 @@
|
||||
extends Node2D
|
||||
|
||||
@onready var cherry_blossom_rain: Node2D = $CherryBlossomRain #栀子花雨
|
||||
@onready var gardenia_rain: Node2D = $GardeniaRain #樱花雨
|
||||
@onready var willow_leaf_rain: Node2D = $WillowLeafRain #柳叶雨
|
||||
@onready var rain: GPUParticles2D = $Rain #下雨
|
||||
@onready var snow: GPUParticles2D = $Snow #下雪
|
||||
|
||||
# 天气系统
|
||||
# 要显示哪种天气直接调用相应天气的show()然后一并隐藏其他天气hide()
|
||||
|
||||
# 动态天气显示控制(可以覆盖全局设置)
|
||||
var weather_display_enabled: bool = true
|
||||
|
||||
# 设置天气的统一方法
|
||||
func set_weather(weather_type: String):
|
||||
# 检查全局设置和动态设置
|
||||
if not weather_display_enabled:
|
||||
hide_all_weather()
|
||||
return
|
||||
|
||||
# 先隐藏所有天气效果
|
||||
#hide_all_weather()
|
||||
|
||||
# 根据天气类型显示对应效果
|
||||
match weather_type:
|
||||
"clear", "stop":
|
||||
# 晴天或停止天气 - 所有天气效果都隐藏
|
||||
pass
|
||||
"rain":
|
||||
if rain:
|
||||
rain.show()
|
||||
"snow":
|
||||
if snow:
|
||||
snow.show()
|
||||
"cherry":
|
||||
if cherry_blossom_rain:
|
||||
cherry_blossom_rain.show()
|
||||
"gardenia":
|
||||
if gardenia_rain:
|
||||
gardenia_rain.show()
|
||||
"willow":
|
||||
if willow_leaf_rain:
|
||||
willow_leaf_rain.show()
|
||||
_:
|
||||
print("未知的天气类型: ", weather_type)
|
||||
|
||||
# 动态设置天气显示状态
|
||||
func set_weather_display_enabled(enabled: bool):
|
||||
"""动态设置天气显示是否启用"""
|
||||
weather_display_enabled = enabled
|
||||
if not enabled:
|
||||
hide_all_weather()
|
||||
print("天气显示已", "启用" if enabled else "禁用")
|
||||
|
||||
# 获取当前天气显示状态
|
||||
func is_weather_display_enabled() -> bool:
|
||||
"""获取当前天气显示状态"""
|
||||
return weather_display_enabled and not GlobalVariables.DisableWeatherDisplay
|
||||
|
||||
# 隐藏所有天气效果
|
||||
func hide_all_weather():
|
||||
if cherry_blossom_rain:
|
||||
cherry_blossom_rain.hide()
|
||||
if gardenia_rain:
|
||||
gardenia_rain.hide()
|
||||
if willow_leaf_rain:
|
||||
willow_leaf_rain.hide()
|
||||
if rain:
|
||||
rain.hide()
|
||||
if snow:
|
||||
snow.hide()
|
||||
1
SproutFarm-Frontend/GameManager/WeatherSystem.gd.uid
Normal file
1
SproutFarm-Frontend/GameManager/WeatherSystem.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://o4mcuqoivqri
|
||||
76
SproutFarm-Frontend/GlobalScript/GlobalFunctions.gd
Normal file
76
SproutFarm-Frontend/GlobalScript/GlobalFunctions.gd
Normal file
@@ -0,0 +1,76 @@
|
||||
extends Node
|
||||
|
||||
# 全局通用功能脚本
|
||||
# 使用方法:首先在项目设置的自动加载中添加此脚本,然后在任何地方使用 GlobalFunctions.函数名() 调用
|
||||
|
||||
func _ready():
|
||||
print("全局函数库已加载")
|
||||
|
||||
# 写入 TXT 文件
|
||||
func write_txt_file(file_path: String, text: String, append: bool = false) -> void:
|
||||
var file
|
||||
if append == true:
|
||||
file = FileAccess.open(file_path, FileAccess.READ_WRITE) # 追加模式
|
||||
if file:
|
||||
file.seek_end() # 移动光标到文件末尾
|
||||
else:
|
||||
file = FileAccess.open(file_path, FileAccess.WRITE) # 覆盖模式
|
||||
if file:
|
||||
file.store_string(text)
|
||||
file.close()
|
||||
if has_node("/root/ToastScript"):
|
||||
get_node("/root/ToastScript").show("游戏已保存!", Color.GREEN, 5.0, 1.0)
|
||||
else:
|
||||
print("写入文件时打开失败: ", file_path)
|
||||
if has_node("/root/ToastScript"):
|
||||
get_node("/root/ToastScript").show("写入文件时打开失败!", Color.RED, 5.0, 1.0)
|
||||
|
||||
|
||||
# 读取 TXT 文件
|
||||
func read_txt_file(file_path: String) -> String:
|
||||
var file = FileAccess.open(file_path, FileAccess.READ)
|
||||
if file:
|
||||
var text = file.get_as_text()
|
||||
file.close()
|
||||
return text
|
||||
else:
|
||||
print("打开文件失败: ", file_path)
|
||||
return "false"
|
||||
|
||||
|
||||
#生成随机数-用于作物随机死亡
|
||||
func random_probability(probability: float) -> bool:
|
||||
# 确保传入的概率值在 0 到 1 之间
|
||||
if probability*0.001 < 0.0 or probability*0.001 > 1.0:
|
||||
print("概率值必须在 0 和 1 之间")
|
||||
return false
|
||||
|
||||
# 生成一个 0 到 1 之间的随机数
|
||||
var random_value = randf()
|
||||
|
||||
# 如果随机数小于等于概率值,则返回 true
|
||||
return random_value <= (probability*0.001)
|
||||
|
||||
|
||||
# 格式化时间为可读字符串
|
||||
func format_time(seconds: int) -> String:
|
||||
var minutes = seconds / 60
|
||||
seconds = seconds % 60
|
||||
var hours = minutes / 60
|
||||
minutes = minutes % 60
|
||||
|
||||
if hours > 0:
|
||||
return "%02d:%02d:%02d" % [hours, minutes, seconds]
|
||||
else:
|
||||
return "%02d:%02d" % [minutes, seconds]
|
||||
|
||||
|
||||
#双击切换UI事件-比如按一下打开再按一下关闭
|
||||
func double_click_close(node):
|
||||
if node.visible == false:
|
||||
node.show()
|
||||
pass
|
||||
else :
|
||||
node.hide()
|
||||
pass
|
||||
pass
|
||||
1
SproutFarm-Frontend/GlobalScript/GlobalFunctions.gd.uid
Normal file
1
SproutFarm-Frontend/GlobalScript/GlobalFunctions.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bv4lf4v2c73pb
|
||||
17
SproutFarm-Frontend/GlobalScript/GlobalVariables.gd
Normal file
17
SproutFarm-Frontend/GlobalScript/GlobalVariables.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Node
|
||||
|
||||
const client_version :String = "2.2.0" #记录客户端版本
|
||||
|
||||
var isZoomDisabled :bool = false
|
||||
|
||||
const server_configs = [
|
||||
{"host": "127.0.0.1", "port": 7070, "name": "本地"},
|
||||
#{"host": "192.168.31.233", "port": 6060, "name": "家里面局域网"},
|
||||
#{"host": "192.168.31.205", "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": "成都公网"}#成都服务器
|
||||
]
|
||||
|
||||
const DisableWeatherDisplay :bool = false #是否禁止显示天气
|
||||
const BackgroundMusicVolume = 1.0 #背景音乐音量
|
||||
1
SproutFarm-Frontend/GlobalScript/GlobalVariables.gd.uid
Normal file
1
SproutFarm-Frontend/GlobalScript/GlobalVariables.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://co5rk48low4kq
|
||||
239
SproutFarm-Frontend/GlobalScript/ResourceLoadingDebugger.gd
Normal file
239
SproutFarm-Frontend/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 ""
|
||||
@@ -0,0 +1 @@
|
||||
uid://dk6uoldjqtc0p
|
||||
152
SproutFarm-Frontend/GlobalScript/Toast.gd
Normal file
152
SproutFarm-Frontend/GlobalScript/Toast.gd
Normal file
@@ -0,0 +1,152 @@
|
||||
# Toast.gd - 合并的Toast系统
|
||||
extends Node
|
||||
|
||||
# Toast节点缓存
|
||||
var toast_container: Control
|
||||
|
||||
func _ready():
|
||||
# 延迟创建Toast容器,避免在节点初始化期间添加子节点的冲突
|
||||
setup_toast_container.call_deferred()
|
||||
|
||||
func setup_toast_container():
|
||||
# 防止重复创建
|
||||
if toast_container and is_instance_valid(toast_container):
|
||||
return
|
||||
|
||||
# 创建一个CanvasLayer来确保Toast始终在最顶层
|
||||
var canvas_layer = CanvasLayer.new()
|
||||
canvas_layer.name = "ToastCanvasLayer"
|
||||
canvas_layer.layer = 100 # 设置一个很高的层级值
|
||||
|
||||
# 创建一个容器来放置所有Toast
|
||||
toast_container = Control.new()
|
||||
toast_container.name = "ToastContainer"
|
||||
toast_container.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
toast_container.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
|
||||
# 将容器添加到CanvasLayer中
|
||||
canvas_layer.add_child(toast_container)
|
||||
|
||||
# 尝试添加到main/UI节点,如果失败则添加到根节点
|
||||
var ui_node = get_node_or_null("/root/main/UI")
|
||||
if ui_node:
|
||||
ui_node.add_child.call_deferred(canvas_layer)
|
||||
print("Toast容器已添加到 main/UI 节点")
|
||||
else:
|
||||
# 如果没有UI节点,直接添加到根节点
|
||||
get_tree().root.add_child.call_deferred(canvas_layer)
|
||||
print("Toast容器已添加到根节点")
|
||||
|
||||
|
||||
func show(text: String,
|
||||
color: Color = Color.WHITE,
|
||||
duration: float = 2.0,
|
||||
fade_duration: float = 0.5) -> void:
|
||||
|
||||
# 确保容器存在且有效
|
||||
if not toast_container or not is_instance_valid(toast_container) or not toast_container.get_parent():
|
||||
setup_toast_container.call_deferred()
|
||||
# 等待容器设置完成
|
||||
await get_tree().process_frame
|
||||
await get_tree().process_frame # 额外等待一帧确保完成
|
||||
|
||||
# 再次检查容器是否有效
|
||||
if not toast_container or not is_instance_valid(toast_container):
|
||||
print("警告:Toast容器初始化失败,无法显示Toast")
|
||||
return
|
||||
|
||||
# 创建Toast UI
|
||||
var toast_panel = create_toast_ui(text, color)
|
||||
toast_container.add_child(toast_panel)
|
||||
|
||||
# 显示动画和自动消失
|
||||
show_toast_animation(toast_panel, duration, fade_duration)
|
||||
|
||||
func create_toast_ui(text: String, color: Color) -> PanelContainer:
|
||||
# 创建主容器
|
||||
var panel = PanelContainer.new()
|
||||
panel.name = "Toast_" + str(Time.get_ticks_msec())
|
||||
|
||||
# 设置样式
|
||||
var style_box = StyleBoxFlat.new()
|
||||
style_box.bg_color = Color(0, 0, 0, 0.8) # 半透明黑色背景
|
||||
style_box.corner_radius_top_left = 8
|
||||
style_box.corner_radius_top_right = 8
|
||||
style_box.corner_radius_bottom_left = 8
|
||||
style_box.corner_radius_bottom_right = 8
|
||||
style_box.content_margin_top = 12
|
||||
style_box.content_margin_bottom = 12
|
||||
style_box.content_margin_left = 16
|
||||
style_box.content_margin_right = 16
|
||||
panel.add_theme_stylebox_override("panel", style_box)
|
||||
|
||||
# 创建文本标签
|
||||
var label = Label.new()
|
||||
label.text = text
|
||||
label.modulate = color
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
|
||||
# 设置字体大小
|
||||
label.add_theme_font_size_override("font_size", 16)
|
||||
|
||||
panel.add_child(label)
|
||||
|
||||
# 定位Toast(屏幕中央偏下)
|
||||
position_toast(panel)
|
||||
|
||||
return panel
|
||||
|
||||
func position_toast(toast_panel: PanelContainer):
|
||||
# 设置位置为屏幕中央偏下
|
||||
toast_panel.set_anchors_and_offsets_preset(Control.PRESET_CENTER)
|
||||
toast_panel.position.y += 100 # 向下偏移
|
||||
|
||||
# 调整现有Toast的位置,避免重叠
|
||||
var existing_toasts = []
|
||||
for child in toast_container.get_children():
|
||||
if child != toast_panel and child is PanelContainer:
|
||||
existing_toasts.append(child)
|
||||
|
||||
# 向上堆叠
|
||||
for i in range(existing_toasts.size()):
|
||||
var existing_toast = existing_toasts[existing_toasts.size() - 1 - i]
|
||||
var tween = create_tween()
|
||||
tween.tween_property(existing_toast, "position:y",
|
||||
existing_toast.position.y - 60, 0.3)
|
||||
|
||||
func show_toast_animation(toast_panel: PanelContainer, duration: float, fade_duration: float):
|
||||
# 初始状态:完全透明并稍微向上
|
||||
toast_panel.modulate.a = 0.0
|
||||
toast_panel.position.y += 20
|
||||
|
||||
# 淡入动画
|
||||
var fade_in_tween = create_tween()
|
||||
fade_in_tween.parallel().tween_property(toast_panel, "modulate:a", 1.0, 0.3)
|
||||
fade_in_tween.parallel().tween_property(toast_panel, "position:y",
|
||||
toast_panel.position.y - 20, 0.3)
|
||||
fade_in_tween.set_ease(Tween.EASE_OUT)
|
||||
|
||||
# 等待显示时间
|
||||
await get_tree().create_timer(duration).timeout
|
||||
|
||||
# 淡出动画
|
||||
var fade_out_tween = create_tween()
|
||||
fade_out_tween.tween_property(toast_panel, "modulate:a", 0.0, fade_duration)
|
||||
await fade_out_tween.finished
|
||||
|
||||
# 移除节点
|
||||
toast_panel.queue_free()
|
||||
|
||||
# 便捷方法
|
||||
func show_success(text: String, duration: float = 2.0):
|
||||
show(text, Color.GREEN, duration)
|
||||
|
||||
func show_error(text: String, duration: float = 3.0):
|
||||
show(text, Color.RED, duration)
|
||||
|
||||
func show_warning(text: String, duration: float = 2.5):
|
||||
show(text, Color.YELLOW, duration)
|
||||
|
||||
func show_info(text: String, duration: float = 2.0):
|
||||
show(text, Color.CYAN, duration)
|
||||
1
SproutFarm-Frontend/GlobalScript/Toast.gd.uid
Normal file
1
SproutFarm-Frontend/GlobalScript/Toast.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://336lik63ehtt
|
||||
4038
SproutFarm-Frontend/MainGame.gd
Normal file
4038
SproutFarm-Frontend/MainGame.gd
Normal file
File diff suppressed because it is too large
Load Diff
1
SproutFarm-Frontend/MainGame.gd.uid
Normal file
1
SproutFarm-Frontend/MainGame.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://2pt11sfcaxf7
|
||||
3727
SproutFarm-Frontend/MainGame.tscn
Normal file
3727
SproutFarm-Frontend/MainGame.tscn
Normal file
File diff suppressed because it is too large
Load Diff
579
SproutFarm-Frontend/MainGame.tscn166226414114.tmp
Normal file
579
SproutFarm-Frontend/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
SproutFarm-Frontend/MainGame.tscn166255147325.tmp
Normal file
579
SproutFarm-Frontend/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
SproutFarm-Frontend/MainGame.tscn166426675922.tmp
Normal file
579
SproutFarm-Frontend/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"]
|
||||
3764
SproutFarm-Frontend/MainGame.tscn89825202664.tmp
Normal file
3764
SproutFarm-Frontend/MainGame.tscn89825202664.tmp
Normal file
File diff suppressed because it is too large
Load Diff
153
SproutFarm-Frontend/Network/TCPClient.gd
Normal file
153
SproutFarm-Frontend/Network/TCPClient.gd
Normal file
@@ -0,0 +1,153 @@
|
||||
extends Node
|
||||
#一个基本的TCP客户端API
|
||||
class_name TCPClient
|
||||
|
||||
signal connected_to_server#连接到服务器信号
|
||||
signal connection_failed#连接失败信号
|
||||
signal connection_closed#连接关闭信号
|
||||
signal data_received(data)#收到数据信号
|
||||
|
||||
var tcp: StreamPeerTCP = StreamPeerTCP.new()
|
||||
var host: String = "127.0.0.1"
|
||||
var port: int = 4040
|
||||
var is_connected: bool = false
|
||||
var auto_reconnect: bool = true
|
||||
var reconnect_delay: float = 2.0
|
||||
|
||||
# 缓冲区管理
|
||||
var buffer = ""
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func _process(_delta):
|
||||
# 更新连接状态
|
||||
tcp.poll()
|
||||
_update_connection_status()
|
||||
_check_for_data()
|
||||
|
||||
|
||||
func connect_to_server(custom_host = null, custom_port = null):
|
||||
if custom_host != null:
|
||||
host = custom_host
|
||||
if custom_port != null:
|
||||
port = custom_port
|
||||
|
||||
if tcp.get_status() != StreamPeerTCP.STATUS_CONNECTED:
|
||||
tcp.disconnect_from_host()
|
||||
print("连接到服务器: %s:%s" % [host, port])
|
||||
var error = tcp.connect_to_host(host, port)
|
||||
if error != OK:
|
||||
print("连接错误: %s" % error)
|
||||
emit_signal("connection_failed")
|
||||
|
||||
|
||||
func disconnect_from_server():
|
||||
tcp.disconnect_from_host()
|
||||
is_connected = false
|
||||
emit_signal("connection_closed")
|
||||
|
||||
|
||||
func _update_connection_status():
|
||||
var status = tcp.get_status()
|
||||
|
||||
match status:
|
||||
StreamPeerTCP.STATUS_NONE:
|
||||
if is_connected:
|
||||
is_connected = false
|
||||
print("连接已断开")
|
||||
emit_signal("connection_closed")
|
||||
|
||||
if auto_reconnect:
|
||||
var timer = get_tree().create_timer(reconnect_delay)
|
||||
await timer.timeout
|
||||
connect_to_server()
|
||||
|
||||
StreamPeerTCP.STATUS_CONNECTING:
|
||||
pass
|
||||
|
||||
StreamPeerTCP.STATUS_CONNECTED:
|
||||
if not is_connected:
|
||||
is_connected = true
|
||||
tcp.set_no_delay(true) # 禁用Nagle算法提高响应速度
|
||||
emit_signal("connected_to_server")
|
||||
|
||||
StreamPeerTCP.STATUS_ERROR:
|
||||
is_connected = false
|
||||
print("连接错误")
|
||||
emit_signal("connection_failed")
|
||||
|
||||
if auto_reconnect:
|
||||
var timer = get_tree().create_timer(reconnect_delay)
|
||||
await timer.timeout
|
||||
connect_to_server()
|
||||
|
||||
|
||||
func _check_for_data():
|
||||
if tcp.get_status() == StreamPeerTCP.STATUS_CONNECTED and tcp.get_available_bytes() > 0:
|
||||
var bytes = tcp.get_available_bytes()
|
||||
var data = tcp.get_utf8_string(bytes)
|
||||
|
||||
# 将数据添加到缓冲区进行处理
|
||||
buffer += data
|
||||
_process_buffer()
|
||||
|
||||
|
||||
func _process_buffer():
|
||||
# 处理缓冲区中的JSON消息
|
||||
# 假设每条消息以换行符结尾
|
||||
while "\n" in buffer:
|
||||
var message_end = buffer.find("\n")
|
||||
var message_text = buffer.substr(0, message_end)
|
||||
buffer = buffer.substr(message_end + 1)
|
||||
|
||||
# 处理JSON数据
|
||||
if message_text.strip_edges() != "":
|
||||
var json = JSON.new()
|
||||
var error = json.parse(message_text)
|
||||
|
||||
if error == OK:
|
||||
var data = json.get_data()
|
||||
emit_signal("data_received", data)
|
||||
else:
|
||||
emit_signal("data_received", message_text)
|
||||
|
||||
func send_data(data):
|
||||
if not is_connected:
|
||||
print("未连接,无法发送数据")
|
||||
return false
|
||||
|
||||
var message: String
|
||||
|
||||
# 如果是字典/数组,转换为JSON
|
||||
if typeof(data) == TYPE_DICTIONARY or typeof(data) == TYPE_ARRAY:
|
||||
message = JSON.stringify(data) + "\n"
|
||||
else:
|
||||
# 否则简单转换为字符串
|
||||
message = str(data) + "\n"
|
||||
|
||||
var result = tcp.put_data(message.to_utf8_buffer())
|
||||
return result == OK
|
||||
|
||||
func is_client_connected() -> bool:
|
||||
return is_connected
|
||||
|
||||
# 示例: 如何使用此客户端
|
||||
#
|
||||
# func _ready():
|
||||
# var client = TCPClient.new()
|
||||
# add_child(client)
|
||||
#
|
||||
# client.connected_to_server.connect(_on_connected)
|
||||
# client.connection_failed.connect(_on_connection_failed)
|
||||
# client.connection_closed.connect(_on_connection_closed)
|
||||
# client.data_received.connect(_on_data_received)
|
||||
#
|
||||
# client.connect_to_server("127.0.0.1", 9000)
|
||||
#
|
||||
# func _on_connected():
|
||||
# print("已连接")
|
||||
# client.send_data({"type": "greeting", "content": "Hello Server!"})
|
||||
#
|
||||
# func _on_data_received(data):
|
||||
# print("收到数据: ", data)
|
||||
1
SproutFarm-Frontend/Network/TCPClient.gd.uid
Normal file
1
SproutFarm-Frontend/Network/TCPClient.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cylhhkh8ooxcu
|
||||
1441
SproutFarm-Frontend/Network/TCPNetworkManager.gd
Normal file
1441
SproutFarm-Frontend/Network/TCPNetworkManager.gd
Normal file
File diff suppressed because it is too large
Load Diff
1
SproutFarm-Frontend/Network/TCPNetworkManager.gd.uid
Normal file
1
SproutFarm-Frontend/Network/TCPNetworkManager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://q1f3tubmdsrk
|
||||
69
SproutFarm-Frontend/Network/TCPNetworkManager.tscn
Normal file
69
SproutFarm-Frontend/Network/TCPNetworkManager.tscn
Normal file
@@ -0,0 +1,69 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cpxiaqh0y6a5d"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://q1f3tubmdsrk" path="res://Network/TCPNetworkManager.gd" id="1_tfd57"]
|
||||
|
||||
[node name="TCPNetworkManager" type="Panel"]
|
||||
script = ExtResource("1_tfd57")
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1.0
|
||||
offset_top = 142.0
|
||||
offset_right = 401.0
|
||||
offset_bottom = 647.0
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="ResponseLabel" type="Label" parent="Scroll"]
|
||||
custom_minimum_size = Vector2(400, 500)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "回应"
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 42.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "TCP网络调试面板"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 647.0
|
||||
color = Color(0.104753, 0.146763, 0.23013, 0.427451)
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 100.0
|
||||
offset_right = 120.0
|
||||
offset_bottom = 142.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "连接状态"
|
||||
|
||||
[node name="MessageInput" type="LineEdit" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 136.0
|
||||
offset_top = 50.0
|
||||
offset_right = 400.0
|
||||
offset_bottom = 100.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
|
||||
[node name="SendButton" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 68.0
|
||||
offset_top = 50.0
|
||||
offset_right = 136.0
|
||||
offset_bottom = 100.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "发送"
|
||||
|
||||
[node name="ConnectionButton" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 50.0
|
||||
offset_right = 68.0
|
||||
offset_bottom = 100.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "连接"
|
||||
267
SproutFarm-Frontend/Scene/BigPanel/CropStorePanel.tscn
Normal file
267
SproutFarm-Frontend/Scene/BigPanel/CropStorePanel.tscn
Normal file
@@ -0,0 +1,267 @@
|
||||
[gd_scene load_steps=7 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"]
|
||||
bg_color = Color(0.9, 0.85, 0.75, 0.95)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.5, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
|
||||
shadow_size = 15
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
|
||||
bg_color = Color(0.85, 0.7, 0.5, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.5, 0.4, 0.2, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
|
||||
bg_color = Color(0.65, 0.5, 0.3, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.2, 0.05, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.75, 0.6, 0.4, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.4, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
|
||||
bg_color = Color(0.95, 0.92, 0.85, 0.9)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.4, 0.2, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 20
|
||||
|
||||
[node name="CropStorePanel" type="Panel"]
|
||||
offset_left = 81.0
|
||||
offset_top = 70.0
|
||||
offset_right = 1640.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(0.901961, 0.8, 0.6, 0.262745)
|
||||
|
||||
[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(0.4, 0.2, 0.1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
|
||||
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 3
|
||||
theme_override_constants/shadow_outline_size = 8
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "🌱 种子商店 🌱"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SortContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 13.0
|
||||
offset_top = 78.0
|
||||
offset_right = 1540.0
|
||||
offset_bottom = 141.0
|
||||
alignment = 1
|
||||
|
||||
[node name="FilterLabel" type="Label" parent="SortContainer"]
|
||||
modulate = Color(0.439216, 0.560784, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
|
||||
theme_override_constants/shadow_offset_x = 1
|
||||
theme_override_constants/shadow_offset_y = 1
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "🔍 筛选:"
|
||||
|
||||
[node name="Sort_All" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🌾 全部"
|
||||
|
||||
[node name="Sort_Common" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⚪ 普通"
|
||||
|
||||
[node name="Sort_Superior" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0.823529, 0.415686, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟢 优良"
|
||||
|
||||
[node name="Sort_Rare" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0.454902, 0.729412, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔵 稀有"
|
||||
|
||||
[node name="Sort_Epic" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.552941, 0.396078, 0.772549, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟣 史诗"
|
||||
|
||||
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.988235, 0.835294, 0.247059, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟡 传奇"
|
||||
|
||||
[node name="SortLabel" type="Label" parent="SortContainer"]
|
||||
modulate = Color(0.439216, 0.560784, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
|
||||
theme_override_constants/shadow_offset_x = 1
|
||||
theme_override_constants/shadow_offset_y = 1
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "📊 排序:"
|
||||
|
||||
[node name="Sort_Price" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "💰 按价格"
|
||||
|
||||
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⏰ 按生长时间"
|
||||
|
||||
[node name="Sort_Profit" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "📈 按收益"
|
||||
|
||||
[node name="Sort_Level" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⭐ 按等级"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 19.0
|
||||
offset_top = 151.0
|
||||
offset_right = 3810.0
|
||||
offset_bottom = 1540.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 = 1478.75
|
||||
offset_top = 15.0
|
||||
offset_right = 1538.75
|
||||
offset_bottom = 78.0
|
||||
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "❌"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(88, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 13.0
|
||||
offset_top = 11.0
|
||||
offset_right = 101.0
|
||||
offset_bottom = 74.0
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔄 刷新"
|
||||
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
266
SproutFarm-Frontend/Scene/BigPanel/CropWarehousePanel.tscn
Normal file
266
SproutFarm-Frontend/Scene/BigPanel/CropWarehousePanel.tscn
Normal file
@@ -0,0 +1,266 @@
|
||||
[gd_scene load_steps=7 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"]
|
||||
bg_color = Color(0.9, 0.85, 0.75, 0.95)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.5, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
|
||||
shadow_size = 15
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
|
||||
bg_color = Color(0.85, 0.7, 0.5, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.5, 0.4, 0.2, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
|
||||
bg_color = Color(0.65, 0.5, 0.3, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.2, 0.05, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.75, 0.6, 0.4, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.4, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
|
||||
bg_color = Color(0.95, 0.92, 0.85, 0.9)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.4, 0.2, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 20
|
||||
|
||||
[node name="CropWarehousePanel" type="Panel"]
|
||||
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(0.9, 0.8, 0.6, 0.3)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 13.0
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 98.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
|
||||
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 3
|
||||
theme_override_constants/shadow_outline_size = 8
|
||||
theme_override_font_sizes/font_size = 45
|
||||
text = "🌾 作物仓库 🌾"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SortContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 10.0
|
||||
offset_top = 97.5
|
||||
offset_right = 1576.0
|
||||
offset_bottom = 160.5
|
||||
alignment = 1
|
||||
|
||||
[node name="FilterLabel" type="Label" parent="SortContainer"]
|
||||
self_modulate = Color(0.439216, 0.560784, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
|
||||
theme_override_constants/shadow_offset_x = 1
|
||||
theme_override_constants/shadow_offset_y = 1
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "🔍 筛选:"
|
||||
|
||||
[node name="Sort_All" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🌾全部"
|
||||
|
||||
[node name="Sort_Common" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⚪普通"
|
||||
|
||||
[node name="Sort_Superior" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0.823529, 0.415686, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟢优良"
|
||||
|
||||
[node name="Sort_Rare" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0.454902, 0.729412, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔵稀有"
|
||||
|
||||
[node name="Sort_Epic" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.552941, 0.396078, 0.772549, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟣史诗"
|
||||
|
||||
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.988235, 0.835294, 0.247059, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟡传奇"
|
||||
|
||||
[node name="SortLabel" type="Label" parent="SortContainer"]
|
||||
self_modulate = Color(0.439216, 0.560784, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
|
||||
theme_override_constants/shadow_offset_x = 1
|
||||
theme_override_constants/shadow_offset_y = 1
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "📊 排序:"
|
||||
|
||||
[node name="Sort_Price" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "💰 按价格"
|
||||
|
||||
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⏰按生长时间"
|
||||
|
||||
[node name="Sort_Profit" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "📈按收益"
|
||||
|
||||
[node name="Sort_Level" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⭐ 按等级"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 9.0
|
||||
offset_top = 179.0
|
||||
offset_right = 3890.0
|
||||
offset_bottom = 1502.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 = 1482.5
|
||||
offset_top = 27.5
|
||||
offset_right = 1542.5
|
||||
offset_bottom = 90.5
|
||||
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "❌"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(88, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 13.0
|
||||
offset_top = 13.0
|
||||
offset_right = 117.0
|
||||
offset_bottom = 76.0
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔄刷新"
|
||||
112
SproutFarm-Frontend/Scene/BigPanel/DailyCheckInPanel.tscn
Normal file
112
SproutFarm-Frontend/Scene/BigPanel/DailyCheckInPanel.tscn
Normal file
@@ -0,0 +1,112 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://smypui0vyso5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c0jfbtkh0mj5b" path="res://Script/BigPanel/DailyCheckInPanel.gd" id="1_fj7a7"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_217t6"]
|
||||
border_width_left = 15
|
||||
border_width_top = 15
|
||||
border_width_right = 15
|
||||
border_width_bottom = 15
|
||||
corner_detail = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4gvib"]
|
||||
|
||||
[node name="DailyCheckInPanel" type="Panel"]
|
||||
offset_left = 441.0
|
||||
offset_right = 1041.0
|
||||
offset_bottom = 720.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_217t6")
|
||||
script = ExtResource("1_fj7a7")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 20.0
|
||||
offset_right = 600.0
|
||||
offset_bottom = 69.0
|
||||
theme_override_colors/font_color = Color(0.624759, 0.8051, 0.828302, 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 = 35
|
||||
text = "📅每日签到📅"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 23.0
|
||||
offset_top = 360.0
|
||||
offset_right = 585.0
|
||||
offset_bottom = 409.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 = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 10
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_4gvib")
|
||||
text = "🎉签到奖励🎉"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(57, 57)
|
||||
layout_mode = 0
|
||||
offset_left = 520.0
|
||||
offset_top = 22.0
|
||||
offset_right = 577.0
|
||||
offset_bottom = 79.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "X"
|
||||
|
||||
[node name="DailyCheckInButton" type="Button" parent="."]
|
||||
modulate = Color(1, 1, 0.52549, 1)
|
||||
custom_minimum_size = Vector2(150, 70)
|
||||
layout_mode = 0
|
||||
offset_left = 239.0
|
||||
offset_top = 630.0
|
||||
offset_right = 389.0
|
||||
offset_bottom = 700.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "签到"
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 23.0
|
||||
offset_top = 77.0
|
||||
offset_right = 577.0
|
||||
offset_bottom = 360.0
|
||||
|
||||
[node name="DailyCheckInHistory" type="RichTextLabel" parent="Scroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
bbcode_enabled = true
|
||||
threaded = true
|
||||
|
||||
[node name="DailyCheckInReward" type="RichTextLabel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 23.0
|
||||
offset_top = 409.0
|
||||
offset_right = 577.0
|
||||
offset_bottom = 630.0
|
||||
theme_override_font_sizes/normal_font_size = 20
|
||||
bbcode_enabled = true
|
||||
text = "+500 经验,+400 钱币,+5 普通-番茄种子,+1 传奇-火龙果种子 "
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ConfirmDialog" type="ConfirmationDialog" parent="."]
|
||||
title = "标题"
|
||||
initial_position = 3
|
||||
size = Vector2i(450, 350)
|
||||
current_screen = 0
|
||||
ok_button_text = "✅ 确定"
|
||||
dialog_text = "弹窗内容"
|
||||
dialog_autowrap = true
|
||||
cancel_button_text = "❌ 取消"
|
||||
|
||||
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="DailyCheckInButton" to="." method="_on_daily_check_in_button_pressed"]
|
||||
210
SproutFarm-Frontend/Scene/BigPanel/ItemBagPanel.tscn
Normal file
210
SproutFarm-Frontend/Scene/BigPanel/ItemBagPanel.tscn
Normal file
@@ -0,0 +1,210 @@
|
||||
[gd_scene load_steps=7 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_8kysg"]
|
||||
bg_color = Color(0.9, 0.85, 0.75, 0.95)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.5, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
|
||||
shadow_size = 15
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
|
||||
bg_color = Color(0.85, 0.7, 0.5, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.5, 0.4, 0.2, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
|
||||
bg_color = Color(0.65, 0.5, 0.3, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.2, 0.05, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.75, 0.6, 0.4, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.4, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ixe68"]
|
||||
bg_color = Color(0.95, 0.92, 0.85, 0.9)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.4, 0.2, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 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_8kysg")
|
||||
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(0.9, 0.8, 0.6, 0.3)
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 13.75
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 82.75
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
|
||||
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 3
|
||||
theme_override_constants/shadow_outline_size = 8
|
||||
theme_override_font_sizes/font_size = 45
|
||||
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_colors/font_color = Color(0.8, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "❌"
|
||||
|
||||
[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_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔄刷新"
|
||||
|
||||
[node name="All_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_left = 188.75
|
||||
offset_top = 16.25
|
||||
offset_right = 286.75
|
||||
offset_bottom = 79.25
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🎒全部"
|
||||
|
||||
[node name="Pet_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_left = 297.5
|
||||
offset_top = 15.0
|
||||
offset_right = 395.5
|
||||
offset_bottom = 78.0
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🐾宠物"
|
||||
|
||||
[node name="Crop_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_left = 410.0
|
||||
offset_top = 13.75
|
||||
offset_right = 508.0
|
||||
offset_bottom = 76.75
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🌾作物"
|
||||
|
||||
[node name="Farm_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 0
|
||||
offset_left = 521.25
|
||||
offset_top = 16.25
|
||||
offset_right = 619.25
|
||||
offset_bottom = 79.25
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🏡农场"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
offset_left = 51.0
|
||||
offset_top = 88.0
|
||||
offset_right = 3663.0
|
||||
offset_bottom = 1687.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ixe68")
|
||||
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
|
||||
|
||||
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
[connection signal="pressed" from="All_Filter" to="." method="_on_all_filter_pressed"]
|
||||
[connection signal="pressed" from="Pet_Filter" to="." method="_on_pet_filter_pressed"]
|
||||
[connection signal="pressed" from="Crop_Filter" to="." method="_on_crop_filter_pressed"]
|
||||
[connection signal="pressed" from="Farm_Filter" to="." method="_on_farm_filter_pressed"]
|
||||
210
SproutFarm-Frontend/Scene/BigPanel/ItemStorePanel.tscn
Normal file
210
SproutFarm-Frontend/Scene/BigPanel/ItemStorePanel.tscn
Normal file
@@ -0,0 +1,210 @@
|
||||
[gd_scene load_steps=7 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_8kysg"]
|
||||
bg_color = Color(0.9, 0.85, 0.75, 0.95)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.5, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
|
||||
shadow_size = 15
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
|
||||
bg_color = Color(0.95, 0.92, 0.85, 0.9)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.4, 0.2, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
|
||||
bg_color = Color(0.85, 0.7, 0.5, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.5, 0.4, 0.2, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
|
||||
bg_color = Color(0.65, 0.5, 0.3, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.2, 0.05, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.75, 0.6, 0.4, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.4, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[node name="ItemStorePanel" type="Panel"]
|
||||
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_8kysg")
|
||||
script = ExtResource("1_vx1qn")
|
||||
|
||||
[node name="TMBackGround" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -85.0
|
||||
offset_top = -129.0
|
||||
offset_right = 1690.0
|
||||
offset_bottom = 820.0
|
||||
color = Color(0.9, 0.8, 0.6, 0.3)
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 51.0
|
||||
offset_top = 88.0
|
||||
offset_right = 3663.0
|
||||
offset_bottom = 1571.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
|
||||
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(0.4, 0.2, 0.1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
|
||||
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 3
|
||||
theme_override_constants/shadow_outline_size = 8
|
||||
theme_override_font_sizes/font_size = 45
|
||||
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_colors/font_color = Color(0.8, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "❌"
|
||||
|
||||
[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_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔄刷新"
|
||||
|
||||
[node name="All_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 161.25
|
||||
offset_top = 13.75
|
||||
offset_right = 259.25
|
||||
offset_bottom = 76.75
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🏪全部"
|
||||
|
||||
[node name="Pet_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 277.5
|
||||
offset_top = 13.75
|
||||
offset_right = 375.5
|
||||
offset_bottom = 76.75
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🐾宠物"
|
||||
|
||||
[node name="Crop_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 391.25
|
||||
offset_top = 12.5
|
||||
offset_right = 489.25
|
||||
offset_bottom = 75.5
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🌾作物"
|
||||
|
||||
[node name="Farm_Filter" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 507.5
|
||||
offset_top = 12.5
|
||||
offset_right = 605.5
|
||||
offset_bottom = 75.5
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🏡农场"
|
||||
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
[connection signal="pressed" from="All_Filter" to="." method="_on_all_filter_pressed"]
|
||||
[connection signal="pressed" from="Pet_Filter" to="." method="_on_pet_filter_pressed"]
|
||||
[connection signal="pressed" from="Crop_Filter" to="." method="_on_crop_filter_pressed"]
|
||||
[connection signal="pressed" from="Farm_Filter" to="." method="_on_farm_filter_pressed"]
|
||||
358
SproutFarm-Frontend/Scene/BigPanel/LoginPanel.tscn
Normal file
358
SproutFarm-Frontend/Scene/BigPanel/LoginPanel.tscn
Normal file
@@ -0,0 +1,358 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cbhitturvihqj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cka0r4g8tbf0" path="res://Script/BigPanel/LoginPanel.gd" id="1_xnwaq"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n8m38"]
|
||||
bg_color = Color(0.454902, 0.321569, 0.188235, 0.85098)
|
||||
border_width_left = 5
|
||||
border_width_top = 5
|
||||
border_width_right = 5
|
||||
border_width_bottom = 5
|
||||
border_color = Color(0.8, 0.6, 0.4, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[node name="LoginPanel" type="PanelContainer"]
|
||||
offset_left = 343.0
|
||||
offset_top = 5.0
|
||||
offset_right = 1093.0
|
||||
offset_bottom = 795.0
|
||||
scale = Vector2(0.9, 0.9)
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n8m38")
|
||||
script = ExtResource("1_xnwaq")
|
||||
|
||||
[node name="LoginVBox" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="Label" parent="LoginVBox"]
|
||||
modulate = Color(1, 1, 0.537255, 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 = 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 = 40
|
||||
text = "🌾登录 🌾"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="UserName" type="HBoxContainer" parent="LoginVBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="LoginVBox/UserName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "账号🔒"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="username_input" type="LineEdit" parent="LoginVBox/UserName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入QQ号"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Password" type="HBoxContainer" parent="LoginVBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="LoginVBox/Password"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "密码🔑"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="password_input" type="LineEdit" parent="LoginVBox/Password"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入密码"
|
||||
|
||||
[node name="LoginButton" type="Button" parent="LoginVBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "登录 🚪"
|
||||
|
||||
[node name="RegisterButton" type="Button" parent="LoginVBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "注册🆕"
|
||||
|
||||
[node name="ForgetPasswdButton" type="Button" parent="LoginVBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "忘记密码🤔"
|
||||
|
||||
[node name="Note" type="Label" parent="LoginVBox"]
|
||||
modulate = Color(1, 0.552941, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "⚠️注意:首次游玩游戏需要注册账号,
|
||||
账号请直接输入您的QQ号,系统会直接向您的QQ
|
||||
邮箱发送一串验证码进行注册验证,密码请设置的复杂一
|
||||
点,以免被暴力破解("
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="status_label" type="Label" parent="LoginVBox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "连接状态"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="RegisterVbox" type="VBoxContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="Label" parent="RegisterVbox"]
|
||||
modulate = Color(1, 1, 0.537255, 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 = 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 = 40
|
||||
text = "🏡注册🏡"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="RegisterUserName" type="HBoxContainer" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="RegisterVbox/RegisterUserName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "账号🔒"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="username_input" type="LineEdit" parent="RegisterVbox/RegisterUserName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入QQ号"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Password1" type="HBoxContainer" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="RegisterVbox/Password1"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "密码🔑"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="password_input" type="LineEdit" parent="RegisterVbox/Password1"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入密码"
|
||||
|
||||
[node name="Password2" type="HBoxContainer" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="RegisterVbox/Password2"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "确认密码 🔑"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="password_input2" type="LineEdit" parent="RegisterVbox/Password2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请再次输入您的密码"
|
||||
|
||||
[node name="PlayerName" type="HBoxContainer" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="RegisterVbox/PlayerName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "玩家昵称 🧑🌾"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="playername_input" type="LineEdit" parent="RegisterVbox/PlayerName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "给自己取个好听的名字吧!"
|
||||
|
||||
[node name="FarmName" type="HBoxContainer" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="RegisterVbox/FarmName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "农场名称 🏞️"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="farmname_input" type="LineEdit" parent="RegisterVbox/FarmName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "给你的农场取个名字吧!"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="VerificationCode" type="HBoxContainer" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="RegisterVbox/VerificationCode"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "验证码📧"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="verificationcode_input" type="LineEdit" parent="RegisterVbox/VerificationCode"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入您的QQ邮箱收到的验证码"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="SendButton" type="Button" parent="RegisterVbox/VerificationCode"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "发送验证码"
|
||||
|
||||
[node name="RegisterButton2" type="Button" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "注册🆕"
|
||||
|
||||
[node name="Register2LoginButton" type="Button" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "返回登录🚪"
|
||||
|
||||
[node name="Note" type="Label" parent="RegisterVbox"]
|
||||
modulate = Color(1, 0.552941, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "⚠️注意:首次游玩游戏需要注册账号,
|
||||
账号请直接输入您的QQ号,系统会直接向您的QQ
|
||||
邮箱发送一串验证码进行注册验证,密码请设置的复杂一
|
||||
点,以免被暴力破解("
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="status_label2" type="Label" parent="RegisterVbox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "连接状态"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ForgetPasswordVbox" type="VBoxContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="Label" parent="ForgetPasswordVbox"]
|
||||
modulate = Color(1, 1, 0.537255, 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 = 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 = 40
|
||||
text = "🧐找回密码🧐"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ForgetPasswordUserName" type="HBoxContainer" parent="ForgetPasswordVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ForgetPasswordVbox/ForgetPasswordUserName"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "账号🔒"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="username_input" type="LineEdit" parent="ForgetPasswordVbox/ForgetPasswordUserName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入QQ号"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="NewPassword" type="HBoxContainer" parent="ForgetPasswordVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="ForgetPasswordVbox/NewPassword"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "新密码 🔑"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="password_input" type="LineEdit" parent="ForgetPasswordVbox/NewPassword"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请设置您的新密码"
|
||||
|
||||
[node name="VerificationCode2" type="HBoxContainer" parent="ForgetPasswordVbox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ForgetPasswordVbox/VerificationCode2"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "验证码📧"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="verificationcode_input" type="LineEdit" parent="ForgetPasswordVbox/VerificationCode2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 30
|
||||
placeholder_text = "请输入您的QQ邮箱收到的验证码"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="SendButton" type="Button" parent="ForgetPasswordVbox/VerificationCode2"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "发送验证码"
|
||||
|
||||
[node name="Forget2LoginButton" type="Button" parent="ForgetPasswordVbox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "确认"
|
||||
|
||||
[node name="ForgetPasswordButton" type="Button" parent="ForgetPasswordVbox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "确认"
|
||||
|
||||
[node name="Note" type="Label" parent="ForgetPasswordVbox"]
|
||||
modulate = Color(1, 0.552941, 1, 1)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "注意:首次游玩游戏需要注册账号,
|
||||
账号请直接输入您的QQ号,系统会直接向您的QQ
|
||||
邮箱发送一串验证码进行注册验证,密码请设置的复杂一
|
||||
点,以免被暴力破解("
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="status_label3" type="Label" parent="ForgetPasswordVbox"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "连接状态"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="RegisterVbox/Register2LoginButton" to="." method="_on_register_2_login_button_pressed"]
|
||||
[connection signal="pressed" from="ForgetPasswordVbox/Forget2LoginButton" to="." method="_on_forget_2_login_button_pressed"]
|
||||
133
SproutFarm-Frontend/Scene/BigPanel/LuckyDrawPanel.tscn
Normal file
133
SproutFarm-Frontend/Scene/BigPanel/LuckyDrawPanel.tscn
Normal file
@@ -0,0 +1,133 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bndf1e4sgdjr6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://65e0rl31fx0i" path="res://Script/BigPanel/LuckyDrawPanel.gd" id="1_dcmen"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ynokl"]
|
||||
border_width_left = 15
|
||||
border_width_top = 15
|
||||
border_width_right = 15
|
||||
border_width_bottom = 15
|
||||
corner_detail = 20
|
||||
|
||||
[node name="LuckyDrawPanel" type="Panel"]
|
||||
offset_left = 373.0
|
||||
offset_top = 1.0
|
||||
offset_right = 1045.0
|
||||
offset_bottom = 721.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ynokl")
|
||||
script = ExtResource("1_dcmen")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 19.0
|
||||
offset_right = 669.0
|
||||
offset_bottom = 78.0
|
||||
theme_override_colors/font_color = Color(0.624759, 0.8051, 0.828302, 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 = 35
|
||||
text = "幸运抽奖"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
modulate = Color(0.642982, 0.510828, 1, 1)
|
||||
layout_mode = 0
|
||||
offset_top = 419.0
|
||||
offset_right = 671.0
|
||||
offset_bottom = 468.0
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "🎉获得奖励🎉"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(57, 57)
|
||||
layout_mode = 0
|
||||
offset_left = 595.0
|
||||
offset_top = 21.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 78.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "X"
|
||||
|
||||
[node name="LuckyDrawReward" type="RichTextLabel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 16.0
|
||||
offset_top = 481.0
|
||||
offset_right = 671.0
|
||||
offset_bottom = 633.0
|
||||
theme_override_font_sizes/normal_font_size = 20
|
||||
bbcode_enabled = true
|
||||
text = "+500 经验,+400 钱币,+5 普通-番茄种子,+1 传奇-火龙果种子 "
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 16.0
|
||||
offset_top = 85.0
|
||||
offset_right = 657.0
|
||||
offset_bottom = 419.0
|
||||
columns = 5
|
||||
|
||||
[node name="RewardItem" type="RichTextLabel" parent="Grid"]
|
||||
custom_minimum_size = Vector2(120, 120)
|
||||
layout_mode = 2
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_font_sizes/normal_font_size = 17
|
||||
bbcode_enabled = true
|
||||
text = "+50钱币
|
||||
+100经验
|
||||
+4番茄种子
|
||||
+3火龙果种子"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
threaded = true
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -2.0
|
||||
offset_top = 633.0
|
||||
offset_right = 671.0
|
||||
offset_bottom = 703.0
|
||||
alignment = 1
|
||||
|
||||
[node name="FiveLuckyDrawButton" type="Button" parent="HBox"]
|
||||
modulate = Color(0.623529, 1, 0.996078, 1)
|
||||
custom_minimum_size = Vector2(150, 70)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "五连抽"
|
||||
|
||||
[node name="TenLuckyDrawButton" type="Button" parent="HBox"]
|
||||
modulate = Color(0.690196, 1, 0.52549, 1)
|
||||
custom_minimum_size = Vector2(150, 70)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "十连抽"
|
||||
|
||||
[node name="LuckyDrawButton" type="Button" parent="HBox"]
|
||||
modulate = Color(1, 1, 0.52549, 1)
|
||||
custom_minimum_size = Vector2(150, 70)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "抽奖"
|
||||
|
||||
[node name="ConfirmDialog" type="ConfirmationDialog" parent="."]
|
||||
title = "标题"
|
||||
initial_position = 3
|
||||
size = Vector2i(450, 350)
|
||||
current_screen = 0
|
||||
ok_button_text = "🎲 确定抽奖"
|
||||
dialog_text = "弹窗内容"
|
||||
dialog_autowrap = true
|
||||
cancel_button_text = "❌ 取消"
|
||||
|
||||
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="HBox/FiveLuckyDrawButton" to="." method="_on_five_lucky_draw_button_pressed"]
|
||||
[connection signal="pressed" from="HBox/TenLuckyDrawButton" to="." method="_on_ten_lucky_draw_button_pressed"]
|
||||
[connection signal="pressed" from="HBox/LuckyDrawButton" to="." method="_on_lucky_draw_button_pressed"]
|
||||
150
SproutFarm-Frontend/Scene/BigPanel/PetBagPanel.tscn
Normal file
150
SproutFarm-Frontend/Scene/BigPanel/PetBagPanel.tscn
Normal file
@@ -0,0 +1,150 @@
|
||||
[gd_scene load_steps=7 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_8kysg"]
|
||||
bg_color = Color(0.9, 0.85, 0.75, 0.95)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.5, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
|
||||
shadow_size = 15
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
|
||||
bg_color = Color(0.95, 0.92, 0.85, 0.9)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.4, 0.2, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
|
||||
bg_color = Color(0.85, 0.7, 0.5, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.5, 0.4, 0.2, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
|
||||
bg_color = Color(0.65, 0.5, 0.3, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.2, 0.05, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.75, 0.6, 0.4, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.4, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[node name="PetBagPanel" type="Panel"]
|
||||
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_m60ti")
|
||||
|
||||
[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(0.9, 0.8, 0.6, 0.3)
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 40.0
|
||||
offset_top = 100.0
|
||||
offset_right = 3753.0
|
||||
offset_bottom = 1532.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="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_top = 13.0
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 98.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
|
||||
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 3
|
||||
theme_override_constants/shadow_outline_size = 8
|
||||
theme_override_font_sizes/font_size = 45
|
||||
text = "🐾 宠物背包 🐾"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1482.5
|
||||
offset_top = 27.5
|
||||
offset_right = 1542.5
|
||||
offset_bottom = 90.5
|
||||
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "❌"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(88, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 13.0
|
||||
offset_top = 13.0
|
||||
offset_right = 117.0
|
||||
offset_bottom = 76.0
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔄刷新"
|
||||
150
SproutFarm-Frontend/Scene/BigPanel/PetStorePanel.tscn
Normal file
150
SproutFarm-Frontend/Scene/BigPanel/PetStorePanel.tscn
Normal file
@@ -0,0 +1,150 @@
|
||||
[gd_scene load_steps=7 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_8kysg"]
|
||||
bg_color = Color(0.9, 0.85, 0.75, 0.95)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.5, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
|
||||
shadow_size = 15
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
|
||||
bg_color = Color(0.95, 0.92, 0.85, 0.9)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.4, 0.2, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 20
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
|
||||
bg_color = Color(0.85, 0.7, 0.5, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.5, 0.4, 0.2, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
|
||||
bg_color = Color(0.65, 0.5, 0.3, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.2, 0.05, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.75, 0.6, 0.4, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.4, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[node name="PetStorePanel" type="Panel"]
|
||||
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_pfdc7")
|
||||
|
||||
[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(0.9, 0.8, 0.6, 0.3)
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 59.0
|
||||
offset_top = 110.0
|
||||
offset_right = 3709.0
|
||||
offset_bottom = 1511.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="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_top = 13.0
|
||||
offset_right = 1566.0
|
||||
offset_bottom = 98.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
|
||||
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 3
|
||||
theme_override_constants/shadow_outline_size = 8
|
||||
theme_override_font_sizes/font_size = 45
|
||||
text = "🏪 宠物商店 🏪"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 1482.5
|
||||
offset_top = 27.5
|
||||
offset_right = 1542.5
|
||||
offset_bottom = 90.5
|
||||
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "❌"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(88, 60)
|
||||
layout_mode = 2
|
||||
offset_left = 13.0
|
||||
offset_top = 13.0
|
||||
offset_right = 117.0
|
||||
offset_bottom = 76.0
|
||||
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔄刷新"
|
||||
450
SproutFarm-Frontend/Scene/BigPanel/PlayGamePanel.tscn
Normal file
450
SproutFarm-Frontend/Scene/BigPanel/PlayGamePanel.tscn
Normal file
@@ -0,0 +1,450 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://jjlgdnoo8e52"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dvaah0n1ia1a3" path="res://Script/BigPanel/PlayGamePanel.gd" id="1_i6cj7"]
|
||||
[ext_resource type="Texture2D" uid="uid://ywdg7xgq7hm8" path="res://assets/装饰物图片/道具背包.webp" id="2_wlugc"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7i23t"]
|
||||
bg_color = Color(0.752836, 0.587098, 0.400951, 0.9)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.364706, 0.254902, 0.156863, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
corner_detail = 20
|
||||
shadow_color = Color(0.2, 0.15, 0.1, 0.5)
|
||||
shadow_size = 25
|
||||
shadow_offset = Vector2(5, 5)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ScrollContainer"]
|
||||
bg_color = Color(0.945056, 0.846293, 0.608526, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
corner_detail = 20
|
||||
shadow_color = Color(0.0823529, 0.0823529, 0.0823529, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Hover"]
|
||||
bg_color = Color(0.8, 0.65098, 0.470588, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.45098, 0.364706, 0.254902, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Pressed"]
|
||||
bg_color = Color(0.564706, 0.45098, 0.317647, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.364706, 0.294118, 0.203922, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Normal"]
|
||||
bg_color = Color(0.678431, 0.54902, 0.392157, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.45098, 0.364706, 0.254902, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_CloseButton"]
|
||||
bg_color = Color(0.8, 0.2, 0.2, 0.9)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.6, 0.15, 0.15, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[node name="PlayGamePanel" type="Panel"]
|
||||
offset_right = 1399.0
|
||||
offset_bottom = 720.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_7i23t")
|
||||
script = ExtResource("1_i6cj7")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 17.0
|
||||
offset_right = 1401.0
|
||||
offset_bottom = 86.0
|
||||
theme_override_colors/font_color = Color(1, 0.901961, 0.498039, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 20
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "🎮 休闲小游戏 🕹️"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 48.0
|
||||
offset_top = 116.0
|
||||
offset_right = 1352.0
|
||||
offset_bottom = 674.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ScrollContainer")
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
columns = 5
|
||||
|
||||
[node name="2048Game" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/2048Game"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🧮 2048 🔢"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/2048Game"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="2048GameButton" type="Button" parent="ScrollContainer/Grid/2048Game"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🎯 开始挑战"
|
||||
|
||||
[node name="PushBox" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/PushBox"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "📦 推箱子 🚚"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/PushBox"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="PushBoxButton" type="Button" parent="ScrollContainer/Grid/PushBox"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "💪 智力考验"
|
||||
|
||||
[node name="SnakeGame" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/SnakeGame"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🐍 贪吃蛇 🍎"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/SnakeGame"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="SnakeGameButton" type="Button" parent="ScrollContainer/Grid/SnakeGame"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🏃 反应游戏"
|
||||
|
||||
[node name="Tetris" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/Tetris"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🧩 俄罗斯方块 🟦"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/Tetris"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="TetrisButton" type="Button" parent="ScrollContainer/Grid/Tetris"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🎮 经典游戏"
|
||||
|
||||
[node name="VBox5" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox5"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🔮 神秘游戏 ✨"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox5"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox5"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🚧 敬请期待"
|
||||
|
||||
[node name="VBox6" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox6"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🎲 桌游世界 🃏"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox6"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox6"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🚧 敬请期待"
|
||||
|
||||
[node name="VBox7" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox7"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🎯 射击游戏 🏹"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox7"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox7"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🚧 敬请期待"
|
||||
|
||||
[node name="VBox8" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox8"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🧠 益智游戏 💡"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox8"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox8"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🚧 敬请期待"
|
||||
|
||||
[node name="VBox9" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox9"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🏆 竞技游戏 ⚔️"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox9"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox9"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🚧 敬请期待"
|
||||
|
||||
[node name="VBox10" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox10"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🎨 创意游戏 ✨"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox10"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_wlugc")
|
||||
|
||||
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox10"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🚧 敬请期待"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(80, 80)
|
||||
layout_mode = 0
|
||||
offset_left = 1297.0
|
||||
offset_top = 20.0
|
||||
offset_right = 1377.0
|
||||
offset_bottom = 100.0
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 40
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_CloseButton")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_CloseButton")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_CloseButton")
|
||||
text = "X"
|
||||
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/2048Game/2048GameButton" to="." method="_on_game_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/PushBox/PushBoxButton" to="." method="_on_push_box_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/SnakeGame/SnakeGameButton" to="." method="_on_snake_game_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/Tetris/TetrisButton" to="." method="_on_tetris_button_pressed"]
|
||||
261
SproutFarm-Frontend/Scene/BigPanel/PlayerBagPanel.tscn
Normal file
261
SproutFarm-Frontend/Scene/BigPanel/PlayerBagPanel.tscn
Normal file
@@ -0,0 +1,261 @@
|
||||
[gd_scene load_steps=7 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"]
|
||||
bg_color = Color(0.9, 0.85, 0.75, 0.95)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.5, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
|
||||
shadow_size = 15
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
|
||||
bg_color = Color(0.85, 0.7, 0.5, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.5, 0.4, 0.2, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
|
||||
bg_color = Color(0.65, 0.5, 0.3, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.2, 0.05, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.75, 0.6, 0.4, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.4, 0.3, 0.1, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_srags"]
|
||||
bg_color = Color(0.95, 0.92, 0.85, 0.9)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.6, 0.4, 0.2, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
corner_detail = 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(0.901961, 0.8, 0.6, 0.262745)
|
||||
|
||||
[node name="SortContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 13.75
|
||||
offset_top = 83.75
|
||||
offset_right = 1570.75
|
||||
offset_bottom = 146.75
|
||||
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_colors/font_color = Color(0.2, 0.4, 0.6, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🌾全部"
|
||||
|
||||
[node name="Sort_Common" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⚪普通"
|
||||
|
||||
[node name="Sort_Superior" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0.823529, 0.415686, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟢优良"
|
||||
|
||||
[node name="Sort_Rare" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0.454902, 0.729412, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔵稀有"
|
||||
|
||||
[node name="Sort_Epic" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.552941, 0.396078, 0.772549, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🟣史诗"
|
||||
|
||||
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.988235, 0.835294, 0.247059, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
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_colors/font_color = Color(0.2, 0.4, 0.6, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "💰按价格"
|
||||
|
||||
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "⏰按生长时间"
|
||||
|
||||
[node name="Sort_Profit" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "📈按收益"
|
||||
|
||||
[node name="Sort_Level" type="Button" parent="SortContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🏆按等级"
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 14.0
|
||||
offset_right = 1557.0
|
||||
offset_bottom = 76.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.4, 0.2, 0.0980392, 1)
|
||||
theme_override_colors/font_shadow_color = Color(1, 0.901961, 0.701961, 0.8)
|
||||
theme_override_colors/font_outline_color = Color(0.701961, 0.501961, 0.301961, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 3
|
||||
theme_override_constants/shadow_outline_size = 8
|
||||
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_colors/font_color = Color(0.2, 0.4, 0.6, 1)
|
||||
theme_override_font_sizes/font_size = 40
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "❌"
|
||||
|
||||
[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_colors/font_color = Color(0.2, 0.4, 0.6, 1)
|
||||
theme_override_font_sizes/font_size = 40
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
text = "🔄刷新"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
offset_left = 19.0
|
||||
offset_top = 151.0
|
||||
offset_right = 3810.0
|
||||
offset_bottom = 1540.0
|
||||
scale = Vector2(0.4, 0.4)
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_srags")
|
||||
horizontal_scroll_mode = 0
|
||||
vertical_scroll_mode = 2
|
||||
scroll_deadzone = -10
|
||||
|
||||
[node name="Bag_Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
|
||||
296
SproutFarm-Frontend/Scene/BigPanel/PlayerRankingPanel.tscn
Normal file
296
SproutFarm-Frontend/Scene/BigPanel/PlayerRankingPanel.tscn
Normal file
@@ -0,0 +1,296 @@
|
||||
[gd_scene load_steps=8 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"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_efhd6"]
|
||||
bg_color = Color(0.12, 0.15, 0.25, 0.95)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.8, 0.6, 0.2, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
corner_detail = 20
|
||||
shadow_color = Color(0.8, 0.6, 0.2, 0.4)
|
||||
shadow_size = 30
|
||||
shadow_offset = Vector2(5, 5)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ButtonHover"]
|
||||
bg_color = Color(0.3, 0.35, 0.55, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.9, 0.7, 0.3, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
shadow_color = Color(0.9, 0.7, 0.3, 0.5)
|
||||
shadow_size = 12
|
||||
shadow_offset = Vector2(4, 4)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button"]
|
||||
bg_color = Color(0.2, 0.25, 0.4, 0.9)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.6, 0.45, 0.15, 0.8)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
shadow_color = Color(0.8, 0.6, 0.2, 0.3)
|
||||
shadow_size = 8
|
||||
shadow_offset = Vector2(3, 3)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ButtonPressed"]
|
||||
bg_color = Color(0.15, 0.2, 0.35, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.7, 0.5, 0.1, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
shadow_color = Color(0.7, 0.5, 0.1, 0.3)
|
||||
shadow_size = 6
|
||||
shadow_offset = Vector2(2, 2)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ScrollBar"]
|
||||
bg_color = Color(0.18, 0.22, 0.35, 0.8)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.6, 0.45, 0.15, 0.6)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[node name="PlayerRankingPanel" type="Panel"]
|
||||
offset_left = 59.0
|
||||
offset_top = 37.0
|
||||
offset_right = 1459.0
|
||||
offset_bottom = 757.0
|
||||
scale = Vector2(0.9, 0.9)
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_efhd6")
|
||||
script = ExtResource("1_efhd6")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -171.0
|
||||
offset_top = -109.0
|
||||
offset_right = 1582.0
|
||||
offset_bottom = 792.0
|
||||
color = Color(0.839723, 0.846103, 0.999009, 0.298039)
|
||||
|
||||
[node name="RegisterPlayerNum" type="Label" parent="."]
|
||||
self_modulate = Color(0.9, 0.7, 0.3, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 841.111
|
||||
offset_top = 32.2222
|
||||
offset_right = 991.111
|
||||
offset_bottom = 74.2222
|
||||
theme_override_colors/font_shadow_color = Color(0.8, 0.6, 0.2, 0.6)
|
||||
theme_override_colors/font_outline_color = Color(0.1, 0.1, 0.2, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_constants/outline_size = 8
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "注册人数:"
|
||||
|
||||
[node name="Title" type="RichTextLabel" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 7.49999
|
||||
offset_top = 18.75
|
||||
offset_right = 1400.5
|
||||
offset_bottom = 74.75
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/default_color = Color(1, 0.85, 0.4, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.1, 0.1, 0.2, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.8, 0.6, 0.2, 0.8)
|
||||
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 = 44
|
||||
bbcode_enabled = true
|
||||
text = "玩家排行榜"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SearchLineEdit" type="LineEdit" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 95.0
|
||||
offset_top = 21.25
|
||||
offset_right = 378.0
|
||||
offset_bottom = 78.25
|
||||
theme_override_colors/font_placeholder_color = Color(0.6, 0.5, 0.3, 0.8)
|
||||
theme_override_colors/font_color = Color(0.9, 0.8, 0.5, 1)
|
||||
theme_override_font_sizes/font_size = 32
|
||||
theme_override_styles/focus = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
placeholder_text = "输入要搜索的人"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_left = 16.25
|
||||
offset_top = 21.25
|
||||
offset_right = 94.25
|
||||
offset_bottom = 78.25
|
||||
theme_override_colors/font_color = Color(0.95, 0.8, 0.4, 1)
|
||||
theme_override_font_sizes/font_size = 32
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "刷新"
|
||||
|
||||
[node name="SearchButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_left = 377.5
|
||||
offset_top = 21.25
|
||||
offset_right = 455.5
|
||||
offset_bottom = 78.25
|
||||
theme_override_colors/font_color = Color(0.95, 0.8, 0.4, 1)
|
||||
theme_override_font_sizes/font_size = 32
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "搜索"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(55, 55)
|
||||
layout_mode = 0
|
||||
offset_left = 1326.25
|
||||
offset_top = 16.25
|
||||
offset_right = 1383.25
|
||||
offset_bottom = 73.25
|
||||
theme_override_colors/font_color = Color(1, 0, 0.301961, 1)
|
||||
theme_override_font_sizes/font_size = 35
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "X"
|
||||
|
||||
[node name="FiterAndSortHBox" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 7.50001
|
||||
offset_top = 105.0
|
||||
offset_right = 1388.5
|
||||
offset_bottom = 162.0
|
||||
|
||||
[node name="SortLabel" type="Label" parent="FiterAndSortHBox"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
theme_override_colors/font_color = Color(1, 0.85, 0.4, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.1, 0.1, 0.2, 0.8)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
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, 0.9, 0.3, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.823529, 0.0627451, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "钱币"
|
||||
|
||||
[node name="SeedSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.4, 0.8, 0.5, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.9, 0.8, 0.4, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "种子数"
|
||||
|
||||
[node name="LevelSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.3, 0.7, 0.9, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.211765, 0.713726, 1, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "等级"
|
||||
|
||||
[node name="OnlineTimeSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.8, 0.5, 0.3, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.9, 0.8, 0.4, 1)
|
||||
theme_override_font_sizes/font_size = 26
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "在线时长"
|
||||
|
||||
[node name="LoginTimeSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.5, 0.8, 0.4, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.340704, 0.882235, 1, 1)
|
||||
theme_override_font_sizes/font_size = 26
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "登录时间"
|
||||
|
||||
[node name="LikeNumSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.9, 0.4, 0.7, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.9, 0.8, 0.4, 1)
|
||||
theme_override_font_sizes/font_size = 28
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "点赞数"
|
||||
|
||||
[node name="IsOnlineSortBtn" type="Button" parent="FiterAndSortHBox"]
|
||||
self_modulate = Color(0.6, 0.6, 0.6, 1)
|
||||
custom_minimum_size = Vector2(158, 57)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.961312, 0.707781, 0.906286, 1)
|
||||
theme_override_font_sizes/font_size = 26
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
|
||||
text = "在线情况"
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 14.0
|
||||
offset_top = 171.0
|
||||
offset_right = 1389.0
|
||||
offset_bottom = 707.0
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ScrollBar")
|
||||
|
||||
[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
|
||||
323
SproutFarm-Frontend/Scene/BigPanel/SpecialFarmPanel.tscn
Normal file
323
SproutFarm-Frontend/Scene/BigPanel/SpecialFarmPanel.tscn
Normal file
@@ -0,0 +1,323 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://byxhjyyaahs6q"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ywdg7xgq7hm8" path="res://assets/装饰物图片/道具背包.webp" id="1_mv0g4"]
|
||||
[ext_resource type="Script" uid="uid://btm2je8pg7rgk" path="res://Script/BigPanel/SpecialFarmPanel.gd" id="1_n2mxy"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7i23t"]
|
||||
bg_color = Color(0.752836, 0.587098, 0.400951, 0.9)
|
||||
border_width_left = 8
|
||||
border_width_top = 8
|
||||
border_width_right = 8
|
||||
border_width_bottom = 8
|
||||
border_color = Color(0.364706, 0.254902, 0.156863, 1)
|
||||
corner_radius_top_left = 25
|
||||
corner_radius_top_right = 25
|
||||
corner_radius_bottom_right = 25
|
||||
corner_radius_bottom_left = 25
|
||||
corner_detail = 20
|
||||
shadow_color = Color(0.2, 0.15, 0.1, 0.5)
|
||||
shadow_size = 25
|
||||
shadow_offset = Vector2(5, 5)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_CloseButton"]
|
||||
bg_color = Color(0.8, 0.2, 0.2, 0.9)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.6, 0.15, 0.15, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n2mxy"]
|
||||
bg_color = Color(0.945056, 0.846293, 0.608526, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
corner_detail = 20
|
||||
shadow_color = Color(0.0823529, 0.0823529, 0.0823529, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Hover"]
|
||||
bg_color = Color(0.8, 0.65098, 0.470588, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.45098, 0.364706, 0.254902, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Pressed"]
|
||||
bg_color = Color(0.564706, 0.45098, 0.317647, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.364706, 0.294118, 0.203922, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Normal"]
|
||||
bg_color = Color(0.678431, 0.54902, 0.392157, 1)
|
||||
border_width_left = 3
|
||||
border_width_top = 3
|
||||
border_width_right = 3
|
||||
border_width_bottom = 3
|
||||
border_color = Color(0.45098, 0.364706, 0.254902, 1)
|
||||
corner_radius_top_left = 15
|
||||
corner_radius_top_right = 15
|
||||
corner_radius_bottom_right = 15
|
||||
corner_radius_bottom_left = 15
|
||||
|
||||
[node name="SpecialFarmPanel" type="Panel"]
|
||||
offset_right = 1399.0
|
||||
offset_bottom = 720.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_7i23t")
|
||||
script = ExtResource("1_n2mxy")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 17.0
|
||||
offset_right = 1401.0
|
||||
offset_bottom = 86.0
|
||||
theme_override_colors/font_color = Color(1, 0.901961, 0.498039, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 20
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "🌾 神秘农场探索 🏞️"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(80, 80)
|
||||
layout_mode = 0
|
||||
offset_left = 1297.0
|
||||
offset_top = 20.0
|
||||
offset_right = 1377.0
|
||||
offset_bottom = 100.0
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 50
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_CloseButton")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_CloseButton")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_CloseButton")
|
||||
text = "X"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 48.0
|
||||
offset_top = 116.0
|
||||
offset_right = 1352.0
|
||||
offset_bottom = 674.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n2mxy")
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
columns = 5
|
||||
|
||||
[node name="FlowerFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/FlowerFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🌸 花卉农场 🌺"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/FlowerFarm"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_mv0g4")
|
||||
|
||||
[node name="FlowerFarmButton" type="Button" parent="ScrollContainer/Grid/FlowerFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🌻欣赏花园"
|
||||
|
||||
[node name="FruitFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/FruitFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🍎 瓜果飘香 🍓"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/FruitFarm"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_mv0g4")
|
||||
|
||||
[node name="FruitFarmButton" type="Button" parent="ScrollContainer/Grid/FruitFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🥕采摘果实"
|
||||
|
||||
[node name="HybridFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/HybridFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🧬 杂交基地 🌱"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/HybridFarm"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_mv0g4")
|
||||
|
||||
[node name="HybridFarmButton" type="Button" parent="ScrollContainer/Grid/HybridFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🔬研究培育"
|
||||
|
||||
[node name="LuckyFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/LuckyFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🍀 幸运农场 ✨"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/LuckyFarm"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_mv0g4")
|
||||
|
||||
[node name="LuckyFarmButton" type="Button" parent="ScrollContainer/Grid/LuckyFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🎲试试运气"
|
||||
|
||||
[node name="RiceFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/RiceFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🌾 稻香田园 🍚"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/RiceFarm"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_mv0g4")
|
||||
|
||||
[node name="RiceFarmButton" type="Button" parent="ScrollContainer/Grid/RiceFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🌾收割稻谷"
|
||||
|
||||
[node name="WheatFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/WheatFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_constants/outline_size = 15
|
||||
theme_override_constants/shadow_outline_size = 15
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "🌾 小麦谷 🥖"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/WheatFarm"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_mv0g4")
|
||||
|
||||
[node name="WheatFarmButton" type="Button" parent="ScrollContainer/Grid/WheatFarm"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
|
||||
text = "🌾收割麦子"
|
||||
|
||||
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/FlowerFarm/FlowerFarmButton" to="." method="_on_flower_farm_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/FruitFarm/FruitFarmButton" to="." method="_on_fruit_farm_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/HybridFarm/HybridFarmButton" to="." method="_on_hybrid_farm_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/LuckyFarm/LuckyFarmButton" to="." method="_on_lucky_farm_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/RiceFarm/RiceFarmButton" to="." method="_on_rice_farm_button_pressed"]
|
||||
[connection signal="pressed" from="ScrollContainer/Grid/WheatFarm/WheatFarmButton" to="." method="_on_wheat_farm_button_pressed"]
|
||||
15
SproutFarm-Frontend/Scene/Dialog/AcceptDialog.tscn
Normal file
15
SproutFarm-Frontend/Scene/Dialog/AcceptDialog.tscn
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://btp1h6hic2sin"]
|
||||
|
||||
[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
|
||||
title = "是否购买"
|
||||
initial_position = 1
|
||||
size = Vector2i(300, 200)
|
||||
visible = true
|
||||
ok_button_text = "确定"
|
||||
script = ExtResource("1_yc5jp")
|
||||
|
||||
[connection signal="canceled" from="." to="." method="_on_canceled"]
|
||||
[connection signal="confirmed" from="." to="." method="_on_confirmed"]
|
||||
368
SproutFarm-Frontend/Scene/NewPet/BulletBase.gd
Normal file
368
SproutFarm-Frontend/Scene/NewPet/BulletBase.gd
Normal file
@@ -0,0 +1,368 @@
|
||||
extends Area2D
|
||||
class_name BulletBase
|
||||
|
||||
# 简化子弹系统 - 辅助攻击用
|
||||
# 基础功能:移动、碰撞检测、伤害
|
||||
|
||||
signal bullet_hit(bullet: BulletBase, target: NewPetBase)
|
||||
|
||||
@onready var sprite: Sprite2D = $Sprite
|
||||
@onready var collision_shape: CollisionShape2D = $CollisionShape2D
|
||||
|
||||
const bullet = {
|
||||
"小蓝弹":{
|
||||
"图片":"res://assets/子弹图片/01.png",
|
||||
"函数":"create_blue_bullet"
|
||||
},
|
||||
"小红弹":{
|
||||
"图片":"res://assets/子弹图片/02.png",
|
||||
"函数":"create_red_bullet"
|
||||
},
|
||||
"小粉弹":{
|
||||
"图片":"res://assets/子弹图片/03.png",
|
||||
"函数":"create_pink_bullet"
|
||||
},
|
||||
"小紫弹":{
|
||||
"图片":"res://assets/子弹图片/04.png",
|
||||
"函数":"create_purple_bullet"
|
||||
},
|
||||
"长橙弹":{
|
||||
"图片":"res://assets/子弹图片/21.png",
|
||||
"函数":"create_long_orange_bullet"
|
||||
},
|
||||
"长紫弹":{
|
||||
"图片":"res://assets/子弹图片/22.png",
|
||||
"函数":"create_long_purple_bullet"
|
||||
},
|
||||
"长绿弹":{
|
||||
"图片":"res://assets/子弹图片/25.png",
|
||||
"函数":"create_long_green_bullet"
|
||||
},
|
||||
"黄色闪电":{
|
||||
"图片":"res://assets/子弹图片/36.png",
|
||||
"函数":"create_yellow_lightning_bullet"
|
||||
},
|
||||
"绿色闪电":{
|
||||
"图片":"res://assets/子弹图片/35.png",
|
||||
"函数":"create_green_lightning_bullet"
|
||||
},
|
||||
"红色闪电":{
|
||||
"图片":"res://assets/子弹图片/33.png",
|
||||
"函数":"create_red_lightning_bullet"
|
||||
},
|
||||
"紫色闪电":{
|
||||
"图片":"res://assets/子弹图片/32.png",
|
||||
"函数":"create_purple_lightning_bullet"
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
# 基础子弹属性
|
||||
var direction: Vector2 = Vector2.RIGHT
|
||||
var speed: float = 300.0
|
||||
var damage: float = 25.0
|
||||
var owner_pet: NewPetBase = null
|
||||
var max_distance: float = 800.0
|
||||
var traveled_distance: float = 0.0
|
||||
var is_active: bool = true
|
||||
|
||||
# 生存时间
|
||||
var lifetime: float = 3.0
|
||||
var current_lifetime: float = 0.0
|
||||
|
||||
|
||||
#==================基础函数=========================
|
||||
func _ready():
|
||||
# 连接碰撞信号
|
||||
area_entered.connect(_on_area_entered)
|
||||
|
||||
# 设置碰撞层
|
||||
collision_layer = 4 # 子弹层
|
||||
collision_mask = 1 # 只检测宠物层
|
||||
|
||||
# 添加到子弹组
|
||||
add_to_group("bullets")
|
||||
|
||||
func _physics_process(delta):
|
||||
if not is_active:
|
||||
return
|
||||
|
||||
# 更新生存时间
|
||||
current_lifetime += delta
|
||||
if current_lifetime >= lifetime:
|
||||
call_deferred("destroy_bullet")
|
||||
return
|
||||
|
||||
# 检查长紫弹分裂计时
|
||||
if has_meta("bullet_type") and get_meta("bullet_type") == "长紫弹":
|
||||
var current_split_time = get_meta("current_split_time", 0.0)
|
||||
var split_timer = get_meta("split_timer", 2.0)
|
||||
current_split_time += delta
|
||||
set_meta("current_split_time", current_split_time)
|
||||
|
||||
if current_split_time >= split_timer:
|
||||
# 时间到了,分裂并销毁
|
||||
call_deferred("create_split_bullets", global_position)
|
||||
call_deferred("destroy_bullet")
|
||||
return
|
||||
|
||||
# 移动子弹
|
||||
var movement = direction * speed * delta
|
||||
position += movement
|
||||
traveled_distance += movement.length()
|
||||
|
||||
# 检查最大距离
|
||||
if traveled_distance >= max_distance:
|
||||
call_deferred("destroy_bullet")
|
||||
return
|
||||
|
||||
# 检查是否超出屏幕边界
|
||||
var viewport_rect = get_viewport().get_visible_rect()
|
||||
if not viewport_rect.has_point(global_position):
|
||||
call_deferred("destroy_bullet")
|
||||
#==================基础函数=========================
|
||||
|
||||
|
||||
#=============================每个子弹单独效果============================
|
||||
# 小蓝弹
|
||||
func create_blue_bullet():
|
||||
sprite.texture = load(bullet["小蓝弹"]["图片"])
|
||||
speed = 250.0
|
||||
damage = 20.0
|
||||
lifetime = 2.5
|
||||
sprite.modulate = Color(0.5, 0.8, 1.0, 1.0) # 蓝色调
|
||||
|
||||
# 小红弹
|
||||
func create_red_bullet():
|
||||
sprite.texture = load(bullet["小红弹"]["图片"])
|
||||
speed = 300.0
|
||||
damage = 25.0
|
||||
lifetime = 3.0
|
||||
sprite.modulate = Color(1.0, 0.5, 0.5, 1.0) # 红色调
|
||||
|
||||
# 小粉弹
|
||||
func create_pink_bullet():
|
||||
sprite.texture = load(bullet["小粉弹"]["图片"])
|
||||
speed = 280.0
|
||||
damage = 22.0
|
||||
lifetime = 2.8
|
||||
sprite.modulate = Color(1.0, 0.7, 0.9, 1.0) # 粉色调
|
||||
|
||||
# 小紫弹
|
||||
func create_purple_bullet():
|
||||
sprite.texture = load(bullet["小紫弹"]["图片"])
|
||||
speed = 320.0
|
||||
damage = 28.0
|
||||
lifetime = 3.2
|
||||
sprite.modulate = Color(0.8, 0.5, 1.0, 1.0) # 紫色调
|
||||
|
||||
# 长橙弹
|
||||
func create_long_orange_bullet():
|
||||
sprite.texture = load(bullet["长橙弹"]["图片"])
|
||||
speed = 350.0
|
||||
damage = 35.0
|
||||
lifetime = 4.0
|
||||
max_distance = 1000.0
|
||||
sprite.modulate = Color(1.0, 0.7, 0.3, 1.0) # 橙色调
|
||||
|
||||
# 长紫弹
|
||||
func create_long_purple_bullet():
|
||||
sprite.texture = load(bullet["长紫弹"]["图片"])
|
||||
speed = 330.0
|
||||
damage = 32.0
|
||||
lifetime = 3.8
|
||||
max_distance = 950.0
|
||||
sprite.modulate = Color(0.9, 0.4, 1.0, 1.0) # 深紫色调
|
||||
# 标记为长紫弹,2秒后自动分裂
|
||||
set_meta("bullet_type", "长紫弹")
|
||||
set_meta("split_timer", 2.0) # 2秒后分裂
|
||||
set_meta("current_split_time", 0.0) # 当前计时
|
||||
|
||||
# 创建分裂子弹(长紫弹2秒后的效果)
|
||||
func create_split_bullets(hit_position: Vector2):
|
||||
"""在指定位置生成4个小弹向四周发射"""
|
||||
var bullet_types = ["小蓝弹", "小红弹", "小粉弹", "小紫弹"]
|
||||
var bullet_scene = preload("res://Scene/NewPet/BulletBase.tscn")
|
||||
|
||||
# 生成4个方向的子弹
|
||||
for i in range(4):
|
||||
# 计算方向角度(每90度一个方向)
|
||||
var angle = i * PI / 2.0
|
||||
var direction_vector = Vector2(cos(angle), sin(angle))
|
||||
|
||||
# 选择子弹类型(每种类型1个)
|
||||
var bullet_type = bullet_types[i]
|
||||
|
||||
# 创建子弹实例
|
||||
var new_bullet = bullet_scene.instantiate()
|
||||
get_parent().add_child(new_bullet)
|
||||
|
||||
# 设置子弹位置
|
||||
new_bullet.global_position = hit_position
|
||||
|
||||
# 设置子弹属性(5个参数:方向、速度、伤害、所有者、子弹类型)
|
||||
new_bullet.setup(direction_vector, 200.0, 15.0, owner_pet, bullet_type)
|
||||
|
||||
# 分裂子弹生成完成
|
||||
|
||||
# 长绿弹
|
||||
func create_long_green_bullet():
|
||||
sprite.texture = load(bullet["长绿弹"]["图片"])
|
||||
speed = 310.0
|
||||
damage = 30.0
|
||||
lifetime = 3.5
|
||||
max_distance = 900.0
|
||||
sprite.modulate = Color(0.4, 1.0, 0.5, 1.0) # 绿色调
|
||||
|
||||
# 黄色闪电
|
||||
func create_yellow_lightning_bullet():
|
||||
sprite.texture = load(bullet["黄色闪电"]["图片"])
|
||||
speed = 400.0
|
||||
damage = 40.0
|
||||
lifetime = 2.0
|
||||
max_distance = 600.0
|
||||
sprite.modulate = Color(1.0, 1.0, 0.3, 1.0) # 黄色闪电
|
||||
|
||||
# 绿色闪电
|
||||
func create_green_lightning_bullet():
|
||||
sprite.texture = load(bullet["绿色闪电"]["图片"])
|
||||
speed = 380.0
|
||||
damage = 38.0
|
||||
lifetime = 2.2
|
||||
max_distance = 650.0
|
||||
sprite.modulate = Color(0.3, 1.0, 0.3, 1.0) # 绿色闪电
|
||||
|
||||
# 红色闪电
|
||||
func create_red_lightning_bullet():
|
||||
sprite.texture = load(bullet["红色闪电"]["图片"])
|
||||
speed = 420.0
|
||||
damage = 45.0
|
||||
lifetime = 1.8
|
||||
max_distance = 550.0
|
||||
sprite.modulate = Color(1.0, 0.3, 0.3, 1.0) # 红色闪电
|
||||
|
||||
# 紫色闪电
|
||||
func create_purple_lightning_bullet():
|
||||
sprite.texture = load(bullet["紫色闪电"]["图片"])
|
||||
speed = 450.0
|
||||
damage = 50.0
|
||||
lifetime = 1.5
|
||||
max_distance = 500.0
|
||||
sprite.modulate = Color(0.8, 0.3, 1.0, 1.0) # 紫色闪电
|
||||
#=============================每个子弹单独效果============================
|
||||
|
||||
|
||||
|
||||
#=========================通用子弹函数==============================
|
||||
# 通用子弹创建函数
|
||||
func create_bullet_by_name(bullet_name: String):
|
||||
"""根据子弹名称创建对应类型的子弹"""
|
||||
if not bullet.has(bullet_name):
|
||||
return
|
||||
|
||||
var bullet_data = bullet[bullet_name]
|
||||
var function_name = bullet_data.get("函数", "")
|
||||
|
||||
if function_name != "":
|
||||
call(function_name)
|
||||
|
||||
|
||||
# 获取子弹图标
|
||||
func get_bullet_icon(bullet_name: String) -> Texture2D:
|
||||
if bullet.has(bullet_name) and bullet[bullet_name].has("图片"):
|
||||
return load(bullet[bullet_name]["图片"])
|
||||
else:
|
||||
return null
|
||||
|
||||
# 获取所有子弹名称列表
|
||||
func get_all_bullet_names() -> Array:
|
||||
return bullet.keys()
|
||||
|
||||
# 创建击中特效
|
||||
func create_hit_effect(pos: Vector2):
|
||||
pass
|
||||
|
||||
#销毁子弹
|
||||
func destroy_bullet():
|
||||
"""销毁子弹"""
|
||||
is_active = false
|
||||
remove_from_group("bullets")
|
||||
queue_free()
|
||||
|
||||
#初始化子弹
|
||||
func setup(dir: Vector2, spd: float, dmg: float, owner: NewPetBase, bullet_type: String = ""):
|
||||
"""初始化子弹"""
|
||||
direction = dir.normalized()
|
||||
owner_pet = owner
|
||||
|
||||
# 如果指定了子弹类型,使用对应的创建函数
|
||||
if bullet_type != "" and bullet.has(bullet_type):
|
||||
create_bullet_by_name(bullet_type)
|
||||
else:
|
||||
# 使用传入的参数作为默认值
|
||||
speed = spd
|
||||
damage = dmg
|
||||
# 简单的视觉效果
|
||||
sprite.modulate = Color.YELLOW
|
||||
|
||||
# 设置子弹旋转
|
||||
rotation = direction.angle()
|
||||
|
||||
#碰撞检测
|
||||
func _on_area_entered(area: Area2D):
|
||||
"""碰撞检测"""
|
||||
if not is_active:
|
||||
return
|
||||
|
||||
# 检查是否是宠物
|
||||
if not area is NewPetBase:
|
||||
return
|
||||
|
||||
var pet_target = area as NewPetBase
|
||||
|
||||
# 检查是否是有效目标
|
||||
if not is_valid_target(pet_target):
|
||||
return
|
||||
|
||||
# 造成伤害并延迟销毁子弹(避免在物理查询期间修改状态)
|
||||
hit_target(pet_target)
|
||||
call_deferred("destroy_bullet")
|
||||
|
||||
#检查是否是有效攻击目标
|
||||
func is_valid_target(target: NewPetBase) -> bool:
|
||||
"""检查是否是有效攻击目标"""
|
||||
# 检查owner_pet是否有效
|
||||
if not is_instance_valid(owner_pet):
|
||||
owner_pet = null
|
||||
|
||||
# 不能攻击自己的主人
|
||||
if target == owner_pet:
|
||||
return false
|
||||
|
||||
# 不能攻击同队伍
|
||||
if owner_pet != null and target.pet_team == owner_pet.pet_team:
|
||||
return false
|
||||
|
||||
# 不能攻击已死亡的宠物
|
||||
if not target.is_alive:
|
||||
return false
|
||||
|
||||
return true
|
||||
|
||||
#击中目标
|
||||
func hit_target(target: NewPetBase):
|
||||
"""击中目标"""
|
||||
# 检查owner_pet是否有效(防止已释放对象错误)
|
||||
if not is_instance_valid(owner_pet):
|
||||
owner_pet = null
|
||||
|
||||
# 造成伤害
|
||||
target.take_damage(damage, owner_pet)
|
||||
|
||||
# 发射信号
|
||||
bullet_hit.emit(self, target)
|
||||
|
||||
# 创建击中特效
|
||||
create_hit_effect(target.global_position)
|
||||
|
||||
#=========================通用子弹函数==============================
|
||||
1
SproutFarm-Frontend/Scene/NewPet/BulletBase.gd.uid
Normal file
1
SproutFarm-Frontend/Scene/NewPet/BulletBase.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bt57qac8hmg1u
|
||||
29
SproutFarm-Frontend/Scene/NewPet/BulletBase.tscn
Normal file
29
SproutFarm-Frontend/Scene/NewPet/BulletBase.tscn
Normal file
@@ -0,0 +1,29 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cqtv1dob3dm8b"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bt57qac8hmg1u" path="res://Scene/NewPet/BulletBase.gd" id="1_guena"]
|
||||
[ext_resource type="Texture2D" uid="uid://by01joyt7e4qh" path="res://assets/子弹图片/01.png" id="2_2q4gn"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_1"]
|
||||
radius = 8.0
|
||||
|
||||
[node name="BulletBase" type="Area2D"]
|
||||
script = ExtResource("1_guena")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
modulate = Color(1, 1, 0, 0.8)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("2_2q4gn")
|
||||
|
||||
[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)
|
||||
|
||||
[node name="HitEffect" type="Node2D" parent="."]
|
||||
|
||||
[node name="LifeTimer" type="Timer" parent="."]
|
||||
wait_time = 5.0
|
||||
one_shot = true
|
||||
autostart = true
|
||||
1278
SproutFarm-Frontend/Scene/NewPet/NewPetBase.gd
Normal file
1278
SproutFarm-Frontend/Scene/NewPet/NewPetBase.gd
Normal file
File diff suppressed because it is too large
Load Diff
1
SproutFarm-Frontend/Scene/NewPet/NewPetBase.gd.uid
Normal file
1
SproutFarm-Frontend/Scene/NewPet/NewPetBase.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cn6a0803t1bmu
|
||||
146
SproutFarm-Frontend/Scene/NewPet/NewPetBase.tscn
Normal file
146
SproutFarm-Frontend/Scene/NewPet/NewPetBase.tscn
Normal file
@@ -0,0 +1,146 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cfwj8rnm2j8s3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cn6a0803t1bmu" path="res://Scene/NewPet/NewPetBase.gd" id="1_bfbjx"]
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_gnd2w"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="3_bfbjx"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h4hw6"]
|
||||
atlas = ExtResource("2_gnd2w")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_51c25"]
|
||||
atlas = ExtResource("2_gnd2w")
|
||||
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="Area2D"]
|
||||
script = ExtResource("1_bfbjx")
|
||||
|
||||
[node name="PetImage" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_wmdx5")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="PetImage"]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("3_bfbjx")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="PetImage"]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("3_bfbjx")
|
||||
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
|
||||
|
||||
[node name="StatusEffects" type="HBoxContainer" parent="."]
|
||||
offset_left = -30.0
|
||||
offset_top = -65.0
|
||||
offset_right = 30.0
|
||||
offset_bottom = -55.0
|
||||
|
||||
[node name="AttackTimer" type="Timer" parent="."]
|
||||
|
||||
[node name="MoveTimer" type="Timer" parent="."]
|
||||
wait_time = 0.1
|
||||
autostart = true
|
||||
|
||||
[node name="StatusTimer" type="Timer" parent="."]
|
||||
autostart = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
|
||||
[node name="HitEffect" type="Node2D" parent="."]
|
||||
|
||||
[node name="DeathEffect" type="Node2D" parent="."]
|
||||
1304
SproutFarm-Frontend/Scene/NewPet/PetBattlePanel.gd
Normal file
1304
SproutFarm-Frontend/Scene/NewPet/PetBattlePanel.gd
Normal file
File diff suppressed because it is too large
Load Diff
1
SproutFarm-Frontend/Scene/NewPet/PetBattlePanel.gd.uid
Normal file
1
SproutFarm-Frontend/Scene/NewPet/PetBattlePanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bt06n5cxip4kr
|
||||
318
SproutFarm-Frontend/Scene/NewPet/PetBattlePanel.tscn
Normal file
318
SproutFarm-Frontend/Scene/NewPet/PetBattlePanel.tscn
Normal file
@@ -0,0 +1,318 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://diwbnwhnq026"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bt06n5cxip4kr" path="res://Scene/NewPet/PetBattlePanel.gd" id="1_0uw4q"]
|
||||
[ext_resource type="Texture2D" uid="uid://dh0dsw3jr0gra" path="res://assets/宠物对战背景图片/背景2.webp" id="2_c80tv"]
|
||||
|
||||
[node name="PetBattlePanel" type="Panel"]
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
script = ExtResource("1_0uw4q")
|
||||
|
||||
[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_c80tv")
|
||||
|
||||
[node name="TeamB" type="Node2D" parent="."]
|
||||
position = Vector2(1239, 421)
|
||||
|
||||
[node name="Pos1" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(17, -166)
|
||||
|
||||
[node name="Pos2" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(42, 160)
|
||||
|
||||
[node name="Pos3" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(42, -38)
|
||||
|
||||
[node name="Pos4" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(21, -315)
|
||||
|
||||
[node name="Pos5" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(42, -102)
|
||||
|
||||
[node name="Pos6" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(42, 96)
|
||||
|
||||
[node name="Pos7" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(42, 32)
|
||||
|
||||
[node name="Pos8" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(21, -251)
|
||||
|
||||
[node name="Pos9" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(42, -230)
|
||||
|
||||
[node name="Pos10" type="Marker2D" parent="TeamB"]
|
||||
position = Vector2(42, 224)
|
||||
|
||||
[node name="TeamA" type="Node2D" parent="."]
|
||||
position = Vector2(138, 134)
|
||||
|
||||
[node name="Pos1" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-37, 408)
|
||||
|
||||
[node name="Pos2" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-41, 93)
|
||||
|
||||
[node name="Pos3" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 313)
|
||||
|
||||
[node name="Pos4" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 223)
|
||||
|
||||
[node name="Pos5" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 133)
|
||||
|
||||
[node name="Pos6" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 43)
|
||||
|
||||
[node name="Pos7" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 358)
|
||||
|
||||
[node name="Pos8" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 268)
|
||||
|
||||
[node name="Pos9" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 178)
|
||||
|
||||
[node name="Pos10" type="Marker2D" parent="TeamA"]
|
||||
position = Vector2(-38, 453)
|
||||
|
||||
[node name="PlayerSkillPanel" type="Panel" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1143.0
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
|
||||
[node name="Title" type="Label" parent="PlayerSkillPanel"]
|
||||
self_modulate = Color(0, 1, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 257.0
|
||||
offset_bottom = 40.0
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "辅助功能"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TeamASkills" type="VBoxContainer" parent="PlayerSkillPanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 50.0
|
||||
offset_right = 257.0
|
||||
offset_bottom = 578.0
|
||||
|
||||
[node name="TeamAHeal" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
text = "团队治疗"
|
||||
|
||||
[node name="TeamARage" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
text = "团队狂暴"
|
||||
|
||||
[node name="TeamAShield" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
text = "团队护盾"
|
||||
|
||||
[node name="test" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test2" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test3" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test4" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test5" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test6" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test7" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test8" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test9" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test10" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="test11" type="Button" parent="PlayerSkillPanel/TeamASkills"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 18
|
||||
disabled = true
|
||||
text = "暂无"
|
||||
|
||||
[node name="BattleControls" type="VBoxContainer" parent="PlayerSkillPanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 580.0
|
||||
offset_right = 257.0
|
||||
offset_bottom = 720.0
|
||||
|
||||
[node name="StartBattleButton" type="Button" parent="PlayerSkillPanel/BattleControls"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 1, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "开始战斗"
|
||||
|
||||
[node name="StopBattleButton" type="Button" parent="PlayerSkillPanel/BattleControls"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "逃跑"
|
||||
|
||||
[node name="BattleEndPanel" type="Panel" parent="."]
|
||||
visible = false
|
||||
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="RichTextLabel" parent="BattleEndPanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 104.0
|
||||
offset_right = 777.0
|
||||
offset_bottom = 567.0
|
||||
theme_override_font_sizes/normal_font_size = 30
|
||||
bbcode_enabled = true
|
||||
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="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="Time" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 574.0
|
||||
offset_top = 60.0
|
||||
offset_right = 813.0
|
||||
offset_bottom = 129.0
|
||||
theme_override_colors/font_color = Color(0.623529, 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 = 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 = 35
|
||||
text = "[05:00]"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[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
|
||||
|
||||
[node name="ConfirmDialog" type="ConfirmationDialog" parent="."]
|
||||
title = "弹窗标题"
|
||||
initial_position = 1
|
||||
size = Vector2i(400, 300)
|
||||
unresizable = true
|
||||
ok_button_text = "确认"
|
||||
dialog_text = "弹窗内容"
|
||||
dialog_autowrap = true
|
||||
cancel_button_text = "取消"
|
||||
|
||||
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamAHeal" to="." method="_on_team_a_heal_pressed"]
|
||||
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamARage" to="." method="_on_team_a_rage_pressed"]
|
||||
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamAShield" to="." method="_on_team_a_shield_pressed"]
|
||||
[connection signal="pressed" from="PlayerSkillPanel/BattleControls/StopBattleButton" to="." method="_on_stop_battle_button_pressed"]
|
||||
416
SproutFarm-Frontend/Scene/NewPet/PetConfig.gd
Normal file
416
SproutFarm-Frontend/Scene/NewPet/PetConfig.gd
Normal file
@@ -0,0 +1,416 @@
|
||||
extends Node
|
||||
class_name PetConfig
|
||||
# 每一种宠物的配置数据 方便导出JSON数据,放到MongoDB数据库上
|
||||
|
||||
|
||||
|
||||
# 攻击类型枚举(简化为仅近战)
|
||||
enum AttackType {
|
||||
MELEE # 近战攻击
|
||||
}
|
||||
|
||||
enum ElementType {
|
||||
NONE, METAL, WOOD, WATER, FIRE, EARTH, THUNDER
|
||||
}
|
||||
|
||||
enum PetState {
|
||||
IDLE, # 待机
|
||||
MOVING, # 移动
|
||||
ATTACKING, # 攻击中
|
||||
SKILL_CASTING, # 释放技能
|
||||
DEAD # 死亡
|
||||
}
|
||||
|
||||
#==========================以下是导出数据可以被修改的=========================================
|
||||
# 基本属性
|
||||
var pet_name: String = "萌芽小绿" # 宠物名称
|
||||
var pet_id: String = "0001" # 宠物唯一编号
|
||||
var pet_type: String = "小绿" # 宠物种类
|
||||
var pet_level: int = 1 # 宠物等级
|
||||
var pet_experience: int = 0 # 宠物经验值
|
||||
|
||||
#性格 出生日期 爱好 个人介绍
|
||||
var pet_temperament: String = "温顺" # 性格
|
||||
var pet_birthday: String = "2023-01-01" # 出生日期
|
||||
var pet_hobby: String = "喜欢吃pet" # 爱好
|
||||
var pet_introduction: String = "我是一个小绿" # 个人介绍
|
||||
|
||||
# 生命与防御
|
||||
var max_health: float = 200.0 # 最大生命值
|
||||
var enable_health_regen: bool = true # 是否开启生命恢复
|
||||
var health_regen: float = 1.0 # 每秒生命恢复大小
|
||||
var enable_shield_regen: bool = true # 是否开启护盾恢复
|
||||
var max_shield: float = 100.0 # 最大护盾值
|
||||
var shield_regen: float = 1.0 # 每秒护盾恢复大小
|
||||
var max_armor: float = 100.0 # 最大护甲值
|
||||
|
||||
# 攻击属性
|
||||
var base_attack_damage: float = 25.0 # 基础攻击力
|
||||
var crit_rate: float = 0.1 # 暴击几率(0~1)
|
||||
var crit_damage: float = 1.5 # 暴击伤害倍率(1.5 = 150%伤害)
|
||||
var armor_penetration: float = 0.0 # 护甲穿透值(直接减少对方护甲值)
|
||||
|
||||
#======================以后有新技能在这里添加==============================
|
||||
# 技能-多发射击
|
||||
var enable_multi_projectile_skill: bool = false
|
||||
var multi_projectile_delay: float = 2.0 # 多发射击延迟时间(秒)
|
||||
|
||||
# 技能-狂暴模式
|
||||
var enable_berserker_skill: bool = false
|
||||
var berserker_bonus: float = 1.5 # 狂暴伤害加成
|
||||
var berserker_duration: float = 5.0 # 狂暴持续时间(秒)
|
||||
|
||||
#技能-自爆
|
||||
var enable_self_destruct_skill: bool = false
|
||||
var self_destruct_damage: float = 50.0 # 自爆伤害值
|
||||
|
||||
#技能-召唤小弟
|
||||
var enable_summon_pet_skill: bool = false
|
||||
var summon_count: int = 1 # 召唤小弟数量
|
||||
var summon_scale: float = 0.1 # 召唤小弟属性缩放比例(10%)
|
||||
|
||||
#技能-死亡重生
|
||||
var enable_death_respawn_skill: bool = false
|
||||
var respawn_health_percentage: float = 0.3 # 重生时恢复的血量百分比(30%)
|
||||
|
||||
#技能-反弹伤害
|
||||
var enable_damage_reflection_skill: bool = false
|
||||
var damage_reflection_cooldown: float = 10.0 # 反弹伤害冷却时间(秒)
|
||||
var damage_reflection_percentage: float = 0.5 # 反弹伤害百分比(50%)
|
||||
#======================以后有新技能在这里添加==============================
|
||||
|
||||
# 移动属性
|
||||
var move_speed: float = 150.0 # 移动速度(像素/秒)
|
||||
var dodge_rate: float = 0.05 # 闪避概率(0~1)
|
||||
|
||||
# 元素属性
|
||||
var element_type: ElementType = ElementType.NONE # 元素类型(例如火、水、雷等)
|
||||
var element_damage_bonus: float = 50.0 # 元素伤害加成(额外元素伤害)
|
||||
|
||||
# 武器系统
|
||||
var left_weapon: String = "" # 左手武器名称
|
||||
var right_weapon: String = "" # 右手武器名称
|
||||
|
||||
# 宠物配置字典 - 用于导出到MongoDB数据库
|
||||
var pet_configs: Dictionary = {
|
||||
"烈焰鸟": {
|
||||
"pet_name": "树萌芽の烈焰鸟",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/flying_bird.tscn",
|
||||
"pet_id": "0001",
|
||||
"pet_type": "烈焰鸟",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 500,
|
||||
"pet_temperament": "勇猛",
|
||||
"pet_birthday": "2023-03-15",
|
||||
"pet_hobby": "喜欢战斗和烈火",
|
||||
"pet_introduction": "我爱吃虫子",
|
||||
"max_health": 300,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 150,
|
||||
"shield_regen": 1.5,
|
||||
"max_armor": 120,
|
||||
"base_attack_damage": 40,
|
||||
"crit_rate": 0.15,
|
||||
"crit_damage": 2,
|
||||
"armor_penetration": 10,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 2,
|
||||
"enable_berserker_skill": true,
|
||||
"berserker_bonus": 1.8,
|
||||
"berserker_duration": 6,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": false,
|
||||
"enable_death_respawn_skill": true,
|
||||
"respawn_health_percentage": 0.4,
|
||||
"enable_damage_reflection_skill": true,
|
||||
"damage_reflection_cooldown": 8.0,
|
||||
"damage_reflection_percentage": 0.6,
|
||||
"move_speed": 180,
|
||||
"dodge_rate": 0.08,
|
||||
"element_type": "FIRE",
|
||||
"element_damage_bonus": 75,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"大蓝虫": {
|
||||
"pet_name": "树萌芽の大蓝虫",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/big_beetle.tscn",
|
||||
"pet_id": "0002",
|
||||
"pet_type": "大蓝虫",
|
||||
"pet_level": 8,
|
||||
"pet_experience": 320,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和小甲壳虫玩",
|
||||
"pet_introduction": "我是大蓝虫,不是大懒虫!",
|
||||
"max_health": 180,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80,
|
||||
"base_attack_damage": 35,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"enable_damage_reflection_skill": true,
|
||||
"damage_reflection_cooldown": 12.0,
|
||||
"damage_reflection_percentage": 0.4,
|
||||
"move_speed": 120,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"小蓝虫": {
|
||||
"pet_name": "树萌芽の小蓝虫",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/small_beetle.tscn",
|
||||
"pet_id": "0002",
|
||||
"pet_type": "小蓝虫",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 0,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和大蓝虫玩",
|
||||
"pet_introduction": "我是小蓝虫,不是小懒虫!",
|
||||
"max_health": 90,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80,
|
||||
"base_attack_damage": 35,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"enable_damage_reflection_skill": false,
|
||||
"damage_reflection_cooldown": 10.0,
|
||||
"damage_reflection_percentage": 0.5,
|
||||
"move_speed": 120,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"小蓝": {
|
||||
"pet_name": "树萌芽の小蓝",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/small_blue.tscn",
|
||||
"pet_id": "0002",
|
||||
"pet_type": "小蓝",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 0,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和小黄一起玩",
|
||||
"pet_introduction": "我是小黄!",
|
||||
"max_health": 120,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80,
|
||||
"base_attack_damage": 35,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"enable_damage_reflection_skill": false,
|
||||
"damage_reflection_cooldown": 10.0,
|
||||
"damage_reflection_percentage": 0.5,
|
||||
"move_speed": 120,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
}
|
||||
}
|
||||
|
||||
# 初始化函数
|
||||
func _ready():
|
||||
"""节点准备就绪时自动加载JSON配置"""
|
||||
load_configs_from_json()
|
||||
|
||||
# 手动初始化配置的函数
|
||||
func initialize_configs():
|
||||
"""手动初始化宠物配置,优先从JSON加载"""
|
||||
if not load_configs_from_json():
|
||||
print("JSON加载失败,使用默认配置")
|
||||
# 如果JSON加载失败,保持使用代码中的默认配置
|
||||
|
||||
|
||||
# 获取宠物配置的函数
|
||||
func get_pet_config(pet_key: String) -> Dictionary:
|
||||
"""根据宠物键值获取配置"""
|
||||
if pet_configs.has(pet_key):
|
||||
return pet_configs[pet_key]
|
||||
else:
|
||||
print("未找到宠物配置: ", pet_key, ",使用默认配置")
|
||||
return get_default_config()
|
||||
|
||||
# 获取所有宠物配置键值的函数
|
||||
func get_all_pet_keys() -> Array:
|
||||
"""获取所有可用的宠物配置键值"""
|
||||
return pet_configs.keys()
|
||||
|
||||
# 检查宠物配置是否存在的函数
|
||||
func has_pet_config(pet_key: String) -> bool:
|
||||
"""检查指定的宠物配置是否存在"""
|
||||
return pet_configs.has(pet_key)
|
||||
|
||||
# 获取默认配置的函数
|
||||
func get_default_config() -> Dictionary:
|
||||
"""获取默认宠物配置"""
|
||||
return {
|
||||
"pet_name": pet_name,
|
||||
"pet_id": pet_id,
|
||||
"pet_type": pet_type,
|
||||
"pet_level": pet_level,
|
||||
"pet_experience": pet_experience,
|
||||
"pet_temperament": pet_temperament,
|
||||
"pet_birthday": pet_birthday,
|
||||
"pet_hobby": pet_hobby,
|
||||
"pet_introduction": pet_introduction,
|
||||
"max_health": max_health,
|
||||
"enable_health_regen": enable_health_regen,
|
||||
"health_regen": health_regen,
|
||||
"enable_shield_regen": enable_shield_regen,
|
||||
"max_shield": max_shield,
|
||||
"shield_regen": shield_regen,
|
||||
"max_armor": max_armor,
|
||||
"base_attack_damage": base_attack_damage,
|
||||
"crit_rate": crit_rate,
|
||||
"crit_damage": crit_damage,
|
||||
"armor_penetration": armor_penetration,
|
||||
"enable_multi_projectile_skill": enable_multi_projectile_skill,
|
||||
"multi_projectile_delay": multi_projectile_delay,
|
||||
"enable_berserker_skill": enable_berserker_skill,
|
||||
"berserker_bonus": berserker_bonus,
|
||||
"berserker_duration": berserker_duration,
|
||||
"enable_self_destruct_skill": enable_self_destruct_skill,
|
||||
"self_destruct_damage": self_destruct_damage,
|
||||
"enable_summon_pet_skill": enable_summon_pet_skill,
|
||||
"summon_count": summon_count,
|
||||
"summon_scale": summon_scale,
|
||||
"enable_death_respawn_skill": enable_death_respawn_skill,
|
||||
"respawn_health_percentage": respawn_health_percentage,
|
||||
"enable_damage_reflection_skill": enable_damage_reflection_skill,
|
||||
"damage_reflection_cooldown": damage_reflection_cooldown,
|
||||
"damage_reflection_percentage": damage_reflection_percentage,
|
||||
"move_speed": move_speed,
|
||||
"dodge_rate": dodge_rate,
|
||||
"element_type": element_type,
|
||||
"element_damage_bonus": element_damage_bonus,
|
||||
"left_weapon": left_weapon,
|
||||
"right_weapon": right_weapon
|
||||
}
|
||||
|
||||
# 字符串转换为ElementType枚举的函数
|
||||
func string_to_element_type(element_str: String) -> ElementType:
|
||||
"""将字符串转换为ElementType枚举"""
|
||||
match element_str.to_upper():
|
||||
"NONE":#没有元素类型
|
||||
return ElementType.NONE
|
||||
"METAL":#金元素
|
||||
return ElementType.METAL
|
||||
"WOOD":#木元素
|
||||
return ElementType.WOOD
|
||||
"WATER":#水元素
|
||||
return ElementType.WATER
|
||||
"FIRE": #火元素
|
||||
return ElementType.FIRE
|
||||
"EARTH":#土元素
|
||||
return ElementType.EARTH
|
||||
"THUNDER":#雷元素
|
||||
return ElementType.THUNDER
|
||||
_:
|
||||
return ElementType.NONE
|
||||
|
||||
# 从JSON文件加载宠物配置的函数
|
||||
func load_configs_from_json(file_path: String = "res://Scene/NewPet/Pet_data.json") -> bool:
|
||||
"""从JSON文件加载宠物配置"""
|
||||
if not FileAccess.file_exists(file_path):
|
||||
print("宠物配置文件不存在: ", file_path)
|
||||
return false
|
||||
|
||||
var file = FileAccess.open(file_path, FileAccess.READ)
|
||||
if file == null:
|
||||
print("无法打开宠物配置文件: ", file_path)
|
||||
return false
|
||||
|
||||
var json_string = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_string)
|
||||
if parse_result != OK:
|
||||
print("JSON解析失败: ", json.error_string)
|
||||
return false
|
||||
|
||||
var loaded_configs = json.data
|
||||
if typeof(loaded_configs) != TYPE_DICTIONARY:
|
||||
print("JSON格式错误,期望字典类型")
|
||||
return false
|
||||
|
||||
# 清空现有配置并加载新配置
|
||||
pet_configs.clear()
|
||||
|
||||
# 遍历加载的配置
|
||||
for pet_key in loaded_configs.keys():
|
||||
var config = loaded_configs[pet_key]
|
||||
if typeof(config) != TYPE_DICTIONARY:
|
||||
print("跳过无效的宠物配置: ", pet_key)
|
||||
continue
|
||||
|
||||
# 处理element_type字符串转换为枚举
|
||||
if config.has("element_type") and typeof(config["element_type"]) == TYPE_STRING:
|
||||
config["element_type"] = string_to_element_type(config["element_type"])
|
||||
|
||||
# 添加到配置字典
|
||||
pet_configs[pet_key] = config
|
||||
|
||||
print("成功从JSON加载了 ", pet_configs.size(), " 个宠物配置")
|
||||
return true
|
||||
|
||||
# 导出配置到JSON的函数
|
||||
func export_configs_to_json() -> String:
|
||||
"""将宠物配置导出为JSON字符串,用于保存到MongoDB"""
|
||||
return JSON.stringify(pet_configs)
|
||||
1
SproutFarm-Frontend/Scene/NewPet/PetConfig.gd.uid
Normal file
1
SproutFarm-Frontend/Scene/NewPet/PetConfig.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://l31ap5jcuyfl
|
||||
68
SproutFarm-Frontend/Scene/NewPet/PetType/big_beetle.tscn
Normal file
68
SproutFarm-Frontend/Scene/NewPet/PetType/big_beetle.tscn
Normal file
@@ -0,0 +1,68 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://ba85asiwug57i"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_4f76q"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_vbyii"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_op7i3"]
|
||||
atlas = ExtResource("1_4f76q")
|
||||
region = Rect2(72, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c36rm"]
|
||||
atlas = ExtResource("1_4f76q")
|
||||
region = Rect2(120, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
|
||||
atlas = ExtResource("1_4f76q")
|
||||
region = Rect2(72, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q454c"]
|
||||
atlas = ExtResource("1_4f76q")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_b73qu")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_vbyii")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_vbyii")
|
||||
flip_h = true
|
||||
64
SproutFarm-Frontend/Scene/NewPet/PetType/flying_bird.tscn
Normal file
64
SproutFarm-Frontend/Scene/NewPet/PetType/flying_bird.tscn
Normal file
@@ -0,0 +1,64 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://bpkq40vvq3cxy"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_lxn61"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_wrr70"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lgi35"]
|
||||
atlas = ExtResource("1_lxn61")
|
||||
region = Rect2(192, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wn6km"]
|
||||
atlas = ExtResource("1_lxn61")
|
||||
region = Rect2(144, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qmpjj"]
|
||||
atlas = ExtResource("1_lxn61")
|
||||
region = Rect2(168, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1mpkc"]
|
||||
atlas = ExtResource("1_lxn61")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_b73qu")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
frame_progress = 0.111287
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_wrr70")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_wrr70")
|
||||
flip_h = true
|
||||
103
SproutFarm-Frontend/Scene/NewPet/PetType/green_slime.tscn
Normal file
103
SproutFarm-Frontend/Scene/NewPet/PetType/green_slime.tscn
Normal file
@@ -0,0 +1,103 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dvkix032ikul3"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b75oytao5cgjo" path="res://assets/宠物图片/绿色史莱姆.png" id="1_m1ura"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_58kah"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ou315"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_saxlb"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(72, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bxslx"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(48, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dvhl1"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(24, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0t1ns"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sbjn0"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(72, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qvnbx"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(48, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n0kjo"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
region = Rect2(24, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_obu0n"]
|
||||
atlas = ExtResource("1_m1ura")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
animation = &"idle"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_58kah")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_58kah")
|
||||
flip_h = true
|
||||
176
SproutFarm-Frontend/Scene/NewPet/PetType/little_knight.tscn
Normal file
176
SproutFarm-Frontend/Scene/NewPet/PetType/little_knight.tscn
Normal file
@@ -0,0 +1,176 @@
|
||||
[gd_scene load_steps=24 format=3 uid="uid://dwdoine3llw30"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bal78ts2eq4yu" path="res://assets/宠物图片/护卫.png" id="1_4imwo"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_ywvjf"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rjt8u"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(224, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_81r1q"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(192, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nliwy"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(160, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kbr5d"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(128, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yhrjc"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(224, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2dbgw"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(192, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h0n46"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(160, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1tk7r"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(128, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ogy1e"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(96, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mygjj"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(64, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rkj0j"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(32, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j7anc"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(0, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cxgnv"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(224, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2itrd"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(192, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c7ofb"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(160, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_aa4e4"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(128, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jx5oo"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(96, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_umo24"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(64, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_853s8"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
region = Rect2(32, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6x5xm"]
|
||||
atlas = ExtResource("1_4imwo")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
frame_progress = 0.272604
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_ywvjf")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_ywvjf")
|
||||
flip_h = true
|
||||
104
SproutFarm-Frontend/Scene/NewPet/PetType/red_slime.tscn
Normal file
104
SproutFarm-Frontend/Scene/NewPet/PetType/red_slime.tscn
Normal file
@@ -0,0 +1,104 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://c8siga6au2vqh"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cvpsjlje7q3to" path="res://assets/宠物图片/红色史莱姆.png" id="1_2d2gf"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_ni2i3"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s7ip1"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ff7pm"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(72, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_53j2r"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(48, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0ij01"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(24, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_20513"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3f8fr"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(72, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kbexh"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(48, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_njkpw"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
region = Rect2(24, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xbspe"]
|
||||
atlas = ExtResource("1_2d2gf")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
frame_progress = 0.528863
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_ni2i3")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_ni2i3")
|
||||
flip_h = true
|
||||
64
SproutFarm-Frontend/Scene/NewPet/PetType/small_beetle.tscn
Normal file
64
SproutFarm-Frontend/Scene/NewPet/PetType/small_beetle.tscn
Normal file
@@ -0,0 +1,64 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bk5di5uq6bo04"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_rph6q"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_bks4n"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nswws"]
|
||||
atlas = ExtResource("1_rph6q")
|
||||
region = Rect2(0, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
|
||||
atlas = ExtResource("1_rph6q")
|
||||
region = Rect2(48, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1eo38"]
|
||||
atlas = ExtResource("1_rph6q")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_b73qu")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_bks4n")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_bks4n")
|
||||
flip_h = true
|
||||
52
SproutFarm-Frontend/Scene/NewPet/PetType/small_blue.tscn
Normal file
52
SproutFarm-Frontend/Scene/NewPet/PetType/small_blue.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://d1sj6wl3mfpo3"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_6fty5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_4lqxb"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_stamd"]
|
||||
atlas = ExtResource("1_6fty5")
|
||||
region = Rect2(48, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v0b4v"]
|
||||
atlas = ExtResource("1_6fty5")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_b2ss3")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_4lqxb")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_4lqxb")
|
||||
flip_h = true
|
||||
@@ -0,0 +1,64 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dkvo63yforem7"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_x37sh"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_w6fwq"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j2fq3"]
|
||||
atlas = ExtResource("1_x37sh")
|
||||
region = Rect2(144, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6q1oc"]
|
||||
atlas = ExtResource("1_x37sh")
|
||||
region = Rect2(192, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xvdwk"]
|
||||
atlas = ExtResource("1_x37sh")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_6q1oc")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_w6fwq")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_w6fwq")
|
||||
flip_h = true
|
||||
56
SproutFarm-Frontend/Scene/NewPet/PetType/small_green.tscn
Normal file
56
SproutFarm-Frontend/Scene/NewPet/PetType/small_green.tscn
Normal file
@@ -0,0 +1,56 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bpsoc04xlvhqa"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_i7yg5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_wo7be"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5gxwu"]
|
||||
atlas = ExtResource("1_i7yg5")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pxsqn"]
|
||||
atlas = ExtResource("1_i7yg5")
|
||||
region = Rect2(0, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xxlll"]
|
||||
atlas = ExtResource("1_i7yg5")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_k25pl")
|
||||
animation = &"idle"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_wo7be")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_wo7be")
|
||||
flip_h = true
|
||||
52
SproutFarm-Frontend/Scene/NewPet/PetType/small_orange.tscn
Normal file
52
SproutFarm-Frontend/Scene/NewPet/PetType/small_orange.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bk7wkksxa7150"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_4x5tv"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_iom1h"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tdtxh"]
|
||||
atlas = ExtResource("1_4x5tv")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5rxf3"]
|
||||
atlas = ExtResource("1_4x5tv")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_ujsmd")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_iom1h")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_iom1h")
|
||||
flip_h = true
|
||||
56
SproutFarm-Frontend/Scene/NewPet/PetType/small_pink.tscn
Normal file
56
SproutFarm-Frontend/Scene/NewPet/PetType/small_pink.tscn
Normal file
@@ -0,0 +1,56 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cxj61dijvapdt"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_wkxhn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_xic1v"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cxnqb"]
|
||||
atlas = ExtResource("1_wkxhn")
|
||||
region = Rect2(96, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_auciw"]
|
||||
atlas = ExtResource("1_wkxhn")
|
||||
region = Rect2(96, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nrp4g"]
|
||||
atlas = ExtResource("1_wkxhn")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_b2ss3")
|
||||
animation = &"idle"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_xic1v")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_xic1v")
|
||||
flip_h = true
|
||||
52
SproutFarm-Frontend/Scene/NewPet/PetType/small_yellow.tscn
Normal file
52
SproutFarm-Frontend/Scene/NewPet/PetType/small_yellow.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://is5klrhiktg4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_qrx6w"]
|
||||
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_dkex0"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_trhvc"]
|
||||
atlas = ExtResource("1_qrx6w")
|
||||
region = Rect2(144, 0, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_k5jn7"]
|
||||
atlas = ExtResource("1_qrx6w")
|
||||
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="PetImage" type="AnimatedSprite2D"]
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_yhcbw")
|
||||
animation = &"walk"
|
||||
autoplay = "walk"
|
||||
|
||||
[node name="LeftToolImage" type="Sprite2D" parent="."]
|
||||
z_index = 5
|
||||
position = Vector2(-10.5, 3)
|
||||
texture = ExtResource("2_dkex0")
|
||||
flip_h = true
|
||||
|
||||
[node name="RightToolImage" type="Sprite2D" parent="."]
|
||||
show_behind_parent = true
|
||||
position = Vector2(-7.5, -6.25)
|
||||
texture = ExtResource("2_dkex0")
|
||||
flip_h = true
|
||||
81
SproutFarm-Frontend/Scene/NewPet/Pet_bag.json
Normal file
81
SproutFarm-Frontend/Scene/NewPet/Pet_bag.json
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"宠物仓库":{
|
||||
"烈焰鸟": {
|
||||
"pet_name": "树萌芽の烈焰鸟",
|
||||
"pet_image":"res://Scene/NewPet/PetType/flying_bird.tscn",
|
||||
"pet_id": "wea1212w12",
|
||||
"pet_type": "烈焰鸟",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 500,
|
||||
"pet_temperament": "勇猛",
|
||||
"pet_birthday": "2025-07-25",
|
||||
"pet_hobby": "喜欢战斗和烈火",
|
||||
"pet_introduction": "我爱吃虫子",
|
||||
"max_health": 300.0,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 2.0,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 150.0,
|
||||
"shield_regen": 1.5,
|
||||
"max_armor": 120.0,
|
||||
"base_attack_damage": 40.0,
|
||||
"crit_rate": 0.15,
|
||||
"crit_damage": 2.0,
|
||||
"armor_penetration": 10.0,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 2.0,
|
||||
"enable_berserker_skill": true,
|
||||
"berserker_bonus": 1.8,
|
||||
"berserker_duration": 6.0,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": false,
|
||||
"enable_death_respawn_skill": true,
|
||||
"respawn_health_percentage": 0.4,
|
||||
"move_speed": 180.0,
|
||||
"dodge_rate": 0.08,
|
||||
"element_type": "FIRE",
|
||||
"element_damage_bonus": 75.0,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"大蓝虫": {
|
||||
"pet_name": "树萌芽の大蓝虫",
|
||||
"pet_image":"res://Scene/NewPet/PetType/big_beetle.tscn",
|
||||
"pet_id": "dlc123123",
|
||||
"pet_type": "大甲壳虫",
|
||||
"pet_level": 8,
|
||||
"pet_experience": 320,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和小甲壳虫玩",
|
||||
"pet_introduction": "我是大蓝虫,不是大懒虫!",
|
||||
"max_health": 180.0,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200.0,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80.0,
|
||||
"base_attack_damage": 35.0,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15.0,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"move_speed": 120.0,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100.0,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
}
|
||||
},
|
||||
"巡逻宠物":["wea1212w12"],
|
||||
"出战宠物":["dlc123123"]
|
||||
}
|
||||
165
SproutFarm-Frontend/Scene/NewPet/Pet_data.json
Normal file
165
SproutFarm-Frontend/Scene/NewPet/Pet_data.json
Normal file
@@ -0,0 +1,165 @@
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "687cf59b8e77ba00a7414bab"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2025-07-20T22:13:38.521Z"
|
||||
},
|
||||
"烈焰鸟": {
|
||||
"pet_name": "树萌芽の烈焰鸟",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/flying_bird.tscn",
|
||||
"pet_id": "0001",
|
||||
"pet_type": "烈焰鸟",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 500,
|
||||
"pet_temperament": "勇猛",
|
||||
"pet_birthday": "2023-03-15",
|
||||
"pet_hobby": "喜欢战斗和烈火",
|
||||
"pet_introduction": "我爱吃虫子",
|
||||
"max_health": 300,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 150,
|
||||
"shield_regen": 1.5,
|
||||
"max_armor": 120,
|
||||
"base_attack_damage": 40,
|
||||
"crit_rate": 0.15,
|
||||
"crit_damage": 2,
|
||||
"armor_penetration": 10,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 2,
|
||||
"enable_berserker_skill": true,
|
||||
"berserker_bonus": 1.8,
|
||||
"berserker_duration": 6,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": false,
|
||||
"enable_death_respawn_skill": true,
|
||||
"respawn_health_percentage": 0.4,
|
||||
"move_speed": 180,
|
||||
"dodge_rate": 0.08,
|
||||
"element_type": "FIRE",
|
||||
"element_damage_bonus": 75,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"大蓝虫": {
|
||||
"pet_name": "树萌芽の大蓝虫",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/big_beetle.tscn",
|
||||
"pet_id": "0002",
|
||||
"pet_type": "大蓝虫",
|
||||
"pet_level": 8,
|
||||
"pet_experience": 320,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和小甲壳虫玩",
|
||||
"pet_introduction": "我是大蓝虫,不是大懒虫!",
|
||||
"max_health": 180,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80,
|
||||
"base_attack_damage": 35,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"move_speed": 120,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"小蓝虫": {
|
||||
"pet_name": "树萌芽の小蓝虫",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/small_beetle.tscn",
|
||||
"pet_id": "0002",
|
||||
"pet_type": "小蓝虫",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 0,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和大蓝虫玩",
|
||||
"pet_introduction": "我是小蓝虫,不是小懒虫!",
|
||||
"max_health": 90,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80,
|
||||
"base_attack_damage": 35,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"move_speed": 120,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
},
|
||||
"小蓝": {
|
||||
"pet_name": "树萌芽の小蓝",
|
||||
"can_purchase": true,
|
||||
"cost": 1000,
|
||||
"pet_image": "res://Scene/NewPet/PetType/small_blue.tscn",
|
||||
"pet_id": "0002",
|
||||
"pet_type": "小蓝",
|
||||
"pet_level": 1,
|
||||
"pet_experience": 0,
|
||||
"pet_temperament": "冷静",
|
||||
"pet_birthday": "2023-06-20",
|
||||
"pet_hobby": "喜欢和小黄一起玩",
|
||||
"pet_introduction": "我是小黄!",
|
||||
"max_health": 120,
|
||||
"enable_health_regen": true,
|
||||
"health_regen": 1.2,
|
||||
"enable_shield_regen": true,
|
||||
"max_shield": 200,
|
||||
"shield_regen": 2.5,
|
||||
"max_armor": 80,
|
||||
"base_attack_damage": 35,
|
||||
"crit_rate": 0.12,
|
||||
"crit_damage": 1.8,
|
||||
"armor_penetration": 15,
|
||||
"enable_multi_projectile_skill": true,
|
||||
"multi_projectile_delay": 1.5,
|
||||
"enable_berserker_skill": false,
|
||||
"enable_self_destruct_skill": false,
|
||||
"enable_summon_pet_skill": true,
|
||||
"summon_count": 2,
|
||||
"summon_scale": 0.15,
|
||||
"enable_death_respawn_skill": false,
|
||||
"move_speed": 120,
|
||||
"dodge_rate": 0.12,
|
||||
"element_type": "WATER",
|
||||
"element_damage_bonus": 100,
|
||||
"left_weapon": "钻石剑",
|
||||
"right_weapon": "钻石剑"
|
||||
}
|
||||
}
|
||||
128
SproutFarm-Frontend/Scene/NewPet/WeaponBase.gd
Normal file
128
SproutFarm-Frontend/Scene/NewPet/WeaponBase.gd
Normal file
@@ -0,0 +1,128 @@
|
||||
extends Node
|
||||
class_name WeaponBase
|
||||
|
||||
#武器系统
|
||||
var weapon_data = {
|
||||
"钻石剑": {
|
||||
"icon": 'res://assets/我的世界图片/武器工具/钻石剑.png',
|
||||
"function": "apply_diamond_sword_effect"
|
||||
},
|
||||
"铁剑": {
|
||||
"icon": 'res://assets/我的世界图片/武器工具/铁剑.png',
|
||||
"function": "apply_iron_sword_effect"
|
||||
},
|
||||
"钻石斧": {
|
||||
"icon": 'res://assets/我的世界图片/武器工具/钻石斧.png',
|
||||
"function": "apply_diamond_axe_effect"
|
||||
},
|
||||
"铁镐": {
|
||||
"icon": 'res://assets/我的世界图片/武器工具/铁镐.png',
|
||||
"function": "apply_iron_pickaxe_effect"
|
||||
}
|
||||
}
|
||||
|
||||
# 武器效果函数 - 每种武器单独一个函数
|
||||
|
||||
#================钻石剑效果========================
|
||||
# 钻石剑效果
|
||||
func apply_diamond_sword_effect(pet):
|
||||
pet.base_attack_damage += 15.0
|
||||
pet.crit_rate += 0.1
|
||||
pet.attack_speed += 0.2
|
||||
# 钻石剑效果已应用
|
||||
|
||||
# 移除钻石剑效果
|
||||
func remove_diamond_sword_effect(pet):
|
||||
pet.base_attack_damage -= 15.0
|
||||
pet.crit_rate -= 0.1
|
||||
pet.attack_speed -= 0.2
|
||||
# 钻石剑效果已移除
|
||||
|
||||
#================钻石剑效果========================
|
||||
|
||||
#================铁剑效果========================
|
||||
# 铁剑效果
|
||||
func apply_iron_sword_effect(pet):
|
||||
pet.base_attack_damage += 10.0
|
||||
pet.crit_rate += 0.05
|
||||
pet.attack_speed += 0.1
|
||||
# 铁剑效果已应用
|
||||
|
||||
# 移除铁剑效果
|
||||
func remove_iron_sword_effect(pet):
|
||||
pet.base_attack_damage -= 10.0
|
||||
pet.crit_rate -= 0.05
|
||||
pet.attack_speed -= 0.1
|
||||
# 铁剑效果已移除
|
||||
#================铁剑效果========================
|
||||
|
||||
|
||||
#================钻石斧效果========================
|
||||
# 钻石斧效果
|
||||
func apply_diamond_axe_effect(pet):
|
||||
pet.base_attack_damage += 20.0
|
||||
pet.armor_penetration += 0.2
|
||||
pet.knockback_force += 100.0
|
||||
# 钻石斧效果已应用
|
||||
|
||||
# 移除钻石斧效果
|
||||
func remove_diamond_axe_effect(pet):
|
||||
pet.base_attack_damage -= 20.0
|
||||
pet.armor_penetration -= 0.2
|
||||
pet.knockback_force -= 100.0
|
||||
# 钻石斧效果已移除
|
||||
#================钻石斧效果========================
|
||||
|
||||
|
||||
#================铁镐效果========================
|
||||
# 铁镐效果
|
||||
func apply_iron_pickaxe_effect(pet):
|
||||
pet.base_attack_damage += 8.0
|
||||
pet.armor_penetration += 0.3
|
||||
pet.attack_range += 20.0
|
||||
# 铁镐效果已应用
|
||||
|
||||
# 移除铁镐效果
|
||||
func remove_iron_pickaxe_effect(pet):
|
||||
pet.base_attack_damage -= 8.0
|
||||
pet.armor_penetration -= 0.3
|
||||
pet.attack_range -= 20.0
|
||||
# 铁镐效果已移除
|
||||
#================铁镐效果========================
|
||||
|
||||
|
||||
#======================武器系统通用函数==========================
|
||||
# 应用武器效果的主函数
|
||||
func apply_weapon_effect(pet, weapon_name: String):
|
||||
if not weapon_data.has(weapon_name):
|
||||
return
|
||||
|
||||
var weapon = weapon_data[weapon_name]
|
||||
var function_name = weapon.get("function", "")
|
||||
|
||||
if function_name != "":
|
||||
call(function_name, pet)
|
||||
|
||||
# 移除武器效果的函数
|
||||
func remove_weapon_effect(pet, weapon_name: String):
|
||||
if not weapon_data.has(weapon_name):
|
||||
return
|
||||
|
||||
var weapon = weapon_data[weapon_name]
|
||||
var function_name = weapon.get("function", "")
|
||||
|
||||
if function_name != "":
|
||||
# 将apply替换为remove来调用移除函数
|
||||
var remove_function_name = function_name.replace("apply_", "remove_")
|
||||
call(remove_function_name, pet)
|
||||
|
||||
# 获取武器图标路径
|
||||
func get_weapon_icon(weapon_name: String) -> String:
|
||||
if weapon_data.has(weapon_name):
|
||||
return weapon_data[weapon_name].get("icon", "")
|
||||
return ""
|
||||
|
||||
# 获取所有武器名称列表
|
||||
func get_all_weapon_names() -> Array:
|
||||
return weapon_data.keys()
|
||||
#======================武器系统通用函数==========================
|
||||
1
SproutFarm-Frontend/Scene/NewPet/WeaponBase.gd.uid
Normal file
1
SproutFarm-Frontend/Scene/NewPet/WeaponBase.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bpa6hp1mm6sj1
|
||||
28
SproutFarm-Frontend/Scene/Particle/Rain.tscn
Normal file
28
SproutFarm-Frontend/Scene/Particle/Rain.tscn
Normal file
@@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://3cr6q4he2y0x"]
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jiccn"]
|
||||
lifetime_randomness = 0.6
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(1000, 1, 1)
|
||||
direction = Vector3(0, 1, 0)
|
||||
spread = 0.0
|
||||
initial_velocity_min = 100.0
|
||||
initial_velocity_max = 400.0
|
||||
gravity = Vector3(0, 98, 0)
|
||||
scale_min = 4.0
|
||||
scale_max = 6.0
|
||||
color = Color(0, 0.380392, 1, 1)
|
||||
turbulence_influence_min = 0.02
|
||||
turbulence_influence_max = 0.08
|
||||
|
||||
[node name="Rain" type="GPUParticles2D"]
|
||||
visible = false
|
||||
z_index = 10
|
||||
amount = 450
|
||||
lifetime = 10.0
|
||||
preprocess = 20.0
|
||||
speed_scale = 1.5
|
||||
visibility_rect = Rect2(-900, 0, 2000, 2000)
|
||||
trail_lifetime = 0.01
|
||||
process_material = SubResource("ParticleProcessMaterial_jiccn")
|
||||
39
SproutFarm-Frontend/Scene/Particle/Snow.tscn
Normal file
39
SproutFarm-Frontend/Scene/Particle/Snow.tscn
Normal file
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dx7rtwu53mgxh"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dk4yl4ghmxaa2" path="res://assets/天气系统图片/雪花.webp" id="1_yj638"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_4ka7t"]
|
||||
_data = [Vector2(0, 0.951807), 0.0, 0.0, 0, 0, Vector2(1e-05, 0.963855), 0.0, 0.0, 0, 0, Vector2(0.0153846, 1), 0.0, 0.0, 0, 0, Vector2(0.0461538, 1), 0.0, 0.0, 0, 0, Vector2(0.561538, 0.819277), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 6
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_nf3jg"]
|
||||
curve = SubResource("Curve_4ka7t")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_adtqp"]
|
||||
offsets = PackedFloat32Array(0.52, 0.697143)
|
||||
colors = PackedColorArray(1, 1, 1, 0.352941, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_5dq3w"]
|
||||
gradient = SubResource("Gradient_adtqp")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4ka7t"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(1000, 1, 1)
|
||||
gravity = Vector3(45, 98, 0)
|
||||
scale_min = 0.4
|
||||
scale_max = 0.8
|
||||
color_initial_ramp = SubResource("GradientTexture1D_5dq3w")
|
||||
alpha_curve = SubResource("CurveTexture_nf3jg")
|
||||
turbulence_enabled = true
|
||||
turbulence_influence_min = 0.02
|
||||
turbulence_influence_max = 0.08
|
||||
|
||||
[node name="Snow" type="GPUParticles2D"]
|
||||
visible = false
|
||||
amount = 300
|
||||
texture = ExtResource("1_yj638")
|
||||
lifetime = 18.0
|
||||
preprocess = 30.0
|
||||
visibility_rect = Rect2(-900, 0, 2300, 2000)
|
||||
process_material = SubResource("ParticleProcessMaterial_4ka7t")
|
||||
25
SproutFarm-Frontend/Scene/Particle/WillowLeafRain.tscn
Normal file
25
SproutFarm-Frontend/Scene/Particle/WillowLeafRain.tscn
Normal file
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cvg38nsrm77jy"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bnv6wb0k443fv" path="res://assets/天气系统图片/柳叶2.webp" id="1_tq8cs"]
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_tdq2s"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(1000, 1, 1)
|
||||
gravity = Vector3(-30, 80, 0)
|
||||
scale_min = 0.4
|
||||
scale_max = 0.5
|
||||
turbulence_enabled = true
|
||||
turbulence_noise_speed = Vector3(10, 0, 0)
|
||||
turbulence_influence_min = 0.02
|
||||
turbulence_influence_max = 0.07
|
||||
|
||||
[node name="WillowLeafRain1" type="GPUParticles2D"]
|
||||
self_modulate = Color(0.7, 0.7, 0.7, 1)
|
||||
z_index = 10
|
||||
amount = 50
|
||||
texture = ExtResource("1_tq8cs")
|
||||
lifetime = 20.0
|
||||
preprocess = 10.0
|
||||
visibility_rect = Rect2(-900, 0, 2300, 2000)
|
||||
process_material = SubResource("ParticleProcessMaterial_tdq2s")
|
||||
477
SproutFarm-Frontend/Scene/SmallGame/2048Game.gd
Normal file
477
SproutFarm-Frontend/Scene/SmallGame/2048Game.gd
Normal file
@@ -0,0 +1,477 @@
|
||||
extends Panel
|
||||
|
||||
# 游戏常量
|
||||
const GRID_SIZE = 4
|
||||
const CELL_SIZE = 90
|
||||
const CELL_MARGIN = 10
|
||||
const SWIPE_THRESHOLD = 50
|
||||
const DATA_FILE_PATH = "user://playergamedata.json"
|
||||
|
||||
# 数字颜色配置
|
||||
const NUMBER_COLORS = {
|
||||
0: Color.TRANSPARENT,
|
||||
2: Color(0.93, 0.89, 0.85),
|
||||
4: Color(0.93, 0.88, 0.78),
|
||||
8: Color(0.95, 0.69, 0.47),
|
||||
16: Color(0.96, 0.58, 0.39),
|
||||
32: Color(0.96, 0.49, 0.37),
|
||||
64: Color(0.96, 0.37, 0.23),
|
||||
128: Color(0.93, 0.81, 0.45),
|
||||
256: Color(0.93, 0.80, 0.38),
|
||||
512: Color(0.93, 0.78, 0.31),
|
||||
1024: Color(0.93, 0.77, 0.25),
|
||||
2048: Color(0.93, 0.76, 0.18),
|
||||
4096: Color(0.93, 0.70, 0.15),
|
||||
8192: Color(0.93, 0.65, 0.12),
|
||||
16384: Color(0.93, 0.60, 0.10),
|
||||
32768: Color(0.93, 0.55, 0.08)
|
||||
}
|
||||
|
||||
const TEXT_COLORS = {
|
||||
2: Color.BLACK,
|
||||
4: Color.BLACK,
|
||||
8: Color.WHITE,
|
||||
16: Color.WHITE,
|
||||
32: Color.WHITE,
|
||||
64: Color.WHITE,
|
||||
128: Color.WHITE,
|
||||
256: Color.WHITE,
|
||||
512: Color.WHITE,
|
||||
1024: Color.WHITE,
|
||||
2048: Color.WHITE,
|
||||
4096: Color.WHITE,
|
||||
8192: Color.WHITE,
|
||||
16384: Color.WHITE,
|
||||
32768: Color.WHITE
|
||||
}
|
||||
|
||||
# 游戏变量
|
||||
var grid = []
|
||||
var score = 0
|
||||
var best_score = 0
|
||||
var game_over = false
|
||||
var won = false
|
||||
var can_continue = true
|
||||
var highest_tile = 0
|
||||
var games_played = 0
|
||||
var total_moves = 0
|
||||
var player_data = {}
|
||||
|
||||
# 触摸控制变量
|
||||
var touch_start_pos = Vector2.ZERO
|
||||
var is_touching = false
|
||||
|
||||
# 节点引用
|
||||
@onready var game_board = $GameBoard
|
||||
@onready var score_label = $ScoreLabel
|
||||
@onready var best_label = $BestLabel
|
||||
@onready var game_over_label = $GameOverLabel
|
||||
@onready var win_label = $WinLabel
|
||||
@onready var stats_label = $StatsLabel
|
||||
|
||||
func _ready():
|
||||
# 设置游戏板样式
|
||||
game_board.modulate = Color(0.7, 0.6, 0.5)
|
||||
|
||||
# 加载玩家数据
|
||||
load_player_data()
|
||||
|
||||
# 初始化游戏
|
||||
init_game()
|
||||
|
||||
func init_game():
|
||||
# 重置游戏状态
|
||||
game_over = false
|
||||
won = false
|
||||
can_continue = true
|
||||
score = 0
|
||||
games_played += 1
|
||||
|
||||
# 初始化网格
|
||||
grid.clear()
|
||||
for y in range(GRID_SIZE):
|
||||
var row = []
|
||||
for x in range(GRID_SIZE):
|
||||
row.append(0)
|
||||
grid.append(row)
|
||||
|
||||
# 添加两个初始数字
|
||||
add_random_number()
|
||||
add_random_number()
|
||||
|
||||
# 更新UI
|
||||
update_ui()
|
||||
hide_labels()
|
||||
|
||||
queue_redraw()
|
||||
|
||||
func _input(event):
|
||||
# 键盘输入
|
||||
if event is InputEventKey and event.pressed:
|
||||
if game_over:
|
||||
if event.keycode == KEY_R:
|
||||
init_game()
|
||||
return
|
||||
|
||||
if won and not can_continue:
|
||||
if event.keycode == KEY_C:
|
||||
can_continue = true
|
||||
win_label.visible = false
|
||||
return
|
||||
|
||||
# 移动控制
|
||||
var moved = false
|
||||
match event.keycode:
|
||||
KEY_UP, KEY_W:
|
||||
moved = move_up()
|
||||
KEY_DOWN, KEY_S:
|
||||
moved = move_down()
|
||||
KEY_LEFT, KEY_A:
|
||||
moved = move_left()
|
||||
KEY_RIGHT, KEY_D:
|
||||
moved = move_right()
|
||||
KEY_R:
|
||||
init_game()
|
||||
return
|
||||
|
||||
if moved:
|
||||
handle_successful_move()
|
||||
|
||||
# 触摸输入
|
||||
elif event is InputEventScreenTouch:
|
||||
if event.pressed:
|
||||
touch_start_pos = event.position
|
||||
is_touching = true
|
||||
else:
|
||||
if is_touching:
|
||||
handle_swipe(event.position)
|
||||
is_touching = false
|
||||
|
||||
# 鼠标输入(用于桌面测试)
|
||||
elif event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||
if event.pressed:
|
||||
touch_start_pos = event.position
|
||||
is_touching = true
|
||||
else:
|
||||
if is_touching:
|
||||
handle_swipe(event.position)
|
||||
is_touching = false
|
||||
|
||||
func move_left() -> bool:
|
||||
var moved = false
|
||||
for y in range(GRID_SIZE):
|
||||
var row = grid[y].duplicate()
|
||||
var new_row = merge_line(row)
|
||||
if new_row != grid[y]:
|
||||
moved = true
|
||||
grid[y] = new_row
|
||||
return moved
|
||||
|
||||
func move_right() -> bool:
|
||||
var moved = false
|
||||
for y in range(GRID_SIZE):
|
||||
var row = grid[y].duplicate()
|
||||
row.reverse()
|
||||
var new_row = merge_line(row)
|
||||
new_row.reverse()
|
||||
if new_row != grid[y]:
|
||||
moved = true
|
||||
grid[y] = new_row
|
||||
return moved
|
||||
|
||||
func move_up() -> bool:
|
||||
var moved = false
|
||||
for x in range(GRID_SIZE):
|
||||
var column = []
|
||||
for y in range(GRID_SIZE):
|
||||
column.append(grid[y][x])
|
||||
|
||||
var new_column = merge_line(column)
|
||||
var changed = false
|
||||
for y in range(GRID_SIZE):
|
||||
if grid[y][x] != new_column[y]:
|
||||
changed = true
|
||||
grid[y][x] = new_column[y]
|
||||
|
||||
if changed:
|
||||
moved = true
|
||||
return moved
|
||||
|
||||
func move_down() -> bool:
|
||||
var moved = false
|
||||
for x in range(GRID_SIZE):
|
||||
var column = []
|
||||
for y in range(GRID_SIZE):
|
||||
column.append(grid[y][x])
|
||||
|
||||
column.reverse()
|
||||
var new_column = merge_line(column)
|
||||
new_column.reverse()
|
||||
|
||||
var changed = false
|
||||
for y in range(GRID_SIZE):
|
||||
if grid[y][x] != new_column[y]:
|
||||
changed = true
|
||||
grid[y][x] = new_column[y]
|
||||
|
||||
if changed:
|
||||
moved = true
|
||||
return moved
|
||||
|
||||
func merge_line(line: Array) -> Array:
|
||||
# 移除零
|
||||
var filtered = []
|
||||
for num in line:
|
||||
if num != 0:
|
||||
filtered.append(num)
|
||||
|
||||
# 合并相同数字
|
||||
var merged = []
|
||||
var i = 0
|
||||
while i < filtered.size():
|
||||
if i < filtered.size() - 1 and filtered[i] == filtered[i + 1]:
|
||||
# 合并
|
||||
var new_value = filtered[i] * 2
|
||||
merged.append(new_value)
|
||||
score += new_value
|
||||
i += 2
|
||||
else:
|
||||
merged.append(filtered[i])
|
||||
i += 1
|
||||
|
||||
# 填充零到指定长度
|
||||
while merged.size() < GRID_SIZE:
|
||||
merged.append(0)
|
||||
|
||||
return merged
|
||||
|
||||
func add_random_number():
|
||||
var empty_cells = []
|
||||
for y in range(GRID_SIZE):
|
||||
for x in range(GRID_SIZE):
|
||||
if grid[y][x] == 0:
|
||||
empty_cells.append(Vector2(x, y))
|
||||
|
||||
if empty_cells.size() > 0:
|
||||
var random_cell = empty_cells[randi() % empty_cells.size()]
|
||||
var value = 2 if randf() < 0.9 else 4
|
||||
grid[random_cell.y][random_cell.x] = value
|
||||
|
||||
func handle_successful_move():
|
||||
total_moves += 1
|
||||
add_random_number()
|
||||
update_ui()
|
||||
check_game_state()
|
||||
save_player_data()
|
||||
queue_redraw()
|
||||
|
||||
func handle_swipe(end_pos: Vector2):
|
||||
if game_over or (won and not can_continue):
|
||||
return
|
||||
|
||||
var delta = end_pos - touch_start_pos
|
||||
var moved = false
|
||||
|
||||
if abs(delta.x) > SWIPE_THRESHOLD or abs(delta.y) > SWIPE_THRESHOLD:
|
||||
if abs(delta.x) > abs(delta.y):
|
||||
# 水平滑动
|
||||
if delta.x > 0:
|
||||
moved = move_right()
|
||||
else:
|
||||
moved = move_left()
|
||||
else:
|
||||
# 垂直滑动
|
||||
if delta.y > 0:
|
||||
moved = move_down()
|
||||
else:
|
||||
moved = move_up()
|
||||
|
||||
if moved:
|
||||
handle_successful_move()
|
||||
|
||||
func check_game_state():
|
||||
# 更新最高数字
|
||||
for y in range(GRID_SIZE):
|
||||
for x in range(GRID_SIZE):
|
||||
if grid[y][x] > highest_tile:
|
||||
highest_tile = grid[y][x]
|
||||
|
||||
# 检查是否达到2048或更高目标
|
||||
if not won:
|
||||
for y in range(GRID_SIZE):
|
||||
for x in range(GRID_SIZE):
|
||||
if grid[y][x] == 2048:
|
||||
won = true
|
||||
can_continue = false
|
||||
win_label.text = "恭喜!达到2048!\n按C继续挑战更高目标"
|
||||
win_label.visible = true
|
||||
return
|
||||
|
||||
# 检查是否游戏结束
|
||||
if not can_move():
|
||||
game_over = true
|
||||
if score > best_score:
|
||||
best_score = score
|
||||
game_over_label.visible = true
|
||||
|
||||
func can_move() -> bool:
|
||||
# 检查是否有空格
|
||||
for y in range(GRID_SIZE):
|
||||
for x in range(GRID_SIZE):
|
||||
if grid[y][x] == 0:
|
||||
return true
|
||||
|
||||
# 检查是否可以合并
|
||||
for y in range(GRID_SIZE):
|
||||
for x in range(GRID_SIZE):
|
||||
var current = grid[y][x]
|
||||
# 检查右边
|
||||
if x < GRID_SIZE - 1 and grid[y][x + 1] == current:
|
||||
return true
|
||||
# 检查下面
|
||||
if y < GRID_SIZE - 1 and grid[y + 1][x] == current:
|
||||
return true
|
||||
|
||||
return false
|
||||
|
||||
func update_ui():
|
||||
score_label.text = "分数: " + str(score)
|
||||
best_label.text = "最高分: " + str(best_score)
|
||||
if stats_label:
|
||||
stats_label.text = "游戏次数: " + str(games_played) + " | 总步数: " + str(total_moves)
|
||||
|
||||
func hide_labels():
|
||||
game_over_label.visible = false
|
||||
win_label.visible = false
|
||||
|
||||
func load_player_data():
|
||||
if FileAccess.file_exists(DATA_FILE_PATH):
|
||||
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.READ)
|
||||
if file:
|
||||
var json_string = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_string)
|
||||
if parse_result == OK:
|
||||
player_data = json.data
|
||||
if player_data.has("2048"):
|
||||
var game_data = player_data["2048"]
|
||||
best_score = game_data.get("best_score", 0)
|
||||
games_played = game_data.get("games_played", 0)
|
||||
highest_tile = game_data.get("highest_tile", 0)
|
||||
total_moves = game_data.get("total_moves", 0)
|
||||
|
||||
func save_player_data():
|
||||
if not player_data.has("2048"):
|
||||
player_data["2048"] = {}
|
||||
|
||||
player_data["2048"]["best_score"] = best_score
|
||||
player_data["2048"]["current_score"] = score
|
||||
player_data["2048"]["games_played"] = games_played
|
||||
player_data["2048"]["highest_tile"] = highest_tile
|
||||
player_data["2048"]["total_moves"] = total_moves
|
||||
|
||||
# 更新全局数据
|
||||
if not player_data.has("global"):
|
||||
player_data["global"] = {}
|
||||
player_data["global"]["last_played"] = Time.get_datetime_string_from_system()
|
||||
|
||||
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.WRITE)
|
||||
if file:
|
||||
var json_string = JSON.stringify(player_data)
|
||||
file.store_string(json_string)
|
||||
file.close()
|
||||
|
||||
func _draw():
|
||||
if not game_board:
|
||||
return
|
||||
|
||||
# 绘制背景渐变
|
||||
var gradient = Gradient.new()
|
||||
gradient.add_point(0.0, Color(0.2, 0.3, 0.5, 0.8))
|
||||
gradient.add_point(1.0, Color(0.1, 0.2, 0.4, 0.9))
|
||||
draw_rect(Rect2(Vector2.ZERO, size), gradient.sample(0.5), true)
|
||||
|
||||
# 获取游戏板位置
|
||||
var board_pos = game_board.position
|
||||
|
||||
# 绘制游戏板阴影
|
||||
var shadow_offset = Vector2(4, 4)
|
||||
var board_rect = Rect2(board_pos + shadow_offset, game_board.size)
|
||||
draw_rect(board_rect, Color(0, 0, 0, 0.3), true, 8)
|
||||
|
||||
# 绘制游戏板背景
|
||||
board_rect = Rect2(board_pos, game_board.size)
|
||||
draw_rect(board_rect, Color(0.7, 0.6, 0.5, 0.9), true, 8)
|
||||
|
||||
# 绘制网格
|
||||
for y in range(GRID_SIZE):
|
||||
for x in range(GRID_SIZE):
|
||||
var cell_x = board_pos.x + x * (CELL_SIZE + CELL_MARGIN) + CELL_MARGIN
|
||||
var cell_y = board_pos.y + y * (CELL_SIZE + CELL_MARGIN) + CELL_MARGIN
|
||||
var rect = Rect2(cell_x, cell_y, CELL_SIZE, CELL_SIZE)
|
||||
|
||||
# 绘制单元格阴影
|
||||
draw_rect(rect.grow(2), Color(0, 0, 0, 0.2), true)
|
||||
|
||||
# 绘制单元格背景
|
||||
draw_rect(rect, Color(0.8, 0.7, 0.6, 0.8), true)
|
||||
|
||||
# 绘制数字
|
||||
var value = grid[y][x]
|
||||
if value > 0:
|
||||
# 绘制数字背景(带渐变效果)
|
||||
var bg_color = NUMBER_COLORS.get(value, Color.GOLD)
|
||||
draw_rect(rect, bg_color, true)
|
||||
|
||||
# 绘制高光效果
|
||||
var highlight_rect = Rect2(rect.position, Vector2(rect.size.x, rect.size.y * 0.3))
|
||||
var highlight_color = Color(1, 1, 1, 0.3)
|
||||
draw_rect(highlight_rect, highlight_color, true)
|
||||
|
||||
# 绘制数字文本
|
||||
var text = str(value)
|
||||
var font_size = 24 if value < 100 else (20 if value < 1000 else (16 if value < 10000 else 14))
|
||||
var text_color = TEXT_COLORS.get(value, Color.WHITE)
|
||||
|
||||
# 获取默认字体
|
||||
var font = ThemeDB.fallback_font
|
||||
|
||||
# 计算文本尺寸
|
||||
var text_size = font.get_string_size(text, HORIZONTAL_ALIGNMENT_CENTER, -1, font_size)
|
||||
|
||||
# 计算文本位置(居中)
|
||||
var text_pos = Vector2(
|
||||
cell_x + (CELL_SIZE - text_size.x) / 2,
|
||||
cell_y + (CELL_SIZE - text_size.y) / 2 + text_size.y
|
||||
)
|
||||
|
||||
# 绘制文本阴影
|
||||
draw_string(font, text_pos + Vector2(1, 1), text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.5))
|
||||
# 绘制文本
|
||||
draw_string(font, text_pos, text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color)
|
||||
|
||||
|
||||
#退出2048游戏界面
|
||||
func _on_quit_button_pressed() -> void:
|
||||
self.hide()
|
||||
get_parent().remove_child(self)
|
||||
queue_free()
|
||||
pass
|
||||
|
||||
#手机端继续游戏按钮
|
||||
func _on_continue_button_pressed() -> void:
|
||||
if won and not can_continue:
|
||||
can_continue = true
|
||||
win_label.visible = false
|
||||
return
|
||||
pass
|
||||
|
||||
#手机端重置游戏按钮
|
||||
func _on_reast_button_pressed() -> void:
|
||||
if game_over:
|
||||
init_game()
|
||||
return
|
||||
pass
|
||||
1
SproutFarm-Frontend/Scene/SmallGame/2048Game.gd.uid
Normal file
1
SproutFarm-Frontend/Scene/SmallGame/2048Game.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://5dkxyuiuuhxk
|
||||
153
SproutFarm-Frontend/Scene/SmallGame/2048Game.tscn
Normal file
153
SproutFarm-Frontend/Scene/SmallGame/2048Game.tscn
Normal file
@@ -0,0 +1,153 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dn0f1hjolxori"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://5dkxyuiuuhxk" path="res://Scene/SmallGame/2048Game.gd" id="1_4d5vb"]
|
||||
|
||||
[node name="2048Game" type="Panel"]
|
||||
offset_right = 1400.0
|
||||
offset_bottom = 720.0
|
||||
script = ExtResource("1_4d5vb")
|
||||
|
||||
[node name="GameBoard" type="Panel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -217.0
|
||||
offset_top = -250.0
|
||||
offset_right = 183.0
|
||||
offset_bottom = 150.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ScoreLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 50.0
|
||||
offset_top = -100.0
|
||||
offset_right = 250.0
|
||||
offset_bottom = -70.0
|
||||
grow_vertical = 0
|
||||
text = "分数: 0"
|
||||
|
||||
[node name="BestLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 50.0
|
||||
offset_top = -70.0
|
||||
offset_right = 250.0
|
||||
offset_bottom = -40.0
|
||||
grow_vertical = 0
|
||||
text = "最高分: 0"
|
||||
|
||||
[node name="GameOverLabel" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -150.0
|
||||
offset_top = -50.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 50.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "游戏结束
|
||||
按R重新开始"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="WinLabel" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -150.0
|
||||
offset_top = -100.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = -50.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "恭喜!达到2048!
|
||||
按C继续游戏"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ControlsLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -350.0
|
||||
offset_top = -180.0
|
||||
offset_right = -50.0
|
||||
offset_bottom = -50.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
text = "操作说明:
|
||||
WASD或方向键 - 移动
|
||||
滑动屏幕 - 移动(手机)
|
||||
R - 重新开始
|
||||
C - 继续游戏(达到2048后)
|
||||
|
||||
目标: 合并数字达到2048或更高!"
|
||||
|
||||
[node name="StatsLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 50.0
|
||||
offset_top = -40.0
|
||||
offset_right = 300.0
|
||||
offset_bottom = -10.0
|
||||
grow_vertical = 0
|
||||
text = "游戏次数: 0 | 总步数: 0"
|
||||
|
||||
[node name="ReastButton" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 19.0
|
||||
offset_top = 19.0
|
||||
offset_right = 97.0
|
||||
offset_bottom = 76.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "重置"
|
||||
|
||||
[node name="ContinueButton" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 97.0
|
||||
offset_top = 19.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 76.0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "继续"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="."]
|
||||
self_modulate = Color(1, 0.247059, 0, 1)
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -129.0
|
||||
offset_right = -46.0
|
||||
offset_bottom = 57.0
|
||||
grow_horizontal = 0
|
||||
scale = Vector2(1.54345, 1.50915)
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "关闭"
|
||||
|
||||
[connection signal="pressed" from="ReastButton" to="." method="_on_reast_button_pressed"]
|
||||
[connection signal="pressed" from="ContinueButton" to="." method="_on_continue_button_pressed"]
|
||||
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
811
SproutFarm-Frontend/Scene/SmallGame/PushBox.gd
Normal file
811
SproutFarm-Frontend/Scene/SmallGame/PushBox.gd
Normal file
@@ -0,0 +1,811 @@
|
||||
extends Panel
|
||||
|
||||
# 游戏常量
|
||||
const CELL_SIZE = 40
|
||||
const DATA_FILE_PATH = "user://playergamedata.json"
|
||||
|
||||
# 地图元素
|
||||
enum CellType {
|
||||
EMPTY, # 空地
|
||||
WALL, # 墙壁
|
||||
TARGET, # 目标点
|
||||
BOX, # 箱子
|
||||
PLAYER, # 玩家
|
||||
BOX_ON_TARGET # 箱子在目标点上
|
||||
}
|
||||
|
||||
# 颜色配置
|
||||
const CELL_COLORS = {
|
||||
CellType.EMPTY: Color.WHITE,
|
||||
CellType.WALL: Color.DARK_GRAY,
|
||||
CellType.TARGET: Color.LIGHT_BLUE,
|
||||
CellType.BOX: Color.SADDLE_BROWN,
|
||||
CellType.PLAYER: Color.GREEN,
|
||||
CellType.BOX_ON_TARGET: Color.DARK_GREEN
|
||||
}
|
||||
|
||||
# 关卡数据
|
||||
const LEVELS = [
|
||||
# 关卡1 - 简单入门
|
||||
[
|
||||
"########",
|
||||
"#......#",
|
||||
"#..##..#",
|
||||
"#..#*..#",
|
||||
"#..#$..#",
|
||||
"#..@...#",
|
||||
"#......#",
|
||||
"########"
|
||||
],
|
||||
# 关卡2 - 两个箱子
|
||||
[
|
||||
"########",
|
||||
"#......#",
|
||||
"#.*$*..#",
|
||||
"#......#",
|
||||
"#..$...#",
|
||||
"#..@...#",
|
||||
"#......#",
|
||||
"########"
|
||||
],
|
||||
# 关卡3 - 稍微复杂
|
||||
[
|
||||
"##########",
|
||||
"#........#",
|
||||
"#..####..#",
|
||||
"#..*##*..#",
|
||||
"#..$$....#",
|
||||
"#........#",
|
||||
"#...@....#",
|
||||
"#........#",
|
||||
"##########"
|
||||
],
|
||||
# 关卡4 - 更复杂的布局
|
||||
[
|
||||
"############",
|
||||
"#..........#",
|
||||
"#..######..#",
|
||||
"#..*....#..#",
|
||||
"#..$....#..#",
|
||||
"#.......#..#",
|
||||
"#..#....#..#",
|
||||
"#..*....#..#",
|
||||
"#..$......@#",
|
||||
"#..........#",
|
||||
"############"
|
||||
],
|
||||
# 关卡5 - 角落挑战
|
||||
[
|
||||
"#########",
|
||||
"#*......#",
|
||||
"#.##....#",
|
||||
"#.#$....#",
|
||||
"#.#.....#",
|
||||
"#.#.....#",
|
||||
"#.......#",
|
||||
"#......@#",
|
||||
"#########"
|
||||
],
|
||||
# 关卡6 - 多箱子排列
|
||||
[
|
||||
"##########",
|
||||
"#........#",
|
||||
"#.*.*.*..#",
|
||||
"#........#",
|
||||
"#.$.$.$..#",
|
||||
"#........#",
|
||||
"#....@...#",
|
||||
"#........#",
|
||||
"##########"
|
||||
],
|
||||
# 关卡7 - 迷宫式
|
||||
[
|
||||
"############",
|
||||
"#..........#",
|
||||
"#.##.##.##.#",
|
||||
"#.*#.#*.#*.#",
|
||||
"#..#.#..#..#",
|
||||
"#.$#.#$.#$.#",
|
||||
"#..#.#..#..#",
|
||||
"#..#.#..#..#",
|
||||
"#..........#",
|
||||
"#....@.....#",
|
||||
"############"
|
||||
],
|
||||
# 关卡8 - 紧密配合
|
||||
[
|
||||
"#########",
|
||||
"#.......#",
|
||||
"#.##*##.#",
|
||||
"#.#$.$#.#",
|
||||
"#.#*.*#.#",
|
||||
"#.#$.$#.#",
|
||||
"#.##*##.#",
|
||||
"#...@...#",
|
||||
"#########"
|
||||
],
|
||||
# 关卡9 - 长廊挑战
|
||||
[
|
||||
"##############",
|
||||
"#............#",
|
||||
"#.##########.#",
|
||||
"#.*........*.#",
|
||||
"#.$.......$.#",
|
||||
"#............#",
|
||||
"#............#",
|
||||
"#.$.......$.#",
|
||||
"#.*........*.#",
|
||||
"#.##########.#",
|
||||
"#......@.....#",
|
||||
"##############"
|
||||
],
|
||||
# 关卡10 - 螺旋结构
|
||||
[
|
||||
"###########",
|
||||
"#.........#",
|
||||
"#.#######.#",
|
||||
"#.#*...#.#",
|
||||
"#.#.#$.#.#",
|
||||
"#.#.#*.#.#",
|
||||
"#.#.#$.#.#",
|
||||
"#.#...#.#",
|
||||
"#.#####.#",
|
||||
"#...@...#",
|
||||
"###########"
|
||||
],
|
||||
# 关卡11 - 对称美学
|
||||
[
|
||||
"############",
|
||||
"#..........#",
|
||||
"#.*#....#*.#",
|
||||
"#.$#....#$.#",
|
||||
"#..#....#..#",
|
||||
"#..........#",
|
||||
"#..........#",
|
||||
"#..#....#..#",
|
||||
"#.$#....#$.#",
|
||||
"#.*#....#*.#",
|
||||
"#.....@....#",
|
||||
"############"
|
||||
],
|
||||
# 关卡12 - 十字路口
|
||||
[
|
||||
"###########",
|
||||
"#.........#",
|
||||
"#....#....#",
|
||||
"#.*..#..*#",
|
||||
"#.$.###.$.#",
|
||||
"#...#@#...#",
|
||||
"#.$.###.$.#",
|
||||
"#.*..#..*#",
|
||||
"#....#....#",
|
||||
"#.........#",
|
||||
"###########"
|
||||
],
|
||||
# 关卡13 - 复杂迷宫
|
||||
[
|
||||
"##############",
|
||||
"#............#",
|
||||
"#.##.####.##.#",
|
||||
"#.*#......#*.#",
|
||||
"#.$#.####.#$.#",
|
||||
"#..#.#..#.#..#",
|
||||
"#....#..#....#",
|
||||
"#..#.#..#.#..#",
|
||||
"#.$#.####.#$.#",
|
||||
"#.*#......#*.#",
|
||||
"#.##.####.##.#",
|
||||
"#......@.....#",
|
||||
"##############"
|
||||
],
|
||||
# 关卡14 - 精密操作
|
||||
[
|
||||
"##########",
|
||||
"#........#",
|
||||
"#.######.#",
|
||||
"#.#*..*.#",
|
||||
"#.#$..$.#",
|
||||
"#.#....#.#",
|
||||
"#.#$..$.#",
|
||||
"#.#*..*.#",
|
||||
"#.######.#",
|
||||
"#...@....#",
|
||||
"##########"
|
||||
],
|
||||
# 关卡15 - 终极挑战
|
||||
[
|
||||
"###############",
|
||||
"#.............#",
|
||||
"#.###.###.###.#",
|
||||
"#.*#*.*#*.*#*.#",
|
||||
"#.$#$.$#$.$#$.#",
|
||||
"#.###.###.###.#",
|
||||
"#.............#",
|
||||
"#.###.###.###.#",
|
||||
"#.$#$.$#$.$#$.#",
|
||||
"#.*#*.*#*.*#*.#",
|
||||
"#.###.###.###.#",
|
||||
"#.......@.....#",
|
||||
"###############"
|
||||
],
|
||||
# 关卡16 - 狭窄通道
|
||||
[
|
||||
"#############",
|
||||
"#...........#",
|
||||
"#.#.#.#.#.#.#",
|
||||
"#*#*#*#*#*#*#",
|
||||
"#$#$#$#$#$#$#",
|
||||
"#.#.#.#.#.#.#",
|
||||
"#...........#",
|
||||
"#.#.#.#.#.#.#",
|
||||
"#$#$#$#$#$#$#",
|
||||
"#*#*#*#*#*#*#",
|
||||
"#.#.#.#.#.#.#",
|
||||
"#.....@.....#",
|
||||
"#############"
|
||||
],
|
||||
# 关卡17 - 环形结构
|
||||
[
|
||||
"##############",
|
||||
"#............#",
|
||||
"#.##########.#",
|
||||
"#.#........#.#",
|
||||
"#.#.######.#.#",
|
||||
"#.#.#*..*.#.#.#",
|
||||
"#.#.#$..$.#.#.#",
|
||||
"#.#.#....#.#.#",
|
||||
"#.#.######.#.#",
|
||||
"#.#........#.#",
|
||||
"#.##########.#",
|
||||
"#......@.....#",
|
||||
"##############"
|
||||
],
|
||||
# 关卡18 - 多层迷宫
|
||||
[
|
||||
"################",
|
||||
"#..............#",
|
||||
"#.############.#",
|
||||
"#.#*........*.#.#",
|
||||
"#.#$........$.#.#",
|
||||
"#.#..########..#.#",
|
||||
"#.#..#*....*.#..#.#",
|
||||
"#.#..#$....$.#..#.#",
|
||||
"#.#..########..#.#",
|
||||
"#.#$........$.#.#",
|
||||
"#.#*........*.#.#",
|
||||
"#.############.#",
|
||||
"#........@.....#",
|
||||
"################"
|
||||
],
|
||||
# 关卡19 - 钻石形状
|
||||
[
|
||||
"#########",
|
||||
"#.......#",
|
||||
"#...*...#",
|
||||
"#..*$*..#",
|
||||
"#.*$@$*.#",
|
||||
"#..*$*..#",
|
||||
"#...*...#",
|
||||
"#.......#",
|
||||
"#########"
|
||||
],
|
||||
# 关卡20 - 复杂交叉
|
||||
[
|
||||
"###############",
|
||||
"#.............#",
|
||||
"#.#.#.#.#.#.#.#",
|
||||
"#*#*#*#*#*#*#*#",
|
||||
"#$#$#$#$#$#$#$#",
|
||||
"#.#.#.#.#.#.#.#",
|
||||
"#.............#",
|
||||
"#.#.#.#.#.#.#.#",
|
||||
"#$#$#$#$#$#$#$#",
|
||||
"#*#*#*#*#*#*#*#",
|
||||
"#.#.#.#.#.#.#.#",
|
||||
"#.............#",
|
||||
"#.#.#.#@#.#.#.#",
|
||||
"#.............#",
|
||||
"###############"
|
||||
],
|
||||
# 关卡21 - 螺旋深渊
|
||||
[
|
||||
"#############",
|
||||
"#...........#",
|
||||
"#.#########.#",
|
||||
"#.#.......#.#",
|
||||
"#.#.#####.#.#",
|
||||
"#.#.#*..#.#.#",
|
||||
"#.#.#$#.#.#.#",
|
||||
"#.#.#*#.#.#.#",
|
||||
"#.#.#$#.#.#.#",
|
||||
"#.#.###.#.#.#",
|
||||
"#.#.....#.#.#",
|
||||
"#.#######.#.#",
|
||||
"#.........#.#",
|
||||
"#.....@...#.#",
|
||||
"#############"
|
||||
],
|
||||
# 关卡22 - 双重挑战
|
||||
[
|
||||
"##############",
|
||||
"#............#",
|
||||
"#.####..####.#",
|
||||
"#.#*.#..#.*#.#",
|
||||
"#.#$.#..#.$#.#",
|
||||
"#.#..####..#.#",
|
||||
"#.#........#.#",
|
||||
"#.#........#.#",
|
||||
"#.#..####..#.#",
|
||||
"#.#$.#..#.$#.#",
|
||||
"#.#*.#..#.*#.#",
|
||||
"#.####..####.#",
|
||||
"#......@.....#",
|
||||
"##############"
|
||||
],
|
||||
# 关卡23 - 星形布局
|
||||
[
|
||||
"###########",
|
||||
"#.........#",
|
||||
"#....#....#",
|
||||
"#.#.*#*.#.#",
|
||||
"#.#$###$#.#",
|
||||
"#.*#.@.#*.#",
|
||||
"#.#$###$#.#",
|
||||
"#.#.*#*.#.#",
|
||||
"#....#....#",
|
||||
"#.........#",
|
||||
"###########"
|
||||
],
|
||||
# 关卡24 - 终极迷宫
|
||||
[
|
||||
"################",
|
||||
"#..............#",
|
||||
"#.############.#",
|
||||
"#.#*.........*.#",
|
||||
"#.#$#########$#.#",
|
||||
"#.#.#*......*.#.#",
|
||||
"#.#.#$######$#.#.#",
|
||||
"#.#.#.#*..*.#.#.#.#",
|
||||
"#.#.#.#$..$.#.#.#.#",
|
||||
"#.#.#.######.#.#.#",
|
||||
"#.#.#........#.#.#",
|
||||
"#.#.##########.#.#",
|
||||
"#.#............#.#",
|
||||
"#.##############.#",
|
||||
"#........@.......#",
|
||||
"################"
|
||||
],
|
||||
# 关卡25 - 大师级挑战
|
||||
[
|
||||
"#################",
|
||||
"#...............#",
|
||||
"#.#############.#",
|
||||
"#.#*.*.*.*.*.*#.#",
|
||||
"#.#$.$.$.$.$.$#.#",
|
||||
"#.#.###########.#",
|
||||
"#.#.#*.*.*.*.*#.#",
|
||||
"#.#.#$.$.$.$.$#.#",
|
||||
"#.#.#.#######.#.#",
|
||||
"#.#.#.#*.*.*#.#.#",
|
||||
"#.#.#.#$.$.$#.#.#",
|
||||
"#.#.#.#####.#.#.#",
|
||||
"#.#.#.......#.#.#",
|
||||
"#.#.#########.#.#",
|
||||
"#.#...........#.#",
|
||||
"#.#############.#",
|
||||
"#.........@.....#",
|
||||
"#################"
|
||||
]
|
||||
]
|
||||
|
||||
# 游戏变量
|
||||
var current_level = 0
|
||||
var level_data = []
|
||||
var player_pos = Vector2()
|
||||
var moves = 0
|
||||
var level_completed = false
|
||||
var map_width = 0
|
||||
var map_height = 0
|
||||
var total_moves = 0
|
||||
var levels_completed = 0
|
||||
var best_moves_per_level = {}
|
||||
var player_data = {}
|
||||
|
||||
# 节点引用
|
||||
@onready var game_area = $GameArea
|
||||
@onready var level_label = $LevelLabel
|
||||
@onready var moves_label = $MovesLabel
|
||||
@onready var win_label = $WinLabel
|
||||
@onready var stats_label = $StatsLabel
|
||||
@onready var virtual_controls = $VirtualControls
|
||||
|
||||
func _ready():
|
||||
# 设置游戏区域样式
|
||||
game_area.modulate = Color(0.9, 0.9, 0.9)
|
||||
|
||||
# 加载玩家数据
|
||||
load_player_data()
|
||||
|
||||
# 初始化游戏
|
||||
init_level()
|
||||
|
||||
# 设置虚拟按键
|
||||
setup_virtual_controls()
|
||||
|
||||
func init_level():
|
||||
# 重置游戏状态
|
||||
level_completed = false
|
||||
moves = 0
|
||||
|
||||
# 加载当前关卡
|
||||
load_level(current_level)
|
||||
|
||||
# 更新UI
|
||||
update_ui()
|
||||
win_label.visible = false
|
||||
|
||||
queue_redraw()
|
||||
|
||||
func load_level(level_index: int):
|
||||
if level_index >= LEVELS.size():
|
||||
level_index = LEVELS.size() - 1
|
||||
|
||||
var level_strings = LEVELS[level_index]
|
||||
map_height = level_strings.size()
|
||||
map_width = level_strings[0].length()
|
||||
|
||||
# 初始化关卡数据
|
||||
level_data.clear()
|
||||
for y in range(map_height):
|
||||
var row = []
|
||||
for x in range(map_width):
|
||||
row.append(CellType.EMPTY)
|
||||
level_data.append(row)
|
||||
|
||||
# 解析关卡字符串
|
||||
for y in range(map_height):
|
||||
var line = level_strings[y]
|
||||
for x in range(line.length()):
|
||||
var char = line[x]
|
||||
match char:
|
||||
'#': # 墙壁
|
||||
level_data[y][x] = CellType.WALL
|
||||
'*': # 目标点
|
||||
level_data[y][x] = CellType.TARGET
|
||||
'$': # 箱子
|
||||
level_data[y][x] = CellType.BOX
|
||||
'@': # 玩家
|
||||
level_data[y][x] = CellType.PLAYER
|
||||
player_pos = Vector2(x, y)
|
||||
'+': # 箱子在目标点上
|
||||
level_data[y][x] = CellType.BOX_ON_TARGET
|
||||
'.': # 空地
|
||||
level_data[y][x] = CellType.EMPTY
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventKey and event.pressed:
|
||||
if level_completed:
|
||||
match event.keycode:
|
||||
KEY_N:
|
||||
next_level()
|
||||
KEY_R:
|
||||
init_level()
|
||||
return
|
||||
|
||||
# 移动控制
|
||||
var direction = Vector2.ZERO
|
||||
match event.keycode:
|
||||
KEY_UP, KEY_W:
|
||||
direction = Vector2(0, -1)
|
||||
KEY_DOWN, KEY_S:
|
||||
direction = Vector2(0, 1)
|
||||
KEY_LEFT, KEY_A:
|
||||
direction = Vector2(-1, 0)
|
||||
KEY_RIGHT, KEY_D:
|
||||
direction = Vector2(1, 0)
|
||||
KEY_R:
|
||||
init_level()
|
||||
return
|
||||
KEY_P:
|
||||
prev_level()
|
||||
return
|
||||
KEY_N:
|
||||
next_level()
|
||||
return
|
||||
|
||||
if direction != Vector2.ZERO:
|
||||
move_player(direction)
|
||||
|
||||
func move_player(direction: Vector2):
|
||||
var new_pos = player_pos + direction
|
||||
|
||||
# 检查边界
|
||||
if new_pos.x < 0 or new_pos.x >= map_width or new_pos.y < 0 or new_pos.y >= map_height:
|
||||
return
|
||||
|
||||
var target_cell = level_data[new_pos.y][new_pos.x]
|
||||
|
||||
# 检查是否撞墙
|
||||
if target_cell == CellType.WALL:
|
||||
return
|
||||
|
||||
# 检查是否推箱子
|
||||
if target_cell == CellType.BOX or target_cell == CellType.BOX_ON_TARGET:
|
||||
var box_new_pos = new_pos + direction
|
||||
|
||||
# 检查箱子新位置是否有效
|
||||
if box_new_pos.x < 0 or box_new_pos.x >= map_width or box_new_pos.y < 0 or box_new_pos.y >= map_height:
|
||||
return
|
||||
|
||||
var box_target_cell = level_data[box_new_pos.y][box_new_pos.x]
|
||||
|
||||
# 箱子不能推到墙上或其他箱子上
|
||||
if box_target_cell == CellType.WALL or box_target_cell == CellType.BOX or box_target_cell == CellType.BOX_ON_TARGET:
|
||||
return
|
||||
|
||||
# 移动箱子
|
||||
var was_on_target = (target_cell == CellType.BOX_ON_TARGET)
|
||||
var moving_to_target = (box_target_cell == CellType.TARGET)
|
||||
|
||||
# 更新箱子原位置
|
||||
if was_on_target:
|
||||
level_data[new_pos.y][new_pos.x] = CellType.TARGET
|
||||
else:
|
||||
level_data[new_pos.y][new_pos.x] = CellType.EMPTY
|
||||
|
||||
# 更新箱子新位置
|
||||
if moving_to_target:
|
||||
level_data[box_new_pos.y][box_new_pos.x] = CellType.BOX_ON_TARGET
|
||||
else:
|
||||
level_data[box_new_pos.y][box_new_pos.x] = CellType.BOX
|
||||
|
||||
# 移动玩家
|
||||
# 恢复玩家原位置(检查是否在目标点上)
|
||||
var level_strings = LEVELS[current_level]
|
||||
if player_pos.y < level_strings.size() and player_pos.x < level_strings[player_pos.y].length():
|
||||
var original_char = level_strings[player_pos.y][player_pos.x]
|
||||
if original_char == '*': # 玩家原来在目标点上
|
||||
level_data[player_pos.y][player_pos.x] = CellType.TARGET
|
||||
else:
|
||||
level_data[player_pos.y][player_pos.x] = CellType.EMPTY
|
||||
else:
|
||||
level_data[player_pos.y][player_pos.x] = CellType.EMPTY
|
||||
|
||||
# 更新玩家位置
|
||||
player_pos = new_pos
|
||||
level_data[player_pos.y][player_pos.x] = CellType.PLAYER
|
||||
|
||||
# 增加步数
|
||||
moves += 1
|
||||
total_moves += 1
|
||||
|
||||
# 检查是否过关
|
||||
check_win_condition()
|
||||
|
||||
# 更新UI和重绘
|
||||
update_ui()
|
||||
save_player_data()
|
||||
queue_redraw()
|
||||
|
||||
func check_win_condition():
|
||||
# 检查是否所有箱子都在目标点上
|
||||
for y in range(map_height):
|
||||
for x in range(map_width):
|
||||
if level_data[y][x] == CellType.BOX:
|
||||
return # 还有箱子不在目标点上
|
||||
|
||||
# 所有箱子都在目标点上,过关!
|
||||
level_completed = true
|
||||
levels_completed += 1
|
||||
|
||||
# 记录最佳步数
|
||||
var level_key = str(current_level + 1)
|
||||
if not best_moves_per_level.has(level_key) or moves < best_moves_per_level[level_key]:
|
||||
best_moves_per_level[level_key] = moves
|
||||
|
||||
win_label.text = "恭喜过关!\n步数: " + str(moves) + "\n最佳: " + str(best_moves_per_level.get(level_key, moves)) + "\n按N进入下一关\n按R重新开始"
|
||||
win_label.visible = true
|
||||
|
||||
func next_level():
|
||||
if current_level < LEVELS.size() - 1:
|
||||
current_level += 1
|
||||
init_level()
|
||||
else:
|
||||
win_label.text = "恭喜!你已完成所有关卡!\n总步数: " + str(total_moves) + "\n按R重新开始第一关"
|
||||
|
||||
func prev_level():
|
||||
if current_level > 0:
|
||||
current_level -= 1
|
||||
init_level()
|
||||
|
||||
func update_ui():
|
||||
level_label.text = "关卡: " + str(current_level + 1) + "/" + str(LEVELS.size())
|
||||
moves_label.text = "步数: " + str(moves)
|
||||
if stats_label:
|
||||
stats_label.text = "已完成: " + str(levels_completed) + " | 总步数: " + str(total_moves)
|
||||
|
||||
func setup_virtual_controls():
|
||||
if not virtual_controls:
|
||||
return
|
||||
|
||||
# 连接虚拟按键信号
|
||||
var up_btn = virtual_controls.get_node("UpButton")
|
||||
var down_btn = virtual_controls.get_node("DownButton")
|
||||
var left_btn = virtual_controls.get_node("LeftButton")
|
||||
var right_btn = virtual_controls.get_node("RightButton")
|
||||
var reset_btn = virtual_controls.get_node("ResetButton")
|
||||
|
||||
if up_btn:
|
||||
up_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(0, -1)))
|
||||
if down_btn:
|
||||
down_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(0, 1)))
|
||||
if left_btn:
|
||||
left_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(-1, 0)))
|
||||
if right_btn:
|
||||
right_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(1, 0)))
|
||||
if reset_btn:
|
||||
reset_btn.pressed.connect(init_level)
|
||||
|
||||
func _on_virtual_button_pressed(direction: Vector2):
|
||||
if not level_completed:
|
||||
move_player(direction)
|
||||
|
||||
func load_player_data():
|
||||
if FileAccess.file_exists(DATA_FILE_PATH):
|
||||
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.READ)
|
||||
if file:
|
||||
var json_string = file.get_as_text()
|
||||
file.close()
|
||||
|
||||
var json = JSON.new()
|
||||
var parse_result = json.parse(json_string)
|
||||
if parse_result == OK:
|
||||
player_data = json.data
|
||||
if player_data.has("pushbox"):
|
||||
var game_data = player_data["pushbox"]
|
||||
current_level = game_data.get("current_level", 0)
|
||||
total_moves = game_data.get("total_moves", 0)
|
||||
levels_completed = game_data.get("levels_completed", 0)
|
||||
best_moves_per_level = game_data.get("best_moves_per_level", {})
|
||||
|
||||
func save_player_data():
|
||||
if not player_data.has("pushbox"):
|
||||
player_data["pushbox"] = {}
|
||||
|
||||
player_data["pushbox"]["current_level"] = current_level
|
||||
player_data["pushbox"]["max_level_reached"] = max(current_level, player_data.get("pushbox", {}).get("max_level_reached", 0))
|
||||
player_data["pushbox"]["total_moves"] = total_moves
|
||||
player_data["pushbox"]["levels_completed"] = levels_completed
|
||||
player_data["pushbox"]["best_moves_per_level"] = best_moves_per_level
|
||||
|
||||
# 更新全局数据
|
||||
if not player_data.has("global"):
|
||||
player_data["global"] = {}
|
||||
player_data["global"]["last_played"] = Time.get_datetime_string_from_system()
|
||||
|
||||
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.WRITE)
|
||||
if file:
|
||||
var json_string = JSON.stringify(player_data)
|
||||
file.store_string(json_string)
|
||||
file.close()
|
||||
|
||||
func _draw():
|
||||
if not game_area:
|
||||
return
|
||||
|
||||
# 绘制背景渐变
|
||||
var gradient = Gradient.new()
|
||||
gradient.add_point(0.0, Color(0.15, 0.25, 0.35, 0.9))
|
||||
gradient.add_point(1.0, Color(0.1, 0.15, 0.25, 0.95))
|
||||
draw_rect(Rect2(Vector2.ZERO, size), gradient.sample(0.5), true)
|
||||
|
||||
# 获取游戏区域位置
|
||||
var area_pos = game_area.position
|
||||
|
||||
# 绘制游戏区域阴影
|
||||
var shadow_offset = Vector2(6, 6)
|
||||
var area_rect = Rect2(area_pos + shadow_offset, game_area.size)
|
||||
draw_rect(area_rect, Color(0, 0, 0, 0.4), true)
|
||||
|
||||
# 绘制游戏区域背景
|
||||
area_rect = Rect2(area_pos, game_area.size)
|
||||
draw_rect(area_rect, Color(0.8, 0.75, 0.7, 0.95), true)
|
||||
|
||||
# 计算起始绘制位置(居中)
|
||||
var start_x = area_pos.x + (game_area.size.x - map_width * CELL_SIZE) / 2
|
||||
var start_y = area_pos.y + (game_area.size.y - map_height * CELL_SIZE) / 2
|
||||
|
||||
# 绘制地图
|
||||
for y in range(map_height):
|
||||
for x in range(map_width):
|
||||
var cell_x = start_x + x * CELL_SIZE
|
||||
var cell_y = start_y + y * CELL_SIZE
|
||||
var rect = Rect2(cell_x, cell_y, CELL_SIZE, CELL_SIZE)
|
||||
|
||||
var cell_type = level_data[y][x]
|
||||
|
||||
# 绘制单元格阴影
|
||||
draw_rect(rect.grow(1), Color(0, 0, 0, 0.2), true)
|
||||
|
||||
# 根据类型绘制不同效果
|
||||
match cell_type:
|
||||
CellType.EMPTY:
|
||||
draw_rect(rect, Color(0.9, 0.85, 0.8, 0.7), true)
|
||||
CellType.WALL:
|
||||
# 绘制立体墙壁效果
|
||||
draw_rect(rect, Color(0.3, 0.3, 0.3), true)
|
||||
# 高光
|
||||
var highlight_rect = Rect2(rect.position, Vector2(rect.size.x, rect.size.y * 0.3))
|
||||
draw_rect(highlight_rect, Color(0.5, 0.5, 0.5, 0.8), true)
|
||||
CellType.TARGET:
|
||||
# 绘制目标点(带光晕效果)
|
||||
draw_rect(rect, Color(0.6, 0.8, 1.0, 0.8), true)
|
||||
# 内圈
|
||||
var inner_rect = rect.grow(-8)
|
||||
draw_rect(inner_rect, Color(0.4, 0.6, 0.9, 0.9), true)
|
||||
CellType.BOX:
|
||||
# 绘制立体箱子
|
||||
draw_rect(rect, Color(0.7, 0.5, 0.3), true)
|
||||
# 高光
|
||||
var box_highlight = Rect2(rect.position + Vector2(2, 2), Vector2(rect.size.x - 4, rect.size.y * 0.3))
|
||||
draw_rect(box_highlight, Color(0.9, 0.7, 0.5, 0.8), true)
|
||||
# 边框
|
||||
draw_rect(rect, Color(0.5, 0.3, 0.1), false, 2)
|
||||
CellType.PLAYER:
|
||||
# 检查玩家下面是否有目标点
|
||||
var level_strings = LEVELS[current_level]
|
||||
if y < level_strings.size() and x < level_strings[y].length():
|
||||
var original_char = level_strings[y][x]
|
||||
if original_char == '*': # 玩家在目标点上
|
||||
# 先绘制目标点
|
||||
draw_rect(rect, Color(0.6, 0.8, 1.0, 0.8), true)
|
||||
var inner_rect = rect.grow(-8)
|
||||
draw_rect(inner_rect, Color(0.4, 0.6, 0.9, 0.9), true)
|
||||
else:
|
||||
draw_rect(rect, Color(0.9, 0.85, 0.8, 0.7), true)
|
||||
else:
|
||||
draw_rect(rect, Color(0.9, 0.85, 0.8, 0.7), true)
|
||||
|
||||
# 绘制玩家(圆形)
|
||||
var center = rect.get_center()
|
||||
var radius = min(rect.size.x, rect.size.y) * 0.3
|
||||
# 阴影
|
||||
draw_circle(center + Vector2(1, 1), radius, Color(0, 0, 0, 0.3))
|
||||
# 玩家主体
|
||||
draw_circle(center, radius, Color(0.2, 0.8, 0.2))
|
||||
# 高光
|
||||
draw_circle(center - Vector2(2, 2), radius * 0.5, Color(0.6, 1.0, 0.6, 0.7))
|
||||
CellType.BOX_ON_TARGET:
|
||||
# 绘制目标点背景
|
||||
draw_rect(rect, Color(0.6, 0.8, 1.0, 0.8), true)
|
||||
var inner_rect = rect.grow(-8)
|
||||
draw_rect(inner_rect, Color(0.4, 0.6, 0.9, 0.9), true)
|
||||
|
||||
# 绘制完成的箱子(绿色)
|
||||
var box_rect = rect.grow(-4)
|
||||
draw_rect(box_rect, Color(0.2, 0.7, 0.2), true)
|
||||
# 高光
|
||||
var box_highlight = Rect2(box_rect.position + Vector2(2, 2), Vector2(box_rect.size.x - 4, box_rect.size.y * 0.3))
|
||||
draw_rect(box_highlight, Color(0.4, 0.9, 0.4, 0.8), true)
|
||||
# 边框
|
||||
draw_rect(box_rect, Color(0.1, 0.5, 0.1), false, 2)
|
||||
|
||||
# 绘制网格线(淡色)
|
||||
draw_rect(rect, Color(0.6, 0.6, 0.6, 0.3), false, 1)
|
||||
|
||||
#手机端下一关
|
||||
func _on_next_button_pressed() -> void:
|
||||
next_level()
|
||||
pass
|
||||
|
||||
#手机端上一关
|
||||
func _on_last_button_pressed() -> void:
|
||||
prev_level()
|
||||
pass
|
||||
|
||||
#关闭推箱子游戏界面
|
||||
func _on_quit_button_pressed() -> void:
|
||||
self.hide()
|
||||
get_parent().remove_child(self)
|
||||
queue_free()
|
||||
pass
|
||||
1
SproutFarm-Frontend/Scene/SmallGame/PushBox.gd.uid
Normal file
1
SproutFarm-Frontend/Scene/SmallGame/PushBox.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b1t5fxyg0jjx5
|
||||
242
SproutFarm-Frontend/Scene/SmallGame/PushBox.tscn
Normal file
242
SproutFarm-Frontend/Scene/SmallGame/PushBox.tscn
Normal file
@@ -0,0 +1,242 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cq14axh7bovu6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b1t5fxyg0jjx5" path="res://Scene/SmallGame/PushBox.gd" id="1_qdfdf"]
|
||||
|
||||
[node name="PushBox" type="Panel"]
|
||||
offset_right = 1402.0
|
||||
offset_bottom = 720.0
|
||||
script = ExtResource("1_qdfdf")
|
||||
|
||||
[node name="GameArea" type="Panel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -300.0
|
||||
offset_top = -250.0
|
||||
offset_right = 300.0
|
||||
offset_bottom = 250.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="LevelLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 50.0
|
||||
offset_top = -100.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = -70.0
|
||||
grow_vertical = 0
|
||||
text = "关卡: 1"
|
||||
|
||||
[node name="MovesLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 50.0
|
||||
offset_top = -70.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = -40.0
|
||||
grow_vertical = 0
|
||||
text = "步数: 0"
|
||||
|
||||
[node name="WinLabel" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -150.0
|
||||
offset_top = -50.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 50.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "恭喜过关!
|
||||
按N进入下一关
|
||||
按R重新开始"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ControlsLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -300.0
|
||||
offset_top = -180.0
|
||||
offset_right = -50.0
|
||||
offset_bottom = -50.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
text = "操作说明:
|
||||
WASD或方向键 - 移动
|
||||
虚拟按钮 - 移动(手机)
|
||||
R - 重新开始当前关卡
|
||||
N - 下一关(过关后)
|
||||
P - 上一关"
|
||||
|
||||
[node name="ObjectiveLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -1402.0
|
||||
offset_right = -1051.0
|
||||
offset_bottom = 35.0
|
||||
grow_horizontal = 0
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "目标: 将所有箱子推到目标位置!"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="StatsLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 50.0
|
||||
offset_top = -40.0
|
||||
offset_right = 400.0
|
||||
offset_bottom = -10.0
|
||||
grow_vertical = 0
|
||||
text = "完成关卡: 0 | 总步数: 0"
|
||||
|
||||
[node name="VirtualControls" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -1289.0
|
||||
offset_top = -472.0
|
||||
offset_right = -1089.0
|
||||
offset_bottom = -272.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="UpButton" type="Button" parent="VirtualControls"]
|
||||
custom_minimum_size = Vector2(90, 90)
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -144.0
|
||||
offset_top = -72.0
|
||||
offset_right = -54.0
|
||||
offset_bottom = 18.0
|
||||
grow_horizontal = 0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "W"
|
||||
|
||||
[node name="DownButton" type="Button" parent="VirtualControls"]
|
||||
custom_minimum_size = Vector2(90, 90)
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -144.0
|
||||
offset_top = 108.0
|
||||
offset_right = -54.0
|
||||
offset_bottom = 198.0
|
||||
grow_horizontal = 0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "S"
|
||||
|
||||
[node name="LeftButton" type="Button" parent="VirtualControls"]
|
||||
custom_minimum_size = Vector2(90, 90)
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -236.0
|
||||
offset_top = 18.0
|
||||
offset_right = -146.0
|
||||
offset_bottom = 108.0
|
||||
grow_horizontal = 0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "A"
|
||||
|
||||
[node name="RightButton" type="Button" parent="VirtualControls"]
|
||||
custom_minimum_size = Vector2(90, 90)
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -54.0
|
||||
offset_top = 18.0
|
||||
offset_right = 36.0
|
||||
offset_bottom = 108.0
|
||||
grow_horizontal = 0
|
||||
theme_override_font_sizes/font_size = 35
|
||||
text = "D"
|
||||
|
||||
[node name="ResetButton" type="Button" parent="VirtualControls"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = 819.0
|
||||
offset_top = 62.0
|
||||
offset_right = 902.0
|
||||
offset_bottom = 119.0
|
||||
grow_horizontal = 0
|
||||
scale = Vector2(1.54345, 1.50915)
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "重置"
|
||||
|
||||
[node name="NextButton" type="Button" parent="VirtualControls"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = 819.0
|
||||
offset_top = -110.0
|
||||
offset_right = 902.0
|
||||
offset_bottom = -53.0
|
||||
grow_horizontal = 0
|
||||
scale = Vector2(1.54345, 1.50915)
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "下一关"
|
||||
|
||||
[node name="LastButton" type="Button" parent="VirtualControls"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = 819.0
|
||||
offset_top = -24.0
|
||||
offset_right = 902.0
|
||||
offset_bottom = 33.0
|
||||
grow_horizontal = 0
|
||||
scale = Vector2(1.54345, 1.50915)
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "上一关"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="VirtualControls"]
|
||||
self_modulate = Color(1, 0.247059, 0, 1)
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = 947.0
|
||||
offset_top = -248.0
|
||||
offset_right = 1030.0
|
||||
offset_bottom = -191.0
|
||||
grow_horizontal = 0
|
||||
scale = Vector2(1.54345, 1.50915)
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "关闭"
|
||||
|
||||
[connection signal="pressed" from="VirtualControls/NextButton" to="." method="_on_next_button_pressed"]
|
||||
[connection signal="pressed" from="VirtualControls/LastButton" to="." method="_on_last_button_pressed"]
|
||||
[connection signal="pressed" from="VirtualControls/QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user