-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added OSCQuery support to OSC control
- Loading branch information
Showing
17 changed files
with
564 additions
and
244 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
src-ui/app/services/osc-control/methods/auto-accept-vrc-invite-requests.osc-method.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { OscMethod } from '../osc-method'; | ||
import { OscService } from '../../osc.service'; | ||
import { OSCBoolValue, OSCMessage } from '../../../models/osc-message'; | ||
import { info } from 'tauri-plugin-log-api'; | ||
import { distinctUntilChanged, map, switchMap } from 'rxjs'; | ||
import { AutomationConfigService } from '../../automation-config.service'; | ||
|
||
export class AutoAcceptVRCInviteRequestsOscMethod extends OscMethod<boolean> { | ||
constructor(osc: OscService, private automationConfig: AutomationConfigService) { | ||
super(osc, { | ||
description: | ||
'Enabled status of the automation for automatically accepting VRChat invite requests', | ||
address: '/OyasumiVR/Automation/AutoAcceptVRCInviteRequests', | ||
addressAliases: ['/Oyasumi/AutoAcceptInviteRequests'], | ||
type: 'Bool', | ||
initialValue: false, | ||
isVRCAvatarParameter: true, | ||
access: 'ReadWrite', | ||
}); | ||
automationConfig.configs | ||
.pipe( | ||
map((c) => c.AUTO_ACCEPT_INVITE_REQUESTS.enabled), | ||
distinctUntilChanged(), | ||
switchMap((enabled) => this.setValue(enabled)) | ||
) | ||
.subscribe(); | ||
} | ||
|
||
async handleOSCMessage(message: OSCMessage) { | ||
const { value: enable } = message.values[0] as OSCBoolValue; | ||
if (this.value === enable) return; | ||
await this.setValue(enable); | ||
if (enable) info('[OSCControl] Enabling automatic invite request acceptance'); | ||
else info('[OSCControl] Disabling automatic invite request acceptance'); | ||
await this.automationConfig.updateAutomationConfig('AUTO_ACCEPT_INVITE_REQUESTS', { | ||
enabled: enable, | ||
}); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src-ui/app/services/osc-control/methods/avatar-change.osc-method.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { OscService } from '../../osc.service'; | ||
import { OscMethod } from '../osc-method'; | ||
import { OSCMessage, OSCStringValue } from '../../../models/osc-message'; | ||
import { OscControlService } from '../osc-control.service'; | ||
|
||
export class AvatarChangeOscMethod extends OscMethod<string> { | ||
constructor(osc: OscService, private oscControl: OscControlService) { | ||
super(osc, { | ||
description: 'Notify OyasumiVR of the user switching avatar in VRChat', | ||
address: '/avatar/change', | ||
addressAliases: [], | ||
type: 'String', | ||
initialValue: '', | ||
isVRCAvatarParameter: false, | ||
access: 'Write', | ||
}); | ||
} | ||
|
||
async handleOSCMessage(message: OSCMessage) { | ||
const { value: avatarId } = message.values[0] as OSCStringValue; | ||
if (this.value === avatarId) return; | ||
await this.setValue(avatarId); | ||
// Trigger resync of all VRChat parameters | ||
await this.oscControl.resyncAllVRCParameters(); | ||
} | ||
} |
Oops, something went wrong.