tooltips and ui
This commit was merged in pull request #42.
This commit is contained in:
@@ -89,9 +89,12 @@ var wagon_instances: Array[Node3D] = []
|
||||
var wagon_progress_offsets: Array[float] = []
|
||||
var _pending_steam_distance_km: float = 0.0
|
||||
var _initial_is_inmotion: bool = true
|
||||
var _is_photo_mode_active: bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
randomize()
|
||||
GameState.on_enable_photo_mode_request.connect(func(): _is_photo_mode_active = true)
|
||||
GameState.on_disable_photo_mode_request.connect(func(): _is_photo_mode_active = false)
|
||||
|
||||
_cache_environment_config()
|
||||
_initial_is_inmotion = is_inmotion
|
||||
@@ -353,12 +356,15 @@ func _has_station_near_position(stop_position: Vector3) -> bool:
|
||||
return false
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if _is_photo_mode_active: return
|
||||
if EnvironmentManagerRoot.is_keyboard_input_blocked(get_tree()):
|
||||
return
|
||||
|
||||
if event is InputEventKey and event.pressed and not event.echo:
|
||||
if event.keycode == KEY_T:
|
||||
_goto_next_stop()
|
||||
if event.is_action_pressed("train_horn"):
|
||||
UIEvents.toot_toot.emit(true)
|
||||
#elif event.keycode == KEY_F:
|
||||
#_test_manual_fireworks()
|
||||
|
||||
@@ -396,13 +402,13 @@ func _physics_process(delta: float) -> void:
|
||||
train_move(delta)
|
||||
|
||||
func input_controls_management(delta: float) -> void:
|
||||
if not is_inmotion: return
|
||||
if EnvironmentManagerRoot.is_keyboard_input_blocked(get_tree()): return
|
||||
if Input.is_action_pressed("ui_up"):
|
||||
if not is_inmotion or _is_photo_mode_active: return
|
||||
if Input.is_action_pressed("train_speed_up"):
|
||||
train_speed += manual_acceleration * delta
|
||||
elif Input.is_action_pressed("ui_down"):
|
||||
elif Input.is_action_pressed("train_speed_down"):
|
||||
train_speed -= manual_acceleration * delta
|
||||
elif Input.is_action_pressed("ui_text_backspace"):
|
||||
elif Input.is_action_pressed("train_stop"):
|
||||
train_speed = 0
|
||||
train_speed = clamp(train_speed, speed_min, speed_max)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user