Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add signal for when contents of cell are changed #40044

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/gridmap/grid_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ void GridMap::set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_rot) {
c.rot = p_rot;

cell_map[key] = c;

emit_signal("cell_contents_changed", Vector3(p_x, p_y, p_z));
}

int GridMap::get_cell_item(int p_x, int p_y, int p_z) const {
Expand Down Expand Up @@ -844,6 +846,7 @@ void GridMap::_bind_methods() {
BIND_CONSTANT(INVALID_CELL_ITEM);

ADD_SIGNAL(MethodInfo("cell_size_changed", PropertyInfo(Variant::VECTOR3, "cell_size")));
ADD_SIGNAL(MethodInfo("cell_contents_changed", PropertyInfo(Variant::VECTOR3, "cell_location")));
}

void GridMap::set_clip(bool p_enabled, bool p_clip_above, int p_floor, Vector3::Axis p_axis) {
Expand Down