Skip to content

Commit

Permalink
remove print, correct spell mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
ARKANYOTA committed Aug 30, 2024
1 parent ac4f55c commit cf81f21
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
32 changes: 17 additions & 15 deletions src/scenes/ui/redirect_page_to_our_games.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@ offset_bottom = 40.0

[node name="Label" type="Label" parent="Control"]
layout_mode = 0
offset_left = 17.0
offset_top = 26.0
offset_right = 229.0
offset_bottom = 63.0
text = "Hey Bro you are on a unknown url.
If you think this is an error, report to us.
Else: Please go on our url:"
offset_left = 19.0
offset_top = 23.0
offset_right = 220.0
offset_bottom = 80.0
text = "Hey man, you are on an unknown URL.
And end the demo for an unknown URL.
If you think this is a mistake,
please report it to us.
Otherwise: Please go to our URL:"
label_settings = ExtResource("1_voncg")

[node name="Yolwoocle" type="LinkButton" parent="Control"]
offset_left = 72.0
offset_top = 66.0
offset_right = 150.0
offset_bottom = 89.0
offset_left = 77.0
offset_top = 80.0
offset_right = 155.0
offset_bottom = 103.0
text = "Yolwoocle"
uri = "https://yolwoocle.itch.io/globs"

[node name="Arkanyota" type="LinkButton" parent="Control"]
offset_left = 71.0
offset_top = 84.0
offset_right = 152.0
offset_bottom = 107.0
offset_left = 77.0
offset_top = 99.0
offset_right = 158.0
offset_bottom = 122.0
text = "ArkanYota"
uri = "https://arkanyota.github.io/gmtk2024"
7 changes: 0 additions & 7 deletions src/scripts/autoload/scene_transition_auto_load.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ static var is_autorized_url_loaded = false
func get_urls():
var http_request = HTTPRequest.new()
add_child(http_request)
# print(http_request.request_raw("https://raw.githubusercontent.com/ARKANYOTA/gmtk2024/main/autorized_url.txt"))
http_request.request("https://raw.githubusercontent.com/ARKANYOTA/gmtk2024/main/autorized_url.txt")
var response = await http_request.request_completed
var result = response[0]
Expand All @@ -22,12 +21,10 @@ func get_urls():
# result, status code, response headers, and body are now in indices 0, 1, 2, and 3 of response
func is_url_valid() -> bool:
if not OS.has_feature('web'):
print("has not JS")
return true
var location = JavaScriptBridge.get_interface("location")
if not location:
return true
print(autorized_url)
var hostname = location.hostname
return hostname in autorized_url

Expand All @@ -41,15 +38,12 @@ func _ready() -> void:
scene_transition_instance = scene_transition.instantiate()
add_child(scene_transition_instance)
if not OS.has_feature('web'):
print("has not JS")
return

if not is_autorized_url_loaded:
print("is now loaded")
is_autorized_url_loaded = true
var urls = await get_urls()
if urls == []:
print("urls cannot be loaded")
return
autorized_url = urls

Expand Down Expand Up @@ -90,7 +84,6 @@ func change_scene_with_transition(scene: String, put_confetis = false) -> void:
animation_player.play(slides[random_slide_transition], -1, -0.7, true)

GameManager.before_scene_change()
print(scene)
if is_url_valid() or scene in ["res://scenes/main.tscn", "res://scenes/ui/world_select/world_select.tscn", "res://scenes/levels_zoomed/world_1/level_110.tscn", "res://scenes/levels_zoomed/world_1/level_120.tscn","res://scenes/levels_zoomed/world_1/level_130.tscn", "res://scenes/levels_zoomed/world_1/level_140.tscn"]:
get_tree().change_scene_to_file(scene)
await get_tree().process_frame
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/ui/game_gui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ func show_correct_game_gui():
if get_tree().get_current_scene():
var current_scene_name = get_tree().get_current_scene().get_name()
# var level_data = LevelData.get_current_level_data()
if current_scene_name == "WorldSelect" or current_scene_name == "YouWinLevel":
if current_scene_name == "WorldSelect" or current_scene_name == "YouWinLevel" or current_scene_name == "RedirectPageToOurGames":
PauseMenuAutoload.game_gui.show_level_select()
elif current_scene_name == "Main" or current_scene_name == "RedirectPageToOurGames":
elif current_scene_name == "Main":
PauseMenuAutoload.game_gui.hide_gui()
else:
PauseMenuAutoload.game_gui.show_gui()
Expand Down

0 comments on commit cf81f21

Please sign in to comment.