Merge pull request #62312 from smix8/navigation_get_maps_4.x

This commit is contained in:
Rémi Verschelde 2022-06-23 16:14:12 +02:00 committed by GitHub
commit 462127eff0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 0 deletions

View file

@ -123,6 +123,18 @@ void GodotNavigationServer::add_command(SetCommand *command) const {
}
}
Array GodotNavigationServer::get_maps() const {
Array all_map_rids;
List<RID> maps_owned;
map_owner.get_owned_list(&maps_owned);
if (maps_owned.size()) {
for (const RID &E : maps_owned) {
all_map_rids.push_back(E);
}
}
return all_map_rids;
}
RID GodotNavigationServer::map_create() const {
GodotNavigationServer *mut_this = const_cast<GodotNavigationServer *>(this);
MutexLock lock(mut_this->operations_mutex);

View file

@ -85,6 +85,8 @@ public:
void add_command(SetCommand *command) const;
virtual Array get_maps() const override;
virtual RID map_create() const override;
COMMAND_2(map_set_active, RID, p_map, bool, p_active);
virtual bool map_is_active(RID p_map) const override;