diff --git a/worlds/apquest/client/custom_views.py b/worlds/apquest/client/custom_views.py index 4c1d28c732..026aa1fc8d 100644 --- a/worlds/apquest/client/custom_views.py +++ b/worlds/apquest/client/custom_views.py @@ -77,7 +77,7 @@ class APQuestGrid(GridLayout): parent_width, parent_height = self.parent.size self_width_according_to_parent_height = parent_height * 12 / 11 - self_height_according_to_parent_width = parent_height * 11 / 12 + self_height_according_to_parent_width = parent_width * 11 / 12 if self_width_according_to_parent_height > parent_width: self.size = parent_width, self_height_according_to_parent_width diff --git a/worlds/apquest/client/graphics.py b/worlds/apquest/client/graphics.py index 535bf84ee8..0e31218c6f 100644 --- a/worlds/apquest/client/graphics.py +++ b/worlds/apquest/client/graphics.py @@ -1,10 +1,10 @@ import pkgutil -from collections.abc import Buffer from enum import Enum from io import BytesIO from typing import Literal, NamedTuple, Protocol, cast from kivy.uix.image import CoreImage +from typing_extensions import Buffer from CommonClient import logger diff --git a/worlds/apquest/client/sounds.py b/worlds/apquest/client/sounds.py index f4c4ab769d..1e1999bff2 100644 --- a/worlds/apquest/client/sounds.py +++ b/worlds/apquest/client/sounds.py @@ -1,12 +1,12 @@ import asyncio import pkgutil from asyncio import Task -from collections.abc import Buffer from pathlib import Path from typing import cast from kivy import Config from kivy.core.audio import Sound, SoundLoader +from typing_extensions import Buffer from CommonClient import logger @@ -85,7 +85,7 @@ class SoundManager: def ensure_config(self) -> None: Config.adddefaultsection("APQuest") - Config.setdefault("APQuest", "volume", 50) + Config.setdefault("APQuest", "volume", 30) self.set_volume_percentage(Config.getint("APQuest", "volume")) async def sound_manager_loop(self) -> None: @@ -149,6 +149,7 @@ class SoundManager: continue if sound_name == audio_filename: + sound.volume = self.volume_percentage / 100 sound.play() self.update_background_music() higher_priority_sound_is_playing = True @@ -213,6 +214,7 @@ class SoundManager: # It ends up feeling better if this just always continues playing quietly after being started. # Even "fading in at a random spot" is better than restarting the song after a jingle / math trap. if self.game_started and song.state == "stop": + song.volume = self.current_background_music_volume * self.volume_percentage / 100 song.play() song.seek(0) continue @@ -228,6 +230,7 @@ class SoundManager: if self.current_background_music_volume != 0: if song.state == "stop": + song.volume = self.current_background_music_volume * self.volume_percentage / 100 song.play() song.seek(0)