Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

複数エンジン対応:エンジンのアイコンをキャラアイコンの近くに表示するように #942

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/components/AudioCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
getDefaultStyle(characterInfo.metas.speakerUuid).iconPath
"
/>
<q-avatar
class="engine-icon"
rounded
v-if="
isMultipleEngine && characterInfo.metas.styles.length < 2
"
>
<img :src="engineInfos[characterInfo.engineId].iconData" />
</q-avatar>
</q-avatar>
<div>{{ characterInfo.metas.speakerName }}</div>
</q-btn>
Expand Down Expand Up @@ -114,6 +123,17 @@
characterInfo.metas.styles[styleIndex].iconPath
"
/>
<q-avatar
rounded
class="engine-icon"
v-if="isMultipleEngine"
>
<img
:src="
engineInfos[characterInfo.engineId].iconData
"
/>
</q-avatar>
</q-avatar>
<q-item-section v-if="style.styleName"
>{{ characterInfo.metas.speakerName }} ({{
Expand Down Expand Up @@ -433,6 +453,9 @@ export default defineComponent({
textfield.value.focus();
};

// 複数エンジン
const isMultipleEngine = computed(() => store.state.engineIds.length > 1);

return {
userOrderedCharacterInfos,
isInitializingSpeaker,
Expand All @@ -447,6 +470,8 @@ export default defineComponent({
reassignSubMenuOpen,
isActiveAudioCell,
audioTextBuffer,
isMultipleEngine,
engineInfos: store.state.engineInfos,
sevenc-nanashi marked this conversation as resolved.
Show resolved Hide resolved
setAudioTextBuffer,
pushAudioText,
changeStyleId,
Expand Down Expand Up @@ -562,5 +587,27 @@ export default defineComponent({
.opened-character-item {
background-color: rgba(colors.$primary-rgb, 0.2);
}
.engine-name {
// position: absolute;
// left: 4px;
// bottom: 0;
margin-top: auto;
margin-left: auto;
padding-left: 8px;
text-align: right;
opacity: 67%;
font-size: 0.67rem;
}
sevenc-nanashi marked this conversation as resolved.
Show resolved Hide resolved
.engine-icon {
position: absolute;
bottom: 0;
right: 0;
transform: translate(50%, 50%);

:deep(img) {
width: 27.5% !important;
height: 27.5% !important;
}
}
}
</style>
1 change: 1 addition & 0 deletions src/store/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ export const audioStore: VoiceVoxStoreOptions<
const styles = getStyles(speaker, speakerInfo);
const characterInfo: CharacterInfo = {
portraitPath: base64ToUrl(speakerInfo.portrait, "image/png"),
engineId,
metas: {
speakerUuid: speaker.speakerUuid,
speakerName: speaker.name,
Expand Down
1 change: 1 addition & 0 deletions src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export type MetasJson = {

export type CharacterInfo = {
portraitPath: string;
engineId: string;
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
metas: {
speakerUuid: string;
speakerName: string;
Expand Down