Skip to content

Commit

Permalink
cursor manager now has methods to modify the mouse mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ninetailsrabbit committed Dec 28, 2024
1 parent 0016ceb commit d4071c5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
21 changes: 20 additions & 1 deletion autoload/screen/cursor_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var cursor_display_timer: Timer
var temporary_display_time: float = 3.5
var last_cursor_texture: Texture2D

## Dictoinary[Input.CursorShape, Texture2D]
## Dictionary[Input.CursorShape, Texture2D]
var default_game_cursors_by_shape: Dictionary = {}


Expand Down Expand Up @@ -36,6 +36,25 @@ func change_cursor_temporary_to(texture: Texture2D, cursor_shape: Input.CursorSh
change_cursor_to(texture, cursor_shape, false)


func show_mouse() -> void:
InputHelper.show_mouse_cursor()


func capture_mouse() -> void:
InputHelper.capture_mouse()


func hide_mouse() -> void:
InputHelper.hide_mouse_cursor()


func switch_mouse_capture_mode() -> void:
if InputHelper.is_mouse_visible():
capture_mouse()
else:
show_mouse()


func on_cursor_display_timer_timeout() -> void:
change_cursor_to(last_cursor_texture)

6 changes: 1 addition & 5 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config_version=5
[application]

config/name="IndieBlueprint"
config/description="is a comprehensive Godot project template designed to streamline your development process. It includes essential features, optimized settings, and best practices to help you create amazing indie game"
config/description="Indie Blueprint is a comprehensive Godot project template designed to streamline your development process. It includes essential features, optimized settings, and best practices to help you create amazing indie game"
config/version="1.2.5"
run/main_scene="res://scenes/entry_point/game-entry_point.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
Expand Down Expand Up @@ -296,7 +296,3 @@ locale/translations=PackedStringArray("res://localization/translations/de.po", "
2d_physics/layer_9="PlayingCards"
3d_physics/layer_9="PlayingCards"
3d_physics/layer_10="DeckPiles"

[physics]

common/physics_ticks_per_second=120

0 comments on commit d4071c5

Please sign in to comment.