diff --git a/assets/fonts/Kenney Future Narrow.ttf b/assets/fonts/Kenney Future Narrow.ttf deleted file mode 100644 index c4cc8a0..0000000 Binary files a/assets/fonts/Kenney Future Narrow.ttf and /dev/null differ diff --git a/assets/fonts/Kenney Future Narrow.ttf.import b/assets/fonts/Kenney Future Narrow.ttf.import deleted file mode 100644 index af2f0ba..0000000 --- a/assets/fonts/Kenney Future Narrow.ttf.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://cpxocc1i62357" -path="res://.godot/imported/Kenney Future Narrow.ttf-ef7e34836d9e5dc059ca737da9380cb7.fontdata" - -[deps] - -source_file="res://assets/fonts/Kenney Future Narrow.ttf" -dest_files=["res://.godot/imported/Kenney Future Narrow.ttf-ef7e34836d9e5dc059ca737da9380cb7.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -disable_embedded_bitmaps=true -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/Kenney Future.ttf b/assets/fonts/Kenney Future.ttf deleted file mode 100644 index 17e2b6c..0000000 Binary files a/assets/fonts/Kenney Future.ttf and /dev/null differ diff --git a/assets/fonts/days_one/DaysOne-Regular.ttf b/assets/fonts/days_one/DaysOne-Regular.ttf new file mode 100644 index 0000000..ef77473 Binary files /dev/null and b/assets/fonts/days_one/DaysOne-Regular.ttf differ diff --git a/assets/fonts/Kenney Future.ttf.import b/assets/fonts/days_one/DaysOne-Regular.ttf.import similarity index 62% rename from assets/fonts/Kenney Future.ttf.import rename to assets/fonts/days_one/DaysOne-Regular.ttf.import index 6a1ed4b..4d59399 100644 --- a/assets/fonts/Kenney Future.ttf.import +++ b/assets/fonts/days_one/DaysOne-Regular.ttf.import @@ -2,13 +2,13 @@ importer="font_data_dynamic" type="FontFile" -uid="uid://diuo1i0qhrx72" -path="res://.godot/imported/Kenney Future.ttf-845b8d86f13614effd75cae8b9fe56b9.fontdata" +uid="uid://c80eqcvqyrda0" +path="res://.godot/imported/DaysOne-Regular.ttf-95c15a87935f4b2e3cb83415e5272a16.fontdata" [deps] -source_file="res://assets/fonts/Kenney Future.ttf" -dest_files=["res://.godot/imported/Kenney Future.ttf-845b8d86f13614effd75cae8b9fe56b9.fontdata"] +source_file="res://assets/fonts/days_one/DaysOne-Regular.ttf" +dest_files=["res://.godot/imported/DaysOne-Regular.ttf-95c15a87935f4b2e3cb83415e5272a16.fontdata"] [params] diff --git a/assets/fonts/days_one/OFL.txt b/assets/fonts/days_one/OFL.txt new file mode 100644 index 0000000..1138518 --- /dev/null +++ b/assets/fonts/days_one/OFL.txt @@ -0,0 +1,94 @@ +Copyright (c) 2011, Jovanny Lemonad (http://www.jovanny.ru) +with Reserved Font Name "Days One" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/entities/player/player.gd b/entities/player/player.gd index c29d3a3..e4370c6 100644 --- a/entities/player/player.gd +++ b/entities/player/player.gd @@ -19,6 +19,7 @@ func _ready() -> void: Utils.set_player(self) # Connect the event from the joysticks click + # HACK: This should rather be connected from a global SignalManager or SignalBus get_viewport().get_tree().get_root().find_child("JoystickPanel", true, false).connect("on_interact", interact) diff --git a/resources/asset_info.gd b/resources/asset_info.gd new file mode 100644 index 0000000..7bcbfc0 --- /dev/null +++ b/resources/asset_info.gd @@ -0,0 +1,27 @@ +extends Resource +class_name AssetInfo + +enum AssetType { + MUSIC, + SFX, + THREEDIMENSIONAL, + TEXTURES, + FONTS +} + +enum LicenseType { + CC0, + CCBY, + CCBYSA, + MIT, + GPL2, + GPL3, + OFL, + NONE +} + +@export var asset_type: AssetType = AssetType.MUSIC +@export var license_type: LicenseType = LicenseType.MIT +@export var asset_name: String = "" +@export var author_name: String = "" +@export var link: String = "https://example.com" diff --git a/resources/asset_info/DaysOne.tres b/resources/asset_info/DaysOne.tres new file mode 100644 index 0000000..c059d9e --- /dev/null +++ b/resources/asset_info/DaysOne.tres @@ -0,0 +1,11 @@ +[gd_resource type="Resource" script_class="AssetInfo" load_steps=2 format=3 uid="uid://ckcssxj1nvkbo"] + +[ext_resource type="Script" path="res://resources/asset_info.gd" id="1_6piw6"] + +[resource] +script = ExtResource("1_6piw6") +asset_type = 4 +license_type = 6 +asset_name = "Days One" +author_name = "Jovanny Lemonad" +link = "https://fonts.google.com/specimen/Days+One" diff --git a/resources/asset_info/kenney_ui_pack.tres b/resources/asset_info/kenney_ui_pack.tres new file mode 100644 index 0000000..035fac2 --- /dev/null +++ b/resources/asset_info/kenney_ui_pack.tres @@ -0,0 +1,11 @@ +[gd_resource type="Resource" script_class="AssetInfo" load_steps=2 format=3 uid="uid://dqe782fxpsnww"] + +[ext_resource type="Script" path="res://resources/asset_info.gd" id="1_up8c2"] + +[resource] +script = ExtResource("1_up8c2") +asset_type = 3 +license_type = 3 +asset_name = "UI Pack 2.0" +author_name = "Kenney" +link = "https://kenney.nl/assets/ui-pack" diff --git a/resources/asset_info/unexplored_fields.tres b/resources/asset_info/unexplored_fields.tres new file mode 100644 index 0000000..f0d412e --- /dev/null +++ b/resources/asset_info/unexplored_fields.tres @@ -0,0 +1,11 @@ +[gd_resource type="Resource" script_class="AssetInfo" load_steps=2 format=3 uid="uid://bxaxwsg2vubd8"] + +[ext_resource type="Script" path="res://resources/asset_info.gd" id="1_me3ee"] + +[resource] +script = ExtResource("1_me3ee") +asset_type = 0 +license_type = 1 +asset_name = "Unexplored Fields" +author_name = "Hello World" +link = "https://example.com" diff --git a/theme/basic_theme.tres b/theme/basic_theme.tres index 9d8de33..d5df67a 100644 --- a/theme/basic_theme.tres +++ b/theme/basic_theme.tres @@ -1,92 +1,20 @@ -[gd_resource type="Theme" load_steps=29 format=3 uid="uid://xfq6d5yqsdh5"] +[gd_resource type="Theme" load_steps=21 format=3 uid="uid://xfq6d5yqsdh5"] -[ext_resource type="FontFile" uid="uid://diuo1i0qhrx72" path="res://assets/fonts/Kenney Future.ttf" id="1_7olm8"] -[ext_resource type="Texture2D" uid="uid://dqvcyivxd6quf" path="res://assets/textures/kenney_ui-pack/PNG/Grey/Double/button_rectangle_flat.png" id="1_cagdw"] +[ext_resource type="StyleBox" uid="uid://citsx8sjgxe0m" path="res://theme/button_normal/button_normal_disabled.tres" id="2_nk20g"] +[ext_resource type="StyleBox" uid="uid://hrjfuopqykvn" path="res://theme/button_normal/button_normal_hover.tres" id="3_dq03w"] [ext_resource type="Texture2D" uid="uid://c7hsf6aa7n8ye" path="res://assets/textures/kenney_ui-pack/PNG/Blue/Double/check_square_grey_checkmark.png" id="3_fwj8m"] +[ext_resource type="StyleBox" uid="uid://cqh18qe8cbawu" path="res://theme/button_normal/button_normal.tres" id="3_h1eup"] +[ext_resource type="StyleBox" uid="uid://djx8hae2knqjy" path="res://theme/button_normal/button_normal_pressed.tres" id="4_d33iv"] [ext_resource type="Texture2D" uid="uid://0mrw1tw5533y" path="res://assets/textures/kenney_ui-pack/PNG/Blue/Double/check_square_grey.png" id="4_ejwd8"] [ext_resource type="Texture2D" uid="uid://fuvect3s8xob" path="res://assets/textures/kenney_ui-pack/PNG/Extra/Double/input_outline_rectangle.png" id="5_0ives"] [ext_resource type="Texture2D" uid="uid://bssj4xg6tgdon" path="res://assets/textures/kenney_ui-pack/PNG/Grey/Double/button_rectangle_depth_flat.png" id="6_afi76"] -[ext_resource type="Texture2D" uid="uid://bgc1chloftw3i" path="res://assets/textures/kenney_ui-pack/PNG/Red/Double/button_rectangle_flat.png" id="7_2hwk4"] +[ext_resource type="FontFile" uid="uid://c80eqcvqyrda0" path="res://assets/fonts/days_one/DaysOne-Regular.ttf" id="7_6o8vx"] [ext_resource type="Texture2D" uid="uid://2aourrhwc2vr" path="res://assets/textures/kenney_ui-pack/PNG/Blue/Double/slide_hangle_rotated.png" id="7_d7yi5"] [ext_resource type="Texture2D" uid="uid://sy5kn23lahn0" path="res://assets/textures/kenney_ui-pack/PNG/Grey/Double/slide_hangle_rotated.png" id="8_vvus7"] [ext_resource type="Texture2D" uid="uid://yivq8q3se8t" path="res://assets/textures/kenney_ui-pack/PNG/Blue/Double/slide_vertical_grey.png" id="9_epdci"] - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_p6kuw"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_lrxv2"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_nsgpx"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mskne"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_4fyti"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_f2xhk"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_dcs77"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_m75dt"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mrqy7"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_38a2s"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_nvcsd"] -texture = ExtResource("1_cagdw") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 +[ext_resource type="StyleBox" uid="uid://buk1mtm8ljn3m" path="res://theme/button_red/button_red_hover.tres" id="10_bf65p"] +[ext_resource type="StyleBox" uid="uid://caqi6ke07ndk2" path="res://theme/button_red/button_red.tres" id="11_21drs"] +[ext_resource type="StyleBox" uid="uid://bija2yr7dfu8h" path="res://theme/button_red/button_red_pressed.tres" id="12_7xw0v"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_g7r8o"] texture = ExtResource("5_0ives") @@ -117,21 +45,6 @@ expand_margin_top = 4.0 expand_margin_right = 4.0 expand_margin_bottom = 4.0 -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_k5ktt"] -texture = ExtResource("7_2hwk4") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 -modulate_color = Color(0.8, 0.8, 0.8, 1) - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_35fmy"] -texture = ExtResource("7_2hwk4") -texture_margin_left = 20.0 -texture_margin_top = 14.0 -texture_margin_right = 20.0 -texture_margin_bottom = 14.0 - [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_872kh"] texture = ExtResource("9_epdci") region_rect = Rect2(8, 30, 16, 16) @@ -146,22 +59,23 @@ texture_margin_bottom = 4.0 [resource] Button/colors/font_color = Color(0.301961, 0.301961, 0.301961, 1) Button/colors/font_disabled_color = Color(0.7, 0.7, 0.7, 0.784314) -Button/colors/font_hover_color = Color(0.2, 0.2, 0.2, 1) -Button/colors/font_pressed_color = Color(0.4, 0.4, 0.4, 1) +Button/colors/font_focus_color = Color(0.301961, 0.301961, 0.301961, 1) +Button/colors/font_hover_color = Color(0.301961, 0.301961, 0.301961, 1) +Button/colors/font_hover_pressed_color = Color(0.301961, 0.301961, 0.301961, 1) +Button/colors/font_pressed_color = Color(0.301961, 0.301961, 0.301961, 1) Button/colors/icon_normal_color = Color(0.827833, 0.105612, 0.719122, 1) Button/font_sizes/font_size = 24 -Button/fonts/font = ExtResource("1_7olm8") -Button/styles/disabled = SubResource("StyleBoxTexture_p6kuw") -Button/styles/disabled_mirrored = SubResource("StyleBoxTexture_lrxv2") -Button/styles/focus = SubResource("StyleBoxTexture_nsgpx") -Button/styles/hover = SubResource("StyleBoxTexture_mskne") -Button/styles/hover_mirrored = SubResource("StyleBoxTexture_4fyti") -Button/styles/hover_pressed = SubResource("StyleBoxTexture_f2xhk") -Button/styles/hover_pressed_mirrored = SubResource("StyleBoxTexture_dcs77") -Button/styles/normal = SubResource("StyleBoxTexture_m75dt") -Button/styles/normal_mirrored = SubResource("StyleBoxTexture_mrqy7") -Button/styles/pressed = SubResource("StyleBoxTexture_38a2s") -Button/styles/pressed_mirrored = SubResource("StyleBoxTexture_nvcsd") +Button/styles/disabled = ExtResource("2_nk20g") +Button/styles/disabled_mirrored = ExtResource("2_nk20g") +Button/styles/focus = ExtResource("3_dq03w") +Button/styles/hover = ExtResource("3_dq03w") +Button/styles/hover_mirrored = ExtResource("3_dq03w") +Button/styles/hover_pressed = ExtResource("4_d33iv") +Button/styles/hover_pressed_mirrored = ExtResource("4_d33iv") +Button/styles/normal = ExtResource("3_h1eup") +Button/styles/normal_mirrored = ExtResource("3_h1eup") +Button/styles/pressed = ExtResource("4_d33iv") +Button/styles/pressed_mirrored = ExtResource("4_d33iv") CheckBox/constants/h_separation = 12 CheckBox/constants/icon_max_width = 32 CheckBox/icons/checked = ExtResource("3_fwj8m") @@ -169,17 +83,29 @@ CheckBox/icons/unchecked = ExtResource("4_ejwd8") CheckButton/constants/icon_max_width = 36 CheckButton/icons/checked = ExtResource("3_fwj8m") CheckButton/icons/unchecked = ExtResource("4_ejwd8") +Label/colors/font_color = Color(0.3, 0.3, 0.3, 1) Label/font_sizes/font_size = 20 -Label/fonts/font = ExtResource("1_7olm8") +Label/fonts/font = ExtResource("7_6o8vx") LineEdit/colors/font_color = Color(0.301961, 0.301961, 0.301961, 1) LineEdit/styles/normal = SubResource("StyleBoxTexture_g7r8o") +LinkButton/colors/font_color = Color(0.299388, 0.345877, 0.799646, 1) +LinkButton/colors/font_hover_pressed_color = Color(0.298039, 0.345098, 0.8, 1) +LinkButton/colors/font_pressed_color = Color(0.298039, 0.345098, 0.8, 1) +LinkButton/fonts/font = ExtResource("7_6o8vx") Panel/styles/panel = SubResource("StyleBoxTexture_cwwj3") PanelContainer/styles/panel = SubResource("StyleBoxTexture_nkhdn") RedButton/base_type = &"Button" RedButton/colors/font_color = Color(1, 1, 1, 1) RedButton/colors/font_hover_color = Color(0.7, 0.7, 0.7, 1) -RedButton/styles/hover = SubResource("StyleBoxTexture_k5ktt") -RedButton/styles/normal = SubResource("StyleBoxTexture_35fmy") +RedButton/styles/focus = ExtResource("10_bf65p") +RedButton/styles/hover = ExtResource("10_bf65p") +RedButton/styles/hover_mirrored = ExtResource("10_bf65p") +RedButton/styles/hover_pressed = ExtResource("12_7xw0v") +RedButton/styles/hover_pressed_mirrored = ExtResource("12_7xw0v") +RedButton/styles/normal = ExtResource("11_21drs") +RedButton/styles/normal_mirrored = ExtResource("11_21drs") +RedButton/styles/pressed = ExtResource("12_7xw0v") +RedButton/styles/pressed_mirrored = ExtResource("12_7xw0v") VSlider/icons/grabber = ExtResource("7_d7yi5") VSlider/icons/grabber_disabled = ExtResource("8_vvus7") VSlider/icons/grabber_highlight = ExtResource("7_d7yi5") diff --git a/theme/button_normal/button_normal.tres b/theme/button_normal/button_normal.tres new file mode 100644 index 0000000..253690b --- /dev/null +++ b/theme/button_normal/button_normal.tres @@ -0,0 +1,10 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://cqh18qe8cbawu"] + +[ext_resource type="Texture2D" uid="uid://dqvcyivxd6quf" path="res://assets/textures/kenney_ui-pack/PNG/Grey/Double/button_rectangle_flat.png" id="1_2ekqu"] + +[resource] +texture = ExtResource("1_2ekqu") +texture_margin_left = 20.0 +texture_margin_top = 14.0 +texture_margin_right = 20.0 +texture_margin_bottom = 14.0 diff --git a/theme/button_normal/button_normal_disabled.tres b/theme/button_normal/button_normal_disabled.tres new file mode 100644 index 0000000..bde42d2 --- /dev/null +++ b/theme/button_normal/button_normal_disabled.tres @@ -0,0 +1,10 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://citsx8sjgxe0m"] + +[ext_resource type="Texture2D" uid="uid://dqvcyivxd6quf" path="res://assets/textures/kenney_ui-pack/PNG/Grey/Double/button_rectangle_flat.png" id="1_tc4e8"] + +[resource] +texture = ExtResource("1_tc4e8") +texture_margin_left = 20.0 +texture_margin_top = 14.0 +texture_margin_right = 20.0 +texture_margin_bottom = 14.0 diff --git a/theme/button_normal/button_normal_hover.tres b/theme/button_normal/button_normal_hover.tres new file mode 100644 index 0000000..bbd99a5 --- /dev/null +++ b/theme/button_normal/button_normal_hover.tres @@ -0,0 +1,11 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://hrjfuopqykvn"] + +[ext_resource type="Texture2D" uid="uid://dqvcyivxd6quf" path="res://assets/textures/kenney_ui-pack/PNG/Grey/Double/button_rectangle_flat.png" id="1_of0i1"] + +[resource] +texture = ExtResource("1_of0i1") +texture_margin_left = 20.0 +texture_margin_top = 14.0 +texture_margin_right = 20.0 +texture_margin_bottom = 14.0 +modulate_color = Color(0.7, 0.7, 0.7, 1) diff --git a/theme/button_normal/button_normal_pressed.tres b/theme/button_normal/button_normal_pressed.tres new file mode 100644 index 0000000..6e2066e --- /dev/null +++ b/theme/button_normal/button_normal_pressed.tres @@ -0,0 +1,11 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://djx8hae2knqjy"] + +[ext_resource type="Texture2D" uid="uid://dqvcyivxd6quf" path="res://assets/textures/kenney_ui-pack/PNG/Grey/Double/button_rectangle_flat.png" id="1_5gr5k"] + +[resource] +texture = ExtResource("1_5gr5k") +texture_margin_left = 20.0 +texture_margin_top = 14.0 +texture_margin_right = 20.0 +texture_margin_bottom = 14.0 +modulate_color = Color(0.5, 0.5, 0.5, 1) diff --git a/theme/button_red/button_red.tres b/theme/button_red/button_red.tres new file mode 100644 index 0000000..dc8f7e3 --- /dev/null +++ b/theme/button_red/button_red.tres @@ -0,0 +1,10 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://caqi6ke07ndk2"] + +[ext_resource type="Texture2D" uid="uid://bgc1chloftw3i" path="res://assets/textures/kenney_ui-pack/PNG/Red/Double/button_rectangle_flat.png" id="1_awex1"] + +[resource] +texture = ExtResource("1_awex1") +texture_margin_left = 12.0 +texture_margin_top = 12.0 +texture_margin_right = 12.0 +texture_margin_bottom = 12.0 diff --git a/theme/button_red/button_red_hover.tres b/theme/button_red/button_red_hover.tres new file mode 100644 index 0000000..47e62d8 --- /dev/null +++ b/theme/button_red/button_red_hover.tres @@ -0,0 +1,11 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://buk1mtm8ljn3m"] + +[ext_resource type="Texture2D" uid="uid://bgc1chloftw3i" path="res://assets/textures/kenney_ui-pack/PNG/Red/Double/button_rectangle_flat.png" id="1_00ahu"] + +[resource] +texture = ExtResource("1_00ahu") +texture_margin_left = 20.0 +texture_margin_top = 14.0 +texture_margin_right = 20.0 +texture_margin_bottom = 14.0 +modulate_color = Color(0.8, 0.8, 0.8, 1) diff --git a/theme/button_red/button_red_pressed.tres b/theme/button_red/button_red_pressed.tres new file mode 100644 index 0000000..c138d74 --- /dev/null +++ b/theme/button_red/button_red_pressed.tres @@ -0,0 +1,10 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://bija2yr7dfu8h"] + +[ext_resource type="Texture2D" uid="uid://bgc1chloftw3i" path="res://assets/textures/kenney_ui-pack/PNG/Red/Double/button_rectangle_flat.png" id="1_es7nv"] + +[resource] +texture = ExtResource("1_es7nv") +texture_margin_left = 12.0 +texture_margin_top = 12.0 +texture_margin_right = 12.0 +texture_margin_bottom = 12.0 diff --git a/ui/license_list/license_entry.gd b/ui/license_list/license_entry.gd new file mode 100644 index 0000000..fbc9bf6 --- /dev/null +++ b/ui/license_list/license_entry.gd @@ -0,0 +1,99 @@ +extends VBoxContainer + +@onready var asset_type: Label = %AssetType +@onready var license_type: Label = %LicenseType +@onready var asset_name: Label = %AssetName +@onready var author_name: Label = %AuthorName +@onready var link_button: LinkButton = %LinkButton + +@export var asset_type_colors: Dictionary = { + "MUSIC": Color("c9ca00"), + "SFX": Color("3aae65"), + "THREEDIMENSIONAL": Color("c8954c"), + "TEXTURES": Color("aa77cc"), + "FONTS": Color("5185b2"), + "NOT_SPECIFIED": Color("aaaaaa") +} + +@export var license_type_colors: Dictionary = { + "CC0": Color("bc852e"), + "CCBY": Color("3478f6"), + "CCBYSA": Color("f69625"), + "MIT": Color("2d8b57"), + "GPL2": Color("d32f2f"), + "GPL3": Color("c0392b"), + "OFL": Color("8e44ad"), + "NONE": Color("aaaaaa") +} + + +func populate(p_asset_info: AssetInfo) -> void: + change_asset_type(p_asset_info.asset_type) + change_asset_license(p_asset_info.license_type) + asset_name.text = p_asset_info.asset_name + author_name.text = "by " + p_asset_info.author_name + link_button.text = p_asset_info.link + link_button.uri = p_asset_info.link + +func change_asset_type(p_asset_type: AssetInfo.AssetType) -> void: + + var style_box: StyleBoxFlat = asset_type.get_parent().get("theme_override_styles/panel").duplicate() + + match p_asset_type: + AssetInfo.AssetType.MUSIC: + asset_type.text = "MUSIC" + style_box.set("bg_color", asset_type_colors["MUSIC"]) + AssetInfo.AssetType.SFX: + asset_type.text = "SFX" + style_box.set("bg_color", asset_type_colors["SFX"]) + AssetInfo.AssetType.THREEDIMENSIONAL: + asset_type.text = "3D" + style_box.set("bg_color", asset_type_colors["THREEDIMENSIONAL"]) + AssetInfo.AssetType.TEXTURES: + asset_type.text = "TEXTURES" + style_box.set("bg_color", asset_type_colors["TEXTURES"]) + AssetInfo.AssetType.FONTS: + asset_type.text = "FONTS" + style_box.set("bg_color", asset_type_colors["FONTS"]) + _: + asset_type.text = "Not specified" + style_box.set("bg_color", asset_type_colors["NOT_SPECIFIED"]) + + # Finally set the background color + asset_type.get_parent().add_theme_stylebox_override("panel", style_box) + +func change_asset_license(p_license_type: AssetInfo.LicenseType) -> void: + + var style_box: StyleBoxFlat = license_type.get_parent().get("theme_override_styles/panel").duplicate() + + match p_license_type: + AssetInfo.LicenseType.CC0: + license_type.text = "CC0" + style_box.set("bg_color", license_type_colors["CC0"]) + AssetInfo.LicenseType.CCBY: + license_type.text = "CC BY" + style_box.set("bg_color", license_type_colors["CCBY"]) + AssetInfo.LicenseType.CCBYSA: + license_type.text = "CC BY-SA" + style_box.set("bg_color", license_type_colors["CCBYSA"]) + AssetInfo.LicenseType.MIT: + license_type.text = "MIT" + style_box.set("bg_color", license_type_colors["MIT"]) + AssetInfo.LicenseType.GPL2: + license_type.text = "GPL 2.0" + style_box.set("bg_color", license_type_colors["GPL2"]) + AssetInfo.LicenseType.GPL3: + license_type.text = "GPL 3.0" + style_box.set("bg_color", license_type_colors["GPL3"]) + AssetInfo.LicenseType.OFL: + license_type.text = "OFL" + style_box.set("bg_color", license_type_colors["OFL"]) + AssetInfo.LicenseType.NONE: + license_type.text = "Not specified" + style_box.set("bg_color", license_type_colors["NONE"]) + _: + license_type.text = "Unknown" + style_box.set("bg_color", license_type_colors["NONE"]) + + # Finally set the background color + license_type.get_parent().add_theme_stylebox_override("panel", style_box) diff --git a/ui/license_list/license_entry.tscn b/ui/license_list/license_entry.tscn new file mode 100644 index 0000000..d80412d --- /dev/null +++ b/ui/license_list/license_entry.tscn @@ -0,0 +1,83 @@ +[gd_scene load_steps=6 format=3 uid="uid://b7raoxonsf116"] + +[ext_resource type="Script" path="res://ui/license_list/license_entry.gd" id="1_fuqxo"] +[ext_resource type="FontFile" uid="uid://c80eqcvqyrda0" path="res://assets/fonts/days_one/DaysOne-Regular.ttf" id="2_48yrm"] + +[sub_resource type="FontVariation" id="FontVariation_yq0xd"] +base_font = ExtResource("2_48yrm") +variation_embolden = 0.5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dvghx"] +content_margin_left = 6.0 +content_margin_top = 0.0 +content_margin_right = 6.0 +content_margin_bottom = 0.0 +bg_color = Color(0.1681, 0.228575, 0.41, 1) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ug4om"] +content_margin_left = 8.0 +content_margin_right = 8.0 +draw_center = false +border_width_left = 4 +border_width_top = 4 +border_width_right = 4 +border_width_bottom = 4 +border_color = Color(0.752941, 0.619608, 0.337255, 1) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 + +[node name="LicenseEntry" type="VBoxContainer"] +script = ExtResource("1_fuqxo") + +[node name="TypeAndName" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="AssetName" type="Label" parent="TypeAndName"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +theme_override_fonts/font = SubResource("FontVariation_yq0xd") +text = "Name of the asset" +max_lines_visible = 1 + +[node name="PanelContainer" type="PanelContainer" parent="TypeAndName"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_dvghx") + +[node name="AssetType" type="Label" parent="TypeAndName/PanelContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_colors/font_color = Color(1, 1, 1, 1) +text = "MUSIC" + +[node name="LicenseContainer" type="PanelContainer" parent="TypeAndName"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_ug4om") + +[node name="LicenseType" type="Label" parent="TypeAndName/LicenseContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_colors/font_color = Color(0.753848, 0.617939, 0.336047, 1) +theme_override_font_sizes/font_size = 16 +text = "CC0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="AuthorName" type="Label" parent="."] +unique_name_in_owner = true +layout_mode = 2 +text = "by Author Of XYZ" + +[node name="LinkButton" type="LinkButton" parent="."] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 0 +text = "https://example.com" +uri = "https://example.com" diff --git a/ui/main_menu/main_menu.gd b/ui/main_menu/main_menu.gd index 51dc5ad..c916683 100644 --- a/ui/main_menu/main_menu.gd +++ b/ui/main_menu/main_menu.gd @@ -5,10 +5,16 @@ signal on_game_continued @onready var continue_game_button: Button = %ContinueGameButton @onready var new_game_button: Button = %NewGameButton +@onready var license_container: VBoxContainer = %LicenseContainer + +const LICENSE_FOLDER: String = "res://resources/asset_info/" +@onready var license_entry: PackedScene = preload("res://ui/license_list/license_entry.tscn") + # On ready, check which buttons to show func _ready() -> void: SoundManager.play_background_music("Unexplored Fields") + list_licenses() if SaveManager.save_exists(): continue_game_button.visible = true @@ -35,7 +41,23 @@ func _on_options_button_pressed() -> void: print("TODO") func _on_licenses_button_pressed() -> void: - print("TODO") + %LicensesScreen.visible = true func _on_exit_button_pressed() -> void: get_tree().quit() + +func list_licenses() -> void: + var dir: DirAccess = DirAccess.open(LICENSE_FOLDER) + for file: String in dir.get_files(): + add_license(file) + +func add_license(license_path: String) -> void: + var asset_info: AssetInfo = load(LICENSE_FOLDER + license_path) + var new_license_entry: Node = license_entry.instantiate() + license_container.add_child(new_license_entry) + new_license_entry.populate(asset_info) + + +func _on_licenses_close_button_pressed() -> void: + %LicensesScreen.visible = false + pass # Replace with function body. diff --git a/ui/main_menu/main_menu.tscn b/ui/main_menu/main_menu.tscn index 275441e..3b89384 100644 --- a/ui/main_menu/main_menu.tscn +++ b/ui/main_menu/main_menu.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=5 format=3 uid="uid://dt00rjsodtady"] +[gd_scene load_steps=4 format=3 uid="uid://dt00rjsodtady"] [ext_resource type="Texture2D" uid="uid://b6ylra30qxf30" path="res://assets/logo/logo.png" id="1_1fmce"] [ext_resource type="Script" path="res://ui/main_menu/main_menu.gd" id="1_5gs73"] [ext_resource type="Texture2D" uid="uid://da7o6lfuoliid" path="res://assets/textures/Backgrounds/meadow2.jpg" id="2_bb61v"] -[ext_resource type="Theme" uid="uid://xfq6d5yqsdh5" path="res://theme/basic_theme.tres" id="4_y6s8u"] [node name="MainMenu" type="Control"] layout_mode = 3 @@ -76,7 +75,6 @@ size_flags_vertical = 3 [node name="NewGameButton" type="Button" parent="VBoxContainer/MarginContainer/MenuButtons"] unique_name_in_owner = true layout_mode = 2 -theme = ExtResource("4_y6s8u") theme_override_font_sizes/font_size = 32 text = "New Game" @@ -84,21 +82,18 @@ text = "New Game" unique_name_in_owner = true visible = false layout_mode = 2 -theme = ExtResource("4_y6s8u") theme_override_font_sizes/font_size = 32 text = "Continue" [node name="OptionsButton" type="Button" parent="VBoxContainer/MarginContainer/MenuButtons"] unique_name_in_owner = true layout_mode = 2 -theme = ExtResource("4_y6s8u") theme_override_font_sizes/font_size = 32 text = "Options" [node name="LicensesButton" type="Button" parent="VBoxContainer/MarginContainer/MenuButtons"] unique_name_in_owner = true layout_mode = 2 -theme = ExtResource("4_y6s8u") theme_override_font_sizes/font_size = 32 text = "Licenses" @@ -106,12 +101,59 @@ text = "Licenses" unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 10 -theme = ExtResource("4_y6s8u") +theme_type_variation = &"RedButton" theme_override_font_sizes/font_size = 32 text = "Exit" +[node name="LicensesScreen" type="PanelContainer" parent="."] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer" type="MarginContainer" parent="LicensesScreen"] +layout_mode = 2 +theme_override_constants/margin_left = 40 +theme_override_constants/margin_top = 40 +theme_override_constants/margin_right = 40 +theme_override_constants/margin_bottom = 40 + +[node name="VBoxContainer" type="VBoxContainer" parent="LicensesScreen/MarginContainer"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="LicensesScreen/MarginContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/margin_bottom = 20 + +[node name="LicensesHeadingLabel" type="Label" parent="LicensesScreen/MarginContainer/VBoxContainer/MarginContainer"] +layout_mode = 2 +text = "Licenses used in this game" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ScrollContainer" type="ScrollContainer" parent="LicensesScreen/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +follow_focus = true + +[node name="LicenseContainer" type="VBoxContainer" parent="LicensesScreen/MarginContainer/VBoxContainer/ScrollContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/separation = 20 + +[node name="LicensesCloseButton" type="Button" parent="LicensesScreen/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_type_variation = &"RedButton" +text = "Close" + [connection signal="pressed" from="VBoxContainer/MarginContainer/MenuButtons/NewGameButton" to="." method="_on_new_game_button_pressed"] [connection signal="pressed" from="VBoxContainer/MarginContainer/MenuButtons/ContinueGameButton" to="." method="_on_continue_game_button_pressed"] [connection signal="pressed" from="VBoxContainer/MarginContainer/MenuButtons/OptionsButton" to="." method="_on_options_button_pressed"] [connection signal="pressed" from="VBoxContainer/MarginContainer/MenuButtons/LicensesButton" to="." method="_on_licenses_button_pressed"] [connection signal="pressed" from="VBoxContainer/MarginContainer/MenuButtons/ExitButton" to="." method="_on_exit_button_pressed"] +[connection signal="pressed" from="LicensesScreen/MarginContainer/VBoxContainer/LicensesCloseButton" to="." method="_on_licenses_close_button_pressed"]