Merge pull request #50205 from vnen/tileset-cellneighbor-binding
This commit is contained in:
commit
053198a5f3
3 changed files with 39 additions and 33 deletions
|
@ -322,37 +322,37 @@
|
|||
</constant>
|
||||
<constant name="TILE_OFFSET_AXIS_VERTICAL" value="1" enum="TileOffsetAxis">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_RIGHT_SIDE" value="0" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_RIGHT_SIDE" value="0" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_RIGHT_CORNER" value="1" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_RIGHT_CORNER" value="1" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE" value="2" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE" value="2" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER" value="3" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER" value="3" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_BOTTOM_SIDE" value="4" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_BOTTOM_SIDE" value="4" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_BOTTOM_CORNER" value="5" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_BOTTOM_CORNER" value="5" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE" value="6" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_BOTTOM_LEFT_SIDE" value="6" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER" value="7" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_BOTTOM_LEFT_CORNER" value="7" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_LEFT_SIDE" value="8" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_LEFT_SIDE" value="8" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_LEFT_CORNER" value="9" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_LEFT_CORNER" value="9" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE" value="10" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_TOP_LEFT_SIDE" value="10" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER" value="11" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_TOP_LEFT_CORNER" value="11" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_TOP_SIDE" value="12" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_TOP_SIDE" value="12" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_TOP_CORNER" value="13" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_TOP_CORNER" value="13" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE" value="14" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_TOP_RIGHT_SIDE" value="14" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER" value="15" enum="CellNeighbor">
|
||||
<constant name="CELL_NEIGHBOR_TOP_RIGHT_CORNER" value="15" enum="CellNeighbor">
|
||||
</constant>
|
||||
<constant name="TERRAIN_MODE_MATCH_CORNERS_AND_SIDES" value="0" enum="TerrainMode">
|
||||
</constant>
|
||||
|
|
|
@ -2245,22 +2245,22 @@ void TileSet::_bind_methods() {
|
|||
BIND_ENUM_CONSTANT(TILE_OFFSET_AXIS_HORIZONTAL);
|
||||
BIND_ENUM_CONSTANT(TILE_OFFSET_AXIS_VERTICAL);
|
||||
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_RIGHT_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_RIGHT_CORNER);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_BOTTOM_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_BOTTOM_CORNER);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_LEFT_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_LEFT_CORNER);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_TOP_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_TOP_CORNER);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE);
|
||||
BIND_ENUM_CONSTANT(TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_RIGHT_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_RIGHT_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_BOTTOM_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_BOTTOM_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_BOTTOM_LEFT_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_BOTTOM_LEFT_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_LEFT_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_LEFT_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_TOP_LEFT_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_TOP_LEFT_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_TOP_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_TOP_CORNER);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_TOP_RIGHT_SIDE);
|
||||
BIND_ENUM_CONSTANT(CELL_NEIGHBOR_TOP_RIGHT_CORNER);
|
||||
|
||||
BIND_ENUM_CONSTANT(TERRAIN_MODE_MATCH_CORNERS_AND_SIDES);
|
||||
BIND_ENUM_CONSTANT(TERRAIN_MODE_MATCH_CORNERS);
|
||||
|
|
|
@ -754,6 +754,9 @@ void add_exposed_classes(Context &r_context) {
|
|||
const List<StringName> &enum_constants = enum_map.get(*k);
|
||||
for (const List<StringName>::Element *E = enum_constants.front(); E; E = E->next()) {
|
||||
const StringName &constant_name = E->get();
|
||||
TEST_FAIL_COND(String(constant_name).find("::") != -1,
|
||||
"Enum constant contains '::', check bindings to remove the scope: '",
|
||||
String(class_name), ".", String(enum_.name), ".", String(constant_name), "'.");
|
||||
int *value = class_info->constant_map.getptr(constant_name);
|
||||
TEST_FAIL_COND(!value, "Missing enum constant value: '",
|
||||
String(class_name), ".", String(enum_.name), ".", String(constant_name), "'.");
|
||||
|
@ -773,8 +776,11 @@ void add_exposed_classes(Context &r_context) {
|
|||
|
||||
for (const List<String>::Element *E = constants.front(); E; E = E->next()) {
|
||||
const String &constant_name = E->get();
|
||||
TEST_FAIL_COND(constant_name.find("::") != -1,
|
||||
"Constant contains '::', check bindings to remove the scope: '",
|
||||
String(class_name), ".", constant_name, "'.");
|
||||
int *value = class_info->constant_map.getptr(StringName(E->get()));
|
||||
TEST_FAIL_COND(!value, "Missing enum constant value: '", String(class_name), ".", String(constant_name), "'.");
|
||||
TEST_FAIL_COND(!value, "Missing constant value: '", String(class_name), ".", String(constant_name), "'.");
|
||||
|
||||
ConstantData constant;
|
||||
constant.name = constant_name;
|
||||
|
|
Loading…
Reference in a new issue