Touches utilisant leur nom local + noms des touches dans le tuto + correction audio settings
This commit is contained in:
@@ -235,7 +235,7 @@ func _ready():
|
|||||||
player.stop()
|
player.stop()
|
||||||
|
|
||||||
fetch_default_volumes()
|
fetch_default_volumes()
|
||||||
# setup_players_bus()
|
setup_players_bus()
|
||||||
settings.sound_changed.connect(
|
settings.sound_changed.connect(
|
||||||
func(_s) : setup_players_bus()
|
func(_s) : setup_players_bus()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -14,12 +14,20 @@ var success = false
|
|||||||
|
|
||||||
@onready var steps: Array[Step] = [
|
@onready var steps: Array[Step] = [
|
||||||
Step.new(
|
Step.new(
|
||||||
"MOVE_WITH_RIGHT_CLICK_OR_WASD",
|
tr("MOVE_WITH_RIGHT_CLICK_OR_WASD").format({
|
||||||
|
"W": get_action_key_name("move_up"),
|
||||||
|
"A": get_action_key_name("move_left"),
|
||||||
|
"S": get_action_key_name("move_down"),
|
||||||
|
"D": get_action_key_name("move_right")
|
||||||
|
}),
|
||||||
(func():
|
(func():
|
||||||
return player.global_position.distance_to(region.data.player_spawn) > 30)
|
return player.global_position.distance_to(region.data.player_spawn) > 30)
|
||||||
),
|
),
|
||||||
Step.new(
|
Step.new(
|
||||||
"CHANGE_ZOOM_WITH_Z_X",
|
tr("CHANGE_ZOOM_WITH_Z_X").format({
|
||||||
|
"Z": get_action_key_name("zoom_in"),
|
||||||
|
"X": get_action_key_name("zoom_out")
|
||||||
|
}),
|
||||||
(func():
|
(func():
|
||||||
return GameInfo.settings_data.zoom != 1.),
|
return GameInfo.settings_data.zoom != 1.),
|
||||||
(func(): GameInfo.game_data.player_data.inventory.add_item(Detector.new()))
|
(func(): GameInfo.game_data.player_data.inventory.add_item(Detector.new()))
|
||||||
@@ -66,7 +74,9 @@ var success = false
|
|||||||
) != -1)
|
) != -1)
|
||||||
),
|
),
|
||||||
Step.new(
|
Step.new(
|
||||||
"DROP_SEED_WITH_KEY",
|
tr("DROP_SEED_WITH_KEY").format({
|
||||||
|
"Q": get_action_key_name("drop")
|
||||||
|
}),
|
||||||
(func():
|
(func():
|
||||||
return (
|
return (
|
||||||
Input.is_action_pressed("drop"))
|
Input.is_action_pressed("drop"))
|
||||||
@@ -162,7 +172,6 @@ func finish_tutorial():
|
|||||||
SteamConnection.unlock_achievement(SteamConnection.ACH_FINISH_TUTORIAL)
|
SteamConnection.unlock_achievement(SteamConnection.ACH_FINISH_TUTORIAL)
|
||||||
|
|
||||||
class Step:
|
class Step:
|
||||||
|
|
||||||
var text: String: get = get_text
|
var text: String: get = get_text
|
||||||
var is_step_over_callable: Callable
|
var is_step_over_callable: Callable
|
||||||
var on_succeeded: Callable
|
var on_succeeded: Callable
|
||||||
@@ -186,3 +195,24 @@ class Step:
|
|||||||
if succeeded:
|
if succeeded:
|
||||||
on_succeeded.call()
|
on_succeeded.call()
|
||||||
return succeeded
|
return succeeded
|
||||||
|
|
||||||
|
func get_action_key_name(action_name: String) -> String:
|
||||||
|
var events: Array[InputEvent] = InputMap.action_get_events(action_name)
|
||||||
|
|
||||||
|
var saved_remapped_input = null
|
||||||
|
var existing_remapped_id: int = GameInfo.settings_data.action_remapped.find(action_name)
|
||||||
|
if existing_remapped_id != -1:
|
||||||
|
saved_remapped_input = GameInfo.settings_data.input_remapped[existing_remapped_id]
|
||||||
|
|
||||||
|
var event: InputEvent = null
|
||||||
|
if saved_remapped_input:
|
||||||
|
event = saved_remapped_input
|
||||||
|
else:
|
||||||
|
event = null if events.size() == 0 else events[0]
|
||||||
|
|
||||||
|
var input_name: String = "UNASSIGNED" if event == null else event.as_text()
|
||||||
|
if event is InputEventKey:
|
||||||
|
var keycode = DisplayServer.keyboard_get_keycode_from_physical(event.physical_keycode)
|
||||||
|
input_name = OS.get_keycode_string(keycode)
|
||||||
|
|
||||||
|
return input_name
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ var is_remapping := false
|
|||||||
|
|
||||||
func update():
|
func update():
|
||||||
%Text.text = action_name.to_upper()
|
%Text.text = action_name.to_upper()
|
||||||
var input_name = "UNASSIGNED" if event == null else event.as_text()
|
var input_name: String = "UNASSIGNED" if event == null else event.as_text()
|
||||||
|
if event is InputEventKey:
|
||||||
|
var keycode = DisplayServer.keyboard_get_keycode_from_physical(event.physical_keycode)
|
||||||
|
input_name = OS.get_keycode_string(keycode)
|
||||||
if input_name.length() > MAX_INPUT_NAME:
|
if input_name.length() > MAX_INPUT_NAME:
|
||||||
input_name = input_name.substr(0,MAX_INPUT_NAME) + "..."
|
input_name = input_name.substr(0,MAX_INPUT_NAME) + "..."
|
||||||
%Button.text = input_name
|
%Button.text = input_name
|
||||||
|
|||||||
@@ -137,12 +137,12 @@ OPEN,Open,Ouvrir
|
|||||||
%s_SEED,%s Seed,Graine de %s
|
%s_SEED,%s Seed,Graine de %s
|
||||||
PLANT_%s_MUST_BE_USED_IN_DECONTAMINATED_ZONE,Plant [b]%s[/b]. Must be used in the fertile zone.,Plante [b]%s[/b]. Doit être utilisée dans la zone fertile.
|
PLANT_%s_MUST_BE_USED_IN_DECONTAMINATED_ZONE,Plant [b]%s[/b]. Must be used in the fertile zone.,Plante [b]%s[/b]. Doit être utilisée dans la zone fertile.
|
||||||
PLANT_%s,Plant [b]%s[/b],Planter [b]%s[/b]
|
PLANT_%s,Plant [b]%s[/b],Planter [b]%s[/b]
|
||||||
MOVE_WITH_RIGHT_CLICK_OR_WASD,"Move with right click or WASD","Déplace-toi avec le clic droit ou ZQSD"
|
MOVE_WITH_RIGHT_CLICK_OR_WASD,"Move with right click or {W}{A}{S}{D}","Déplace-toi avec clic droit ou {W}{A}{S}{D}"
|
||||||
INTERACT_WITH_LEFT_CLICK,"Interact with left click","Interagis avec le clic gauche"
|
INTERACT_WITH_LEFT_CLICK,"Interact with left click","Interagis avec le clic gauche"
|
||||||
CHANGE_ZOOM_WITH_Z_X,"Change the zoom with Z and X","Changez le zoom avec W et X"
|
CHANGE_ZOOM_WITH_Z_X,"Change the zoom with {Z} and {X}","Changez le zoom avec {Z} et {X}"
|
||||||
SELECT_ITEM_WITH_SCROLL_CLICK_OR_NUMBER,"Select an item in your toolbar with the mouse wheel or by clicking on it","Sélectionne un item dans ta barre d'outil en utilisant la molette ou en cliquant dessus"
|
SELECT_ITEM_WITH_SCROLL_CLICK_OR_NUMBER,"Select an item in your toolbar with the mouse wheel or by clicking on it","Sélectionne un item dans ta barre d'outil en utilisant la molette ou en cliquant dessus"
|
||||||
LEFT_CLICK_TO_USE_ITEMS,"Use an item with left click","Utilise un item avec le clic gauche"
|
LEFT_CLICK_TO_USE_ITEMS,"Use an item with left click","Utilise un item avec le clic gauche"
|
||||||
DROP_SEED_WITH_KEY,"Drop current item with Q","Lâche l'item sélectionné avec A"
|
DROP_SEED_WITH_KEY,"Drop current item with {Q}","Lâche l'item sélectionné avec {Q}"
|
||||||
USE_YOUR_DETECTOR_TO_FIND_THE_BATTERY,Use your [b]Detector[/b] to find the [b]Recharge station[/b],Utilise ton [b]Détecteur[/b] pour trouver la [b]Station de recharge[/b]
|
USE_YOUR_DETECTOR_TO_FIND_THE_BATTERY,Use your [b]Detector[/b] to find the [b]Recharge station[/b],Utilise ton [b]Détecteur[/b] pour trouver la [b]Station de recharge[/b]
|
||||||
RECHARGE_IN_THE_RECHARGE_STATION,Recharge on the [b]Recharge station[/b] to pass the day,Se recharger sur la [b]Station de recharge[/b] pour passer la journée
|
RECHARGE_IN_THE_RECHARGE_STATION,Recharge on the [b]Recharge station[/b] to pass the day,Se recharger sur la [b]Station de recharge[/b] pour passer la journée
|
||||||
TAKE_A_SEED_BY_CLICKING_ON_IT,Take a [b]Seed[/b] by clicking or moving over it,Prend une [b]Graine[/b] en cliquant ou en passant dessus
|
TAKE_A_SEED_BY_CLICKING_ON_IT,Take a [b]Seed[/b] by clicking or moving over it,Prend une [b]Graine[/b] en cliquant ou en passant dessus
|
||||||
|
|||||||
|
Reference in New Issue
Block a user