Expose public APIs for WCE buttons, notes, and instant messenger integration - #172
Open
awdrrawd wants to merge 2 commits into
Open
Expose public APIs for WCE buttons, notes, and instant messenger integration#172awdrrawd wants to merge 2 commits into
awdrrawd wants to merge 2 commits into
Conversation
✅ Deploy Preview for wce ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Summary
This PR introduces a public
window.WCEAPI 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.MessengerWCE.Button.EditProfileWCE.Button.pastProfilesEach 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.Messengeradditionally 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 of100.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: