Skip to content

Commit

Permalink
feat(AudioTheme): add support for audio/sfx themes
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowApex committed Jun 17, 2024
1 parent 1fc541e commit 76676a8
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
10 changes: 10 additions & 0 deletions assets/audio/themes/default.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="AudioTheme" load_steps=2 format=3 uid="uid://d70xost7hk1i"]

[ext_resource type="Script" path="res://core/systems/audio/audio_theme.gd" id="1_7ff30"]

[resource]
script = ExtResource("1_7ff30")
intro = ""
focus = "res://assets/audio/interface/536764__egomassive__toss.ogg"
select = "res://assets/audio/interface/96127__bmaczero__contact1.ogg"
open_menu = ""
1 change: 1 addition & 0 deletions assets/editor-icons/icon-park-outline--sound-wave.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/editor-icons/icon-park-outline--sound-wave.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://brtu0g62ohgn1"
path="res://.godot/imported/icon-park-outline--sound-wave.svg-6694d7867012105e482585279d7a4c37.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/editor-icons/icon-park-outline--sound-wave.svg"
dest_files=["res://.godot/imported/icon-park-outline--sound-wave.svg-6694d7867012105e482585279d7a4c37.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
45 changes: 45 additions & 0 deletions core/systems/audio/audio_theme.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@icon("res://assets/editor-icons/icon-park-outline--sound-wave.svg")
extends Resource
class_name AudioTheme

## Resource for customizing the UI audio sounds

@export_category("General")
## Unique name of the audio theme
@export var name: String

@export_category("Global")
## Sounds to play when OpenGamepadUI first launches
@export_file("*.ogg") var intro := ""
## Sound to play when volume is increased
@export_file("*.ogg") var audio_volume_up := ""
## Sound to play when volume is decreased
@export_file("*.ogg") var audio_volume_down := ""
## Ambient background music to play in menus
@export_file("*.ogg") var ambient_music := ""
## Sound to play when a notification is displayed
@export_file("*.ogg") var notification_display := ""

@export_category("Side Menus")
## Sound to play when side menus (Main menu and QB menu) open
@export_file("*.ogg") var side_menu_open := ""
## Sound to play when side menus (Main menu and QB menu) close
@export_file("*.ogg") var side_menu_close := ""

@export_category("Button")
## Sound to play when button is focused
@export_file("*.ogg") var button_focus := "res://assets/audio/interface/536764__egomassive__toss.ogg"
## Sound to play when button is selected
@export_file("*.ogg") var button_select := "res://assets/audio/interface/96127__bmaczero__contact1.ogg"

@export_category("Slider")
## Sound to play when slider is focused
@export_file("*.ogg") var slider_focus := "res://assets/audio/interface/536764__egomassive__toss.ogg"
## Sound to play when slider value changes
@export_file("*.ogg") var slider_change := ""

@export_category("Toggle")
## Sound to play when toggle is focused
@export_file("*.ogg") var toggle_focus := "res://assets/audio/interface/536764__egomassive__toss.ogg"
## Sound to play when toggle value changes
@export_file("*.ogg") var toggle_change := ""

0 comments on commit 76676a8

Please sign in to comment.