Initial commit

This commit is contained in:
2024-02-08 22:16:58 +01:00
commit 89e97a200c
524 changed files with 15626 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -0,0 +1,96 @@
@tool
extends Control
@onready var btn_save_preset = %BtnSavePreset
@onready var btn_load_preset = %BtnLoadPreset
@onready var lin_ed_preset_name = %LinEdPresetName
@onready var dropdown = %Dropdown
@onready var btn_import = %BtnImport
@onready var confirmation_dialog = $ConfirmationDialog
@onready var file_dialog = $FileDialog
var folder_path : String
# Called when the node enters the scene tree for the first time.
func _ready():
btn_load_preset.pressed.connect(on_btn_pressed_load)
btn_save_preset.pressed.connect(on_btn_pressed_save)
btn_import.pressed.connect(on_btn_pressed_import)
confirmation_dialog.confirmed.connect(on_confirmed_restart)
file_dialog.dialog_hide_on_ok = true
file_dialog.access = 2
file_dialog.dir_selected.connect(on_folder_selected)
btn_import.disabled = true
func on_folder_selected(path):
folder_path = path
btn_import.disabled = false
dir_contents(path)
func on_confirmed_restart():
EditorPlugin.new().get_editor_interface().restart_editor()
func on_btn_pressed_import():
var file_path = folder_path.path_join(dropdown.get_item_text(dropdown.selected))
var config = ConfigFile.new()
var err = config.load(file_path)
if err != OK:
return
for input_name in config.get_section_keys("input"):
var action_obj = config.get_value("input", input_name)
ProjectSettings.set_setting("input/" + input_name, action_obj)
ProjectSettings.save()
confirmation_dialog.popup_centered()
func on_btn_pressed_load():
file_dialog.popup_centered()
func on_btn_pressed_save():
if lin_ed_preset_name.text != null:
save_test_file()
func save_test_file():
InputMap.load_from_project_settings()
var config = ConfigFile.new()
var Actions = InputMap.get_actions()
for action in Actions:
if not action.begins_with("ui"):
var input_object = {
"deadzone": InputMap.action_get_deadzone(action),
"events": InputMap.action_get_events(action)
}
config.set_value("input", action, input_object)
# Save it to a file (overwrite if already exists).
config.save(folder_path.path_join(lin_ed_preset_name.text + ".godot"))
func dir_contents(path):
dropdown.clear()
var dir = DirAccess.open(path)
if dir:
dir.list_dir_begin()
var file_name = dir.get_next()
while file_name != "":
if dir.current_is_dir():
print("Found directory: " + file_name)
else:
if file_name.ends_with(".godot"):
dropdown.add_item(file_name)
file_name = dir.get_next()
else:
print("An error occurred when trying to access the path.")

View File

@@ -0,0 +1,78 @@
[gd_scene load_steps=2 format=3 uid="uid://cpunnqo5npx7a"]
[ext_resource type="Script" path="res://addons/inputmapperpresetloader/InputMapperPresets.gd" id="1_m65gv"]
[node name="InputMapperPresets" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_m65gv")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="HBoxContainer2" type="VBoxContainer" parent="MarginContainer"]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer2"]
layout_mode = 2
[node name="BtnSavePreset" type="Button" parent="MarginContainer/HBoxContainer2/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Saves the projects current input map using name given to the right of this button and it ends with `.godot`
Will ignore default values (anything that starts with `ui`"
text = "Save"
[node name="LinEdPresetName" type="LineEdit" parent="MarginContainer/HBoxContainer2/HBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "The name the config file will have and it ends with a `.godot`"
[node name="TxtExtention" type="Label" parent="MarginContainer/HBoxContainer2/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
text = ".godot"
[node name="BtnLoadPreset" type="Button" parent="MarginContainer/HBoxContainer2/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Select the folder that has your saved config files"
text = "Select Folder"
[node name="Dropdown" type="OptionButton" parent="MarginContainer/HBoxContainer2"]
unique_name_in_owner = true
layout_mode = 2
allow_reselect = true
[node name="BtnImport" type="Button" parent="MarginContainer/HBoxContainer2"]
unique_name_in_owner = true
layout_mode = 2
disabled = true
text = "Import"
[node name="FileDialog" type="FileDialog" parent="."]
title = "Open a Directory"
size = Vector2i(480, 240)
min_size = Vector2i(480, 240)
ok_button_text = "Select Current Folder"
dialog_hide_on_ok = true
file_mode = 2
access = 2
root_subfolder = "C:\\Users\\Light\\AppData\\Roaming\\Godot"
[node name="ConfirmationDialog" type="AcceptDialog" parent="."]
dialog_text = "Restart Project Now?"

View File

@@ -0,0 +1,17 @@
@tool
extends EditorPlugin
const editorAddon = preload("res://addons/inputmapperpresetloader/InputMapperPresets.tscn")
var InputMapperPresetsScene
func _enter_tree():
InputMap.load_from_project_settings()
InputMapperPresetsScene = editorAddon.instantiate()
add_control_to_dock(EditorPlugin.DOCK_SLOT_RIGHT_UL, InputMapperPresetsScene)
func _exit_tree():
remove_control_from_docks(InputMapperPresetsScene)
InputMapperPresetsScene.free()

View File

@@ -0,0 +1,7 @@
[plugin]
name="InputMapperPresetLoader"
description="This plugin works by letting users save/import pre-defined Input Maps"
author="Light1c3"
version="1.0.0"
script="inputmapperpresetloader.gd"

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2023 The Godot Engine community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
[configuration]
entry_symbol = "git_plugin_init"
compatibility_minimum = "4.1.0"
[libraries]
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
windows.editor.x86_64 = "win64/libgit_plugin.windows.editor.x86_64.dll"
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
linux.editor.arm64 = "linux/libgit_plugin.linux.editor.arm64.so"
linux.editor.rv64 = ""

View File

@@ -0,0 +1,7 @@
[plugin]
name="Godot Git Plugin"
description="This plugin lets you interact with Git without leaving the Godot editor. More information can be found at https://github.com/godotengine/godot-git-plugin/wiki"
author="twaritwaikar"
version="v3.1.0"
script="godot-git-plugin.gd"