Initial Android commit

This commit is contained in:
OleSTEEP 2024-11-10 03:34:28 +03:00
commit 1e2b80c13d
8521 changed files with 231475 additions and 0 deletions

View file

@ -0,0 +1,113 @@
tool
extends GridContainer
signal data_updated(section)
var loading = false
var editor_reference
var path = ""
onready var n:Dictionary = {
"enable":$"FileHBoxContainer/EnableCheckBox",
"path":$"FileHBoxContainer/PathButton",
"volume":$"VolumeHBoxContainer/VolumeSpinBox",
"volume_rand_range":$"VolumeHBoxContainer/VolumeRandRangeSpinBox",
"pitch":$"PitchHBoxContainer/PitchSpinBox",
"pitch_rand_range":$"PitchHBoxContainer/PitchRandRangeSpinBox",
"allow_interrupt":$"AllowInterruptCheckBox",
"audio_bus":$"AudioBusOptionButton"
}
func _ready():
editor_reference = find_parent("EditorView")
AudioServer.connect("bus_layout_changed", self, "_on_bus_layout_changed")
update_audio_bus_option_buttons()
func set_data(data):
loading = true
n["enable"].set_pressed(data["enable"])
path = data["path"]
_on_Path_selected(path)
n["path"].text = DTS.translate("File or folder path")
n["volume"].set_value(data["volume"])
n["volume_rand_range"].set_value(data["volume_rand_range"])
n["pitch"].set_value(data["pitch"])
n["pitch_rand_range"].set_value(data["pitch_rand_range"])
n["allow_interrupt"].set_pressed(data["allow_interrupt"])
update_audio_bus_option_buttons(data["audio_bus"])
_set_disabled( not data["enable"])
loading = false
func get_data():
return {
"enable":n["enable"].is_pressed(),
"path":path,
"volume":n["volume"].get_value(),
"volume_rand_range":n["volume_rand_range"].get_value(),
"pitch":n["pitch"].get_value(),
"pitch_rand_range":n["pitch_rand_range"].get_value(),
"allow_interrupt":n["allow_interrupt"].is_pressed(),
"audio_bus":AudioServer.get_bus_name(n["audio_bus"].get_selected_id())
}
func _on_EnableCheckBox_toggled(button_pressed):
if not loading:emit_signal("data_updated", name.to_lower())
_set_disabled( not button_pressed)
func _set_disabled(disabled):
n["path"].set_disabled(disabled)
n["volume"].set_editable( not disabled)
n["volume_rand_range"].set_editable( not disabled)
n["pitch"].set_editable( not disabled)
n["pitch_rand_range"].set_editable( not disabled)
n["allow_interrupt"].set_disabled(disabled)
n["audio_bus"].set_disabled(disabled)
func _on_PathButton_pressed():
editor_reference.godot_dialog("*.ogg, *.wav", EditorFileDialog.MODE_OPEN_ANY)
editor_reference.godot_dialog_connect(self, "_on_Path_selected", ["dir_selected", "file_selected"])
func _on_Path_selected(selected_path, target = ""):
if typeof(selected_path) == TYPE_STRING and path != "":
path = selected_path
n["path"].text = DialogicResources.get_filename_from_path(path)
if not loading:emit_signal("data_updated", name.to_lower())
func _on_VolumeSpinBox_value_changed(value):
if not loading:emit_signal("data_updated", name.to_lower())
func _on_VolumeRandRangeSpinBox_value_changed(value):
n["volume_rand_range"].set_value(abs(value))
if not loading:emit_signal("data_updated", name.to_lower())
func _on_PitchSpinBox_value_changed(value):
n["pitch"].set_value(max(0.01, value))
if not loading:emit_signal("data_updated", name.to_lower())
func _on_PitchRandRangeSpinBox_value_changed(value):
n["pitch_rand_range"].set_value(abs(value))
if not loading:emit_signal("data_updated", name.to_lower())
func _on_AllowInterruptCheckBox_toggled(button_pressed):
if not loading:emit_signal("data_updated", name.to_lower())
func _on_AudioBusOptionButton_item_selected(index):
if not loading:emit_signal("data_updated", name.to_lower())
func _on_bus_layout_changed():
var selected_id = n["audio_bus"].get_selected_id()
var selected_text = n["audio_bus"].get_item_text(selected_id)
update_audio_bus_option_buttons(selected_text)
func update_audio_bus_option_buttons(selected_text = ""):
n["audio_bus"].clear()
for i in range(AudioServer.bus_count):
var bus_name = AudioServer.get_bus_name(i)
n["audio_bus"].add_item(bus_name)
if bus_name == selected_text:
n["audio_bus"].select(i)

View file

@ -0,0 +1,146 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/AudioPicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Common/TLabel.tscn" type="PackedScene" id=2]
[node name="AudioPicker" type="GridContainer"]
margin_right = 265.0
margin_bottom = 132.0
size_flags_horizontal = 3
custom_constants/hseparation = 10
columns = 2
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="FileLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 5.0
margin_right = 95.0
margin_bottom = 19.0
text = "Lautstärke"
text_key = "UseAudio"
[node name="FileHBoxContainer" type="HBoxContainer" parent="."]
margin_left = 105.0
margin_right = 265.0
margin_bottom = 24.0
[node name="EnableCheckBox" type="CheckBox" parent="FileHBoxContainer"]
margin_right = 24.0
margin_bottom = 24.0
[node name="PathButton" type="Button" parent="FileHBoxContainer"]
margin_left = 28.0
margin_right = 160.0
margin_bottom = 24.0
size_flags_horizontal = 3
text = "File or Folder"
[node name="VolumeLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 33.0
margin_right = 95.0
margin_bottom = 47.0
text = "Volume"
text_key = "Volume"
[node name="VolumeHBoxContainer" type="HBoxContainer" parent="."]
margin_left = 105.0
margin_top = 28.0
margin_right = 265.0
margin_bottom = 52.0
size_flags_horizontal = 3
[node name="VolumeSpinBox" type="SpinBox" parent="VolumeHBoxContainer"]
margin_right = 82.0
margin_bottom = 24.0
size_flags_horizontal = 3
size_flags_vertical = 4
min_value = -80.0
step = 0.01
[node name="VolumeRandRangeSpinBox" type="SpinBox" parent="VolumeHBoxContainer"]
margin_left = 86.0
margin_right = 160.0
margin_bottom = 24.0
hint_tooltip = "Random Range"
step = 0.01
prefix = "±"
[node name="PitchLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 61.0
margin_right = 95.0
margin_bottom = 75.0
text = "Pitch"
text_key = "Pitch"
[node name="PitchHBoxContainer" type="HBoxContainer" parent="."]
margin_left = 105.0
margin_top = 56.0
margin_right = 265.0
margin_bottom = 80.0
size_flags_horizontal = 3
[node name="PitchSpinBox" type="SpinBox" parent="PitchHBoxContainer"]
margin_right = 82.0
margin_bottom = 24.0
size_flags_horizontal = 3
size_flags_vertical = 4
step = 0.01
[node name="PitchRandRangeSpinBox" type="SpinBox" parent="PitchHBoxContainer"]
margin_left = 86.0
margin_right = 160.0
margin_bottom = 24.0
hint_tooltip = "Random Range"
max_value = 10.0
step = 0.01
prefix = "±"
[node name="InterruptLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 89.0
margin_right = 95.0
margin_bottom = 103.0
text = "Allow interrupt"
text_key = "Allow interrupt"
[node name="AllowInterruptCheckBox" type="CheckBox" parent="."]
margin_left = 105.0
margin_top = 84.0
margin_right = 265.0
margin_bottom = 108.0
[node name="AudioBusLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 115.0
margin_right = 95.0
margin_bottom = 129.0
text = "AudioBus"
text_key = "Audio Bus"
[node name="AudioBusOptionButton" type="OptionButton" parent="."]
margin_left = 105.0
margin_top = 112.0
margin_right = 265.0
margin_bottom = 132.0
text = "Master"
items = [ "Master", null, false, 0, null ]
selected = 0
[connection signal="toggled" from="FileHBoxContainer/EnableCheckBox" to="." method="_on_EnableCheckBox_toggled"]
[connection signal="pressed" from="FileHBoxContainer/PathButton" to="." method="_on_PathButton_pressed"]
[connection signal="value_changed" from="VolumeHBoxContainer/VolumeSpinBox" to="." method="_on_VolumeSpinBox_value_changed"]
[connection signal="value_changed" from="VolumeHBoxContainer/VolumeRandRangeSpinBox" to="." method="_on_VolumeRandRangeSpinBox_value_changed"]
[connection signal="value_changed" from="PitchHBoxContainer/PitchSpinBox" to="." method="_on_PitchSpinBox_value_changed"]
[connection signal="value_changed" from="PitchHBoxContainer/PitchRandRangeSpinBox" to="." method="_on_PitchRandRangeSpinBox_value_changed"]
[connection signal="toggled" from="AllowInterruptCheckBox" to="." method="_on_AllowInterruptCheckBox_toggled"]
[connection signal="item_selected" from="AudioBusOptionButton" to="." method="_on_AudioBusOptionButton_item_selected"]

View file

@ -0,0 +1,81 @@
tool
extends GridContainer
signal style_modified(section)
signal picking_background(section)
var real_file_path = "res://addons/dialogic/Example Assets/backgrounds/background-2.png"
func load_style(data):
$TextColor / CheckBox.pressed = data[0]
$TextColor / ColorPickerButton.color = data[1]
$FlatBackground / CheckBox.pressed = data[2]
$FlatBackground / ColorPickerButton.color = data[3]
$BackgroundTexture / CheckBox.pressed = data[4]
set_path(data[5])
$TextureModulation / CheckBox.pressed = data[6]
$TextureModulation / ColorPickerButton.color = data[7]
check_visible_buttons()
func get_style_array():
var results = []
results.append($TextColor / CheckBox.pressed)
results.append($TextColor / ColorPickerButton.color)
results.append($FlatBackground / CheckBox.pressed)
results.append($FlatBackground / ColorPickerButton.color)
results.append($BackgroundTexture / CheckBox.pressed)
results.append(real_file_path)
results.append($TextureModulation / CheckBox.pressed)
results.append($TextureModulation / ColorPickerButton.color)
return results
func set_path(path):
$BackgroundTexture / Button.text = DialogicResources.get_filename_from_path(path)
func check_visible_buttons():
$FlatBackground / ColorPickerButton.visible = $FlatBackground / CheckBox.pressed
if $FlatBackground / CheckBox.pressed:
$BackgroundTexture.visible = false
$BackgroundTextureLabel.visible = false
$TextureModulation.visible = false
$TextureModulationLabel.visible = false
else :
$BackgroundTexture.visible = true
$BackgroundTextureLabel.visible = true
$TextureModulation.visible = true
$TextureModulationLabel.visible = true
func _on_CheckBox_toggled(button_pressed):
emit_signal("style_modified", name.to_lower())
check_visible_buttons()
func _on_ColorPickerButton_color_changed(color):
emit_signal("style_modified", name.to_lower())
func _on_Button_pressed():
emit_signal("picking_background", name.to_lower())
func _on_button_texture_selected(path, target)->void :
emit_signal("style_modified", name.to_lower())
func _on_TextColor_ColorPickerButton_color_changed(color):
$TextColor / CheckBox.pressed = true
emit_signal("style_modified", name.to_lower())

View file

@ -0,0 +1,133 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/ButtonStylePicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Common/TLabel.tscn" type="PackedScene" id=2]
[node name="ButtonStylePicker" type="GridContainer"]
margin_right = 380.0
margin_bottom = 112.0
size_flags_horizontal = 3
custom_constants/hseparation = 10
columns = 2
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 5.0
margin_right = 126.0
margin_bottom = 19.0
text = "Text Color"
text_key = "Text Color"
[node name="TextColor" type="HBoxContainer" parent="."]
margin_left = 136.0
margin_right = 296.0
margin_bottom = 24.0
rect_min_size = Vector2( 160, 0 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CheckBox" type="CheckBox" parent="TextColor"]
margin_right = 24.0
margin_bottom = 24.0
[node name="ColorPickerButton" type="ColorPickerButton" parent="TextColor"]
margin_left = 28.0
margin_right = 160.0
margin_bottom = 24.0
size_flags_horizontal = 3
color = Color( 1, 1, 1, 1 )
[node name="TLabel2" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 33.0
margin_right = 126.0
margin_bottom = 47.0
text = "Flat background"
text_key = "Flat background"
[node name="FlatBackground" type="HBoxContainer" parent="."]
margin_left = 136.0
margin_top = 28.0
margin_right = 296.0
margin_bottom = 52.0
[node name="CheckBox" type="CheckBox" parent="FlatBackground"]
margin_right = 24.0
margin_bottom = 24.0
[node name="ColorPickerButton" type="ColorPickerButton" parent="FlatBackground"]
visible = false
margin_left = 28.0
margin_right = 160.0
margin_bottom = 24.0
size_flags_horizontal = 3
[node name="BackgroundTextureLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 61.0
margin_right = 126.0
margin_bottom = 75.0
text = "Background Texture"
text_key = "Background Texture"
[node name="BackgroundTexture" type="HBoxContainer" parent="."]
margin_left = 136.0
margin_top = 56.0
margin_right = 296.0
margin_bottom = 80.0
rect_min_size = Vector2( 123, 0 )
[node name="CheckBox" type="CheckBox" parent="BackgroundTexture"]
margin_right = 24.0
margin_bottom = 24.0
[node name="Button" type="Button" parent="BackgroundTexture"]
margin_left = 28.0
margin_right = 160.0
margin_bottom = 24.0
size_flags_horizontal = 3
text = "Don't change"
[node name="TextureModulationLabel" parent="." instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 89.0
margin_right = 126.0
margin_bottom = 103.0
text = "Texture Modulation"
text_key = "Texture Modulation"
[node name="TextureModulation" type="HBoxContainer" parent="."]
margin_left = 136.0
margin_top = 84.0
margin_right = 296.0
margin_bottom = 108.0
rect_min_size = Vector2( 123, 0 )
[node name="CheckBox" type="CheckBox" parent="TextureModulation"]
margin_right = 24.0
margin_bottom = 24.0
[node name="ColorPickerButton" type="ColorPickerButton" parent="TextureModulation"]
margin_left = 28.0
margin_right = 160.0
margin_bottom = 24.0
size_flags_horizontal = 3
color = Color( 1, 1, 1, 1 )
[connection signal="toggled" from="TextColor/CheckBox" to="." method="_on_CheckBox_toggled"]
[connection signal="color_changed" from="TextColor/ColorPickerButton" to="." method="_on_TextColor_ColorPickerButton_color_changed"]
[connection signal="toggled" from="FlatBackground/CheckBox" to="." method="_on_CheckBox_toggled"]
[connection signal="color_changed" from="FlatBackground/ColorPickerButton" to="." method="_on_ColorPickerButton_color_changed"]
[connection signal="toggled" from="BackgroundTexture/CheckBox" to="." method="_on_CheckBox_toggled"]
[connection signal="pressed" from="BackgroundTexture/Button" to="." method="_on_Button_pressed"]
[connection signal="toggled" from="TextureModulation/CheckBox" to="." method="_on_CheckBox_toggled"]
[connection signal="color_changed" from="TextureModulation/ColorPickerButton" to="." method="_on_ColorPickerButton_color_changed"]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
[settings]
name="Default Theme"