Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Oct 13, 2022
2 parents 64dc803 + 6a5f510 commit 05834dd
Show file tree
Hide file tree
Showing 21 changed files with 178 additions and 46 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.0]

### Added
- Sleeping animation automation preset for [GoGo Loco v1.7.1 by franada](https://booth.pm/en/items/3290806).
- Sleeping animation automation (workaround) preset for [GoGo Loco v1.6.2 - v1.7.0 by franada](https://booth.pm/en/items/3290806).

### Changed
- Marked the preset for [ごろ寝システム (Sleep System) by みんみんみーん](https://booth.pm/ko/items/2886739) to also support v2.3 and the new EX version.
- Changed presets to support multiple info links (to show both んみんみーん's EX and non-EX version)

### Fixed
- Fixed side sleeping poses being detected too early in some positions.

## [1.0.0]

### Added

- Sleeping animation automations for automatically changing the sleeping animation of your avatar based on your sleeping position.
- Preset for [ごろ寝システム (Sleep System) v2.2 by んみんみーん](https://booth.pm/ko/items/2886739).
- Preset for [ごろ寝システム (Sleep System) v2.2 by みんみんみーん](https://booth.pm/ko/items/2886739).
- Setting to start Oyasumi with administrator privileges by default
- Editor for writing OSC scripts
- In-app updater & changelog
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ Grab the latest installer over on the [Releases](https://github.com/Raphiiko/Oya
- Detects your sleeping position to switch between your avatar's sleeping animations automatically.
- Trigger your own animations with the included OSC script editors.
- Presets for popular locomotion assets, including:
- [ごろ寝システム v2.2](https://minminmart.booth.pm/items/2886739) by [みんみんみーん](https://twitter.com/minminmeeean)
<br>(Sleep System v2.2 by minminmiin)
- Coming soon: [GoGo Loco v1.7.1](https://booth.pm/en/items/3290806) by [franada](https://twitter.com/franada) (Unreleased)
<br>(Semi-functional workaround will be available for 1.6.2 - 1.7.0)
- [ごろ寝システム v2.2 - 2.3](https://minminmart.booth.pm/items/2886739) by [みんみんみーん](https://twitter.com/minminmeeean)
<br>(Sleep System v2.2 - 2.3 by minminmiin)
<br>([EX version](https://booth.pm/en/items/4233545) also supported!)
- [GoGo Loco v1.7.1](https://booth.pm/en/items/3290806) by [franada](https://twitter.com/franada)
<br>(Semi-functional workaround available for 1.6.2 - 1.7.0)
- :electric_plug: GPU Automations:
- Automatically tweak your power limits when you go to sleep and when you wake up.
- :battery: Battery automations:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oyasumi",
"version": "1.0.0",
"version": "1.1.0",
"author": "Raphiiko",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -67,4 +67,4 @@
"prettier": "^2.7.1",
"typescript": "~4.7.2"
}
}
}
2 changes: 1 addition & 1 deletion src-elevated-sidecar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumi-elevated-sidecar"
version = "1.0.0"
version = "1.1.0"
authors = ["Raphiiko"]
license = "MIT"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-shared/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumi-shared"
version = "1.0.0"
version = "1.1.0"
authors = ["Raphiiko"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumi"
version = "1.0.0"
version = "1.1.0"
description = ""
authors = ["Raphiiko"]
license = "MIT"
Expand Down
13 changes: 9 additions & 4 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"package": {
"productName": "Oyasumi",
"version": "1.0.0"
"version": "1.1.0"
},
"tauri": {
"allowlist": {
Expand All @@ -35,7 +35,9 @@
"deb": {
"depends": []
},
"externalBin": ["../src-elevated-sidecar/target/release/oyasumi-elevated-sidecar"],
"externalBin": [
"../src-elevated-sidecar/target/release/oyasumi-elevated-sidecar"
],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
Expand All @@ -60,7 +62,10 @@
"digestAlgorithm": "sha256",
"timestampUrl": "",
"wix": {
"language": ["en-US", "nl-NL"]
"language": [
"en-US",
"nl-NL"
]
}
}
},
Expand Down Expand Up @@ -102,4 +107,4 @@
}
]
}
}
}
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { TelemetryService } from './services/telemetry.service';
import { LanguageSelectModalComponent } from './components/language-select-modal/language-select-modal.component';
import { AppSettingsService } from './services/app-settings.service';
import { filter } from 'rxjs';
import { SleepingAnimationPresetModalComponent } from './components/sleeping-animation-preset-modal/sleeping-animation-preset-modal.component';

export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
Expand Down Expand Up @@ -97,6 +98,7 @@ export function createTranslateLoader(http: HttpClient) {
ConfirmModalComponent,
UpdateModalComponent,
LanguageSelectModalComponent,
SleepingAnimationPresetModalComponent,
],
imports: [
CommonModule,
Expand Down
11 changes: 2 additions & 9 deletions src/app/components/select-box/select-box.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
[class.small]="type === 'SMALL'"
>
<div class="select-item-content">
<div class="select-item-title">
{{ selected.label | tsTranslate }}
</div>
<div class="select-item-title">{{ selected.label | tsTranslate }}</div>
<div class="select-item-subtitle" *ngIf="selected.subLabel && type !== 'SMALL'">
{{ selected.subLabel | tsTranslate }}
</div>
Expand Down Expand Up @@ -55,12 +53,7 @@
{{ item.subLabel | tsTranslate }}
</div>
</div>
<a
class="select-item-info noselect"
*ngIf="item.infoLink"
[href]="item.infoLink"
target="_blank"
>
<a class="select-item-info noselect" *ngIf="item.infoAction" (click)="item.infoAction()">
<i class="material-icons-round noselect">info</i>
</a>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/select-box/select-box.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
border-radius: 0.5em;
border: 1px solid var(--color-surface-1);
transition: all 0.15s ease;
min-height: 4.5em;
min-height: 3em;

&.small {
min-height: 2.5em;
Expand Down Expand Up @@ -144,6 +144,7 @@
}
&-title {
color: var(--color-text-2);
white-space: pre-wrap;
}
&-subtitle {
color: var(--color-text-3);
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/select-box/select-box.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface SelectBoxItem {
id: string;
label: TString;
subLabel?: TString;
infoLink?: string;
infoAction?: () => void;
}

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="pane modal" [@fadeUp]>
<div class="pane-title">
{{ preset?.name }}
</div>
<div class="pane-content">
<div *ngFor='let link of preset?.infoLinks || []' class='link'>
<span>{{link.label}}</span>
<button class='btn btn-secondary' translate (click)='openUrl(link.url)'>shared.modals.open</button>
</div>
</div>
<div class="pane-actions spread">
<button class="btn btn-secondary" (click)="close()">
{{ 'shared.modals.close' | translate }}
</button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


.link {
display: flex;
flex-direction: row;
align-items: center;
&:not(:last-child) {
margin-bottom: 1em;
}
span {
flex: 1;
}
button {
flex-shrink: 0;
margin-left: 1em;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SleepingAnimationPresetModalComponent } from './sleeping-animation-preset-modal.component';

describe('SleepingAnimationPresetModalComponent', () => {
let component: SleepingAnimationPresetModalComponent;
let fixture: ComponentFixture<SleepingAnimationPresetModalComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ SleepingAnimationPresetModalComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(SleepingAnimationPresetModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Component, OnInit } from '@angular/core';
import { SimpleModalComponent } from 'ngx-simple-modal';
import { SleepingAnimationPreset } from '../../models/sleeping-animation-presets';
import { open } from '@tauri-apps/api/shell';

interface SleepingAnimationPresetModalInputModel {
preset?: SleepingAnimationPreset;
}

@Component({
selector: 'app-sleeping-animation-preset-modal',
templateUrl: './sleeping-animation-preset-modal.component.html',
styleUrls: ['./sleeping-animation-preset-modal.component.scss'],
})
export class SleepingAnimationPresetModalComponent
extends SimpleModalComponent<SleepingAnimationPresetModalInputModel, void>
implements OnInit, SleepingAnimationPresetModalInputModel
{
preset?: SleepingAnimationPreset;

constructor() {
super();
}

ngOnInit(): void {}

async openUrl(url: string) {
await open(url);
}
}
30 changes: 20 additions & 10 deletions src/app/models/sleeping-animation-presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ import { OscScript } from './osc-script';
import { parseOscScriptFromCode } from '../utils/osc-script-utils';
import { TString } from './translatable-string';


export interface SleepingAnimationPresetNote {
type: 'CAUTION' | 'WARNING' | 'INFO' | 'SUCCESS';
text: TString;
}

export interface SleepingAnimationPresetInfoLink {
label: TString;
url: string;
}
export interface SleepingAnimationPreset {
id: string;
name: string;
author: string;
infoLink: string;
versions: string;
infoLinks: SleepingAnimationPresetInfoLink[];
oscScripts: {
SIDE_BACK?: OscScript;
SIDE_FRONT?: OscScript;
Expand All @@ -26,9 +30,13 @@ export interface SleepingAnimationPreset {

const MMM_SLEEP_SYSTEM_2_2_PRESET: SleepingAnimationPreset = {
id: 'MMM_SLEEP_SYSTEM_2_2',
name: 'ごろ寝システム v2.2+',
name: 'ごろ寝システム(EX)',
versions: '2.2 - 2.3',
author: 'みんみんみーん',
infoLink: 'https://booth.pm/ko/items/2886739',
infoLinks: [
{ label: 'ごろ寝システム (booth.pm)', url: 'https://booth.pm/ko/items/2886739' },
{ label: 'ごろ寝システムEX (booth.pm)', url: 'https://booth.pm/en/items/4233545' },
],
oscScripts: {
SIDE_BACK: parseOscScriptFromCode(`
i 1 /avatar/parameters/VRCSupine
Expand All @@ -55,9 +63,10 @@ b false /avatar/parameters/VRCLockPose

const GOGO_LOCO_LEGACY_1_7_1_PRESET: SleepingAnimationPreset = {
id: 'GOGO_LOCO_1_7_1',
name: 'GoGo Loco 1.7.1+',
name: 'GoGo Loco',
versions: '1.7.1+',
author: 'franada',
infoLink: 'https://booth.pm/en/items/3290806',
infoLinks: [{ label: 'GoGo Loco (booth.pm)', url: 'https://booth.pm/en/items/3290806' }],
oscScripts: {
SIDE_BACK: parseOscScriptFromCode(`
i 214 /avatar/parameters/VRCEmote
Expand Down Expand Up @@ -86,9 +95,10 @@ b false /avatar/parameters/Go/Stationary

const GOGO_LOCO_LEGACY_PRESET: SleepingAnimationPreset = {
id: 'GOGO_LOCO_LEGACY',
name: 'GoGo Loco 1.6.2 - 1.7.0',
name: 'GoGo Loco',
versions: '1.6.2 - 1.7.0',
author: 'franada',
infoLink: 'https://booth.pm/en/items/3290806',
infoLinks: [{ label: 'GoGo Loco (booth.pm)', url: 'https://booth.pm/en/items/3290806' }],
notes: [
{
type: 'WARNING',
Expand Down Expand Up @@ -143,6 +153,6 @@ b false /avatar/parameters/Go/Stationary

export const SLEEPING_ANIMATION_PRESETS: SleepingAnimationPreset[] = [
MMM_SLEEP_SYSTEM_2_2_PRESET,
// GOGO_LOCO_LEGACY_1_7_1_PRESET,
// GOGO_LOCO_LEGACY_PRESET,
GOGO_LOCO_LEGACY_1_7_1_PRESET,
GOGO_LOCO_LEGACY_PRESET,
];
8 changes: 4 additions & 4 deletions src/app/utils/sleeping-pose-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ export class SleepingPoseDetector {
this.createContactReceiver(3, [0, -8, 7], receiverOrientation, 0xffff00),
];
this.receivers['SIDE_RIGHT'] = [
this.createContactReceiver(4, [0, 9, 4], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, 9, 1], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, 9, 0], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, 9, -4], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, 9, -1], receiverOrientation, 0xffff00),
];
this.receivers['SIDE_LEFT'] = [
this.createContactReceiver(4, [0, -10, 4], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, -10, 1], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, -10, 0], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, -10, -4], receiverOrientation, 0xffff00),
this.createContactReceiver(4, [0, -10, -1], receiverOrientation, 0xffff00),
];
// Determine collisions

Expand Down
Loading

0 comments on commit 05834dd

Please sign in to comment.