diff --git a/godot/button_email_feedback.gd b/godot/button_email_feedback.gd index 13e2219..d319895 100644 --- a/godot/button_email_feedback.gd +++ b/godot/button_email_feedback.gd @@ -1,21 +1,9 @@ extends Button -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - - -# Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body. -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass - - func _on_button_email_feedback_pressed(): -# warning-ignore:return_value_discarded var _error = OS.shell_open("mailto:feedback@jaapmarsman.com") diff --git a/godot/button_name.gd b/godot/button_name.gd index 69319e4..fe716aa 100644 --- a/godot/button_name.gd +++ b/godot/button_name.gd @@ -1,24 +1,8 @@ extends Button -# I'll use this script to call up the user details menu. -# This includes their name, but also topics of interest, etc. -# referencing nodes for menu switching - -onready var node_variables = get_node("/root/NodeVariables") onready var ui_control = get_node("/root/UiControl") -# Called when the node enters the scene tree for the first time. -func _ready(): - pass - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass - - -# makes the start menu disappear and the user menu appear func _on_button_name_pressed(): ui_control.show_user_menu() - diff --git a/godot/button_open_github.gd b/godot/button_open_github.gd index 7709ff0..da095cc 100644 --- a/godot/button_open_github.gd +++ b/godot/button_open_github.gd @@ -1,18 +1,5 @@ extends Button -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - -# Called when the node enters the scene tree for the first time. -#func _ready(): -# pass - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass - - func _on_button_open_github_pressed(): var _error = OS.shell_open("https://github.com/hobbesjaap/wellbeingapp") diff --git a/godot/button_user_save.gd b/godot/button_user_save.gd index 55944b0..a0e3b79 100644 --- a/godot/button_user_save.gd +++ b/godot/button_user_save.gd @@ -1,10 +1,12 @@ extends Button + onready var node_variables = get_node("/root/NodeVariables") onready var ui_control = get_node("/root/UiControl") onready var user_values = get_node("/root/UserValues") onready var user_name = get_node("%textbox_user_name") + func _on_button_user_save_pressed(): if user_name.text == "": diff --git a/godot/main_screen.gd b/godot/main_screen.gd index aff5a16..edc5121 100644 --- a/godot/main_screen.gd +++ b/godot/main_screen.gd @@ -3,13 +3,14 @@ extends CanvasLayer onready var node_variables = get_node("/root/NodeVariables") onready var ui_control = get_node("/root/UiControl") -onready var user_info = get_node("/root/UserValues") +onready var user_values = get_node("/root/UserValues") + func _ready(): # Read config file if it exists # otherwise set up new user data - if user_info.err != OK: + if user_values.err != OK: ui_control.show_user_menu() node_variables.first_time_label.visible = true @@ -19,7 +20,7 @@ func _ready(): ui_control.show_start_menu() # define variables from ini file - node_variables.user_name.text = user_info.user_first_name + node_variables.user_name.text = user_values.user_first_name # Iterate over all sections. # for player in config.get_sections(): diff --git a/godot/node_variables.gd b/godot/node_variables.gd index b73fdc1..ae7eeac 100644 --- a/godot/node_variables.gd +++ b/godot/node_variables.gd @@ -12,11 +12,5 @@ onready var first_time_label = get_node("/root/main_screen/UI/top_container/menu onready var welcome_label = get_node("/root/main_screen/UI/top_container/menus_container/start_menu/welcome_title") -# Called when the node enters the scene tree for the first time. func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass + pass diff --git a/godot/program_values.gd b/godot/program_values.gd index a9a593f..ddd169f 100644 --- a/godot/program_values.gd +++ b/godot/program_values.gd @@ -13,12 +13,6 @@ var release_version = 1 var web_release_version = 0 var current_version = "0.0.8" -func check_update(): - pass func _ready(): pass - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass diff --git a/godot/start_menu.gd b/godot/start_menu.gd index 40e2f73..9c95639 100644 --- a/godot/start_menu.gd +++ b/godot/start_menu.gd @@ -11,13 +11,13 @@ func _ready(): #func _process(_delta): -# Currently the only working way to show the user name. NOT desirable, continuously running the same line of code for no reason than me not figuring it out. -# $welcome_title.text = "Good morning, " + user_info.user_first_name + "!" +# pass func _on_button_update_check_pressed(): $HTTPRequest.request("https://raw.githubusercontent.com/hobbesjaap/wellbeingapp/main/version_info.csv") + func update_user_name_label(): $welcome_title.text = "Good morning, " + user_values.user_first_name + "!" diff --git a/godot/ui_control.gd b/godot/ui_control.gd index 3cfdfac..be2f37e 100644 --- a/godot/ui_control.gd +++ b/godot/ui_control.gd @@ -4,9 +4,10 @@ extends Node onready var node_variables = get_node("/root/NodeVariables") onready var user_values = get_node("/root/UserValues") -# Called when the node enters the scene tree for the first time. + func _ready(): - pass # Replace with function body. + pass + func show_start_menu(): node_variables.main_screen.visible = true @@ -14,18 +15,16 @@ func show_start_menu(): node_variables.user_menu.visible = false node_variables.daily_prompts.visible = false + func show_user_menu(): node_variables.main_screen.visible = true node_variables.start_menu.visible = false node_variables.user_menu.visible = true node_variables.daily_prompts.visible = false + func show_daily_prompts(): node_variables.main_screen.visible = true node_variables.start_menu.visible = false node_variables.user_menu.visible = false node_variables.daily_prompts.visible = true - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass diff --git a/godot/user_values.gd b/godot/user_values.gd index 746c5e5..1296cdb 100644 --- a/godot/user_values.gd +++ b/godot/user_values.gd @@ -23,8 +23,3 @@ func _ready(): else: pass - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass