Small Godot Wild Jam game
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1 from Raptor1818/gwj-accessibility-scripts

Install gwj-accessibility-scripts from the AssetLib

authored by

Aria and committed by
GitHub
61ec20c4 db0c46cf

+470
addons/gwj_accessibility_scripts/docs/gwj_mascot_80x80.png

This is a binary file and will not be displayed.

+34
addons/gwj_accessibility_scripts/docs/gwj_mascot_80x80.png.import
··· 1 + [remap] 2 + 3 + importer="texture" 4 + type="CompressedTexture2D" 5 + uid="uid://coo7d6ij8kaj2" 6 + path="res://.godot/imported/gwj_mascot_80x80.png-7a8e85c2d492b44bd11d7ed3336e53ec.ctex" 7 + metadata={ 8 + "vram_texture": false 9 + } 10 + 11 + [deps] 12 + 13 + source_file="res://addons/gwj_accessibility_scripts/docs/gwj_mascot_80x80.png" 14 + dest_files=["res://.godot/imported/gwj_mascot_80x80.png-7a8e85c2d492b44bd11d7ed3336e53ec.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
+12
addons/gwj_accessibility_scripts/gwj_accessibility_scripts.gd
··· 1 + @tool 2 + extends EditorPlugin 3 + 4 + 5 + func _enter_tree(): 6 + # Initialization of the plugin goes here. 7 + pass 8 + 9 + 10 + func _exit_tree(): 11 + # Clean-up of the plugin goes here. 12 + pass
+1
addons/gwj_accessibility_scripts/gwj_accessibility_scripts.gd.uid
··· 1 + uid://bmvspwyjvun8g
+59
addons/gwj_accessibility_scripts/options/config.gd
··· 1 + class_name Config 2 + extends Object 3 + 4 + ## Interface for a single configuration file through [ConfigFile]. 5 + 6 + const CONFIG_FILE_LOCATION := "user://config.cfg" 7 + 8 + static var config_file : ConfigFile 9 + 10 + static func _init(): 11 + load_config_file() 12 + 13 + static func _save_config_file() -> void: 14 + var save_error : int = config_file.save(CONFIG_FILE_LOCATION) 15 + if save_error: 16 + push_error("save config file failed with error %d" % save_error) 17 + 18 + static func load_config_file() -> void: 19 + if config_file != null: 20 + return 21 + config_file = ConfigFile.new() 22 + var load_error : int = config_file.load(CONFIG_FILE_LOCATION) 23 + if load_error: 24 + var save_error : int = config_file.save(CONFIG_FILE_LOCATION) 25 + if save_error: 26 + push_error("save config file failed with error %d" % save_error) 27 + 28 + static func set_config(section: String, key: String, value) -> void: 29 + load_config_file() 30 + config_file.set_value(section, key, value) 31 + _save_config_file() 32 + 33 + static func get_config(section: String, key: String, default = null) -> Variant: 34 + load_config_file() 35 + return config_file.get_value(section, key, default) 36 + 37 + static func has_section(section: String): 38 + load_config_file() 39 + return config_file.has_section(section) 40 + 41 + static func has_section_key(section: String, key: String): 42 + load_config_file() 43 + return config_file.has_section_key(section, key) 44 + 45 + static func erase_section(section: String): 46 + if has_section(section): 47 + config_file.erase_section(section) 48 + _save_config_file() 49 + 50 + static func erase_section_key(section: String, key: String): 51 + if has_section_key(section, key): 52 + config_file.erase_section_key(section, key) 53 + _save_config_file() 54 + 55 + static func get_section_keys(section: String): 56 + load_config_file() 57 + if config_file.has_section(section): 58 + return config_file.get_section_keys(section) 59 + return PackedStringArray()
+1
addons/gwj_accessibility_scripts/options/config.gd.uid
··· 1 + uid://bp8554ojsmqyj
+24
addons/gwj_accessibility_scripts/options/mute_button.gd
··· 1 + class_name MuteButton 2 + extends CheckBox 3 + 4 + const AUDIO_CONFIG_SECTION = "Audio" 5 + const MUTE_BUS_PREFIX = "%sMute" 6 + 7 + @export var bus_name: StringName = "Master" 8 + 9 + var _bus_index = 0 10 + 11 + func _ready() -> void: 12 + _bus_index = AudioServer.get_bus_index(bus_name) 13 + var config_value = Config.get_config(AUDIO_CONFIG_SECTION, MUTE_BUS_PREFIX % bus_name, false) 14 + button_pressed = config_value 15 + _set_mute(config_value) 16 + if not toggled.is_connected(_on_toggled): 17 + toggled.connect(_on_toggled) 18 + 19 + func _set_mute(muted: bool) -> void: 20 + AudioServer.set_bus_mute(_bus_index, muted) 21 + Config.set_config(AUDIO_CONFIG_SECTION, MUTE_BUS_PREFIX % bus_name, muted) 22 + 23 + func _on_toggled(toggled_on): 24 + _set_mute(toggled_on) # Replace with function body.
+1
addons/gwj_accessibility_scripts/options/mute_button.gd.uid
··· 1 + uid://dcc1nru5grl3l
+6
addons/gwj_accessibility_scripts/options/mute_button.tscn
··· 1 + [gd_scene load_steps=2 format=3 uid="uid://cf00wkvfngqp2"] 2 + 3 + [ext_resource type="Script" uid="uid://dcc1nru5grl3l" path="res://addons/gwj_accessibility_scripts/options/mute_button.gd" id="1_1reos"] 4 + 5 + [node name="MuteButton" type="CheckBox"] 6 + script = ExtResource("1_1reos")
+42
addons/gwj_accessibility_scripts/options/rebindable_action.gd
··· 1 + class_name RebindableActionButton 2 + extends Button 3 + 4 + const INPUT_CONFIG_SECTION = "Input" 5 + 6 + # Set this string to the name of the action in the InputMap 7 + @export var action: String 8 + 9 + func _ready(): 10 + var action_events = InputMap.action_get_events(action) 11 + if action_events.is_empty(): return 12 + var default_input = action_events[0] 13 + var config_value = Config.get_config(INPUT_CONFIG_SECTION, action, default_input) 14 + _update_button_text(config_value) 15 + if not toggled.is_connected(_on_toggled): 16 + toggled.connect(_on_toggled) 17 + 18 + func _input(input_event: InputEvent) -> void: 19 + if button_pressed and not input_event is InputEventMouseMotion: 20 + if not input_event.is_pressed(): 21 + set_pressed_no_signal(false) 22 + release_focus() 23 + InputMap.action_erase_events(action) 24 + InputMap.action_add_event(action, input_event) 25 + _update_button_text(input_event) 26 + Config.set_config(INPUT_CONFIG_SECTION, action, input_event) 27 + grab_focus() 28 + 29 + func _update_button_text(input_event: InputEvent) -> void: 30 + if input_event is InputEventMouseButton: 31 + if input_event.button_index == MOUSE_BUTTON_LEFT: 32 + text = "Mouse Left" 33 + elif input_event.button_index == MOUSE_BUTTON_RIGHT: 34 + text = "Mouse Right" 35 + elif input_event.button_index == MOUSE_BUTTON_MIDDLE: 36 + text = "Mouse Middle" 37 + else: 38 + text = input_event.as_text() 39 + 40 + func _on_toggled(button_pressed_state): 41 + if button_pressed_state: 42 + text = "press a key..."
+1
addons/gwj_accessibility_scripts/options/rebindable_action.gd.uid
··· 1 + uid://d3kq44lbqrr8l
+11
addons/gwj_accessibility_scripts/options/rebindable_action.tscn
··· 1 + [gd_scene load_steps=2 format=3 uid="uid://ce2r6mevl3dp2"] 2 + 3 + [ext_resource type="Script" uid="uid://d3kq44lbqrr8l" path="res://addons/gwj_accessibility_scripts/options/rebindable_action.gd" id="1"] 4 + 5 + [node name="Button" type="Button"] 6 + offset_right = 21.0 7 + offset_bottom = 20.0 8 + toggle_mode = true 9 + text = "Space" 10 + script = ExtResource("1") 11 + action = "ui_select"
+25
addons/gwj_accessibility_scripts/options/setting_slider.gd
··· 1 + class_name SettingSlider 2 + extends Slider 3 + 4 + 5 + @export var config_section : StringName 6 + @export var config_key: StringName 7 + @export var feedback_sound_path: NodePath 8 + 9 + var _feedback_sound: AudioStreamPlayer = null 10 + 11 + func _ready() -> void: 12 + if not feedback_sound_path.is_empty(): 13 + _feedback_sound = get_node(feedback_sound_path) 14 + if not Config.has_section_key(config_section, config_key): 15 + Config.set_config(config_section, config_key, value) 16 + var config_value = Config.get_config(config_section, config_key, 0.0) 17 + set_value_no_signal(config_value) 18 + if not value_changed.is_connected(_on_value_changed): 19 + value_changed.connect(_on_value_changed) 20 + 21 + func _on_value_changed(new_value: float) -> void: 22 + Config.set_config(config_section, config_key, new_value) 23 + if _feedback_sound != null: 24 + if not _feedback_sound.is_playing(): 25 + _feedback_sound.play()
+1
addons/gwj_accessibility_scripts/options/setting_slider.gd.uid
··· 1 + uid://c5ihdq0pht7s6
+11
addons/gwj_accessibility_scripts/options/setting_slider.tscn
··· 1 + [gd_scene load_steps=2 format=3 uid="uid://dh5kn8bfiy1wn"] 2 + 3 + [ext_resource type="Script" uid="uid://c5ihdq0pht7s6" path="res://addons/gwj_accessibility_scripts/options/setting_slider.gd" id="1_g864b"] 4 + 5 + [node name="SettingSlider" type="HSlider"] 6 + offset_right = 106.0 7 + offset_bottom = 16.0 8 + max_value = 1.0 9 + step = 0.05 10 + value = 0.5 11 + script = ExtResource("1_g864b")
+36
addons/gwj_accessibility_scripts/options/volume_slider.gd
··· 1 + class_name VolumeSlider 2 + extends Slider 3 + 4 + const AUDIO_CONFIG_SECTION = "Audio" 5 + 6 + @export var bus_name: StringName = "Master" 7 + # This path can link to an AudioStreamPlayer node to play after the volume has changed. 8 + # For a music volume slider it should not be used (music should be playing while in the menu), 9 + # but for a sounds volume slider it helps the user adjust to the right volume. 10 + @export var feedback_sound_path: NodePath 11 + 12 + var _feedback_sound: AudioStreamPlayer = null 13 + var _original_bus_volume : float = 1.0 14 + 15 + var _bus_index = 0 16 + 17 + func _ready() -> void: 18 + if not feedback_sound_path.is_empty(): 19 + _feedback_sound = get_node(feedback_sound_path) 20 + _bus_index = AudioServer.get_bus_index(bus_name) 21 + _original_bus_volume = db_to_linear(AudioServer.get_bus_volume_db(_bus_index)) 22 + var config_value = Config.get_config(AUDIO_CONFIG_SECTION, bus_name, 1.0) 23 + set_value_no_signal(config_value) 24 + _set_volume(config_value) 25 + if not value_changed.is_connected(_on_value_changed): 26 + value_changed.connect(_on_value_changed) 27 + 28 + func _set_volume(volume_linear: float) -> void: 29 + AudioServer.set_bus_volume_db(_bus_index, linear_to_db(volume_linear * _original_bus_volume)) 30 + Config.set_config(AUDIO_CONFIG_SECTION, bus_name, volume_linear) 31 + 32 + func _on_value_changed(new_value: float) -> void: 33 + _set_volume(new_value) 34 + if _feedback_sound != null: 35 + if not _feedback_sound.is_playing(): 36 + _feedback_sound.play()
+1
addons/gwj_accessibility_scripts/options/volume_slider.gd.uid
··· 1 + uid://dlp8wpikc6x75
+11
addons/gwj_accessibility_scripts/options/volume_slider.tscn
··· 1 + [gd_scene load_steps=2 format=3 uid="uid://cxch7x2j3wv3p"] 2 + 3 + [ext_resource type="Script" uid="uid://dlp8wpikc6x75" path="res://addons/gwj_accessibility_scripts/options/volume_slider.gd" id="1"] 4 + 5 + [node name="VolumeSlider" type="HSlider"] 6 + offset_right = 106.0 7 + offset_bottom = 16.0 8 + max_value = 1.0 9 + step = 0.05 10 + value = 0.5 11 + script = ExtResource("1")
+9
addons/gwj_accessibility_scripts/plugin.cfg
··· 1 + [plugin] 2 + 3 + name="GWJ Accessibility Scripts" 4 + description="Scripts for managing accessibility and persistent settings. 5 + 6 + Created by the Godot Wild Jam community." 7 + author="Godot Wild Jam" 8 + version="0.1.0" 9 + script="gwj_accessibility_scripts.gd"
examples-from-addons/gwj_options_menu/assets/feedback_sound.wav

This is a binary file and will not be displayed.

+24
examples-from-addons/gwj_options_menu/assets/feedback_sound.wav.import
··· 1 + [remap] 2 + 3 + importer="wav" 4 + type="AudioStreamWAV" 5 + uid="uid://nb5bufmvmchf" 6 + path="res://.godot/imported/feedback_sound.wav-5d262628a2e5079010920d2e8bb8b2c0.sample" 7 + 8 + [deps] 9 + 10 + source_file="res://examples-from-addons/gwj_options_menu/assets/feedback_sound.wav" 11 + dest_files=["res://.godot/imported/feedback_sound.wav-5d262628a2e5079010920d2e8bb8b2c0.sample"] 12 + 13 + [params] 14 + 15 + force/8_bit=false 16 + force/mono=false 17 + force/max_rate=false 18 + force/max_rate_hz=44100 19 + edit/trim=false 20 + edit/normalize=false 21 + edit/loop_mode=0 22 + edit/loop_begin=0 23 + edit/loop_end=-1 24 + compress/mode=0
+160
examples-from-addons/gwj_options_menu/scenes/options_menu_example.tscn
··· 1 + [gd_scene load_steps=6 format=3 uid="uid://glhpumkx46qg"] 2 + 3 + [ext_resource type="PackedScene" uid="uid://ce2r6mevl3dp2" path="res://addons/gwj_accessibility_scripts/options/rebindable_action.tscn" id="1_ee5m2"] 4 + [ext_resource type="PackedScene" uid="uid://cxch7x2j3wv3p" path="res://addons/gwj_accessibility_scripts/options/volume_slider.tscn" id="2_vxtyn"] 5 + [ext_resource type="AudioStream" uid="uid://nb5bufmvmchf" path="res://examples-from-addons/gwj_options_menu/assets/feedback_sound.wav" id="3_vlk37"] 6 + [ext_resource type="PackedScene" uid="uid://cf00wkvfngqp2" path="res://addons/gwj_accessibility_scripts/options/mute_button.tscn" id="4_sokce"] 7 + [ext_resource type="PackedScene" uid="uid://dh5kn8bfiy1wn" path="res://addons/gwj_accessibility_scripts/options/setting_slider.tscn" id="5_jc3wj"] 8 + 9 + [node name="MarginContainer" type="MarginContainer"] 10 + anchors_preset = 15 11 + anchor_right = 1.0 12 + anchor_bottom = 1.0 13 + theme_override_constants/margin_left = 20 14 + theme_override_constants/margin_top = 20 15 + theme_override_constants/margin_right = 20 16 + theme_override_constants/margin_bottom = 20 17 + 18 + [node name="HotkeysContainer" type="HBoxContainer" parent="."] 19 + layout_mode = 2 20 + theme_override_constants/separation = 80 21 + 22 + [node name="GridContainer" type="GridContainer" parent="HotkeysContainer"] 23 + layout_mode = 2 24 + theme_override_constants/h_separation = 10 25 + theme_override_constants/v_separation = 10 26 + columns = 2 27 + 28 + [node name="UiUp" type="HBoxContainer" parent="HotkeysContainer/GridContainer"] 29 + layout_mode = 2 30 + 31 + [node name="Label" type="Label" parent="HotkeysContainer/GridContainer/UiUp"] 32 + layout_mode = 2 33 + text = "Move Up:" 34 + 35 + [node name="RebindableAction" parent="HotkeysContainer/GridContainer/UiUp" instance=ExtResource("1_ee5m2")] 36 + layout_mode = 2 37 + keep_pressed_outside = true 38 + text = "Up" 39 + action = "move_up" 40 + 41 + [node name="UiDown" type="HBoxContainer" parent="HotkeysContainer/GridContainer"] 42 + layout_mode = 2 43 + 44 + [node name="Label" type="Label" parent="HotkeysContainer/GridContainer/UiDown"] 45 + layout_mode = 2 46 + text = "Move Down:" 47 + 48 + [node name="RebindableAction" parent="HotkeysContainer/GridContainer/UiDown" instance=ExtResource("1_ee5m2")] 49 + layout_mode = 2 50 + text = "Down" 51 + action = "move_down" 52 + 53 + [node name="UILeft" type="HBoxContainer" parent="HotkeysContainer/GridContainer"] 54 + layout_mode = 2 55 + 56 + [node name="Label" type="Label" parent="HotkeysContainer/GridContainer/UILeft"] 57 + layout_mode = 2 58 + text = "Move Left:" 59 + 60 + [node name="RebindableAction" parent="HotkeysContainer/GridContainer/UILeft" instance=ExtResource("1_ee5m2")] 61 + layout_mode = 2 62 + text = "Left" 63 + action = "move_left" 64 + 65 + [node name="UIRight" type="HBoxContainer" parent="HotkeysContainer/GridContainer"] 66 + layout_mode = 2 67 + 68 + [node name="Label" type="Label" parent="HotkeysContainer/GridContainer/UIRight"] 69 + layout_mode = 2 70 + text = "Move Right:" 71 + 72 + [node name="RebindableAction" parent="HotkeysContainer/GridContainer/UIRight" instance=ExtResource("1_ee5m2")] 73 + layout_mode = 2 74 + text = "Right" 75 + action = "move_right" 76 + 77 + [node name="HBoxContainer" type="HBoxContainer" parent="HotkeysContainer/GridContainer"] 78 + layout_mode = 2 79 + 80 + [node name="Label" type="Label" parent="HotkeysContainer/GridContainer/HBoxContainer"] 81 + layout_mode = 2 82 + text = "Interact:" 83 + 84 + [node name="RebindableAction" parent="HotkeysContainer/GridContainer/HBoxContainer" instance=ExtResource("1_ee5m2")] 85 + layout_mode = 2 86 + action = "interact" 87 + 88 + [node name="VolumeContainer" type="VBoxContainer" parent="HotkeysContainer"] 89 + layout_mode = 2 90 + 91 + [node name="Label" type="Label" parent="HotkeysContainer/VolumeContainer"] 92 + layout_mode = 2 93 + text = "Master Volume" 94 + 95 + [node name="VolumeSlider" parent="HotkeysContainer/VolumeContainer" instance=ExtResource("2_vxtyn")] 96 + layout_mode = 2 97 + value = 1.0 98 + feedback_sound_path = NodePath("AudioStreamPlayer") 99 + 100 + [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="HotkeysContainer/VolumeContainer/VolumeSlider"] 101 + stream = ExtResource("3_vlk37") 102 + 103 + [node name="MuteContainer" type="HBoxContainer" parent="HotkeysContainer/VolumeContainer"] 104 + layout_mode = 2 105 + 106 + [node name="Label" type="Label" parent="HotkeysContainer/VolumeContainer/MuteContainer"] 107 + layout_mode = 2 108 + size_flags_horizontal = 3 109 + text = "Mute" 110 + 111 + [node name="MuteButton" parent="HotkeysContainer/VolumeContainer/MuteContainer" instance=ExtResource("4_sokce")] 112 + layout_mode = 2 113 + 114 + [node name="VBoxContainer" type="VBoxContainer" parent="HotkeysContainer"] 115 + layout_mode = 2 116 + 117 + [node name="Label2" type="Label" parent="HotkeysContainer/VBoxContainer"] 118 + layout_mode = 2 119 + text = "Generic Examples" 120 + 121 + [node name="HSeparator" type="HSeparator" parent="HotkeysContainer/VBoxContainer"] 122 + layout_mode = 2 123 + 124 + [node name="Label4" type="Label" parent="HotkeysContainer/VBoxContainer"] 125 + layout_mode = 2 126 + text = "Game Difficulty" 127 + 128 + [node name="SettingSlider" parent="HotkeysContainer/VBoxContainer" instance=ExtResource("5_jc3wj")] 129 + layout_mode = 2 130 + max_value = 2.0 131 + step = 0.5 132 + value = 1.0 133 + config_section = &"Game" 134 + config_key = &"difficulty" 135 + 136 + [node name="Label3" type="Label" parent="HotkeysContainer/VBoxContainer"] 137 + layout_mode = 2 138 + text = "Input Sensitivity" 139 + 140 + [node name="SettingSlider2" parent="HotkeysContainer/VBoxContainer" instance=ExtResource("5_jc3wj")] 141 + layout_mode = 2 142 + max_value = 2.0 143 + step = 0.5 144 + value = 1.0 145 + config_section = &"Input" 146 + config_key = &"sensitivity" 147 + 148 + [node name="Label5" type="Label" parent="HotkeysContainer/VBoxContainer"] 149 + layout_mode = 2 150 + text = "Brightness Levels" 151 + 152 + [node name="SettingSlider3" parent="HotkeysContainer/VBoxContainer" instance=ExtResource("5_jc3wj")] 153 + layout_mode = 2 154 + max_value = 2.0 155 + step = 0.5 156 + value = 1.0 157 + config_section = &"Video" 158 + config_key = &"brightness" 159 + 160 + [editable path="HotkeysContainer/GridContainer/HBoxContainer/RebindableAction"]