aboutsummaryrefslogtreecommitdiff
path: root/main.gd
diff options
context:
space:
mode:
authordam <dam@gudinoff>2021-12-06 18:42:53 +0000
committerdam <dam@gudinoff>2021-12-06 18:42:53 +0000
commit2c1085cf56e8fa1baf3c764752828e7f04391d7e (patch)
treebf7cc9c2c4ce340ddeccfeaeceb74a1d1f2be916 /main.gd
parente5072b4342aecc7b19ed3b0df156f3ecfcf0598f (diff)
downloadsurgery-log-2c1085cf56e8fa1baf3c764752828e7f04391d7e.tar.zst
surgery-log-2c1085cf56e8fa1baf3c764752828e7f04391d7e.zip
Add file dialogs for import/export filters. Height adjusted to virtual keyboard.
Diffstat (limited to 'main.gd')
-rw-r--r--main.gd45
1 files changed, 22 insertions, 23 deletions
diff --git a/main.gd b/main.gd
index f6c1f88..803c2d4 100644
--- a/main.gd
+++ b/main.gd
@@ -1,38 +1,37 @@
extends Control
-
-# Declare member variables here. Examples:
-# var a = 2
-# var b = "text"
-var _timeout: float
-
-# Called when the node enters the scene tree for the first time.
-func _ready():
- $output.text = "Hello!"
- $button.connect("pressed", self, "_pressed")
+var timeout: float
+onready var controls_sensible_to_keyboard: Array = [
+ self,
+ get_node("/root/main/about"),
+ get_node("/root/main/delete_filters"),
+ get_node("/root/main/import_filters"),
+ get_node("/root/main/export_filters"),
+]
func _process(delta: float):
- $output.text = "%s" % Engine.get_frames_per_second()
- $timer.text = "%s" % _timeout
- if _timeout > 0.0:
- _timeout -= delta
+
+ var keyboard_height: int = OS.get_virtual_keyboard_height()
+ for it in controls_sensible_to_keyboard:
+ it.margin_bottom = -keyboard_height
+
+ # @DAM Debug information.
+# $debug.text = "%s" % Engine.get_frames_per_second()
+# $debug.text = "%s" % timeout
+ if timeout > 0.0:
+ timeout -= delta
else:
Engine.target_fps = 10.0
-func _pressed():
- $log.text += "PRESSED\n"
-
-# Called every frame. 'delta' is the elapsed time since the previous frame.
-#func _process(delta):
-# pass
-
func _input(event):
Engine.target_fps = 0
- _timeout = 5.0
+ timeout = 3.5
func _unhandled_input(event):
Engine.target_fps = 0
- _timeout = 5.0
+ timeout = 3.5
+
+