forked from datawhale/whale-town-front
docs: 完善项目文档和README,修复字符显示问题
- 修复README.md中的emoji字符显示问题 - 移除文档质量评级系统 - 添加贡献者致谢部分,创建详细的CONTRIBUTORS.md - 创建核心系统文件EventNames.gd和ProjectPaths.gd - 更新项目配置文件project.godot,添加输入映射 - 完善各模块文档,修正路径引用问题 - 创建文档更新日志CHANGELOG.md - 优化文档结构和导航系统
This commit is contained in:
58
_Core/EventNames.gd
Normal file
58
_Core/EventNames.gd
Normal file
@@ -0,0 +1,58 @@
|
||||
# ============================================================================
|
||||
# 事件名称定义 - EventNames.gd
|
||||
#
|
||||
# 定义项目中所有事件的名称常量,确保事件名称的一致性和可维护性
|
||||
#
|
||||
# 使用方式:
|
||||
# EventSystem.emit_event(EventNames.PLAYER_MOVED, data)
|
||||
# EventSystem.connect_event(EventNames.INTERACT_PRESSED, callback)
|
||||
# ============================================================================
|
||||
|
||||
class_name EventNames
|
||||
|
||||
# ============================================================================
|
||||
# 玩家相关事件
|
||||
# ============================================================================
|
||||
const PLAYER_MOVED = "player_moved"
|
||||
const PLAYER_SPAWNED = "player_spawned"
|
||||
const PLAYER_HEALTH_CHANGED = "player_health_changed"
|
||||
const PLAYER_DIED = "player_died"
|
||||
const PLAYER_RESPAWNED = "player_respawned"
|
||||
const PLAYER_ATTACK = "player_attack"
|
||||
|
||||
# ============================================================================
|
||||
# 交互事件
|
||||
# ============================================================================
|
||||
const INTERACT_PRESSED = "interact_pressed"
|
||||
const NPC_TALKED = "npc_talked"
|
||||
const ITEM_COLLECTED = "item_collected"
|
||||
const OBJECT_INTERACTED = "object_interacted"
|
||||
|
||||
# ============================================================================
|
||||
# UI事件
|
||||
# ============================================================================
|
||||
const UI_BUTTON_CLICKED = "ui_button_clicked"
|
||||
const DIALOG_OPENED = "dialog_opened"
|
||||
const DIALOG_CLOSED = "dialog_closed"
|
||||
const MENU_OPENED = "menu_opened"
|
||||
const MENU_CLOSED = "menu_closed"
|
||||
|
||||
# ============================================================================
|
||||
# 游戏状态事件
|
||||
# ============================================================================
|
||||
const GAME_PAUSED = "game_paused"
|
||||
const GAME_RESUMED = "game_resumed"
|
||||
const SCENE_CHANGED = "scene_changed"
|
||||
const SCENE_DATA_TRANSFER = "scene_data_transfer"
|
||||
|
||||
# ============================================================================
|
||||
# 系统事件
|
||||
# ============================================================================
|
||||
const TILEMAP_READY = "tilemap_ready"
|
||||
const COMPONENT_MESSAGE = "component_message"
|
||||
const POSITION_UPDATE = "position_update"
|
||||
|
||||
# ============================================================================
|
||||
# 测试事件
|
||||
# ============================================================================
|
||||
const TEST_EVENT = "test_event"
|
||||
1
_Core/EventNames.gd.uid
Normal file
1
_Core/EventNames.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://qn0imbklx1m0
|
||||
107
_Core/ProjectPaths.gd
Normal file
107
_Core/ProjectPaths.gd
Normal file
@@ -0,0 +1,107 @@
|
||||
# ============================================================================
|
||||
# 项目路径配置 - ProjectPaths.gd
|
||||
#
|
||||
# 统一管理项目中所有路径常量,确保路径的一致性和可维护性
|
||||
#
|
||||
# 使用方式:
|
||||
# var scene_path = ProjectPaths.SCENES_COMPONENTS + "ui/Button.tscn"
|
||||
# var config_path = ProjectPaths.DATA_CONFIG + "game_config.json"
|
||||
# ============================================================================
|
||||
|
||||
class_name ProjectPaths
|
||||
|
||||
# ============================================================================
|
||||
# 核心系统路径
|
||||
# ============================================================================
|
||||
const CORE_ROOT = "res://_Core/"
|
||||
const CORE_MANAGERS = CORE_ROOT + "managers/"
|
||||
const CORE_SYSTEMS = CORE_ROOT + "systems/"
|
||||
|
||||
# ============================================================================
|
||||
# 场景路径
|
||||
# ============================================================================
|
||||
const SCENES_ROOT = "res://scenes/"
|
||||
const SCENES_MAPS = SCENES_ROOT + "Maps/"
|
||||
const SCENES_COMPONENTS = SCENES_ROOT + "Components/"
|
||||
const SCENES_UI_COMPONENTS = SCENES_COMPONENTS + "ui/"
|
||||
const SCENES_CHARACTER_COMPONENTS = SCENES_COMPONENTS + "characters/"
|
||||
const SCENES_EFFECT_COMPONENTS = SCENES_COMPONENTS + "effects/"
|
||||
const SCENES_ITEM_COMPONENTS = SCENES_COMPONENTS + "items/"
|
||||
|
||||
# ============================================================================
|
||||
# UI路径
|
||||
# ============================================================================
|
||||
const UI_ROOT = "res://UI/"
|
||||
const UI_WINDOWS = UI_ROOT + "Windows/"
|
||||
|
||||
# ============================================================================
|
||||
# 资源路径
|
||||
# ============================================================================
|
||||
const ASSETS_ROOT = "res://assets/"
|
||||
const ASSETS_SPRITES = ASSETS_ROOT + "sprites/"
|
||||
const ASSETS_AUDIO = ASSETS_ROOT + "audio/"
|
||||
const ASSETS_FONTS = ASSETS_ROOT + "fonts/"
|
||||
const ASSETS_MATERIALS = ASSETS_ROOT + "materials/"
|
||||
const ASSETS_SHADERS = ASSETS_ROOT + "shaders/"
|
||||
|
||||
# ============================================================================
|
||||
# 数据路径
|
||||
# ============================================================================
|
||||
const DATA_ROOT = "res://data/"
|
||||
const DATA_CONFIG = "res://Config/"
|
||||
const DATA_SCENES = DATA_ROOT + "scenes/"
|
||||
const DATA_LEVELS = DATA_ROOT + "levels/"
|
||||
const DATA_DIALOGUES = DATA_ROOT + "dialogues/"
|
||||
|
||||
# ============================================================================
|
||||
# Web资源路径
|
||||
# ============================================================================
|
||||
const WEB_ASSETS = "res://web_assets/"
|
||||
|
||||
# ============================================================================
|
||||
# 测试路径
|
||||
# ============================================================================
|
||||
const TESTS_ROOT = "res://tests/"
|
||||
const TESTS_UNIT = TESTS_ROOT + "unit/"
|
||||
const TESTS_INTEGRATION = TESTS_ROOT + "integration/"
|
||||
const TESTS_AUTH = TESTS_ROOT + "auth/"
|
||||
|
||||
# ============================================================================
|
||||
# 工具路径
|
||||
# ============================================================================
|
||||
const UTILS_ROOT = "res://Utils/"
|
||||
|
||||
# ============================================================================
|
||||
# 模块路径
|
||||
# ============================================================================
|
||||
const MODULES_ROOT = "res://module/"
|
||||
|
||||
# ============================================================================
|
||||
# 辅助方法
|
||||
# ============================================================================
|
||||
|
||||
# 获取场景组件路径
|
||||
static func get_component_path(category: String, component_name: String) -> String:
|
||||
match category:
|
||||
"ui":
|
||||
return SCENES_UI_COMPONENTS + component_name + ".tscn"
|
||||
"characters":
|
||||
return SCENES_CHARACTER_COMPONENTS + component_name + ".tscn"
|
||||
"effects":
|
||||
return SCENES_EFFECT_COMPONENTS + component_name + ".tscn"
|
||||
"items":
|
||||
return SCENES_ITEM_COMPONENTS + component_name + ".tscn"
|
||||
_:
|
||||
return SCENES_COMPONENTS + component_name + ".tscn"
|
||||
|
||||
# 获取模块路径
|
||||
static func get_module_path(module_name: String) -> String:
|
||||
return MODULES_ROOT + module_name + "/"
|
||||
|
||||
# 获取模块配置路径
|
||||
static func get_module_config_path(module_name: String) -> String:
|
||||
return get_module_path(module_name) + "data/module_config.json"
|
||||
|
||||
# 获取场景数据路径
|
||||
static func get_scene_data_path(scene_name: String) -> String:
|
||||
return DATA_SCENES + scene_name.to_lower() + ".json"
|
||||
1
_Core/ProjectPaths.gd.uid
Normal file
1
_Core/ProjectPaths.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dybcuscku7tyl
|
||||
Reference in New Issue
Block a user