Skip to content

Commit

Permalink
Re-implemented changes in 4.3 (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
tafode authored Aug 30, 2024
1 parent e5e7c26 commit baebe8b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions lorien/Assets/I18n/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ ACTION_duplicate_strokes Duplicate strokes
ACTION_toggle_zen_mode Toggle Zen Mode
ACTION_toggle_player Toggle Easteregg
ACTION_toggle_fullscreen Toggle Fullscreen
ACTION_canvas_pan_key Pan Key

# -----------------------------------------------------------------------------
# Kebindings dialog messages
Expand Down
11 changes: 11 additions & 0 deletions lorien/InfiniteCanvas/PanZoomCamera.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func do_center(screen_space_center_point: Vector2) -> void:
# -------------------------------------------------------------------------------------------------
func tool_event(event: InputEvent) -> void:
if _is_input_enabled:
if event is InputEventKey:
if Utils.event_pressed_bug_workaround("canvas_pan_key", event):
_pan_active = event.is_pressed()
else:
_pan_active = event.is_pressed()

if event is InputEventMouseButton:

# Scroll wheel up/down to zoom
Expand Down Expand Up @@ -112,3 +118,8 @@ func disable_input() -> void:
# -------------------------------------------------------------------------------------------------
func xform(pos: Vector2) -> Vector2:
return (pos * zoom) + offset

#--------------------------------------------------------------------------------------------------
func _notification(what):
if what == NOTIFICATION_WM_MOUSE_EXIT:
_pan_active = false
5 changes: 5 additions & 0 deletions lorien/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ player_jump={
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
canvas_pan_key={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
]
}

[locale]

Expand Down

0 comments on commit baebe8b

Please sign in to comment.