update windows to configure control #3

This commit is contained in:
AleaJactaEst 2022-03-06 18:15:34 +01:00
parent f13e51ca5a
commit 2350c98af9
8 changed files with 595 additions and 4 deletions

View file

@ -113,3 +113,119 @@ msgstr "Please select your button mouse"
msgid "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
msgstr "Please select your button joypad"
msgid "INPUT_ACTION_UP"
msgstr ""
msgid "INPUT_ACTION_DOWN"
msgstr ""
msgid "INPUT_ACTION_LEFT"
msgstr ""
msgid "INPUT_ACTION_RIGHT"
msgstr ""
msgid "INPUT_ACTION_STRAFE_LEFT"
msgstr ""
msgid "INPUT_ACTION_STRAFE_RIGHT"
msgstr ""
msgid "INPUT_ACTION_RUN"
msgstr ""
msgid "INPUT_ACTION_AUTO_UP"
msgstr ""
msgid "INPUT_ACTION_SIT_DOWN"
msgstr ""
msgid "INPUT_ACTION_FLY"
msgstr ""
msgid "INPUT_ACTION_ENTER_VEHICLE"
msgstr ""
msgid "INPUT_VIEW_CAMERA_LEFT"
msgstr ""
msgid "INPUT_VIEW_CAMERA_RIGHT"
msgstr ""
msgid "INPUT_VIEW_CAMERA_UP"
msgstr ""
msgid "INPUT_VIEW_CAMERA_DOWN"
msgstr ""
msgid "INPUT_VIEW_UP"
msgstr ""
msgid "INPUT_VIEW_DOWN"
msgstr ""
msgid "INPUT_VIEW_FRONT"
msgstr ""
msgid "INPUT_VIEW_BACK"
msgstr ""
msgid "INPUT_VIEW_CAMERA_FPS_TPS"
msgstr ""
msgid "INPUT_VIEW_SCREENSHOT"
msgstr ""
msgid "INPUT_VIEW_ZOOM_IN"
msgstr ""
msgid "INPUT_VIEW_ZOOM_OUT"
msgstr ""
msgid "CONTROL_VIEW_BY_GROUP"
msgstr ""
#, fuzzy
msgid "CONTROL_VIEW_BY_INPUT"
msgstr "Sort by input"
msgid "CONTROL_VIEW_BY_INPUT_SORTED"
msgstr ""
#, fuzzy
msgid "CONTROL_INPUT_ACTION"
msgstr "Cancel"
#, fuzzy
msgid "CONTROL_INPUT_VIEW"
msgstr "Cancel"
#, fuzzy
msgid "CONTROL_INPUT_OTHER"
msgstr "Cancel"
#, fuzzy
msgid "CONTROL_ADD_INPUT"
msgstr "Sort by input"
#, fuzzy
msgid "CONTROL_DEL_INPUT"
msgstr "Cancel"
msgid "BUTTON_RIGHT"
msgstr ""
msgid "BUTTON_LEFT"
msgstr ""
msgid "BUTTON_WHEEL_UP"
msgstr ""
msgid "BUTTON_WHEEL_DOWN"
msgstr ""
msgid "INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW"
msgstr ""
msgid "INPUT_VIEW_CAMERA_MOVE_ONLY"
msgstr ""

View file

@ -112,3 +112,114 @@ msgstr "Merci d'appuyer sur un bouton de la souris"
msgid "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
msgstr "Merci d'appuyer sur un bouton de votre manette de jeux"
msgid "INPUT_ACTION_UP"
msgstr "En avant"
msgid "INPUT_ACTION_DOWN"
msgstr "En arrière"
msgid "INPUT_ACTION_LEFT"
msgstr "Tourner à gauche"
msgid "INPUT_ACTION_RIGHT"
msgstr "Tourner à droite"
msgid "INPUT_ACTION_STRAFE_LEFT"
msgstr "Déplacement latéral à gauche"
msgid "INPUT_ACTION_STRAFE_RIGHT"
msgstr "Déplacement latéral à droite"
msgid "INPUT_ACTION_RUN"
msgstr "Courir/Marcher"
msgid "INPUT_ACTION_AUTO_UP"
msgstr "Marche auto"
msgid "INPUT_ACTION_SIT_DOWN"
msgstr "S'asseoir/se lever"
msgid "INPUT_ACTION_FLY"
msgstr "Voler"
msgid "INPUT_ACTION_ENTER_VEHICLE"
msgstr "Monter/Descendre d'un véhicule"
msgid "INPUT_VIEW_CAMERA_LEFT"
msgstr "Caméra sur axe vertical, gauche"
msgid "INPUT_VIEW_CAMERA_RIGHT"
msgstr "Caméra sur axe vertical, droite"
msgid "INPUT_VIEW_CAMERA_UP"
msgstr "Caméra sur axe horizontal, haut"
msgid "INPUT_VIEW_CAMERA_DOWN"
msgstr "Caméra sur axe horizontal, bas"
msgid "INPUT_VIEW_UP"
msgstr "Centre de l'axe plus bas"
msgid "INPUT_VIEW_DOWN"
msgstr "Centre de l'axe plus haut"
msgid "INPUT_VIEW_FRONT"
msgstr "Recentrer la caméra derrière le personnage"
msgid "INPUT_VIEW_BACK"
msgstr "Regarder derrière soi"
msgid "INPUT_VIEW_CAMERA_FPS_TPS"
msgstr "1ère/3ème personne"
msgid "INPUT_VIEW_SCREENSHOT"
msgstr "Capture d'écran"
msgid "INPUT_VIEW_ZOOM_IN"
msgstr "Zoommer"
msgid "INPUT_VIEW_ZOOM_OUT"
msgstr "Dézoomer"
msgid "CONTROL_VIEW_BY_GROUP"
msgstr "Afficher par groupe"
msgid "CONTROL_VIEW_BY_INPUT"
msgstr "Afficher par entrée"
msgid "CONTROL_VIEW_BY_INPUT_SORTED"
msgstr "Trié par rapport aux entrées"
msgid "CONTROL_INPUT_ACTION"
msgstr "Action"
msgid "CONTROL_INPUT_VIEW"
msgstr "Vue"
msgid "CONTROL_INPUT_OTHER"
msgstr "Autre"
msgid "CONTROL_ADD_INPUT"
msgstr "Ajouter"
msgid "CONTROL_DEL_INPUT"
msgstr "Supprimer"
msgid "BUTTON_RIGHT"
msgstr "Bouton droit de la souris"
msgid "BUTTON_LEFT"
msgstr "Bouton gauche de la souris"
msgid "BUTTON_WHEEL_UP"
msgstr "Molette souris vers avant"
msgid "BUTTON_WHEEL_DOWN"
msgstr "Molette souris vers arrière"
msgid "INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW"
msgstr "Déplacer la caméra et le joueur suit"
msgid "INPUT_VIEW_CAMERA_MOVE_ONLY"
msgstr "Déplacer la caméra seulement"

Binary file not shown.

View file

@ -104,3 +104,114 @@ msgstr ""
msgid "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
msgstr ""
msgid "INPUT_ACTION_UP"
msgstr ""
msgid "INPUT_ACTION_DOWN"
msgstr ""
msgid "INPUT_ACTION_LEFT"
msgstr ""
msgid "INPUT_ACTION_RIGHT"
msgstr ""
msgid "INPUT_ACTION_STRAFE_LEFT"
msgstr ""
msgid "INPUT_ACTION_STRAFE_RIGHT"
msgstr ""
msgid "INPUT_ACTION_RUN"
msgstr ""
msgid "INPUT_ACTION_AUTO_UP"
msgstr ""
msgid "INPUT_ACTION_SIT_DOWN"
msgstr ""
msgid "INPUT_ACTION_FLY"
msgstr ""
msgid "INPUT_ACTION_ENTER_VEHICLE"
msgstr ""
msgid "INPUT_VIEW_CAMERA_LEFT"
msgstr ""
msgid "INPUT_VIEW_CAMERA_RIGHT"
msgstr ""
msgid "INPUT_VIEW_CAMERA_UP"
msgstr ""
msgid "INPUT_VIEW_CAMERA_DOWN"
msgstr ""
msgid "INPUT_VIEW_UP"
msgstr ""
msgid "INPUT_VIEW_DOWN"
msgstr ""
msgid "INPUT_VIEW_FRONT"
msgstr ""
msgid "INPUT_VIEW_BACK"
msgstr ""
msgid "INPUT_VIEW_CAMERA_FPS_TPS"
msgstr ""
msgid "INPUT_VIEW_SCREENSHOT"
msgstr ""
msgid "INPUT_VIEW_ZOOM_IN"
msgstr ""
msgid "INPUT_VIEW_ZOOM_OUT"
msgstr ""
msgid "CONTROL_VIEW_BY_GROUP"
msgstr ""
msgid "CONTROL_VIEW_BY_INPUT"
msgstr ""
msgid "CONTROL_VIEW_BY_INPUT_SORTED"
msgstr ""
msgid "CONTROL_INPUT_ACTION"
msgstr ""
msgid "CONTROL_INPUT_VIEW"
msgstr ""
msgid "CONTROL_INPUT_OTHER"
msgstr ""
msgid "CONTROL_ADD_INPUT"
msgstr ""
msgid "CONTROL_DEL_INPUT"
msgstr ""
msgid "BUTTON_RIGHT"
msgstr ""
msgid "BUTTON_LEFT"
msgstr ""
msgid "BUTTON_WHEEL_UP"
msgstr ""
msgid "BUTTON_WHEEL_DOWN"
msgstr ""
msgid "INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW"
msgstr ""
msgid "INPUT_VIEW_CAMERA_MOVE_ONLY"
msgstr ""

View file

@ -101,6 +101,133 @@ board_ship={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":70,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_UP={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":87,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_DOWN={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_LEFT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_RIGHT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_STRAFE_LEFT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":81,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_STRAFE_RIGHT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":69,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_RUN={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777224,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_AUTO_UP={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":82,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_SIT_DOWN={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777223,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_FLY={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":70,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_ACTION_ENTER_VEHICLE={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":88,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_CAMERA_LEFT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777231,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_CAMERA_RIGHT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777233,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_CAMERA_UP={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777232,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_CAMERA_DOWN={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777234,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_UP={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":true,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777232,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_DOWN={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":true,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777234,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_FRONT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":true,"pressed":false,"keycode":16777232,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_BACK={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":true,"pressed":false,"keycode":16777234,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_CAMERA_FPS_TPS={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":86,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_SCREENSHOT={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777226,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_ZOOM_IN={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":4,"pressed":false,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":true,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777235,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_ZOOM_OUT={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"button_mask":16,"position":Vector2(321, 157),"global_position":Vector2(321, 157),"factor":1.0,"button_index":5,"pressed":true,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":true,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777236,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"button_mask":2,"position":Vector2(217, 135),"global_position":Vector2(217, 135),"factor":1.0,"button_index":2,"pressed":true,"double_click":false,"script":null)
]
}
INPUT_VIEW_CAMERA_MOVE_ONLY={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"pressed":false,"double_click":false,"script":null)
]
}
[internationalization]

View file

@ -132,10 +132,87 @@ func load_current_control():
func configure_control():
if $Window/VBox/Menu/SortByInput.is_pressed():
configure_control_sort_by_input()
else:
if $Window/VBox/Menu/ShowMethod.get_selected() == 0:
$Window/VBox/Input.visible = false
$Window/VBox/Tree.visible = true
configure_control_by_group()
elif $Window/VBox/Menu/ShowMethod.get_selected() == 1:
$Window/VBox/Tree.visible = false
$Window/VBox/Input.visible = true
configure_control_sort_by_categories()
else:
$Window/VBox/Tree.visible = false
$Window/VBox/Input.visible = true
configure_control_sort_by_input()
func configure_control_by_group():
$Window/VBox/Tree.clear()
var root = $Window/VBox/Tree.create_item()
$Window/VBox/Tree.hide_root = true
var child_action = $Window/VBox/Tree.create_item(root)
child_action.set_text(0, tr("CONTROL_INPUT_ACTION"))
var child_view = $Window/VBox/Tree.create_item(root)
child_view.set_text(0, tr("CONTROL_INPUT_VIEW"))
var child_other = $Window/VBox/Tree.create_item(root)
child_other.set_text(0, tr("CONTROL_INPUT_OTHER"))
for action in InputMap.get_actions():
var text:String = action
if text.find("INPUT_ACTION") == 0:
var subchild:TreeItem = $Window/VBox/Tree.create_item(child_action)
subchild.set_text(0, tr(text))
var buttontxt : Texture2D = preload("res://scenes/controls/add.png")
subchild.add_button(0, buttontxt, 0, false, "CONTROL_ADD_INPUT")
subchild.set_meta("action", 0)
subchild.set_meta("group", action)
var a = InputMap.action_get_events(action)
for z in a:
var text2:String = Common.get_string_input(z)
var subchild2:TreeItem = $Window/VBox/Tree.create_item(subchild)
subchild2.set_text(0, tr(text2))
var button2txt : Texture2D = preload("res://scenes/controls/trash.png")
subchild2.add_button(0, button2txt, 0, false, "CONTROL_DEL_INPUT")
subchild2.set_meta("action", 1)
subchild2.set_meta("group", action)
subchild2.set_meta("control", z)
elif text.find("INPUT_VIEW") == 0:
var subchild:TreeItem = $Window/VBox/Tree.create_item(child_view)
subchild.set_text(0, tr(text))
var buttontxt : Texture2D = preload("res://scenes/controls/add.png")
subchild.add_button(0, buttontxt, 0, false, "CONTROL_ADD_INPUT")
subchild.set_meta("action", 0)
subchild.set_meta("group", action)
var a = InputMap.action_get_events(action)
for z in a:
var text2:String = Common.get_string_input(z)
var subchild2:TreeItem = $Window/VBox/Tree.create_item(subchild)
subchild2.set_text(0, tr(text2))
var button2txt : Texture2D = preload("res://scenes/controls/trash.png")
subchild2.add_button(0, button2txt, 0, false, "CONTROL_DEL_INPUT")
subchild2.set_meta("action", 1)
subchild2.set_meta("group", action)
subchild2.set_meta("control", z)
else:
var subchild:TreeItem = $Window/VBox/Tree.create_item(child_other)
subchild.set_text(0, tr(text))
var buttontxt : Texture2D = preload("res://scenes/controls/add.png")
subchild.add_button(0, buttontxt, 0, false, "CONTROL_ADD_INPUT")
subchild.set_meta("action", 0)
subchild.set_meta("group", action)
var a = InputMap.action_get_events(action)
for z in a:
var text2:String = Common.get_string_input(z)
var subchild2:TreeItem = $Window/VBox/Tree.create_item(subchild)
subchild2.set_text(0, tr(text2))
var button2txt : Texture2D = preload("res://scenes/controls/trash.png")
subchild2.add_button(0, button2txt, 0, false, "CONTROL_DEL_INPUT")
subchild2.set_meta("action", 1)
subchild2.set_meta("group", action)
subchild2.set_meta("control", z)
func __button_pressed():
print("__button_pressed")
func configure_control_sort_by_input():
@ -232,3 +309,20 @@ func _on_control_box_add_pressed(action, command):
$SelectType/Window.popup_centered()
$SelectType/Window.visible = true
func _on_option_button_item_selected(index):
configure_control()
func _on_tree_button_pressed(item:TreeItem, column, id):
if item.has_meta("action") and item.has_meta("group"):
var action = item.get_meta("group")
if item.get_meta("action") == 0:
$SelectType.set_param(action, "signal_refresh" )
$SelectType/Window.popup_centered()
$SelectType/Window.visible = true
elif item.has_meta("control"):
var control = item.get_meta("control")
InputMap.action_erase_event(action, control)
configure_control()

View file

@ -36,7 +36,21 @@ offset_right = 1024.0
offset_bottom = 31.0
size_flags_horizontal = 3
[node name="ShowMethod" type="OptionButton" parent="Window/VBox/Menu"]
offset_right = 43.0
offset_bottom = 31.0
text = "CONTROL_VIEW_BY_GROUP"
item_count = 3
selected = 0
popup/item_0/text = "CONTROL_VIEW_BY_GROUP"
popup/item_0/id = 0
popup/item_1/text = "CONTROL_VIEW_BY_INPUT"
popup/item_1/id = 1
popup/item_2/text = "CONTROL_VIEW_BY_INPUT_SORTED"
popup/item_2/id = 2
[node name="SortByInput" type="CheckBox" parent="Window/VBox/Menu"]
visible = false
offset_right = 510.0
offset_bottom = 31.0
size_flags_horizontal = 7
@ -62,6 +76,12 @@ offset_bottom = 530.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Tree" type="Tree" parent="Window/VBox"]
visible = false
offset_right = 40.0
offset_bottom = 40.0
size_flags_vertical = 3
[node name="Quit" type="Button" parent="Window/VBox"]
offset_left = 491.0
offset_top = 569.0
@ -74,6 +94,8 @@ text = "EDIT_CONTROL/QUIT"
[node name="SelectType" parent="." instance=ExtResource( "2_ps0mu" )]
[connection signal="close_requested" from="Window" to="." method="_on_quit_pressed"]
[connection signal="item_selected" from="Window/VBox/Menu/ShowMethod" to="." method="_on_option_button_item_selected"]
[connection signal="pressed" from="Window/VBox/Menu/SortByInput" to="." method="_on_sort_by_input_pressed"]
[connection signal="pressed" from="Window/VBox/Menu/Reload" to="." method="reload_control_system"]
[connection signal="button_pressed" from="Window/VBox/Tree" to="." method="_on_tree_button_pressed"]
[connection signal="pressed" from="Window/VBox/Quit" to="." method="_on_quit_pressed"]

View file

@ -4,6 +4,7 @@ declare DEBUG=0
declare HELP=0
declare EDITOR=0
declare FORCE=0
declare IMPORT=0
declare WORKDIR="$(dirname $(readlink -f $0))"
declare GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha3/Godot_v4.0-alpha3_linux.64.zip"
declare OUTZIP="$WORKDIR/$(basename $GODOT_SRC)"
@ -84,7 +85,7 @@ function extract()
}
while getopts hdeo:s:f flag
while getopts hdeo:s:fi flag
do
case "${flag}" in
h) HELP=1;;
@ -93,6 +94,7 @@ do
o) OUTZIP=${OPTARG};;
s) GODOT_SRC=${OPTARG};;
f) FORCE=1;;
i) IMPORT=1;;
*) HELP=1;;
esac
done
@ -106,6 +108,7 @@ $(basename $0) [Option] : Donwload Launch Godot
-d : Show debug message
-e : Start Godot in editor mode
-f : force download & uncompress
-i : force import data
-o <File> : target godot file (downloaded)
-s <Url> : Url to download a specific godot version
EOF
@ -118,6 +121,12 @@ download "$GODOT_SRC" "$OUTZIP"
EXE=$(extract "$OUTZIP")
msg_info "Prg:$EXE"
if [ $IMPORT -ne 0 ]
then
$WORKDIR/$EXE --editor --quit
exit $?
fi
if [ $EDITOR -ne 0 ]
then
OPTION="$OPTION -e"
@ -126,4 +135,5 @@ fi
$WORKDIR/$EXE $OPTION
msg_info "End"