Skip to content

Expose public APIs for WCE buttons, notes, and instant messenger integration - #172

Open
awdrrawd wants to merge 2 commits into
KittenApps:betafrom
awdrrawd:beta
Open

Expose public APIs for WCE buttons, notes, and instant messenger integration#172
awdrrawd wants to merge 2 commits into
KittenApps:betafrom
awdrrawd:beta

Conversation

@awdrrawd

Copy link
Copy Markdown

Description:

Summary

This PR introduces a public window.WCE API that allows other addons and userscripts to integrate with WCE without patching its internal functions.

It exposes controls for WCE-drawn buttons, access to saved profile notes, and additional instant messenger integration options.

Public button API

The following buttons are exposed through WCE.Button:

  • WCE.Button.Messenger
  • WCE.Button.EditProfile
  • WCE.Button.pastProfiles

Each button supports:

  • getPosition()
  • setPosition(x, y, width, height)
  • resetPosition()
  • hide()
  • show()
  • isHidden()
  • hideVisual()
  • showVisual()
  • isVisualHidden()

hide() hides the button and disables its click area.

hideVisual() only hides the button drawing while preserving its original click area. This is useful when another addon wants to draw its own button over the same location while keeping WCE's click handling active.

All position values use Bondage Club canvas coordinates.

Instant messenger API

WCE.Button.Messenger additionally exposes:

  • isEnabled() to determine whether the instant messenger feature is enabled.
  • getZIndex() to retrieve the messenger window's current CSS z-index.
  • setZIndex(zIndex) to change the messenger window's stacking order.
  • resetZIndex() to restore the default z-index of 100.

The messenger button also no longer accumulates a red unread indicator while it is hidden, including when only its visual is hidden.

Past Profiles notes API

Saved profile notes can be accessed through:

await WCE.pastProfiles.get(memberNumber);
await WCE.pastProfiles.set(memberNumber, note);
The API validates its arguments and keeps the currently open note editor synchronized when a note is updated externally.
Motivation
Other addons may need to reposition WCE buttons to avoid UI overlap, replace their visual appearance while retaining WCE behavior, change the instant messenger window's stacking order, or access WCE's saved profile notes.
Providing a supported public API makes these integrations possible without relying on fragile hooks, hard-coded coordinates, or direct access to WCE's internal state.
Type declarations
The public API and all newly exposed methods are included in WCE's TypeScript declarations.

@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for wce ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 40ef8d2
🔍 Latest deploy log https://app.netlify.com/projects/wce/deploys/6a86f2a5421c520008c80294
😎 Deploy Preview https://deploy-preview-172--wce.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant