From 2c7590286c26c44a7cdd80a72c782f253ba740de Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 11 Feb 2024 12:43:31 -0500 Subject: Shrink font for WBQW --- racing/lobby.gd | 18 +++--------------- racing/manager.gd | 12 ++++++++++++ racing/router.gd | 22 +++++++++++++++++++++- 3 files changed, 36 insertions(+), 16 deletions(-) (limited to 'racing') diff --git a/racing/lobby.gd b/racing/lobby.gd index d326098..3a04460 100644 --- a/racing/lobby.gd +++ b/racing/lobby.gd @@ -247,16 +247,10 @@ func _read_p2p_packet() -> void: Steam.P2P_SEND_RELIABLE_WITH_BUFFERING, false ) - if "start_x" in data: + if "start_name" in data: race_manager.level = data["level"] - race_manager.start_pos = { - "title": data["start_name"], - "pos": [int(data["start_x"]), int(data["start_y"]), int(data["start_z"])] - } - race_manager.end_pos = { - "title": data["end_name"], - "pos": [int(data["end_x"]), int(data["end_y"]), int(data["end_z"])] - } + race_manager.start_pos = router.get_area(data["level"], data["start_name"]) + race_manager.end_pos = router.get_area(data["level"], data["end_name"]) is_starting = true _start_game() @@ -336,13 +330,7 @@ func _main_button_pressed(): { "level": route[0], "start_name": start_pos["title"], - "start_x": str(start_pos["pos"][0]), - "start_y": str(start_pos["pos"][1]), - "start_z": str(start_pos["pos"][2]), "end_name": end_pos["title"], - "end_x": str(end_pos["pos"][0]), - "end_y": str(end_pos["pos"][1]), - "end_z": str(end_pos["pos"][2]), }, RECIPIENT_BROADCAST_ALL, Steam.P2P_SEND_RELIABLE, diff --git a/racing/manager.gd b/racing/manager.gd index 573e50a..0d29eff 100644 --- a/racing/manager.gd +++ b/racing/manager.gd @@ -16,11 +16,23 @@ func everyone_ready(): var player = get_tree().get_root().get_node("Spatial/player") get_node("/root/Spatial").remove_child(get_node("/root/Spatial/blindfold")) var indicator = player.get_node("pivot/camera/achievement_label") + var regular_font = indicator.get_font("font") indicator.visible = true indicator.text = "Destination:\n%s" % end_pos["title"] + if end_pos.has("small_font") and end_pos["small_font"]: + var dynamic_font = DynamicFont.new() + dynamic_font.font_data = load("res://fonts/Lingo.ttf") + dynamic_font.size = 96 + dynamic_font.outline_color = Color(0, 0, 0, 1) + dynamic_font.outline_size = 2 + indicator.add_font_override("font", dynamic_font) + yield(get_tree().create_timer(10), "timeout") + if end_pos.has("small_font") and end_pos["small_font"]: + indicator.add_font_override("font", regular_font) + indicator.text = "3..." yield(get_tree().create_timer(1), "timeout") diff --git a/racing/router.gd b/racing/router.gd index ea3693f..627412d 100644 --- a/racing/router.gd +++ b/racing/router.gd @@ -72,7 +72,13 @@ const LL2_AREAS = [ {"title": "The Sapient", "pos": [-36, 36, -36]}, {"title": "The Ethereal", "pos": [-42, 0, -22]}, {"title": "The Learned", "pos": [34, 1, -64], "no_start": true}, - {"title": "Whispers Behind Quiet Walls", "pos": [44, 0, -51], "no_start": true, "long": true}, + { + "title": "Whispers Behind Quiet Walls", + "pos": [44, 0, -51], + "no_start": true, + "long": true, + "small_font": true + }, {"title": "The Lunar", "pos": [45, 0, -22]}, {"title": "The Arcadian", "pos": [86, 0, -53]}, {"title": "The Frozen", "pos": [84, 0, -27]}, @@ -177,3 +183,17 @@ func choose_route(levelchoice: int, lengthchoice: int): found = true return [level_name, start_pos, end_pos] + + +func get_area(level, name): + var areas_slot + if level == "level1": + areas_slot = LL1_AREAS + elif level == "level2": + areas_slot = LL2_AREAS + + for item in areas_slot: + if item["title"] == name: + return item + + return {"title": "Error"} -- cgit 1.4.1