Compare commits

...

4 commits

Author SHA1 Message Date
3525401560
Update CORE 2024-05-17 02:09:32 +02:00
e104adfc0f
Fix entrypoint crashes 2024-05-17 02:09:29 +02:00
65a7f5ca8e
Add click overlay 2024-05-17 02:09:08 +02:00
7d01a8fd13
Add more logging to input handling 2024-05-17 02:08:57 +02:00
4 changed files with 21 additions and 5 deletions

@ -1 +1 @@
Subproject commit a03db0f4e1ba0f4171f9425e56a4731f9090ad16
Subproject commit 59ac90c40be92ec4cf3517f3813de1dc99b72d5d

View file

@ -12,7 +12,7 @@
"contributors": [ "Contributors" ],
"license": "AGPL-3.0-or-later",
"entrypoint": "entrypoint.gd",
"slides": 5,
"slides": 1,
"animations": false,
"display_end_text_after_last_slide": true
}

View file

@ -19,4 +19,4 @@ func switch_to_slide(new_slide: int) -> void:
api.remove_all_slides()
# Add new slide
sms.add_scene("slide", resources["slide_" + str(new_slide)], CoreTypes.SceneType.MAIN)
sms.add_scene("slide", resources["slide_" + str(new_slide)].duplicate(), CoreTypes.SceneType.MAIN)

View file

@ -24,6 +24,7 @@ var sms: CoreBaseModule
# Presencode infrastructure
var presenloader: Node
var clickoverlay: Button = Button.new()
# Presentation data
var entrypoint: PresencodeEntrypoint
@ -31,16 +32,29 @@ var manifest: Dictionary
var current_slide: int = 0
var slide_switch_in_progress: bool = false
# +++ initialization +++
# +++ initialization and processing +++
func _init(core_new: Core, presenloader_new: Node) -> void:
name = "Communication"
core = core_new
logger = core.logger.get_instance("src/classes/communication.gd", self)
sms = core.sms
presenloader = presenloader_new
clickoverlay.name = "Click Overlay"
clickoverlay.size = Vector2(100000.0, 100000.0)
clickoverlay.position = -Vector2(50000.5, 50000.5)
clickoverlay.modulate = Color(1, 1, 1, 0)
clickoverlay.connect("pressed", func() -> void:
logger.diag("Navigating to next slide")
switch_slide(current_slide + 1)
)
func _ready() -> void:
# Add click overlay to 'debug' scene collection
sms.add_scene("clickoverlay", clickoverlay, CoreTypes.SceneType.DEBUG)
func _process(_delta: float) -> void:
# Check for inputs
if Input.is_action_just_pressed("fullscreen"):
logger.diag("Toggling fullscreen mode")
@ -49,8 +63,10 @@ func _process(_delta: float) -> void:
DisplayServer.WindowMode.WINDOW_MODE_WINDOWED: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_FULLSCREEN)
_: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED)
if Input.is_action_just_pressed("navigate_forwards"):
logger.diag("Navigating to next slide")
switch_slide(current_slide + 1)
if Input.is_action_just_pressed("navigate_backwards"):
logger.diag("Navigating to previous slide")
switch_slide(current_slide - 1)
func _update_variables() -> void: