summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorLightning_A <aaronjrecord@gmail.com>2021-06-16 10:24:34 -0600
committerLightning_A <aaronjrecord@gmail.com>2021-06-16 10:32:22 -0600
commitb6af2a29eb1f96518c89a35a6a50a6309673d9f0 (patch)
tree83014054a222c71409ba4760741b6dcfb12b7981 /editor
parent48fe9c97948f44125e68f3b8f67eaaf032c763bd (diff)
Rename `is_valid_integer()` to `is_valid_int()`
Method from `String`
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp6
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp4
-rw-r--r--editor/plugins/tiles/tile_set_editor.cpp8
3 files changed, 9 insertions, 9 deletions
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index 61457e3e59..191440bdb3 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -136,7 +136,7 @@ void TileDataOcclusionShapeEditor::draw_over_tile(CanvasItem *p_canvas_item, Tra
ERR_FAIL_COND(!tile_data);
Vector<String> components = String(p_property).split("/", true);
- if (components[0].begins_with("occlusion_layer_") && components[0].trim_prefix("occlusion_layer_").is_valid_integer()) {
+ if (components[0].begins_with("occlusion_layer_") && components[0].trim_prefix("occlusion_layer_").is_valid_int()) {
int occlusion_layer = components[0].trim_prefix("occlusion_layer_").to_int();
if (occlusion_layer >= 0 && occlusion_layer < p_tile_set->get_occlusion_layers_count()) {
// Draw all shapes.
@@ -158,7 +158,7 @@ void TileDataCollisionShapeEditor::draw_over_tile(CanvasItem *p_canvas_item, Tra
ERR_FAIL_COND(!tile_data);
Vector<String> components = String(p_property).split("/", true);
- if (components[0].begins_with("physics_layer_") && components[0].trim_prefix("physics_layer_").is_valid_integer()) {
+ if (components[0].begins_with("physics_layer_") && components[0].trim_prefix("physics_layer_").is_valid_int()) {
int physics_layer = components[0].trim_prefix("physics_layer_").to_int();
if (physics_layer >= 0 && physics_layer < p_tile_set->get_physics_layers_count()) {
// Draw all shapes.
@@ -190,7 +190,7 @@ void TileDataNavigationPolygonEditor::draw_over_tile(CanvasItem *p_canvas_item,
ERR_FAIL_COND(!tile_data);
Vector<String> components = String(p_property).split("/", true);
- if (components[0].begins_with("navigation_layer_") && components[0].trim_prefix("navigation_layer_").is_valid_integer()) {
+ if (components[0].begins_with("navigation_layer_") && components[0].trim_prefix("navigation_layer_").is_valid_int()) {
int navigation_layer = components[0].trim_prefix("navigation_layer_").to_int();
if (navigation_layer >= 0 && navigation_layer < p_tile_set->get_navigation_layers_count()) {
// Draw all shapes.
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
index 8e7d613027..eb52aff318 100644
--- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
@@ -1040,7 +1040,7 @@ Map<Vector2i, List<const PropertyInfo *>> TileSetAtlasSourceEditor::_group_prope
Vector<String> components = String(E_property->get().name).split("/", true, 1);
if (components.size() >= 1) {
Vector<String> coord_arr = components[0].split(":");
- if (coord_arr.size() == 2 && coord_arr[0].is_valid_integer() && coord_arr[1].is_valid_integer()) {
+ if (coord_arr.size() == 2 && coord_arr[0].is_valid_int() && coord_arr[1].is_valid_int()) {
Vector2i coords = Vector2i(coord_arr[0].to_int(), coord_arr[1].to_int());
per_tile[coords].push_back(&(E_property->get()));
}
@@ -1088,7 +1088,7 @@ void TileSetAtlasSourceEditor::_menu_option(int p_option) {
if (per_tile.has(selected.tile)) {
for (List<const PropertyInfo *>::Element *E_property = per_tile[selected.tile].front(); E_property; E_property = E_property->next()) {
Vector<String> components = E_property->get()->name.split("/", true, 2);
- if (components.size() >= 2 && components[1].is_valid_integer() && components[1].to_int() == selected.alternative) {
+ if (components.size() >= 2 && components[1].is_valid_int() && components[1].to_int() == selected.alternative) {
String property = E_property->get()->name;
Variant value = tile_set_atlas_source->get(property);
if (value.get_type() != Variant::NIL) {
diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp
index 11842981f3..ae5620a4e3 100644
--- a/editor/plugins/tiles/tile_set_editor.cpp
+++ b/editor/plugins/tiles/tile_set_editor.cpp
@@ -356,8 +356,8 @@ void TileSetEditor::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p
}
}
} else if ((p_property == "terrains_sets_count" && tile_data->get_terrain_set() >= (int)p_new_value) ||
- (components.size() == 2 && components[0].begins_with("terrain_set_") && components[0].trim_prefix("terrain_set_").is_valid_integer() && components[1] == "mode") ||
- (components.size() == 2 && components[0].begins_with("terrain_set_") && components[0].trim_prefix("terrain_set_").is_valid_integer() && components[1] == "terrains_count" && tile_data->get_terrain_set() == components[0].trim_prefix("terrain_set_").to_int() && (int)p_new_value < tile_set->get_terrains_count(tile_data->get_terrain_set()))) {
+ (components.size() == 2 && components[0].begins_with("terrain_set_") && components[0].trim_prefix("terrain_set_").is_valid_int() && components[1] == "mode") ||
+ (components.size() == 2 && components[0].begins_with("terrain_set_") && components[0].trim_prefix("terrain_set_").is_valid_int() && components[1] == "terrains_count" && tile_data->get_terrain_set() == components[0].trim_prefix("terrain_set_").to_int() && (int)p_new_value < tile_set->get_terrains_count(tile_data->get_terrain_set()))) {
ADD_UNDO(tile_data, "terrain_set");
if (tile_data->is_valid_peering_bit_terrain(TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) {
ADD_UNDO(tile_data, "terrains_peering_bit/right_side");
@@ -423,8 +423,8 @@ void TileSetEditor::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p
ADD_UNDO(tile_data, vformat("custom_data_%d", custom_data_layer_index));
}
}
- } else if (components.size() == 2 && components[0].begins_with("custom_data_layer_") && components[0].trim_prefix("custom_data_layer_").is_valid_integer() && components[1] == "type") {
- int custom_data_layer = components[0].trim_prefix("custom_data_layer_").is_valid_integer();
+ } else if (components.size() == 2 && components[0].begins_with("custom_data_layer_") && components[0].trim_prefix("custom_data_layer_").is_valid_int() && components[1] == "type") {
+ int custom_data_layer = components[0].trim_prefix("custom_data_layer_").is_valid_int();
ADD_UNDO(tile_data, vformat("custom_data_%d", custom_data_layer));
}
}