merge aleajactaest

This commit is contained in:
AleaJactaEst 2022-05-24 22:59:03 +02:00
commit 1736143a8f
14 changed files with 639 additions and 437 deletions

View file

@ -301,3 +301,27 @@ msgstr "Reverse vertical"
msgid "NO_MOUSE_BUTTON"
msgstr "Nothing"
msgid "INPUT_VIEW_CAMERA_LEFT_JOYPAD"
msgstr "Camera Left (Joypad)"
msgid "INPUT_VIEW_CAMERA_RIGHT_JOYPAD"
msgstr "Camera Right (Joypad)"
msgid "INPUT_VIEW_CAMERA_FORWARD_JOYPAD"
msgstr "camera Up (Joypad)"
msgid "INPUT_VIEW_CAMERA_BACK_JOYPAD"
msgstr "Camera Down (Joypad)"
msgid "INPUT_ACTION_PLAYER_LEFT_JOYPAD"
msgstr "Move Left (Joypad)"
msgid "INPUT_ACTION_PLAYER_RIGHT_JOYPAD"
msgstr "Move Right (Joypad)"
msgid "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
msgstr "Move Up (Joypad)"
msgid "INPUT_ACTION_PLAYER_BACK_JOYPAD"
msgstr "Move Down (Joypad)"

View file

@ -301,3 +301,27 @@ msgstr "Inversé verticale"
msgid "NO_MOUSE_BUTTON"
msgstr "Rien n'est sélectionné"
msgid "INPUT_VIEW_CAMERA_LEFT_JOYPAD"
msgstr "Caméra à gauche (Manette)"
msgid "INPUT_VIEW_CAMERA_RIGHT_JOYPAD"
msgstr "Caméra à droite (Manette)"
msgid "INPUT_VIEW_CAMERA_FORWARD_JOYPAD"
msgstr "Caméra en haut (Manette)"
msgid "INPUT_VIEW_CAMERA_BACK_JOYPAD"
msgstr "Caméra en bas (Manette)"
msgid "INPUT_ACTION_PLAYER_LEFT_JOYPAD"
msgstr "Déplacer à gauche (Manette)"
msgid "INPUT_ACTION_PLAYER_RIGHT_JOYPAD"
msgstr "Déplacer à droite (Manette)"
msgid "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
msgstr "Déplacer en haut (Manette)"
msgid "INPUT_ACTION_PLAYER_BACK_JOYPAD"
msgstr "Déplacer en bas (Manette)"

Binary file not shown.

View file

@ -293,5 +293,39 @@ msgstr ""
msgid "NO_MOUSE_BUTTON"
msgstr ""
msgid "INPUT_VIEW_CAMERA_LEFT_JOYPAD"
msgstr ""
msgid "INPUT_VIEW_CAMERA_RIGHT_JOYPAD"
msgstr ""
msgid "INPUT_VIEW_CAMERA_FORWARD_JOYPAD"
msgstr ""
msgid "INPUT_VIEW_CAMERA_BACK_JOYPAD"
msgstr ""
msgid "INPUT_ACTION_PLAYER_LEFT_JOYPAD"
msgstr ""
msgid "INPUT_ACTION_PLAYER_RIGHT_JOYPAD"
msgstr ""
msgid "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
msgstr ""
msgid "INPUT_ACTION_PLAYER_BACK_JOYPAD"
msgstr ""
msgid "FACTOR_CAMERA_HORIZONTALE_JOYPAD"
msgstr ""
msgid "FACTOR_CAMERA_VERTICALE_JOYPAD"
msgstr ""
msgid "FACTOR_PLAYER_HORIZONTALE_JOYPAD"
msgstr ""
msgid "FACTOR_PLAYER_VERTICALE_JOYPAD"
msgstr ""

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -793,6 +793,15 @@ func rotate_camera_y(angle_y):
detect_camera_collision_y(-angle_y)
func rotate_player(angle_x, angle_y):
player_rotate_y += angle_y
if player_rotate_y > PI:
player_rotate_y -= TAU
elif player_rotate_y <= -PI:
player_rotate_y += TAU
rotate_y( -angle_y )
func move_camera(angle_x, angle_y):
var new_camera_rotate_x = camera_rotate_x + angle_x
if angle_x != 0.0 and new_camera_rotate_x <= PI_2 and new_camera_rotate_x >= - PI_2:
@ -940,6 +949,14 @@ func _process( delta ):
var y = 0
var animation_selected:AnimationSelected = AnimationSelected.IDLE
# Joypad
if tps:
var move_camera:Vector2 = Input.get_vector("INPUT_VIEW_CAMERA_LEFT_JOYPAD", "INPUT_VIEW_CAMERA_RIGHT_JOYPAD", "INPUT_VIEW_CAMERA_FORWARD_JOYPAD", "INPUT_VIEW_CAMERA_BACK_JOYPAD")
move_camera(move_camera.y * Common.get_factor_camera_verticale_joypad() * delta, move_camera.x * Common.get_factor_camera_horizontale_joypad() * delta)
var player_joypad:Vector2 = Input.get_vector("INPUT_ACTION_PLAYER_LEFT_JOYPAD", "INPUT_ACTION_PLAYER_RIGHT_JOYPAD", "INPUT_ACTION_PLAYER_FORWARD_JOYPAD", "INPUT_ACTION_PLAYER_BACK_JOYPAD")
#rotate_player(player_joypad.y * Common.get_factor_player_verticale_joypad() * delta, player_joypad.x * Common.get_factor_player_horizontale_joypad() * delta)
y += player_joypad.x * Common.get_factor_player_verticale_joypad()
if offset_camera_current != offset_camera_target:
var offset_diff = move_camera_y_one_step( offset_camera_target - offset_camera_current, MOVE_CAMERA_Y_OFFSET)
offset_camera_current += offset_diff

View file

@ -28,6 +28,14 @@ shapes/collision/shape_color=Color(0, 0.6, 0.701961, 0.419608)
[input]
ui_accept={
"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":16777221,"physical_keycode":0,"unicode":16777221,"echo":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":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777222,"physical_keycode":0,"unicode":16777222,"echo":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":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"unicode":32,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
]
}
ui_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":16777231,"echo":false,"script":null)
@ -60,6 +68,7 @@ ui_menu={
"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":16777262,"physical_keycode":0,"unicode":16777262,"echo":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":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777217,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
]
}
ui_strafe={
@ -288,17 +297,45 @@ INPUT_ACTION_CAMERA_MOVE_PLAYER_MOUSE_PLUS={
"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_PLAYER_FOLLOW_JOYPAD={
INPUT_VIEW_CAMERA_LEFT_JOYPAD={
"deadzone": 0.5,
"events": []
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
]
}
INPUT_VIEW_CAMERA_MOVE_ONLY_JOYPAD={
INPUT_VIEW_CAMERA_RIGHT_JOYPAD={
"deadzone": 0.5,
"events": []
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
]
}
INPUT_ACTION_CAMERA_MOVE_PLAYER_JOYPAD={
INPUT_VIEW_CAMERA_FORWARD_JOYPAD={
"deadzone": 0.5,
"events": []
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
]
}
INPUT_VIEW_CAMERA_BACK_JOYPAD={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
]
}
INPUT_ACTION_PLAYER_LEFT_JOYPAD={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":-1.0,"script":null)
]
}
INPUT_ACTION_PLAYER_RIGHT_JOYPAD={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":1.0,"script":null)
]
}
INPUT_ACTION_PLAYER_FORWARD_JOYPAD={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":-1.0,"script":null)
]
}
INPUT_ACTION_PLAYER_BACK_JOYPAD={
"deadzone": 0.5,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":1.0,"script":null)
]
}
[internationalization]

View file

@ -142,12 +142,30 @@ func load_current_control():
func update_mouse_button_move_camera():
Common.msg_debug("update_mouse_button_move_camera")
$Window/v/Tab/MOUSE/v/CameraPlayer/h1/SelectButton.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW_MOUSE"))
$Window/v/Tab/MOUSE/v/CameraOnly/h1/SelectButton.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_MOVE_ONLY_MOUSE"))
$Window/v/Tab/MOUSE/v/CameraPlayerMove/h1/SelectButton.set_text(Common.get_input_plus("INPUT_ACTION_CAMERA_MOVE_PLAYER_MOUSE"))
$Window/v/Tab/JOYPAD/v/CameraPlayer/h1/SelectButton.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW_JOYPAD"))
$Window/v/Tab/JOYPAD/v/CameraOnly/h1/SelectButton.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_MOVE_ONLY_JOYPAD"))
$Window/v/Tab/JOYPAD/v/CameraPlayerMove/h1/SelectButton.set_text(Common.get_input_plus("INPUT_ACTION_CAMERA_MOVE_PLAYER_JOYPAD"))
func update_joypad_motion():
Common.msg_debug("update_joypad_motion")
$Window/v/Tab/JOYPAD/v/CameraLeft/h1/CameraLeft.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_LEFT_JOYPAD"))
$Window/v/Tab/JOYPAD/v/CameraRight/h1/CameraRight.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_RIGHT_JOYPAD"))
$Window/v/Tab/JOYPAD/v/CameraForward/h1/CameraForward.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_FORWARD_JOYPAD"))
$Window/v/Tab/JOYPAD/v/CameraBack/h1/CameraBack.set_text(Common.get_input_plus("INPUT_VIEW_CAMERA_BACK_JOYPAD"))
$Window/v/Tab/JOYPAD/v/PlayerLeft/h1/PlayerLeft.set_text(Common.get_input_plus("INPUT_ACTION_PLAYER_LEFT_JOYPAD"))
$Window/v/Tab/JOYPAD/v/PlayerRight/h1/PlayerRight.set_text(Common.get_input_plus("INPUT_ACTION_PLAYER_RIGHT_JOYPAD"))
$Window/v/Tab/JOYPAD/v/PlayerForward/h1/PlayerForward.set_text(Common.get_input_plus("INPUT_ACTION_PLAYER_FORWARD_JOYPAD"))
$Window/v/Tab/JOYPAD/v/PlayerBack/h1/PlayerBack.set_text(Common.get_input_plus("INPUT_ACTION_PLAYER_BACK_JOYPAD"))
$Window/v/Tab/JOYPAD/v/FactorCameraHorizontale/FactorCameraHorizontale.set_value(Common.get_factor_camera_horizontale_joypad())
$Window/v/Tab/JOYPAD/v/FactorCameraHorizontale/value.set_text(str(Common.get_factor_camera_horizontale_joypad()))
$Window/v/Tab/JOYPAD/v/FactorCameraVerticale/FactorCameraVerticale.set_value(Common.get_factor_camera_verticale_joypad())
$Window/v/Tab/JOYPAD/v/FactorCameraVerticale/value.set_text(str(Common.get_factor_camera_verticale_joypad()))
$Window/v/Tab/JOYPAD/v/FactorPlayerHorizontale/FactorPlayerHorizontale.set_value(Common.get_factor_player_horizontale_joypad())
$Window/v/Tab/JOYPAD/v/FactorPlayerHorizontale/value.set_text(str(Common.get_factor_player_horizontale_joypad()))
$Window/v/Tab/JOYPAD/v/FactorPlayerVerticale/FactorPlayerVerticale.set_value(Common.get_factor_player_verticale_joypad())
$Window/v/Tab/JOYPAD/v/FactorPlayerVerticale/value.set_text(str(Common.get_factor_player_verticale_joypad()))
func configure_control():
@ -164,6 +182,7 @@ func configure_control():
$Window/v/Tab/CONTROL/Input.visible = true
configure_control_sort_by_input()
update_mouse_button_move_camera()
update_joypad_motion()
func configure_control_by_group():
@ -413,23 +432,58 @@ func _on_select_mouse_button_camera_player_move_pressed():
$DefineInput/Window.visible = true
func _on_select_joypad_button_camera_player_pressed():
func _on_camera_left_pressed():
$Window.visible = false
$DefineInput.set_param(4, "INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW_JOYPAD")
$DefineInput.set_param(4, "INPUT_VIEW_CAMERA_LEFT_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
func _on_select_joypad_button_camera_only_pressed():
func _on_camera_right_pressed():
$Window.visible = false
$DefineInput.set_param(4, "INPUT_VIEW_CAMERA_MOVE_ONLY_JOYPAD")
$DefineInput.set_param(5, "INPUT_VIEW_CAMERA_RIGHT_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
func _on_joypad_camera_player_move_button_pressed():
func _on_camera_forward_pressed():
$Window.visible = false
$DefineInput.set_param(4, "INPUT_ACTION_CAMERA_MOVE_PLAYER_JOYPAD")
$DefineInput.set_param(6, "INPUT_VIEW_CAMERA_FORWARD_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
func _on_camera_back_pressed():
$Window.visible = false
$DefineInput.set_param(7, "INPUT_VIEW_CAMERA_BACK_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
func _on_player_left_pressed():
$Window.visible = false
$DefineInput.set_param(8, "INPUT_ACTION_PLAYER_LEFT_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
func _on_player_right_pressed():
$Window.visible = false
$DefineInput.set_param(9, "INPUT_ACTION_PLAYER_RIGHT_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
func _on_player_forward_pressed():
$Window.visible = false
$DefineInput.set_param(10, "INPUT_ACTION_PLAYER_FORWARD_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
func _on_player_back_pressed():
$Window.visible = false
$DefineInput.set_param(11, "INPUT_ACTION_PLAYER_BACK_JOYPAD")
$DefineInput/Window.popup_centered()
$DefineInput/Window.visible = true
@ -456,3 +510,23 @@ func _on_camera_player_move_reverse_horizontal_toggled(button_pressed):
func _on_camera_player_move_reverse_vertical_toggled(button_pressed):
Common.set_mouse_camera_player_move_reverse_vertical(button_pressed)
func _on_factor_camera_horizontale_value_changed(value):
$Window/v/Tab/JOYPAD/v/FactorCameraHorizontale/value.set_text(str(value))
Common.set_factor_camera_horizontale_joypad(value)
func _on_factor_camera_verticale_value_changed(value):
$Window/v/Tab/JOYPAD/v/FactorCameraVerticale/value.set_text(str(value))
Common.set_factor_camera_verticale_joypad(value)
func _on_factor_player_horizontale_value_changed(value):
$Window/v/Tab/JOYPAD/v/FactorPlayerHorizontale/value.set_text(str(value))
Common.set_factor_player_horizontale_joypad(value)
func _on_factor_player_verticale_value_changed(value):
$Window/v/Tab/JOYPAD/v/FactorPlayerVerticale/value.set_text(str(value))
Common.set_factor_player_verticale_joypad(value)

View file

@ -244,144 +244,326 @@ offset_right = 40.0
offset_bottom = 40.0
[node name="v" type="VBoxContainer" parent="Window/v/Tab/JOYPAD"]
offset_right = 934.0
offset_bottom = 312.0
offset_right = 384.0
offset_bottom = 724.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="CameraPlayer" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
[node name="CameraLeft" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraPlayer"]
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraLeft"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_VIEW_CAMERA_MOVE_PLAYER_FOLLOW"
text = "INPUT_VIEW_CAMERA_LEFT_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraPlayer"]
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraLeft"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraPlayer/h1"]
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraLeft/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="SelectButton" type="Button" parent="Window/v/Tab/JOYPAD/v/CameraPlayer/h1"]
[node name="CameraLeft" type="Button" parent="Window/v/Tab/JOYPAD/v/CameraLeft/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "SELECT"
[node name="h2" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraPlayer"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraPlayer/h2"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="ReverseHorizontal" type="CheckBox" parent="Window/v/Tab/JOYPAD/v/CameraPlayer/h2"]
offset_right = 24.0
offset_bottom = 31.0
text = "EDIT_CONTROL/MOVE_CAMERA_REVERSE_HORIZONTAL"
[node name="ReverseVertical" type="CheckBox" parent="Window/v/Tab/JOYPAD/v/CameraPlayer/h2"]
offset_right = 24.0
offset_bottom = 31.0
text = "EDIT_CONTROL/MOVE_CAMERA_REVERSE_VERTICAL"
[node name="HSeparator1" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="CameraOnly" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
[node name="CameraRight" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraOnly"]
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraRight"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_VIEW_CAMERA_MOVE_ONLY"
text = "INPUT_VIEW_CAMERA_RIGHT_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraOnly"]
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraRight"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraOnly/h1"]
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraRight/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="SelectButton" type="Button" parent="Window/v/Tab/JOYPAD/v/CameraOnly/h1"]
[node name="CameraRight" type="Button" parent="Window/v/Tab/JOYPAD/v/CameraRight/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "SELECT"
[node name="h2" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraOnly"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraOnly/h2"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="ReverseHorizontal" type="CheckBox" parent="Window/v/Tab/JOYPAD/v/CameraOnly/h2"]
offset_right = 24.0
offset_bottom = 31.0
text = "EDIT_CONTROL/MOVE_CAMERA_REVERSE_HORIZONTAL"
[node name="ReverseVertical" type="CheckBox" parent="Window/v/Tab/JOYPAD/v/CameraOnly/h2"]
offset_right = 24.0
offset_bottom = 31.0
text = "EDIT_CONTROL/MOVE_CAMERA_REVERSE_VERTICAL"
[node name="HSeparator2" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="CameraPlayerMove" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
[node name="FactorCameraHorizontale" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 384.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove"]
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorCameraHorizontale"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_ACTION_CAMERA_MOVE_PLAYER"
size_flags_horizontal = 3
text = "FACTOR_CAMERA_HORIZONTALE_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove"]
offset_right = 40.0
offset_bottom = 40.0
[node name="FactorCameraHorizontale" type="HSlider" parent="Window/v/Tab/JOYPAD/v/FactorCameraHorizontale"]
offset_right = 8.0
offset_bottom = 16.0
size_flags_horizontal = 3
max_value = 10.0
step = 0.1
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove/h1"]
[node name="value" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorCameraHorizontale"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="SelectButton" type="Button" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove/h1"]
[node name="HSeparator3" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="CameraForward" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraForward"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_VIEW_CAMERA_FORWARD_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraForward"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraForward/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="CameraForward" type="Button" parent="Window/v/Tab/JOYPAD/v/CameraForward/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "SELECT"
[node name="h2" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove"]
[node name="HSeparator4" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="CameraBack" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove/h2"]
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraBack"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_VIEW_CAMERA_BACK_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/CameraBack"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/CameraBack/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="ReverseHorizontal" type="CheckBox" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove/h2"]
offset_right = 24.0
[node name="CameraBack" type="Button" parent="Window/v/Tab/JOYPAD/v/CameraBack/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "EDIT_CONTROL/MOVE_CAMERA_REVERSE_HORIZONTAL"
text = "SELECT"
[node name="ReverseVertical" type="CheckBox" parent="Window/v/Tab/JOYPAD/v/CameraPlayerMove/h2"]
offset_right = 24.0
[node name="HSeparator5" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="FactorCameraVerticale" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 354.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorCameraVerticale"]
offset_right = 40.0
offset_bottom = 23.0
size_flags_horizontal = 3
text = "FACTOR_CAMERA_VERTICALE_JOYPAD"
[node name="FactorCameraVerticale" type="HSlider" parent="Window/v/Tab/JOYPAD/v/FactorCameraVerticale"]
offset_right = 8.0
offset_bottom = 16.0
size_flags_horizontal = 3
max_value = 10.0
step = 0.1
[node name="value" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorCameraVerticale"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="HSeparator6" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="PlayerLeft" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerLeft"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_ACTION_PLAYER_LEFT_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/PlayerLeft"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerLeft/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="PlayerLeft" type="Button" parent="Window/v/Tab/JOYPAD/v/PlayerLeft/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "EDIT_CONTROL/MOVE_CAMERA_REVERSE_VERTICAL"
text = "SELECT"
[node name="HSeparator7" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="PlayerRight" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerRight"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_ACTION_PLAYER_RIGHT_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/PlayerRight"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerRight/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="PlayerRight" type="Button" parent="Window/v/Tab/JOYPAD/v/PlayerRight/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "SELECT"
[node name="HSeparator8" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="FactorPlayerHorizontale" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 384.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorPlayerHorizontale"]
offset_right = 40.0
offset_bottom = 23.0
size_flags_horizontal = 3
text = "FACTOR_PLAYER_HORIZONTALE_JOYPAD"
[node name="FactorPlayerHorizontale" type="HSlider" parent="Window/v/Tab/JOYPAD/v/FactorPlayerHorizontale"]
offset_right = 8.0
offset_bottom = 16.0
size_flags_horizontal = 3
max_value = 10.0
step = 0.1
[node name="value" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorPlayerHorizontale"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="HSeparator9" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="PlayerForward" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 332.0
offset_bottom = 61.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerForward"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_ACTION_PLAYER_FORWARD_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/PlayerForward"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerForward/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="PlayerForward" type="Button" parent="Window/v/Tab/JOYPAD/v/PlayerForward/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "SELECT"
[node name="HSeparator10" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="PlayerBack" type="VBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 294.0
offset_bottom = 61.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerBack"]
offset_right = 40.0
offset_bottom = 23.0
text = "INPUT_ACTION_PLAYER_BACK_JOYPAD"
[node name="h1" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v/PlayerBack"]
offset_right = 40.0
offset_bottom = 40.0
[node name="space" type="Label" parent="Window/v/Tab/JOYPAD/v/PlayerBack/h1"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="PlayerBack" type="Button" parent="Window/v/Tab/JOYPAD/v/PlayerBack/h1"]
offset_right = 8.0
offset_bottom = 31.0
text = "SELECT"
[node name="HSeparator11" type="HSeparator" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 40.0
offset_bottom = 4.0
[node name="FactorPlayerVerticale" type="HBoxContainer" parent="Window/v/Tab/JOYPAD/v"]
offset_right = 354.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorPlayerVerticale"]
offset_right = 40.0
offset_bottom = 23.0
size_flags_horizontal = 3
text = "FACTOR_PLAYER_VERTICALE_JOYPAD"
[node name="FactorPlayerVerticale" type="HSlider" parent="Window/v/Tab/JOYPAD/v/FactorPlayerVerticale"]
offset_right = 8.0
offset_bottom = 16.0
size_flags_horizontal = 3
max_value = 10.0
step = 0.1
[node name="value" type="Label" parent="Window/v/Tab/JOYPAD/v/FactorPlayerVerticale"]
minimum_size = Vector2(50, 0)
offset_right = 40.0
offset_bottom = 23.0
[node name="Quit" type="Button" parent="Window/v"]
anchor_left = 0.5
@ -417,7 +599,16 @@ metadata/_edit_use_custom_anchors = false
[connection signal="pressed" from="Window/v/Tab/MOUSE/v/CameraPlayerMove/h1/SelectButton" to="." method="_on_select_mouse_button_camera_player_move_pressed"]
[connection signal="toggled" from="Window/v/Tab/MOUSE/v/CameraPlayerMove/h2/ReverseHorizontal" to="." method="_on_camera_player_move_reverse_horizontal_toggled"]
[connection signal="toggled" from="Window/v/Tab/MOUSE/v/CameraPlayerMove/h2/ReverseVertical" to="." method="_on_camera_player_move_reverse_vertical_toggled"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/CameraPlayer/h1/SelectButton" to="." method="_on_select_joypad_button_camera_player_pressed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/CameraOnly/h1/SelectButton" to="." method="_on_select_joypad_button_camera_only_pressed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/CameraPlayerMove/h1/SelectButton" to="." method="_on_joypad_camera_player_move_button_pressed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/CameraLeft/h1/CameraLeft" to="." method="_on_camera_left_pressed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/CameraRight/h1/CameraRight" to="." method="_on_camera_right_pressed"]
[connection signal="value_changed" from="Window/v/Tab/JOYPAD/v/FactorCameraHorizontale/FactorCameraHorizontale" to="." method="_on_factor_camera_horizontale_value_changed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/CameraForward/h1/CameraForward" to="." method="_on_camera_forward_pressed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/CameraBack/h1/CameraBack" to="." method="_on_camera_back_pressed"]
[connection signal="value_changed" from="Window/v/Tab/JOYPAD/v/FactorCameraVerticale/FactorCameraVerticale" to="." method="_on_factor_camera_verticale_value_changed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/PlayerLeft/h1/PlayerLeft" to="." method="_on_player_left_pressed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/PlayerRight/h1/PlayerRight" to="." method="_on_player_right_pressed"]
[connection signal="value_changed" from="Window/v/Tab/JOYPAD/v/FactorPlayerHorizontale/FactorPlayerHorizontale" to="." method="_on_factor_player_horizontale_value_changed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/PlayerForward/h1/PlayerForward" to="." method="_on_player_forward_pressed"]
[connection signal="pressed" from="Window/v/Tab/JOYPAD/v/PlayerBack/h1/PlayerBack" to="." method="_on_player_back_pressed"]
[connection signal="value_changed" from="Window/v/Tab/JOYPAD/v/FactorPlayerVerticale/FactorPlayerVerticale" to="." method="_on_factor_player_verticale_value_changed"]
[connection signal="pressed" from="Window/v/Quit" to="." method="_on_quit_pressed"]

View file

@ -35,7 +35,21 @@ func set_param(typeevent:int, _action):
elif typeevent == 3:
comment = "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
elif typeevent == 4:
comment = "OPTION_DEFINE_INPUT/MESSAGE_JOYPAD"
comment = "OPTION_DEFINE_INPUT/MESSAGE_CAMERA_LEFT_JOYPAD"
elif typeevent == 5:
comment = "OPTION_DEFINE_INPUT/MESSAGE_CAMERA_RIGHT_JOYPAD"
elif typeevent == 6:
comment = "OPTION_DEFINE_INPUT/MESSAGE_CAMERA_FORWARD_JOYPAD"
elif typeevent == 7:
comment = "OPTION_DEFINE_INPUT/MESSAGE_CAMERA_BACK_JOYPAD"
elif typeevent == 8:
comment = "OPTION_DEFINE_INPUT/MESSAGE_ACTION_LEFT_JOYPAD"
elif typeevent == 9:
comment = "OPTION_DEFINE_INPUT/MESSAGE_ACTION_RIGHT_JOYPAD"
elif typeevent == 10:
comment = "OPTION_DEFINE_INPUT/MESSAGE_ACTION_FORWARD_JOYPAD"
elif typeevent == 11:
comment = "OPTION_DEFINE_INPUT/MESSAGE_ACTION_BACK_JOYPAD"
else:
comment = "OPTION_DEFINE_INPUT/DISABLED"
type_event = typeevent
@ -56,7 +70,8 @@ func _on_cancel_pressed():
func _on_ok_pressed():
$Window.hide()
Common.set_input_plus(action, last_event, last_last_event, self.type_event == 2)
Common.msg_debug("type_event: " + str(self.type_event))
Common.set_input_plus(action, last_event, last_last_event, self.type_event == 2 or (self.type_event >= 4 and self.type_event <= 11))
emit_signal("refresh_control_define_input")
@ -66,7 +81,6 @@ func _on_window_window_input(event):
if focus_ok:
return
if (event is InputEventKey) && (self.type_event == 1):
#last_last_event = last_event
last_event = event
$Window/v/result.set_text( Common.get_string_input(event) )
elif event is InputEventMouseButton and self.type_event == 2:
@ -89,23 +103,17 @@ func _on_window_window_input(event):
else:
$Window/v/result.set_text( tr(Common.get_string_input(event)) + " + " + tr(Common.get_string_input(last_last_event)))
elif event is InputEventJoypadButton and self.type_event == 3:
#last_last_event = last_event
last_event = event
$Window/v/result.set_text( Common.get_string_input(event) )
elif event is InputEventJoypadMotion and self.type_event == 4:
#last_last_event = last_event
if not last_event:
last_event = event
elif last_event.get_axis() != event.get_axis():
last_last_event = last_event
last_event = event
if last_last_event != null:
$Window/v/result.set_text( "Axe:" + str(event.get_axis()) + " & " + str(last_last_event.get_axis()))
elif event is InputEventJoypadMotion and (self.type_event >= 4 and self.type_event <= 11):
if event.get_axis_value() < 0:
event.set_axis_value(-1.0)
else:
$Window/v/result.set_text( "move all axes" )
event.set_axis_value(1.0)
last_event = event
$Window/v/result.set_text( Common.get_string_input(event) )
if last_event != null:
if self.type_event != 4 or last_last_event != null:
set_disabled(false)
set_disabled(false)
func _on_ok_mouse_entered():

View file

@ -10,6 +10,11 @@ var mouse_camera_only_reverse_vertical:bool = false
var mouse_camera_player_move_reverse_horizontal:bool = false
var mouse_camera_player_move_reverse_vertical:bool = false
var factor_camera_horizontale_joypad:float = 2.0
var factor_camera_verticale_joypad:float = 2.0
var factor_player_horizontale_joypad:float = 2.0
var factor_player_verticale_joypad:float = 2.0
func _ready():
randomize()
@ -181,17 +186,24 @@ func get_input_plus(action:String):
func set_input(action:String, event, origin, eraselast:bool):
if eraselast:
for curaction in InputMap.get_actions():
var text:String = curaction
if text == action:
for z in InputMap.action_get_events(curaction):
if origin is InputEventMouseButton and z is InputEventMouseButton:
InputMap.action_erase_event(text, z)
# for curaction in InputMap.get_actions():
# var text:String = curaction
# if text == action:
# for z in InputMap.action_get_events(curaction):
# if origin is InputEventMouseButton and z is InputEventMouseButton:
# InputMap.action_erase_event(text, z)
for z in InputMap.action_get_events(action):
if (origin is InputEventMouseButton and z is InputEventMouseButton) or \
(origin is InputEventJoypadMotion and z is InputEventJoypadMotion) or \
(origin is InputEventJoypadButton and z is InputEventJoypadButton):
InputMap.action_erase_event(action, z)
if event != null:
Common.msg_debug("action: " + str(action) + " / event:" + str(event))
InputMap.action_add_event(action, event)
func set_input_plus(action:String, event, eventplus, eraselast:bool):
Common.msg_debug("set_input_plus: " + str(action) + " eraselast:" + str(eraselast))
set_input(action, event, event, eraselast)
set_input(action + "_PLUS", eventplus, event, eraselast)
@ -284,3 +296,35 @@ func get_mul_mouse_camera_player_move_reverse_vertical() -> float:
return -1.0
else:
return 1.0
func set_factor_camera_horizontale_joypad(value:float):
factor_camera_horizontale_joypad = value
func get_factor_camera_horizontale_joypad() -> float:
return factor_camera_horizontale_joypad
func set_factor_camera_verticale_joypad(value:float):
factor_camera_verticale_joypad = value
func get_factor_camera_verticale_joypad() -> float:
return factor_camera_verticale_joypad
func set_factor_player_horizontale_joypad(value:float):
factor_player_horizontale_joypad = value
func get_factor_player_horizontale_joypad() -> float:
return factor_player_horizontale_joypad
func set_factor_player_verticale_joypad(value:float):
factor_player_verticale_joypad = value
func get_factor_player_verticale_joypad() -> float:
return factor_player_verticale_joypad

View file

@ -7,7 +7,7 @@ declare FORCE=0
declare IMPORT=0
declare ERASEIMPORT=0
declare WORKDIR="$(dirname $(readlink -f $0))"
declare GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha6/Godot_v4.0-alpha6_linux.64.zip"
declare GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha8/Godot_v4.0-alpha8_linux.64.zip"
declare OUTZIP="$WORKDIR/$(basename $GODOT_SRC)"
declare OPTION=""
declare NEWPRG=0