diff --git a/Console.tscn b/Console.tscn index 94d11bc..ebafc55 100644 --- a/Console.tscn +++ b/Console.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=10 format=3 uid="uid://btyi16dkvbly1"] [ext_resource type="Script" path="res://src/console.gd" id="1_viv5y"] -[ext_resource type="FontFile" uid="uid://bl4vgye7bg8kf" path="res://docs/static/assets/fonts/FiraCode-Regular.ttf" id="2_ebuk0"] -[ext_resource type="FontFile" uid="uid://b5qsng8gpvos3" path="res://docs/static/assets/fonts/FiraCode-Bold.ttf" id="3_102to"] -[ext_resource type="FontFile" uid="uid://c5jkbqx10tj8e" path="res://docs/static/assets/fonts/FiraCode-Medium.ttf" id="4_jqfsc"] +[ext_resource type="FontFile" uid="uid://fd61n825la2g" path="res://assets/fonts/FiraCode/Regular.ttf" id="2_ebuk0"] +[ext_resource type="FontFile" uid="uid://cqa0ee5go1p00" path="res://assets/fonts/FiraCode/Bold.ttf" id="3_102to"] +[ext_resource type="FontFile" uid="uid://ddjvx4n721qha" path="res://assets/fonts/FiraCode/Medium.ttf" id="4_jqfsc"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_u40jo"] diff --git a/assets/fonts/FiraCode-Bold.ttf.import b/assets/fonts/FiraCode-Bold.ttf.import deleted file mode 100644 index 1093aa5..0000000 --- a/assets/fonts/FiraCode-Bold.ttf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://b5qsng8gpvos3" -path="res://.godot/imported/FiraCode-Bold.ttf-85308023e4b3887c42a87bcac392d375.fontdata" - -[deps] - -source_file="res://docs/static/assets/fonts/FiraCode-Bold.ttf" -dest_files=["res://.godot/imported/FiraCode-Bold.ttf-85308023e4b3887c42a87bcac392d375.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/assets/fonts/FiraCode-Light.ttf.import b/assets/fonts/FiraCode-Light.ttf.import deleted file mode 100644 index 22bee39..0000000 --- a/assets/fonts/FiraCode-Light.ttf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://4q4lsmuimus1" -path="res://.godot/imported/FiraCode-Light.ttf-c09448311f89f98ee7f002def57567d8.fontdata" - -[deps] - -source_file="res://docs/static/assets/fonts/FiraCode-Light.ttf" -dest_files=["res://.godot/imported/FiraCode-Light.ttf-c09448311f89f98ee7f002def57567d8.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/assets/fonts/FiraCode-Medium.ttf.import b/assets/fonts/FiraCode-Medium.ttf.import deleted file mode 100644 index 81ce89f..0000000 --- a/assets/fonts/FiraCode-Medium.ttf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://c5jkbqx10tj8e" -path="res://.godot/imported/FiraCode-Medium.ttf-0db7f1fcf0ebd067a2e7f37f0ec7247d.fontdata" - -[deps] - -source_file="res://docs/static/assets/fonts/FiraCode-Medium.ttf" -dest_files=["res://.godot/imported/FiraCode-Medium.ttf-0db7f1fcf0ebd067a2e7f37f0ec7247d.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/assets/fonts/FiraCode-Regular.ttf.import b/assets/fonts/FiraCode-Regular.ttf.import deleted file mode 100644 index 475fc0b..0000000 --- a/assets/fonts/FiraCode-Regular.ttf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://bl4vgye7bg8kf" -path="res://.godot/imported/FiraCode-Regular.ttf-5fbe404b04fc56529c18062b38f4ba3d.fontdata" - -[deps] - -source_file="res://docs/static/assets/fonts/FiraCode-Regular.ttf" -dest_files=["res://.godot/imported/FiraCode-Regular.ttf-5fbe404b04fc56529c18062b38f4ba3d.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/assets/fonts/FiraCode-Retina.ttf.import b/assets/fonts/FiraCode-Retina.ttf.import deleted file mode 100644 index 9aa03cc..0000000 --- a/assets/fonts/FiraCode-Retina.ttf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://btpllsnn0t030" -path="res://.godot/imported/FiraCode-Retina.ttf-3af65c1aa12af660768f353167f5ab00.fontdata" - -[deps] - -source_file="res://docs/static/assets/fonts/FiraCode-Retina.ttf" -dest_files=["res://.godot/imported/FiraCode-Retina.ttf-3af65c1aa12af660768f353167f5ab00.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/assets/fonts/FiraCode-Bold.ttf b/assets/fonts/FiraCode/Bold.ttf similarity index 100% rename from assets/fonts/FiraCode-Bold.ttf rename to assets/fonts/FiraCode/Bold.ttf diff --git a/assets/fonts/FiraCode-Light.ttf b/assets/fonts/FiraCode/Light.ttf similarity index 100% rename from assets/fonts/FiraCode-Light.ttf rename to assets/fonts/FiraCode/Light.ttf diff --git a/assets/fonts/FiraCode-Medium.ttf b/assets/fonts/FiraCode/Medium.ttf similarity index 100% rename from assets/fonts/FiraCode-Medium.ttf rename to assets/fonts/FiraCode/Medium.ttf diff --git a/assets/fonts/FiraCode-Regular.ttf b/assets/fonts/FiraCode/Regular.ttf similarity index 100% rename from assets/fonts/FiraCode-Regular.ttf rename to assets/fonts/FiraCode/Regular.ttf diff --git a/assets/fonts/FiraCode-Retina.ttf b/assets/fonts/FiraCode/Retina.ttf similarity index 100% rename from assets/fonts/FiraCode-Retina.ttf rename to assets/fonts/FiraCode/Retina.ttf diff --git a/assets/fonts/Inter/Black.ttf b/assets/fonts/Inter/Black.ttf new file mode 100644 index 0000000..034a73e Binary files /dev/null and b/assets/fonts/Inter/Black.ttf differ diff --git a/assets/fonts/Inter/BlackItalic.ttf b/assets/fonts/Inter/BlackItalic.ttf new file mode 100644 index 0000000..7eb4b51 Binary files /dev/null and b/assets/fonts/Inter/BlackItalic.ttf differ diff --git a/assets/fonts/Inter/Bold.ttf b/assets/fonts/Inter/Bold.ttf new file mode 100644 index 0000000..15e908f Binary files /dev/null and b/assets/fonts/Inter/Bold.ttf differ diff --git a/assets/fonts/Inter/BoldItalic.ttf b/assets/fonts/Inter/BoldItalic.ttf new file mode 100644 index 0000000..1e7bc41 Binary files /dev/null and b/assets/fonts/Inter/BoldItalic.ttf differ diff --git a/assets/fonts/Inter/ExtraBold.ttf b/assets/fonts/Inter/ExtraBold.ttf new file mode 100644 index 0000000..c1449e8 Binary files /dev/null and b/assets/fonts/Inter/ExtraBold.ttf differ diff --git a/assets/fonts/Inter/ExtraBoldItalic.ttf b/assets/fonts/Inter/ExtraBoldItalic.ttf new file mode 100644 index 0000000..f0f4260 Binary files /dev/null and b/assets/fonts/Inter/ExtraBoldItalic.ttf differ diff --git a/assets/fonts/Inter/ExtraLight.ttf b/assets/fonts/Inter/ExtraLight.ttf new file mode 100644 index 0000000..e98ac27 Binary files /dev/null and b/assets/fonts/Inter/ExtraLight.ttf differ diff --git a/assets/fonts/Inter/ExtraLightItalic.ttf b/assets/fonts/Inter/ExtraLightItalic.ttf new file mode 100644 index 0000000..cf74046 Binary files /dev/null and b/assets/fonts/Inter/ExtraLightItalic.ttf differ diff --git a/assets/fonts/Inter/Italic.ttf b/assets/fonts/Inter/Italic.ttf new file mode 100644 index 0000000..e0421ee Binary files /dev/null and b/assets/fonts/Inter/Italic.ttf differ diff --git a/assets/fonts/Inter/Light.ttf b/assets/fonts/Inter/Light.ttf new file mode 100644 index 0000000..31ac788 Binary files /dev/null and b/assets/fonts/Inter/Light.ttf differ diff --git a/assets/fonts/Inter/LightItalic.ttf b/assets/fonts/Inter/LightItalic.ttf new file mode 100644 index 0000000..0bd6cec Binary files /dev/null and b/assets/fonts/Inter/LightItalic.ttf differ diff --git a/assets/fonts/Inter/Medium.ttf b/assets/fonts/Inter/Medium.ttf new file mode 100644 index 0000000..9342730 Binary files /dev/null and b/assets/fonts/Inter/Medium.ttf differ diff --git a/assets/fonts/Inter/MediumItalic.ttf b/assets/fonts/Inter/MediumItalic.ttf new file mode 100644 index 0000000..a607d9f Binary files /dev/null and b/assets/fonts/Inter/MediumItalic.ttf differ diff --git a/assets/fonts/Inter/Regular.ttf b/assets/fonts/Inter/Regular.ttf new file mode 100644 index 0000000..c544be4 Binary files /dev/null and b/assets/fonts/Inter/Regular.ttf differ diff --git a/assets/fonts/Inter/SemiBold.ttf b/assets/fonts/Inter/SemiBold.ttf new file mode 100644 index 0000000..a32e2b8 Binary files /dev/null and b/assets/fonts/Inter/SemiBold.ttf differ diff --git a/assets/fonts/Inter/SemiBoldItalic.ttf b/assets/fonts/Inter/SemiBoldItalic.ttf new file mode 100644 index 0000000..7f28786 Binary files /dev/null and b/assets/fonts/Inter/SemiBoldItalic.ttf differ diff --git a/assets/fonts/Inter/Thin.ttf b/assets/fonts/Inter/Thin.ttf new file mode 100644 index 0000000..af78ac3 Binary files /dev/null and b/assets/fonts/Inter/Thin.ttf differ diff --git a/assets/fonts/Inter/ThinItalic.ttf b/assets/fonts/Inter/ThinItalic.ttf new file mode 100644 index 0000000..681cbf2 Binary files /dev/null and b/assets/fonts/Inter/ThinItalic.ttf differ diff --git a/assets/images/IconTextInverted.png b/assets/images/IconTextInverted.png new file mode 100644 index 0000000..e40d27a Binary files /dev/null and b/assets/images/IconTextInverted.png differ diff --git a/src/loader.gd b/src/loader.gd index ab13476..3ab5456 100644 --- a/src/loader.gd +++ b/src/loader.gd @@ -57,8 +57,8 @@ func _ready() -> void: logrtl.auto_translate = false logrtl.localize_numeral_system = false ## Create font override - logrtl.add_theme_font_override("normal_font", ResourceLoader.load("res://assets/fonts/FiraCode-Regular.ttf")) - logrtl.add_theme_font_override("bold_font", ResourceLoader.load("res://assets/fonts/FiraCode-Bold.ttf")) + logrtl.add_theme_font_override("normal_font", ResourceLoader.load("res://assets/fonts/FiraCode/Regular.ttf")) + logrtl.add_theme_font_override("bold_font", ResourceLoader.load("res://assets/fonts/FiraCode/Bold.ttf")) logrtl.add_theme_font_size_override("normal_font_size", 14) logrtl.add_theme_font_size_override("bold_font_size", 14) ## Connect to logger @@ -111,7 +111,7 @@ Licensed under the GNU General Public License version 3 # Open presentation archive/directory var path: String = " ".join(OS.get_cmdline_user_args()) if OS.get_cmdline_user_args().size() == 0: - await logger.error("No presentation was passed to Presencode") + ui_engine.initialize(self) else: await print_warning() await load_presentation(path) @@ -157,6 +157,27 @@ func _process(_delta: float) -> void: if typeof(logrtl) == TYPE_OBJECT: logrtl.size = DisplayServer.window_get_size() if config_window_size_support: move_child($WindowSizeSupport, get_child_count(true)) + # Fullscreen key combo + if pmana.config_allow_fullscreen and Input.is_action_just_pressed("fullscreen"): + if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_WINDOWED: + # window is windowed, set to fullscreen mode + logger.info("Switched to fullscreen mode") + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) + else: + # window is in fullscreen (or something else) mode, set to windowed mode + logger.info("Switched to windowed mode") + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) + # Content scale switch combo + if Input.is_action_just_pressed("content_scale_switch"): + match(get_tree().root.content_scale_stretch): + Window.CONTENT_SCALE_STRETCH_FRACTIONAL: + logger.info("Switching to fractional scaling") + get_tree().root.content_scale_stretch = Window.CONTENT_SCALE_STRETCH_INTEGER + Window.CONTENT_SCALE_STRETCH_INTEGER: + logger.info("Switching to integer scaling") + get_tree().root.content_scale_stretch = Window.CONTENT_SCALE_STRETCH_FRACTIONAL + _: + logger.error("Invalid content_scale_stretch value") # Append log output to logrtl.text func append_log(_type: logger.Types, _message: String, log_str: String) -> void: diff --git a/src/pmana.gd b/src/pmana.gd index 0dd92ca..3bbd2b1 100644 --- a/src/pmana.gd +++ b/src/pmana.gd @@ -197,38 +197,17 @@ func shutdown(exitcode: int = 0) -> void: # Runs every frame (duh) func _process(_delta: float) -> void: - # Fullscreen key combo - if config_allow_fullscreen and Input.is_action_just_pressed("fullscreen"): - if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_WINDOWED: - # window is windowed, set to fullscreen mode - logger.info("Switched to fullscreen mode") - DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) - else: - # window is in fullscreen (or something else) mode, set to windowed mode - logger.info("Switched to windowed mode") - DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) + if !registered: return # Navigation key combos - if Input.is_action_pressed("slide_forwards") and Input.is_action_pressed("slide_backwards"): - # slide_forwards and slide_backwards shouldn't be pressed at the same time - logger.warn("slide_forwards and slide_backwards are both pressed, aborting") - return + if Input.is_action_pressed("slide_forwards") and Input.is_action_pressed("slide_backwards"): return else: - if Input.is_action_just_pressed("slide_forwards"): - # Increase current_slide by one - logger.info("Navigating one slide forwards (key)") - change_slide(current_slide+1) - elif Input.is_action_just_pressed("slide_backwards"): - # Decrease current_slide by one - logger.info("Navigating one slide backwards (key)") - change_slide(current_slide-1) - # Content scale switch combo - if Input.is_action_just_pressed("content_scale_switch"): - match(get_tree().root.content_scale_stretch): - Window.CONTENT_SCALE_STRETCH_FRACTIONAL: - logger.info("Switching to fractional scaling") - get_tree().root.content_scale_stretch = Window.CONTENT_SCALE_STRETCH_INTEGER - Window.CONTENT_SCALE_STRETCH_INTEGER: - logger.info("Switching to integer scaling") - get_tree().root.content_scale_stretch = Window.CONTENT_SCALE_STRETCH_FRACTIONAL - _: - logger.error("Invalid content_scale_stretch value") + if get_node_or_null("/root/Console") == null or !get_node("/root/Console").visible: + if Input.is_action_just_pressed("slide_forwards"): + # Increase current_slide by one + logger.info("Navigating one slide forwards (key)") + change_slide(current_slide+1) + elif Input.is_action_just_pressed("slide_backwards"): + # Decrease current_slide by one + logger.info("Navigating one slide backwards (key)") + + change_slide(current_slide-1)