mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-23 07:54:17 +01:00
Work on layered tile maps.
This commit is contained in:
parent
275a9124de
commit
2783a9d58a
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
def can_build(env, platform):
|
def can_build(env, platform):
|
||||||
return True
|
return False
|
||||||
|
|
||||||
def configure(env):
|
def configure(env):
|
||||||
pass
|
pass
|
||||||
|
@ -892,17 +892,11 @@ PoolVector2iArray LayeredTileMap::get_surrounding_cells(const Vector2i &p_coords
|
|||||||
return tile_set->get_surrounding_cells(p_coords);
|
return tile_set->get_surrounding_cells(p_coords);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LayeredTileMap::use_tile_data_runtime_update(const int p_layer, const Vector2i &p_pos) {
|
bool LayeredTileMap::use_tile_data_runtime_update(const int p_layer, const Vector2i &p_coords) {
|
||||||
return call("_use_tile_data_runtime_update", p_layer, p_pos);
|
return call("_use_tile_data_runtime_update", p_layer, p_coords);
|
||||||
}
|
}
|
||||||
void LayeredTileMap::tile_data_runtime_update(const int p_layer, const Vector2i &p_pos, LayeredTileData *p_tile_data) {
|
void LayeredTileMap::tile_data_runtime_update(const int p_layer, const Vector2i &p_coords, LayeredTileData *p_tile_data) {
|
||||||
call("_tile_data_runtime_update", p_layer, p_pos, p_tile_data);
|
call("_tile_data_runtime_update", p_layer, p_coords, p_tile_data);
|
||||||
}
|
|
||||||
|
|
||||||
bool LayeredTileMap::_use_tile_data_runtime_update(const int p_layer, const Vector2i &p_pos) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
void LayeredTileMap::_tile_data_runtime_update(const int p_layer, const Vector2i &p_pos, LayeredTileData *p_tile_data) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String LayeredTileMap::get_configuration_warning() const {
|
String LayeredTileMap::get_configuration_warning() const {
|
||||||
@ -1052,18 +1046,15 @@ void LayeredTileMap::_bind_methods() {
|
|||||||
|
|
||||||
BIND_VMETHOD(MethodInfo("_use_tile_data_runtime_update",
|
BIND_VMETHOD(MethodInfo("_use_tile_data_runtime_update",
|
||||||
PropertyInfo(Variant::INT, "layer"),
|
PropertyInfo(Variant::INT, "layer"),
|
||||||
PropertyInfo(Variant::VECTOR2I, "pos")));
|
PropertyInfo(Variant::VECTOR2I, "coords")));
|
||||||
|
|
||||||
BIND_VMETHOD(MethodInfo("_tile_data_runtime_update",
|
BIND_VMETHOD(MethodInfo("_tile_data_runtime_update",
|
||||||
PropertyInfo(Variant::INT, "layer"),
|
PropertyInfo(Variant::INT, "layer"),
|
||||||
PropertyInfo(Variant::VECTOR2I, "pos"),
|
PropertyInfo(Variant::VECTOR2I, "coords"),
|
||||||
PropertyInfo(Variant::OBJECT, "tile_data", PROPERTY_HINT_RESOURCE_TYPE, "LayeredTileData")));
|
PropertyInfo(Variant::OBJECT, "tile_data", PROPERTY_HINT_RESOURCE_TYPE, "LayeredTileData")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("use_tile_data_runtime_update", "layer", "pos"), &LayeredTileMap::use_tile_data_runtime_update);
|
ClassDB::bind_method(D_METHOD("use_tile_data_runtime_update", "layer", "coords"), &LayeredTileMap::use_tile_data_runtime_update);
|
||||||
ClassDB::bind_method(D_METHOD("tile_data_runtime_update", "layer", "pos", "tile_data"), &LayeredTileMap::tile_data_runtime_update);
|
ClassDB::bind_method(D_METHOD("tile_data_runtime_update", "layer", "coords", "tile_data"), &LayeredTileMap::tile_data_runtime_update);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("_use_tile_data_runtime_update", "layer", "pos"), &LayeredTileMap::_use_tile_data_runtime_update);
|
|
||||||
ClassDB::bind_method(D_METHOD("_tile_data_runtime_update", "layer", "pos", "tile_data"), &LayeredTileMap::_tile_data_runtime_update);
|
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("_emit_changed"), &LayeredTileMap::_emit_changed);
|
ClassDB::bind_method(D_METHOD("_emit_changed"), &LayeredTileMap::_emit_changed);
|
||||||
|
|
||||||
|
@ -201,11 +201,8 @@ public:
|
|||||||
PoolVector2iArray get_surrounding_cells(const Vector2i &p_coords);
|
PoolVector2iArray get_surrounding_cells(const Vector2i &p_coords);
|
||||||
|
|
||||||
// Virtual function to modify the LayeredTileData at runtime.
|
// Virtual function to modify the LayeredTileData at runtime.
|
||||||
bool use_tile_data_runtime_update(const int p_layer, const Vector2i &p_pos);
|
bool use_tile_data_runtime_update(const int p_layer, const Vector2i &p_coords);
|
||||||
void tile_data_runtime_update(const int p_layer, const Vector2i &p_pos, LayeredTileData *p_tile_data);
|
void tile_data_runtime_update(const int p_layer, const Vector2i &p_coords, LayeredTileData *p_tile_data);
|
||||||
|
|
||||||
virtual bool _use_tile_data_runtime_update(const int p_layer, const Vector2i &p_pos);
|
|
||||||
virtual void _tile_data_runtime_update(const int p_layer, const Vector2i &p_pos, LayeredTileData *p_tile_data);
|
|
||||||
|
|
||||||
// Configuration warnings.
|
// Configuration warnings.
|
||||||
String get_configuration_warning() const;
|
String get_configuration_warning() const;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -419,8 +419,6 @@ public:
|
|||||||
int get_y_sort_origin() const;
|
int get_y_sort_origin() const;
|
||||||
virtual void set_z_index(int p_z_index);
|
virtual void set_z_index(int p_z_index);
|
||||||
virtual void set_light_mask(int p_light_mask);
|
virtual void set_light_mask(int p_light_mask);
|
||||||
virtual void set_texture_filter(CanvasItem::TextureFilter p_texture_filter);
|
|
||||||
virtual void set_texture_repeat(CanvasItem::TextureRepeat p_texture_repeat);
|
|
||||||
void set_rendering_quadrant_size(int p_size);
|
void set_rendering_quadrant_size(int p_size);
|
||||||
int get_rendering_quadrant_size() const;
|
int get_rendering_quadrant_size() const;
|
||||||
|
|
||||||
@ -447,8 +445,9 @@ public:
|
|||||||
Ref<LayeredTileSet> get_effective_tile_set() const;
|
Ref<LayeredTileSet> get_effective_tile_set() const;
|
||||||
|
|
||||||
// Virtual function to modify the LayeredTileData at runtime.
|
// Virtual function to modify the LayeredTileData at runtime.
|
||||||
GDVIRTUAL1R(bool, _use_tile_data_runtime_update, Vector2i);
|
bool use_tile_data_runtime_update(const Vector2i &p_coords);
|
||||||
GDVIRTUAL2(_tile_data_runtime_update, Vector2i, LayeredTileData *);
|
void tile_data_runtime_update(const Vector2i &p_coords, LayeredTileData *p_tile_data);
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
LayeredTileMapLayer();
|
LayeredTileMapLayer();
|
||||||
|
@ -112,6 +112,8 @@ void LayeredTileMapLayerGroup::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("get_tileset"), &LayeredTileMapLayerGroup::get_tileset);
|
ClassDB::bind_method(D_METHOD("get_tileset"), &LayeredTileMapLayerGroup::get_tileset);
|
||||||
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "tile_set", PROPERTY_HINT_RESOURCE_TYPE, "LayeredTileSet"), "set_tileset", "get_tileset");
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "tile_set", PROPERTY_HINT_RESOURCE_TYPE, "LayeredTileSet"), "set_tileset", "get_tileset");
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("_tile_set_changed"), &LayeredTileMapLayerGroup::_tile_set_changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayeredTileMapLayerGroup::set_tileset(const Ref<LayeredTileSet> &p_tileset) {
|
void LayeredTileMapLayerGroup::set_tileset(const Ref<LayeredTileSet> &p_tileset) {
|
||||||
@ -121,13 +123,13 @@ void LayeredTileMapLayerGroup::set_tileset(const Ref<LayeredTileSet> &p_tileset)
|
|||||||
|
|
||||||
// Set the tileset, registering to its changes.
|
// Set the tileset, registering to its changes.
|
||||||
if (tile_set.is_valid()) {
|
if (tile_set.is_valid()) {
|
||||||
tile_set->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &LayeredTileMapLayerGroup::_tile_set_changed));
|
tile_set->disconnect(CoreStringNames::get_singleton()->changed, this, "_tile_set_changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
tile_set = p_tileset;
|
tile_set = p_tileset;
|
||||||
|
|
||||||
if (tile_set.is_valid()) {
|
if (tile_set.is_valid()) {
|
||||||
tile_set->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &LayeredTileMapLayerGroup::_tile_set_changed));
|
tile_set->connect(CoreStringNames::get_singleton()->changed, this, "_tile_set_changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < get_child_count(); i++) {
|
for (int i = 0; i < get_child_count(); i++) {
|
||||||
@ -144,6 +146,6 @@ Ref<LayeredTileSet> LayeredTileMapLayerGroup::get_tileset() const {
|
|||||||
|
|
||||||
LayeredTileMapLayerGroup::~LayeredTileMapLayerGroup() {
|
LayeredTileMapLayerGroup::~LayeredTileMapLayerGroup() {
|
||||||
if (tile_set.is_valid()) {
|
if (tile_set.is_valid()) {
|
||||||
tile_set->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &LayeredTileMapLayerGroup::_tile_set_changed));
|
tile_set->disconnect(CoreStringNames::get_singleton()->changed, this, "_tile_set_changed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user