Commit Graph

5 Commits

Author SHA1 Message Date
3c812cfb41 UI系统优化 2026-05-25 11:54:37 +08:00
da2948dff8 refactor: Round 53 remove all legacy backward-compatibility code
- QuestSO: remove giverNpcId, prerequisiteQuests/Flags/FlagsLogic, failCondition,
  conditionFlags, npcDialogueKey fields; simplify GiverNpcId property to giverNpc?.npcId;
  clean ValidatePrerequisiteCycles/HasPrerequisiteCycle to use prerequisites.questDependencies;
  remove ValidateBranchDialogueKeys migration warning block; clean QuestPrerequisite doc
- QuestManager: remove OnLoad DataVersion 1/2 migration paths (ProgressCounts, hasNewFormat/
  useNewFormat); remove CheckQuestDepsAndFlags old-field fallback (prerequisiteQuests/Flags);
  remove UnlockBranches conditionFlags fallback; remove DispatchEvent failCondition fallback;
  fix ValidatePrerequisites DFS to scan prerequisites.questDependencies
- SaveData: remove ProgressCounts (Obsolete), ObjectiveIndex (unused), GiverNpcId (never
  written) fields from QuestState; simplify DataVersion doc comment
- QuestSOEditor: replace migration-only editor with minimal DrawDefaultInspector
- QuestModule: update all prerequisiteQuests/conditionFlags/npcDialogueKey/failCondition
  references to canonical new fields; update ValidateBranchFlags check 10
- FlagAuditModule: replace conditionFlags/prerequisiteFlags scans with conditionFlagEntries/
  prerequisites.flagCondition.flags
- NpcSO: remove QuestSO.giverNpcId reference from npcId tooltip
- NpcAffinityEvent/RewardSO: update doc comments to reference giverNpc instead of giverNpcId

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-25 01:00:32 +08:00
48f018f4b8 feat: Round 51 narrative systems improvements
- SaveData: update QuestState.Status comment to include Paused state
- QuestManager: add inline comment on AcceptQuest duplicate-accept guard
- QuestManager: wrap reward.Apply() in try-catch so exceptions don't
  corrupt already-committed Completed state
- QuestManager.UnlockBranches: support new conditionFlagEntries (invert/
  NOT logic) with graceful fallback to legacy conditionFlags
- QuestGiver: cache IQuestManager field in OnEnable; subscribe to
  OnQuestStateChanged for automatic cache invalidation instead of manual
  _cacheDirty = true after each Interact; remove per-call SL.GetOrDefault
- QuestGiver: replace hardcoded Chinese prompt strings with
  LocalizationManager.Get(key, 'UI') + inline fallback via GetPrompt()
- QuestSO: add BranchFlagEntry struct (flagId + invert) for NOT-logic
  branch conditions; add conditionFlagEntries to QuestBranch with
  HideInInspector on legacy conditionFlags for backward compat
- QuestModule: add static TTL cache (5 s) for FindAll<QuestSO>() in
  PopulateDependencyGraph to avoid re-scanning disk on every foldout open
- NpcSOEditor: add 'jump to localization file' button that pings and
  selects the UI table JSON in the Project window

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-25 00:34:59 +08:00
6eaa83dc71 feat: Round 48 narrative systems improvements
- QuestSO: Add ValidateBranchCycles() DFS detection for branches[].nextQuest loop
- QuestSO: Mark three legacy prerequisite fields with v2.0 removal warning in Tooltip
- IQuestManager: Add QuestLockReason enum + QuestLockInfo struct (strongly-typed lock info)
- IQuestManager: Add GetQuestLockInfo() method to interface; GetQuestLockReason() now delegates to it
- IQuestEventSource: Add OnQuestStateChanged(questId, oldState, newState) unified event
- QuestManager: Implement GetQuestLockInfo(); fire OnQuestStateChanged on all state transitions
- DialogueManager: Add one-frame yield in HandleChoices before ShowChoices (skip-debounce fix)
- DialogueManager: Increment _playbackId in ForceEnd() to invalidate residual choice callbacks
- DialogueSequenceSO: Add UNITY_EDITOR debug log in TryGetActiveVariant on variant match
- WorldStateRegistry: Add OnBatchStateChanged event + BatchMark() batch-write API
- DialogueModule: List badge shows warning indicator for unconditional-shadowing variants
- DialogueModule: BuildVariantsCard shows logic mode (AND/OR) alongside flag conditions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-25 00:05:15 +08:00
446fd5dcd0 feat: Add WorldStateFlagAttribute and custom property drawer for enhanced dialogue management
- Implemented WorldStateFlagAttribute to mark string fields as world state flags.
- Created NarrativeNPCEditor for custom inspector to visualize dialogue version activation states.
- Developed WorldStateFlagDrawer to provide dropdown menu for known flags in the inspector.
- Introduced ActorModule for managing DialogueActorSO assets, including viewing, creating, and deleting actors.
- Added DialogueModule for managing DialogueSequenceSO assets with detailed previews and action bars.
- Established QuestModule for managing QuestSO assets, including objectives and branches.
- Implemented QuestManagerPostprocessor to automatically refresh QuestManager's quest list on asset changes.
2026-05-24 00:36:11 +08:00