Browse Source

Renaming clear_blocks to reset_world

pull/7/head
Ryan Reed 1 month ago
parent
commit
e0f6a76dac
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      autoloads/entity_manager.gd
  2. +1
    -1
      save_load/autoloads/save_game_manager.gd
  3. +2
    -2
      scenes/world/world.gd

+ 1
- 1
autoloads/entity_manager.gd View File

@ -2,5 +2,5 @@ extends Node
signal create_block(id: String, position: Vector3) signal create_block(id: String, position: Vector3)
signal drop_block(id: String, position: Vector3) signal drop_block(id: String, position: Vector3)
signal clear_blocks ## Used for signaling a deletion of all in the BlocksContainer and DroppedItemsContainer
signal reset_world ## Used for signaling a deletion of all in the BlocksContainer and DroppedItemsContainer
signal spawn_player(position: Vector3) signal spawn_player(position: Vector3)

+ 1
- 1
save_load/autoloads/save_game_manager.gd View File

@ -29,7 +29,7 @@ func _save_game() -> void:
game_saved.emit() game_saved.emit()
func _load_game() -> void: func _load_game() -> void:
EntityManager.clear_blocks.emit()
EntityManager.reset_world.emit()
var save_level_data_component: SaveLevelDataComponent = get_tree().get_first_node_in_group("save_level_data_component") var save_level_data_component: SaveLevelDataComponent = get_tree().get_first_node_in_group("save_level_data_component")


+ 2
- 2
scenes/world/world.gd View File

@ -14,7 +14,7 @@ func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
EntityManager.create_block.connect(_create_block.bind()) EntityManager.create_block.connect(_create_block.bind())
EntityManager.drop_block.connect(_create_dropped_block.bind()) EntityManager.drop_block.connect(_create_dropped_block.bind())
EntityManager.clear_blocks.connect(_on_clear_blocks.bind())
EntityManager.reset_world.connect(_on_reset_world.bind())
EntityManager.spawn_player.connect(_spawn_player.bind()) EntityManager.spawn_player.connect(_spawn_player.bind())
_initialize_ground() _initialize_ground()
@ -63,7 +63,7 @@ func _initialize_ground() -> void:
EntityManager.create_block.emit("002", ground_position) EntityManager.create_block.emit("002", ground_position)
## Generally for resetting/emptying the world to allow for load_game ## Generally for resetting/emptying the world to allow for load_game
func _on_clear_blocks() -> void:
func _on_reset_world() -> void:
for block: Block in blocks_container.get_children(): for block: Block in blocks_container.get_children():
block.queue_free() block.queue_free()


Loading…
Cancel
Save