Skip to content

Commit

Permalink
Add version label.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Daniel Schulze committed Mar 8, 2020
1 parent e2b223a commit c1ffeed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
1 change: 1 addition & 0 deletions glider/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ run/main_scene="res://scenes/Root/Root.tscn"
boot_splash/image="res://scenes/Root/splash.png"
boot_splash/bg_color=Color( 1, 1, 1, 1 )
config/icon="res://icon.png"
config/version="0.1.0"

[autoload]

Expand Down
3 changes: 3 additions & 0 deletions glider/scenes/Menu/MainMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extends State
onready var _menu_animation := $MenuAnimation
onready var _menu := $Menu
onready var _aircraft_animation := $Menu/Graphics/AircraftAnimation
onready var _version_label := $Menu/Graphics/VersionLabel
onready var _play_button := $Menu/Controls/NewGameButton


Expand All @@ -17,6 +18,8 @@ func _ready() -> void:
set_yield_on_pause(true)
_menu.modulate = Color.transparent

_version_label.text = "v" + ProjectSettings.get("application/config/version")


####################################################################################
# State Lifecycle
Expand Down
33 changes: 25 additions & 8 deletions glider/scenes/Menu/MainMenu.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=12 format=2]

[ext_resource path="res://scenes/Clouds/Clouds.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/World/Sky.tscn" type="PackedScene" id=2]
Expand All @@ -22,8 +22,13 @@ tracks/0/keys = {
"times": PoolRealArray( 0, 1.5, 3 )
}

[sub_resource type="Animation" id=2]
resource_name = "FadeMenu"
[sub_resource type="DynamicFontData" id=2]
font_path = "res://themes/FutilePro.ttf"

[sub_resource type="DynamicFont" id=3]
font_data = SubResource( 2 )

[sub_resource type="Animation" id=4]
length = 0.2
tracks/0/type = "value"
tracks/0/path = NodePath("Menu:modulate")
Expand All @@ -38,8 +43,7 @@ tracks/0/keys = {
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}

[sub_resource type="Animation" id=3]
resource_name = "PresentMenu"
[sub_resource type="Animation" id=5]
length = 0.8
tracks/0/type = "value"
tracks/0/path = NodePath("Menu/Graphics/Title:position")
Expand Down Expand Up @@ -94,7 +98,6 @@ tracks/3/keys = {
script = ExtResource( 4 )

[node name="Menu" type="Node2D" parent="."]
modulate = Color( 1, 1, 1, 0 )

[node name="Graphics" type="Node2D" parent="Menu"]

Expand Down Expand Up @@ -127,6 +130,20 @@ margin_top = -100.0
margin_right = 1644.0
margin_bottom = 657.0

[node name="VersionLabel" type="Label" parent="Menu/Graphics"]
margin_left = 690.435
margin_top = 438.691
margin_right = 925.435
margin_bottom = 525.691
custom_fonts/font = SubResource( 3 )
text = "0.1.0
"
align = 2
valign = 2
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Controls" type="VBoxContainer" parent="Menu"]
anchor_right = 0.658
margin_left = 310.0
Expand All @@ -151,7 +168,7 @@ margin_bottom = 116.0
text = "Exit"

[node name="MenuAnimation" type="AnimationPlayer" parent="."]
anims/FadeMenu = SubResource( 2 )
anims/PresentMenu = SubResource( 3 )
anims/FadeMenu = SubResource( 4 )
anims/PresentMenu = SubResource( 5 )
[connection signal="pressed" from="Menu/Controls/NewGameButton" to="." method="_on_NewGameButton_pressed"]
[connection signal="pressed" from="Menu/Controls/QuitButton" to="." method="_on_QuitButton_pressed"]

0 comments on commit c1ffeed

Please sign in to comment.