Quellcode durchsuchen

Name the cue window window_ms

The authored float bounds a delayed cue; it is not a playback length.
The generated mission.DialogueDefinition rows now publish it as
window_ms, the catalog contract names the raw field after the window,
and the Dialogue page labels it as the window.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stan vor 4 Tagen
Ursprung
Commit
5ebaf16767

+ 2 - 2
Sunrise/src/client/content/activity/activity_sdk_dialogue_list.cpp

@@ -236,7 +236,7 @@ bool read(std::span<const std::byte> list, Snapshot& output) {
     for (std::size_t index = 0; index < definitions.size(); ++index) {
         Cue& cue = output.cues[index];
         cue.definitionHash = definitions[index].hash;
-        cue.seconds = definitions[index].authoredWindowSeconds;
+        cue.windowSeconds = definitions[index].authoredWindowSeconds;
         const auto range = std::equal_range(trees.begin(),
                                             trees.end(),
                                             Tree{cue.definitionHash, 0},
@@ -255,7 +255,7 @@ bool read(std::span<const std::byte> list, Snapshot& output) {
                 malformed = true;
                 continue;
             }
-            if (std::fabs(seconds - cue.seconds) <= kSecondsTolerance) {
+            if (std::fabs(seconds - cue.windowSeconds) <= kSecondsTolerance) {
                 ++matches;
                 matched = std::move(walk.lines);
             } else {

+ 2 - 2
Sunrise/src/client/content/activity/activity_sdk_dialogue_list.h

@@ -38,8 +38,8 @@ enum class CueStatus : std::uint8_t {
 /** One cue in list order. Lines are present only for resolved and mismatched cues. */
 struct Cue final {
     std::uint32_t definitionHash{};
-    /** Authored total: a sequence adds its children, a selection lasts its longest branch. */
-    float seconds{};
+    /** Authored window from the definition row; a tree must last as long to resolve. */
+    float windowSeconds{};
     std::uint32_t firstLine{};
     std::uint32_t lineCount{};
     CueStatus status{CueStatus::missing};

+ 2 - 2
Sunrise/src/client/content/activity/activity_sdk_lua_catalog_contract.cpp

@@ -292,8 +292,8 @@ constexpr std::array<RowSpec, 41> kRows{{
      "dialogue_cues",
      "dialogue_cues",
      "CatalogDialogueCueView",
-     "s:id;u32:slot_index;u32:cue_index;u32:list_tag;u32:definition_hash;u32:duration_ms;"
-     "u32:line_count;u32:flags;u32:reserved"},
+     "u32:slot_index;u32:cue_index;u32:definition_hash;u32:authored_window_seconds_bits;s:id;"
+     "u32:list_tag;u32:line_count;u32:flags;u32:reserved"},
 }};
 
 /** Splits the semicolon list into type:name pairs; false on a bad token or a refusing callback. */

+ 2 - 1
Sunrise/src/client/content/activity/activity_sdk_lua_missions.cpp

@@ -557,7 +557,8 @@ bool render_mission(const Source& source,
                 append_uint(dialogueDefinitionConstants, cue);
                 dialogueDefinitionConstants.append("] = { hash = ");
                 append_hex(dialogueDefinitionConstants, row.definitionHash);
-                dialogueDefinitionConstants.append(", duration_ms = ");
+                // The authored window bounds a delayed cue; it is not a playback length.
+                dialogueDefinitionConstants.append(", window_ms = ");
                 append_uint(dialogueDefinitionConstants,
                             state::activity_sdk::authored_milliseconds(row.authoredWindowSeconds));
                 dialogueDefinitionConstants.append(", lines = ");

+ 1 - 1
Sunrise/src/client/content/activity/activity_sdk_native_pack_text.cpp

@@ -418,7 +418,7 @@ bool attach_authored_text(const topology_inventory::Snapshot& topology,
                     cueRow.cueIndex = static_cast<std::uint32_t>(cue);
                     cueRow.listTag = resourceTag;
                     cueRow.definitionHash = row.definitionHash;
-                    cueRow.authoredWindowSeconds = row.seconds;
+                    cueRow.authoredWindowSeconds = row.windowSeconds;
                     const bool mismatched = row.status == dialogue_list::CueStatus::mismatched;
                     const bool hasLines =
                         mismatched || row.status == dialogue_list::CueStatus::resolved;

+ 1 - 1
Sunrise/src/server/ui/activity_host/activity_host_sdk_mission_view.cpp

@@ -483,7 +483,7 @@ void draw_dialogues(const sdk::BoundView& view, const mission::Snapshot& snapsho
                     ImGui::SameLine();
                     if (cueRow < cueRows.size()) {
                         const sdk::format::DialogueCue& definition = cueRows[cueRow];
-                        ImGui::Text("Cue %u  definition %08X  %.3f s  %u lines",
+                        ImGui::Text("Cue %u  definition %08X  window %.3f s  %u lines",
                                     static_cast<unsigned>(cue),
                                     static_cast<unsigned>(definition.definitionHash),
                                     static_cast<double>(definition.authoredWindowSeconds),