批量修改钱币

This commit is contained in:
2025-07-21 10:55:09 +08:00
parent 9a2de2ac87
commit ca75186d8f
13 changed files with 168 additions and 168 deletions

View File

@@ -421,7 +421,7 @@ func _handle_login_success(user_data: Dictionary):
main_game.experience = user_data.get("经验值", 0)
main_game.farm_lots = user_data.get("农场土地", [])
main_game.level = user_data.get("等级", 1)
main_game.money = user_data.get("money", 0)
main_game.money = user_data.get("钱币", 0)
main_game.stamina = user_data.get("体力值", 20)
main_game.show_farm_name.text = "农场名称:" + user_data.get("农场名称", "")
main_game.show_player_name.text = "玩家昵称:" + user_data.get("玩家昵称", "")

View File

@@ -60,7 +60,7 @@ func _ready() -> void:
online_time_sort_btn.pressed.connect(func(): _on_sort_button_pressed("online_time"))
login_time_sort_btn.pressed.connect(func(): _on_sort_button_pressed("login_time"))
like_num_sort_btn.pressed.connect(func(): _on_sort_button_pressed("like_num"))
money_sort_btn.pressed.connect(func(): _on_sort_button_pressed("money"))
money_sort_btn.pressed.connect(func(): _on_sort_button_pressed("钱币"))
is_online_sort_btn.pressed.connect(_on_online_filter_pressed)
# 初始化按钮状态
@@ -92,7 +92,7 @@ func _on_online_filter_pressed():
func _update_button_states():
# 重置所有排序按钮
var sort_buttons = [seed_sort_btn, level_sort_btn, online_time_sort_btn, login_time_sort_btn, like_num_sort_btn, money_sort_btn]
var sort_fields = ["seed_count", "等级", "online_time", "login_time", "like_num", "money"]
var sort_fields = ["seed_count", "等级", "online_time", "login_time", "like_num", "钱币"]
var sort_names = ["种子数", "等级", "游玩时间", "登录时间", "点赞数", "金币数"]
for i in range(sort_buttons.size()):
@@ -215,7 +215,7 @@ func add_player_entry(player_data):
player_name.text = display_name
#都是整数,不要乱用浮点数
player_level.text = "等级: " + str(int(player_data.get("等级", 0)))
player_money.text = "金币: " + str(int(player_data.get("money", 0)))
player_money.text = "金币: " + str(int(player_data.get("钱币", 0)))
player_seed_num.text = "种子: " + str(int(player_data.get("seed_count", 0)))
player_online_time.text = "游玩时间: " + player_data.get("总游玩时间", "0时0分0秒")
player_last_login_time.text = "最后登录: " + player_data.get("最后登录时间", "未知")

View File

@@ -163,7 +163,7 @@ func _on_water_button_pressed():
# 如果是访问模式,需要检查自己的原始金钱数据
if main_game.is_visiting_mode:
my_money = main_game.original_player_data.get("money", 0)
my_money = main_game.original_player_data.get("钱币", 0)
if my_money < water_cost:
var action_text = "帮助浇水" if main_game.is_visiting_mode else "浇水"
@@ -227,7 +227,7 @@ func _on_fertilize_button_pressed():
# 如果是访问模式,需要检查自己的原始金钱数据
if main_game.is_visiting_mode:
my_money = main_game.original_player_data.get("money", 0)
my_money = main_game.original_player_data.get("钱币", 0)
if my_money < fertilize_cost:
var action_text = "帮助施肥" if main_game.is_visiting_mode else "施肥"

View File

@@ -170,8 +170,8 @@ func handle_claim_online_gift_response(data: Dictionary):
reward_text += seed["名称"] + "x" + str(seed["数量"]) + " "
# 兼容老格式
if rewards.has("money"):
reward_text += "金币+" + str(rewards["money"]) + " "
if rewards.has("钱币"):
reward_text += "金币+" + str(rewards["钱币"]) + " "
if rewards.has("经验值"):
reward_text += "经验+" + str(rewards["经验值"]) + " "
if rewards.has("seeds"):

View File

@@ -209,8 +209,8 @@ func handle_buy_scare_crow_response(success: bool, message: String, updated_data
Toast.show(message, Color.GREEN)
# 更新玩家数据
if updated_data.has("money"):
main_game.money = updated_data["money"]
if updated_data.has("钱币"):
main_game.money = updated_data["钱币"]
if updated_data.has("稻草人配置"):
player_scare_crow_config = updated_data["稻草人配置"]
@@ -230,8 +230,8 @@ func handle_modify_scare_crow_config_response(success: bool, message: String, up
Toast.show(message, Color.GREEN)
# 更新玩家数据
if updated_data.has("money"):
main_game.money = updated_data["money"]
if updated_data.has("钱币"):
main_game.money = updated_data["钱币"]
if updated_data.has("稻草人配置"):
player_scare_crow_config = updated_data["稻草人配置"]

View File

@@ -233,8 +233,8 @@ func handle_wisdom_tree_operation_response(success: bool, message: String, opera
main_game.login_data["智慧树配置"] = wisdom_tree_config
# 更新玩家数据
if updated_data.has("money"):
main_game.money = updated_data["money"]
if updated_data.has("钱币"):
main_game.money = updated_data["钱币"]
main_game._update_ui()
# 更新智慧树设置面板UI
@@ -289,8 +289,8 @@ func handle_wisdom_tree_operation_response(success: bool, message: String, opera
func handle_wisdom_tree_message_response(success: bool, message: String, updated_data: Dictionary = {}):
if success:
# 更新玩家金钱
if updated_data.has("money"):
main_game.money = updated_data["money"]
if updated_data.has("钱币"):
main_game.money = updated_data["钱币"]
main_game._update_ui()
Toast.show("消息发送成功!", Color.GREEN)