config.gd 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # 赛博小镇 - 全局配置
  2. extends Node
  3. # ==================== API配置 ====================
  4. const API_BASE_URL = "http://localhost:8000"
  5. const API_CHAT = API_BASE_URL + "/chat"
  6. const API_NPCS = API_BASE_URL + "/npcs"
  7. const API_NPC_STATUS = API_BASE_URL + "/npcs/status"
  8. # ==================== NPC配置 ====================
  9. const NPC_NAMES = ["张三", "李四", "王五"]
  10. const NPC_TITLES = {
  11. "张三": "Python工程师",
  12. "李四": "产品经理",
  13. "王五": "UI设计师"
  14. }
  15. # ==================== 游戏配置 ====================
  16. const PLAYER_SPEED = 200.0 # 玩家移动速度
  17. const INTERACTION_DISTANCE = 80.0 # 交互距离
  18. const NPC_STATUS_UPDATE_INTERVAL = 30.0 # NPC状态更新间隔(秒)
  19. # ==================== UI配置 ====================
  20. const DIALOGUE_FADE_TIME = 0.3 # 对话框淡入淡出时间
  21. const NPC_LABEL_OFFSET = Vector2(0, -60) # NPC名字标签偏移
  22. # ==================== 调试配置 ====================
  23. const DEBUG_MODE = true # 调试模式
  24. const SHOW_INTERACTION_RANGE = true # 显示交互范围
  25. # ==================== 工具函数 ====================
  26. func log_info(message: String) -> void:
  27. if DEBUG_MODE:
  28. print("[INFO] ", message)
  29. func log_error(message: String) -> void:
  30. print("[ERROR] ", message)
  31. func log_api(endpoint: String, data: Dictionary) -> void:
  32. if DEBUG_MODE:
  33. print("[API] ", endpoint, " -> ", JSON.stringify(data))