Skip to content

Add Director WebSocket sync docs and enable drag-and-drop survivor slot swapping in local BP UI - #8

Merged
luolangaga merged 1 commit into
mainfrom
codex/add-drag-and-drop-for-survivor-selection
Mar 7, 2026
Merged

luolangaga merged 1 commit into
mainfrom
codex/add-drag-and-drop-for-survivor-selection

Conversation

@luolangaga

Copy link
Copy Markdown
Owner

Motivation

  • Provide a documented remote-control API so third-party apps can control ASG.Director over WebSocket without an OBS plugin.
  • Improve local BP UX by allowing quick reordering of survivor slots via drag-and-drop.

Description

  • Add DIRECTOR_SYNC_API.md which documents the ws://...:19625 WebSocket envelope format (protocol: asg-director-sync, version: 1, kind values), supported payload.data.type values, examples in JavaScript/Python, and operational notes.
  • Add drag-and-drop swap support for survivor slots by adding styles (.slot-swap-tip, .slot.drag-over) to pages/css/local-bp.css.
  • Implement initSurvivorSlotSwapDnD() and swapSurvivorSlotCharacter(fromIndex, toIndex) in pages/js/local-bp-logic.js, including drag event handlers, visual drag-over state, IPC calls via window.electronAPI.invoke('localBp:setSurvivor', ...), and updating state and UI; call initSurvivorSlotSwapDnD() from DOMContentLoaded.
  • Update pages/local-bp.html to add a small tip (拖拽板块可以交换选角) above the selected-display grid.

Testing

  • No automated tests were added or run for these changes.

Codex Task

@luolangaga
luolangaga merged commit 0c81a33 into main Mar 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant