diff --git a/Assets/Sprites/Items/Vine.json b/Assets/Sprites/Items/Vine.json index f41372f..5668458 100644 --- a/Assets/Sprites/Items/Vine.json +++ b/Assets/Sprites/Items/Vine.json @@ -67,4 +67,4 @@ ] } } -} \ No newline at end of file +} diff --git a/Scenes/Levels/CustomLevelMenu.tscn b/Scenes/Levels/CustomLevelMenu.tscn index 73967a9..9f18be6 100644 --- a/Scenes/Levels/CustomLevelMenu.tscn +++ b/Scenes/Levels/CustomLevelMenu.tscn @@ -262,6 +262,7 @@ text = "EDITOR_MAIN_CREATE_1" uppercase = true [node name="TextureRect" type="TextureRect" parent="BG/Border/Levels/VBoxContainer/LevelList/TopBit/Button"] +visible = false layout_mode = 1 anchors_preset = -1 anchor_top = 0.5 @@ -361,11 +362,11 @@ layout_mode = 2 focus_mode = 0 [node name="ScrollContainer" parent="BG/Border/Levels/VBoxContainer/LevelInfo/SelectedLevel/MarginContainer/HBoxContainer/HSplitContainer/LeftHalf/LevelInfo" index="0"] -scroll_horizontal = 1 +scroll_horizontal = 202 is_active = true [node name="ScrollContainer2" parent="BG/Border/Levels/VBoxContainer/LevelInfo/SelectedLevel/MarginContainer/HBoxContainer/HSplitContainer/LeftHalf/LevelInfo" index="1"] -scroll_horizontal = 1 +scroll_horizontal = 5 is_active = true [node name="Panel" type="PanelContainer" parent="BG/Border/Levels/VBoxContainer/LevelInfo"] @@ -376,7 +377,7 @@ theme_override_styles/panel = ExtResource("8_psbt7") [node name="AutoScrollContainer" type="ScrollContainer" parent="BG/Border/Levels/VBoxContainer/LevelInfo/Panel"] layout_mode = 2 mouse_filter = 2 -scroll_vertical = 1 +scroll_vertical = 13 horizontal_scroll_mode = 3 vertical_scroll_mode = 3 script = ExtResource("24_wf6nb") @@ -564,12 +565,11 @@ layout_mode = 2 focus_mode = 0 [node name="ScrollContainer" parent="BG/Border/Levels/VBoxContainer/LSSLevelInfo/SelectedOnlineLevel/MarginContainer/HBoxContainer/HSplitContainer/LeftHalf/LevelInfo" index="0"] -scroll_horizontal = 1 is_active = true auto_connect_focus = false [node name="ScrollContainer2" parent="BG/Border/Levels/VBoxContainer/LSSLevelInfo/SelectedOnlineLevel/MarginContainer/HBoxContainer/HSplitContainer/LeftHalf/LevelInfo" index="1"] -scroll_horizontal = 1 +scroll_horizontal = 5 is_active = true auto_connect_focus = false @@ -582,7 +582,7 @@ theme_override_styles/panel = ExtResource("8_psbt7") [node name="AutoScrollContainer" type="ScrollContainer" parent="BG/Border/Levels/VBoxContainer/LSSLevelInfo/Panel"] layout_mode = 2 mouse_filter = 0 -scroll_vertical = 1 +scroll_vertical = 13 horizontal_scroll_mode = 3 script = ExtResource("24_wf6nb") direction = 1 diff --git a/Scenes/Prefabs/Entities/Objects/Burner.tscn b/Scenes/Prefabs/Entities/Objects/Burner.tscn index de24f07..2886632 100644 --- a/Scenes/Prefabs/Entities/Objects/Burner.tscn +++ b/Scenes/Prefabs/Entities/Objects/Burner.tscn @@ -175,12 +175,10 @@ physics_interpolation_mode = 2 [node name="Flame" type="AnimatedSprite2D" parent="RotationJoint"] unique_name_in_owner = true -visible = false position = Vector2(0, -32) sprite_frames = SubResource("SpriteFrames_8axu6") -animation = &"Rise" -frame = 5 -frame_progress = 1.0 +animation = &"Loop" +frame_progress = 0.19739561 [node name="ResourceSetterNew" type="Node" parent="RotationJoint/Flame" node_paths=PackedStringArray("node_to_affect")] script = ExtResource("3_fsldu") @@ -244,6 +242,9 @@ offset = Vector2(0, 0) disable_physics = false metadata/_custom_type_script = "uid://d4a7yp6e55u8t" +[node name="OnScreen" type="VisibleOnScreenNotifier2D" parent="."] +rect = Rect2(-64, -64, 128, 128) + [connection signal="player_hit" from="RotationJoint/EnemyPlayerDetection" to="." method="damage_player"] [connection signal="player_stomped_on" from="RotationJoint/EnemyPlayerDetection" to="." method="damage_player"] [connection signal="timeout" from="Timer" to="." method="do_cycle"] diff --git a/Scenes/Prefabs/Entities/Objects/Door.tscn b/Scenes/Prefabs/Entities/Objects/Door.tscn index fda6dfd..b7e4b83 100644 --- a/Scenes/Prefabs/Entities/Objects/Door.tscn +++ b/Scenes/Prefabs/Entities/Objects/Door.tscn @@ -71,7 +71,7 @@ static var colour_ids := {} func _process(_delta: float) -> void: - $\"../LevelEditorVisibleNode/Label\".text = str(owner.door_id) + $\"../LevelEditorVisibleNode/Label\".text = str(owner.door_id) +\"/\" + str(owner.sublevel_id) " [sub_resource type="Animation" id="Animation_hk64y"] diff --git a/Scenes/Prefabs/Entities/Objects/EmptyPDoor.tscn b/Scenes/Prefabs/Entities/Objects/EmptyPDoor.tscn index bac7c8f..4efb6e9 100644 --- a/Scenes/Prefabs/Entities/Objects/EmptyPDoor.tscn +++ b/Scenes/Prefabs/Entities/Objects/EmptyPDoor.tscn @@ -44,7 +44,7 @@ property_name = "sprite_frames" resource_json = ExtResource("3_7tad6") metadata/_custom_type_script = "uid://cbal8ms2oe1ik" -[node name="PropertyExposer" type="Node" parent="."] +[node name="EditorPropertyExposer" type="Node" parent="."] script = ExtResource("4_hj3mh") properties = ["door_id", "sublevel_id"] properties_force_selector = Dictionary[String, PackedScene]({ diff --git a/Scripts/Classes/Components/EditorPropertyExposer.gd b/Scripts/Classes/Components/EditorPropertyExposer.gd index ab7c14c..72e7d80 100644 --- a/Scripts/Classes/Components/EditorPropertyExposer.gd +++ b/Scripts/Classes/Components/EditorPropertyExposer.gd @@ -14,6 +14,9 @@ signal modifier_applied func _ready() -> void: name = "EditorPropertyExposer" + get_entity_map() + +func get_entity_map() -> void: if entity_map.is_empty(): entity_map = JSON.parse_string(FileAccess.open(EntityIDMapper.MAP_PATH, FileAccess.READ).get_as_text()) @@ -45,6 +48,7 @@ func get_string() -> String: return string func apply_string(entity_string := "") -> void: + get_entity_map() var idx := 2 var slice = entity_string.split(",") for i in properties: @@ -62,6 +66,10 @@ func apply_string(entity_string := "") -> void: var scene = entity_map.get(value) if scene != null: owner.set(i, load(entity_map.get(value)[0])) + elif value != "!!": + print([value, entity_map.get(value)]) + print(entity_map) + Global.log_error("error getting item! : " + i + str(value)) elif owner.get(i) is int: var num = value if value.length() > 1: diff --git a/Scripts/Classes/Entities/Objects/Burner.gd b/Scripts/Classes/Entities/Objects/Burner.gd index 1beb03d..9fbec62 100644 --- a/Scripts/Classes/Entities/Objects/Burner.gd +++ b/Scripts/Classes/Entities/Objects/Burner.gd @@ -7,7 +7,8 @@ func _ready() -> void: func do_cycle() -> void: if BooRaceHandler.countdown_active == false: - AudioManager.play_sfx("burner", global_position) + if $OnScreen.is_on_screen(): + AudioManager.play_sfx("burner", global_position) do_animation() await get_tree().create_timer(0.25, false).timeout %Shape.set_deferred("disabled", false) diff --git a/Scripts/Classes/Entities/Objects/Door.gd b/Scripts/Classes/Entities/Objects/Door.gd index 2919f3b..d58e853 100644 --- a/Scripts/Classes/Entities/Objects/Door.gd +++ b/Scripts/Classes/Entities/Objects/Door.gd @@ -112,7 +112,12 @@ func player_enter(player: Player) -> void: LevelEditor.play_door_transition = true AudioManager.play_sfx("door_open", global_position) await get_tree().create_timer(0.5, false).timeout - if Global.current_level.sublevel_id == sublevel_id: + var level_id = -1 + if Global.current_level is CustomLevel: + level_id = Global.current_level.sublevel_id + elif Global.level_editor != null: + level_id = Global.level_editor.sub_level_id + if level_id == sublevel_id: Global.do_fake_transition() if Global.fade_transition: await get_tree().create_timer(0.25, false).timeout diff --git a/Scripts/Classes/Singletons/Global.gd b/Scripts/Classes/Singletons/Global.gd index c6c3705..06a776b 100644 --- a/Scripts/Classes/Singletons/Global.gd +++ b/Scripts/Classes/Singletons/Global.gd @@ -334,6 +334,7 @@ func reset_values() -> void: Checkpoint.sublevel_id = 0 Global.total_deaths = 0 Door.unlocked_doors = [] + Door.exiting_door_id = -1 Checkpoint.unlocked_doors = [] KeyItem.total_collected = 0 Checkpoint.keys_collected = 0 diff --git a/Scripts/Parts/EditorVisibleNode.gd b/Scripts/Parts/EditorVisibleNode.gd index 2466d75..5ad1535 100644 --- a/Scripts/Parts/EditorVisibleNode.gd +++ b/Scripts/Parts/EditorVisibleNode.gd @@ -5,4 +5,4 @@ func _ready() -> void: update() func update() -> void: - visible = !LevelEditor.playing_level and Global.current_game_mode == Global.GameMode.LEVEL_EDITOR + visible = (!LevelEditor.playing_level and Global.current_game_mode == Global.GameMode.LEVEL_EDITOR) or Global.debug_mode diff --git a/Scripts/UI/CustomLevelMenu.gd b/Scripts/UI/CustomLevelMenu.gd index 7c7bd1c..e81889f 100644 --- a/Scripts/UI/CustomLevelMenu.gd +++ b/Scripts/UI/CustomLevelMenu.gd @@ -22,6 +22,7 @@ func _ready() -> void: Global.world_num = 1 Global.level_num = 1 Global.reset_values() + Global.clear_saved_values() Checkpoint.sublevel_id = 0 Global.current_campaign = "SMB1" AudioManager.stop_all_music()