Skip to content

Commit

Permalink
update 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Blockyheadman committed Dec 30, 2022
1 parent 32c12df commit 228e0b5
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 62 deletions.
2 changes: 1 addition & 1 deletion game-version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"0.4.0"}
{"version":"0.4.1"}
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ window/stretch/aspect="expand"

[editor_plugins]

enabled=PoolStringArray( "res://addons/godot-firebase/plugin.cfg", "res://addons/http-sse-client/plugin.cfg", "res://addons/silicon.util.custom_docs/plugin.cfg" )
enabled=PoolStringArray( "res://addons/godot-firebase/plugin.cfg", "res://addons/http-sse-client/plugin.cfg", "res://addons/onscreenkeyboard/plugin.cfg", "res://addons/silicon.util.custom_docs/plugin.cfg" )

[gdnative]

Expand Down
11 changes: 8 additions & 3 deletions scenes/Home.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ theme = ExtResource( 13 )
text = "Leaderboards"

[node name="Changelog" type="AcceptDialog" parent="."]
visible = true
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
Expand All @@ -308,10 +309,14 @@ margin_right = -8.0
margin_bottom = -5.80002

[node name="Label" type="Label" parent="Changelog/ScrollContainer"]
margin_right = 320.0
margin_bottom = 813.0
margin_right = 310.0
margin_bottom = 981.0
size_flags_horizontal = 3
text = "Version 0.4.0:
text = "Version 0.4.1:
* Fixed offline version checker alert from producing null response.
* Fixed version checker from giving false positive when version number is higher than previous.
Version 0.4.0:
* Added an auto clicker slowdown
* Enabled sign in with google (For PC only).
* Added Upgrades Menu
Expand Down
53 changes: 50 additions & 3 deletions scenes/Login.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=2]
[gd_scene load_steps=20 format=2]

[ext_resource path="res://resources/fonts/ariblk.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://resources/styles/LoginTextEdits.tres" type="Theme" id=2]
Expand All @@ -8,6 +8,7 @@
[ext_resource path="res://scripts/Login.gd" type="Script" id=6]
[ext_resource path="res://resources/styles/SmallButtonPreset.tres" type="Theme" id=7]
[ext_resource path="res://resources/audio/Clikc.wav" type="AudioStream" id=8]
[ext_resource path="res://addons/onscreenkeyboard/onscreen_keyboard.gd" type="Script" id=9]

[sub_resource type="DynamicFont" id=1]
size = 27
Expand All @@ -27,6 +28,39 @@ font_data = ExtResource( 1 )
size = 14
font_data = ExtResource( 1 )

[sub_resource type="StyleBoxFlat" id=6]
bg_color = Color( 0.423529, 0.423529, 0.423529, 1 )
corner_radius_top_left = 10
corner_radius_top_right = 10

[sub_resource type="StyleBoxFlat" id=7]
bg_color = Color( 0.72549, 0.72549, 0.72549, 1 )
corner_radius_top_left = 7
corner_radius_top_right = 7
corner_radius_bottom_right = 7
corner_radius_bottom_left = 7
expand_margin_left = 1.0
expand_margin_right = 1.0
expand_margin_top = 1.0
expand_margin_bottom = 1.0

[sub_resource type="StyleBoxFlat" id=8]
bg_color = Color( 0.27451, 0.27451, 0.27451, 1 )
corner_radius_top_left = 7
corner_radius_top_right = 7
corner_radius_bottom_right = 7
corner_radius_bottom_left = 7

[sub_resource type="StyleBoxFlat" id=9]
corner_radius_top_left = 7
corner_radius_top_right = 7
corner_radius_bottom_right = 7
corner_radius_bottom_left = 7

[sub_resource type="DynamicFont" id=10]
size = 20
font_data = ExtResource( 1 )

[node name="Login" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
Expand Down Expand Up @@ -192,7 +226,6 @@ margin_top = -256.0
margin_right = 196.0
margin_bottom = 256.0
theme = ExtResource( 5 )
popup_exclusive = true
window_title = "Sign In With Google"

[node name="HelpLabel" type="Label" parent="GoogleLoginPopup"]
Expand Down Expand Up @@ -257,7 +290,6 @@ margin_top = -128.5
margin_right = 196.0
margin_bottom = 128.5
theme = ExtResource( 5 )
popup_exclusive = true
window_title = "Forgot Password"

[node name="EmailLabel" type="Label" parent="ForgotPassWindow"]
Expand Down Expand Up @@ -344,6 +376,21 @@ text = "Accept & Continue"
[node name="ClikcerSFX" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 )

[node name="OnscreenKeyboard" type="PanelContainer" parent="."]
anchor_top = 0.631
anchor_right = 0.996
anchor_bottom = 1.0
margin_top = 262.765
margin_right = 1.95996
margin_bottom = 263.0
custom_styles/panel = SubResource( 6 )
script = ExtResource( 9 )
styleBackground = SubResource( 6 )
styleHover = SubResource( 7 )
stylePressed = SubResource( 8 )
styleNormal = SubResource( 9 )
font = SubResource( 10 )

[connection signal="pressed" from="Guest" to="." method="_on_Guest_pressed"]
[connection signal="pressed" from="ForgotPass" to="." method="_on_ForgotPass_pressed"]
[connection signal="pressed" from="SignInGoogle" to="." method="_on_SignInGoogle_pressed"]
Expand Down
5 changes: 4 additions & 1 deletion scripts/GLOBAL.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ extends Node

var verMajor = 0
var verMinor = 4
var verRev = 0
var verRev = 1
var gameVersion = str(verMajor) + "." + str(verMinor) + "." + str(verRev)
var onlineGameVersion
var onlineVerMajor
var onlineVerMinor
var onlineVerRev
var seenUpdateWarning := false

var username : String
Expand Down
34 changes: 25 additions & 9 deletions scripts/Home.gd
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,32 @@ func check_for_updates():
http_request.request("https://raw.githubusercontent.com/Blockyheadman/Clikcer/main/game-version.json")

func _http_request_completed(result, response_code, headers, body):
var data = JSON.parse(body.get_string_from_utf8())
print("online game version (as keypair): "+ str(data.result))
Global.onlineGameVersion = str(data.result["version"])
print("online game version (as string): " + Global.onlineGameVersion)
if Global.gameVersion != Global.onlineGameVersion:
OS.alert("A more recent update (" + Global.onlineGameVersion + ") is available at: https://github.com/Blockyheadman/Clikcer/releases")
print("Game has a more recent version.")
if response_code == 200:
var data = JSON.parse(body.get_string_from_utf8())
print("online game version (as keypair): "+ str(data.result))
Global.onlineGameVersion = str(data.result["version"])
print("online game version (as string): " + Global.onlineGameVersion)
var splitVersionNumbers = Global.onlineGameVersion.split(".")
print(str(Global.onlineGameVersion.split(".")))
Global.onlineVerMajor = int(splitVersionNumbers[0])
Global.onlineVerMinor = int(splitVersionNumbers[1])
Global.onlineVerRev = int(splitVersionNumbers[2])
if Global.gameVersion != Global.onlineGameVersion:
if Global.onlineVerMajor > Global.verMajor:
OS.alert("A more recent update (" + Global.onlineGameVersion + ") is available at: https://github.com/Blockyheadman/Clikcer/releases")
print("Game has a more recent version.")
if Global.onlineVerMinor > Global.verMinor:
OS.alert("A more recent update (" + Global.onlineGameVersion + ") is available at: https://github.com/Blockyheadman/Clikcer/releases")
print("Game has a more recent version.")
if Global.onlineVerRev > Global.verRev:
OS.alert("A more recent update (" + Global.onlineGameVersion + ") is available at: https://github.com/Blockyheadman/Clikcer/releases")
print("Game has a more recent version.")
else:
print("Game is up to date!")
Global.seenUpdateWarning = true
else:
print("Game is up to date!")
Global.seenUpdateWarning = true
if OS.has_feature("debug"):
OS.alert("Response Code " + str(response_code) + "\nCannot find.")

func _on_Upgrades_pressed():
$ClikcerSFX.play(0)
Expand Down
24 changes: 22 additions & 2 deletions scripts/Login.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ extends Control

func _ready():
OS.min_window_size = Vector2(490, 685)
if OS.get_name() == "Android" or OS.get_name() == "iOS":
$OnscreenKeyboard.visible = true
$OnscreenKeyboard.autoShow = true
$Email.virtual_keyboard_enabled = false
$Password.virtual_keyboard_enabled = false
$GoogleLoginPopup/AuthCode.virtual_keyboard_enabled = false
$ForgotPassWindow/Email.virtual_keyboard_enabled = false
else:
$OnscreenKeyboard.visible = false
$OnscreenKeyboard.autoShow = false

var directory = Directory.new()
if Firebase._config["apiKey"] != "":
Expand All @@ -22,10 +32,14 @@ func _ready():

func _on_SignInGoogle_pressed():
$ClikcerSFX.play(0)
$OnscreenKeyboard._hideKeyboard()
Firebase.Auth.get_auth_localhost()
"""if OS.get_name() == "Android" or OS.get_name() == "X11" or OS.get_name() == "OSX":
"""if OS.get_name() == "Windows" or OS.get_name() == "X11" or OS.get_name() == "OSX":
Firebase.Auth.get_auth_localhost()
if OS.get_name() == "Windows" or OS.get_name() == "iOS":
if OS.get_name() == "Android" or OS.get_name() == "iOS":
$OnscreenKeyboard._hideKeyboard()
$ForgotPassWindow.visible = false
$GuestPrompt.visible = false
#$GoogleLoginPopup.popup_centered()
#Firebase.Auth.set_redirect_uri("http://localhost:8060/")"""

Expand Down Expand Up @@ -86,6 +100,9 @@ func _on_LoginButton_pressed():
# forgot pass stuff
func _on_ForgotPass_pressed():
$ClikcerSFX.play(0)
$OnscreenKeyboard._hideKeyboard()
$GoogleLoginPopup.visible = false
$GuestPrompt.visible = false
$ForgotPassWindow.popup_centered()

func _on_ResetPass_pressed():
Expand All @@ -97,6 +114,9 @@ func _on_ResetPass_pressed():
# continue as guest
func _on_Guest_pressed():
$ClikcerSFX.play(0)
$OnscreenKeyboard._hideKeyboard()
$ForgotPassWindow.visible = false
$GoogleLoginPopup.visible = false
$GuestPrompt.popup_centered()

func _on_Accept_pressed():
Expand Down
77 changes: 35 additions & 42 deletions scripts/Startup.gd
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,42 @@ func load_game():
# Get the saved dictionary from the next line in the save file
var node_data = parse_json(save_game.get_line())

if node_data["clikcs"] >= 0:
print("Success! 'clikcs' Value exists!")
Global.clikcs = node_data["clikcs"]
Global.upgrade1Count = node_data["upgrade1count"]
Global.upgrade2Count = node_data["upgrade2count"]
Global.upgrade3Count = node_data["upgrade3count"]
Global.upgrade4Count = node_data["upgrade4count"]
Global.upgrade5Count = node_data["upgrade5count"]
Global.upgrade1Cost = node_data["upgrade1cost"]
Global.upgrade2Cost = node_data["upgrade2cost"]
Global.upgrade3Cost = node_data["upgrade3cost"]
Global.upgrade4Cost = node_data["upgrade4cost"]
Global.upgrade5Cost = node_data["upgrade5cost"]
Global.achievement1 = node_data["achievement1"]
Global.achievement2 = node_data["achievement2"]
Global.achievement3 = node_data["achievement3"]
Global.achievement4 = node_data["achievement4"]
Global.achievement5 = node_data["achievement5"]
Global.achievement1Claimed = node_data["achievement1claimed"]
Global.achievement2Claimed = node_data["achievement2claimed"]
Global.achievement3Claimed = node_data["achievement3claimed"]
Global.achievement4Claimed = node_data["achievement4claimed"]
Global.achievement5Claimed = node_data["achievement5claimed"]
Global.AutoSaveEnabled = node_data["autosaveenabled"]
Global.AutoSaveSliderValue = node_data["autosavetimeout"]
if Global.isGuest == false:
Global.username = node_data["username"]
if Global.username == "":
$UsernameInput.popup_centered()
if Global.username != "":
get_tree().change_scene("res://scenes/Home.tscn")
elif Global.isGuest == true:
Global.username = node_data["username"]
if Global.username == "":
$UsernameInput.popup_centered()
if Global.username != "":
get_tree().change_scene("res://scenes/Home.tscn")
if !node_data["clikcs"]:
print("save non existant. creating file")
if Global.isGuest == false:
print("Success! 'clikcs' Value exists!")
Global.clikcs = node_data["clikcs"]
Global.upgrade1Count = node_data["upgrade1count"]
Global.upgrade2Count = node_data["upgrade2count"]
Global.upgrade3Count = node_data["upgrade3count"]
Global.upgrade4Count = node_data["upgrade4count"]
Global.upgrade5Count = node_data["upgrade5count"]
Global.upgrade1Cost = node_data["upgrade1cost"]
Global.upgrade2Cost = node_data["upgrade2cost"]
Global.upgrade3Cost = node_data["upgrade3cost"]
Global.upgrade4Cost = node_data["upgrade4cost"]
Global.upgrade5Cost = node_data["upgrade5cost"]
Global.achievement1 = node_data["achievement1"]
Global.achievement2 = node_data["achievement2"]
Global.achievement3 = node_data["achievement3"]
Global.achievement4 = node_data["achievement4"]
Global.achievement5 = node_data["achievement5"]
Global.achievement1Claimed = node_data["achievement1claimed"]
Global.achievement2Claimed = node_data["achievement2claimed"]
Global.achievement3Claimed = node_data["achievement3claimed"]
Global.achievement4Claimed = node_data["achievement4claimed"]
Global.achievement5Claimed = node_data["achievement5claimed"]
Global.AutoSaveEnabled = node_data["autosaveenabled"]
Global.AutoSaveSliderValue = node_data["autosavetimeout"]
if Global.isGuest == false:
Global.username = node_data["username"]
if Global.username == "":
$UsernameInput.popup_centered()
elif Global.isGuest == true:
save_game()
if Global.username != "":
get_tree().change_scene("res://scenes/Home.tscn")
elif Global.isGuest == true:
Global.username = node_data["username"]
if Global.username == "":
$UsernameInput.popup_centered()
if Global.username != "":
get_tree().change_scene("res://scenes/Home.tscn")

save_game.close()

Expand Down

0 comments on commit 228e0b5

Please sign in to comment.