From 4b8c57ccbe8a0b1eb35a7c8692635f8f7fef3def Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Thu, 28 Jan 2021 11:28:47 +0100 Subject: [PATCH] survey button in level selection --- scenes/level_select.gd | 4 ++++ scenes/level_select.tscn | 35 ++++++++++++++++++++++++++++++++++- styles/alert_button.tres | 8 ++++---- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/scenes/level_select.gd b/scenes/level_select.gd index b4acec3..927af7c 100644 --- a/scenes/level_select.gd +++ b/scenes/level_select.gd @@ -57,3 +57,7 @@ func reload(): level_id += 1 chapter_id += 1 + + +func onSurveyPressed(): + OS.shell_open("https://docs.google.com/forms/d/e/1FAIpQLSehHVcYfELT59h6plcn2ilbuqBcmDX3TH0qzB4jCgFIFOy_qg/viewform") diff --git a/scenes/level_select.tscn b/scenes/level_select.tscn index dae7f6c..9b58dad 100644 --- a/scenes/level_select.tscn +++ b/scenes/level_select.tscn @@ -1,7 +1,15 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://styles/theme.tres" type="Theme" id=1] [ext_resource path="res://scenes/level_select.gd" type="Script" id=2] +[ext_resource path="res://styles/alert_button.tres" type="StyleBox" id=3] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.54902, 0.0392157, 0.0392157, 1 ) +corner_radius_top_left = 4 +corner_radius_top_right = 4 +corner_radius_bottom_right = 4 +corner_radius_bottom_left = 4 [node name="LevelSelect" type="Control"] anchor_right = 1.0 @@ -56,5 +64,30 @@ __meta__ = { [node name="TextureRect" type="TextureRect" parent="Button2"] margin_right = 40.0 margin_bottom = 40.0 + +[node name="HelpLabel" type="Label" parent="."] +margin_left = 63.0 +margin_top = 159.0 +margin_right = 378.0 +margin_bottom = 220.0 +text = "Help us improving git-hydra by +answering some questions:" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Button3" type="Button" parent="HelpLabel"] +margin_left = -1.0 +margin_top = 68.0 +margin_right = 314.0 +margin_bottom = 118.0 +custom_styles/hover = SubResource( 1 ) +custom_styles/focus = ExtResource( 3 ) +custom_styles/normal = ExtResource( 3 ) +text = "To the survey /o/" +__meta__ = { +"_edit_use_anchors_": false +} [connection signal="pressed" from="Button" to="." method="back"] [connection signal="pressed" from="Button2" to="." method="reload"] +[connection signal="pressed" from="HelpLabel/Button3" to="." method="onSurveyPressed"] diff --git a/styles/alert_button.tres b/styles/alert_button.tres index a513fee..b4a9e5b 100644 --- a/styles/alert_button.tres +++ b/styles/alert_button.tres @@ -6,7 +6,7 @@ content_margin_right = 10.0 content_margin_top = 5.0 content_margin_bottom = 5.0 bg_color = Color( 0.717647, 0.160784, 0.160784, 1 ) -corner_radius_top_left = 3 -corner_radius_top_right = 3 -corner_radius_bottom_right = 3 -corner_radius_bottom_left = 3 +corner_radius_top_left = 4 +corner_radius_top_right = 4 +corner_radius_bottom_right = 4 +corner_radius_bottom_left = 4