Skip to content

Commit 76676a8

Browse files
committed
feat(AudioTheme): add support for audio/sfx themes
1 parent 1fc541e commit 76676a8

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

assets/audio/themes/default.tres

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[gd_resource type="Resource" script_class="AudioTheme" load_steps=2 format=3 uid="uid://d70xost7hk1i"]
2+
3+
[ext_resource type="Script" path="res://core/systems/audio/audio_theme.gd" id="1_7ff30"]
4+
5+
[resource]
6+
script = ExtResource("1_7ff30")
7+
intro = ""
8+
focus = "res://assets/audio/interface/536764__egomassive__toss.ogg"
9+
select = "res://assets/audio/interface/96127__bmaczero__contact1.ogg"
10+
open_menu = ""
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://brtu0g62ohgn1"
6+
path="res://.godot/imported/icon-park-outline--sound-wave.svg-6694d7867012105e482585279d7a4c37.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://assets/editor-icons/icon-park-outline--sound-wave.svg"
14+
dest_files=["res://.godot/imported/icon-park-outline--sound-wave.svg-6694d7867012105e482585279d7a4c37.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1
35+
svg/scale=1.0
36+
editor/scale_with_editor_scale=false
37+
editor/convert_colors_with_editor_theme=false

core/systems/audio/audio_theme.gd

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@icon("res://assets/editor-icons/icon-park-outline--sound-wave.svg")
2+
extends Resource
3+
class_name AudioTheme
4+
5+
## Resource for customizing the UI audio sounds
6+
7+
@export_category("General")
8+
## Unique name of the audio theme
9+
@export var name: String
10+
11+
@export_category("Global")
12+
## Sounds to play when OpenGamepadUI first launches
13+
@export_file("*.ogg") var intro := ""
14+
## Sound to play when volume is increased
15+
@export_file("*.ogg") var audio_volume_up := ""
16+
## Sound to play when volume is decreased
17+
@export_file("*.ogg") var audio_volume_down := ""
18+
## Ambient background music to play in menus
19+
@export_file("*.ogg") var ambient_music := ""
20+
## Sound to play when a notification is displayed
21+
@export_file("*.ogg") var notification_display := ""
22+
23+
@export_category("Side Menus")
24+
## Sound to play when side menus (Main menu and QB menu) open
25+
@export_file("*.ogg") var side_menu_open := ""
26+
## Sound to play when side menus (Main menu and QB menu) close
27+
@export_file("*.ogg") var side_menu_close := ""
28+
29+
@export_category("Button")
30+
## Sound to play when button is focused
31+
@export_file("*.ogg") var button_focus := "res://assets/audio/interface/536764__egomassive__toss.ogg"
32+
## Sound to play when button is selected
33+
@export_file("*.ogg") var button_select := "res://assets/audio/interface/96127__bmaczero__contact1.ogg"
34+
35+
@export_category("Slider")
36+
## Sound to play when slider is focused
37+
@export_file("*.ogg") var slider_focus := "res://assets/audio/interface/536764__egomassive__toss.ogg"
38+
## Sound to play when slider value changes
39+
@export_file("*.ogg") var slider_change := ""
40+
41+
@export_category("Toggle")
42+
## Sound to play when toggle is focused
43+
@export_file("*.ogg") var toggle_focus := "res://assets/audio/interface/536764__egomassive__toss.ogg"
44+
## Sound to play when toggle value changes
45+
@export_file("*.ogg") var toggle_change := ""

0 commit comments

Comments
 (0)