feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -182,7 +182,7 @@ void Polygon2DEditor::_sync_bones() {
}
}
if (weights.size() == 0) { //create them
if (weights.is_empty()) { //create them
weights.resize(wc);
float *w = weights.ptrw();
for (int j = 0; j < wc; j++) {
@ -311,7 +311,7 @@ void Polygon2DEditor::_edit_menu_option(int p_option) {
switch (p_option) {
case MENU_POLYGON_TO_UV: {
Vector<Vector2> points = node->get_polygon();
if (points.size() == 0) {
if (points.is_empty()) {
break;
}
Vector<Vector2> uvs = node->get_uv();
@ -323,7 +323,7 @@ void Polygon2DEditor::_edit_menu_option(int p_option) {
case MENU_UV_TO_POLYGON: {
Vector<Vector2> points = node->get_polygon();
Vector<Vector2> uvs = node->get_uv();
if (uvs.size() == 0) {
if (uvs.is_empty()) {
break;
}
@ -334,7 +334,7 @@ void Polygon2DEditor::_edit_menu_option(int p_option) {
} break;
case MENU_UV_CLEAR: {
Vector<Vector2> uvs = node->get_uv();
if (uvs.size() == 0) {
if (uvs.is_empty()) {
break;
}
undo_redo->create_action(TTR("Create UV Map"));
@ -1319,6 +1319,18 @@ Polygon2DEditor::Polygon2DEditor() {
action_buttons[ACTION_PAINT_WEIGHT]->set_tooltip_text(TTR("Paint weights with specified intensity."));
action_buttons[ACTION_CLEAR_WEIGHT]->set_tooltip_text(TTR("Unpaint weights with specified intensity."));
action_buttons[ACTION_CREATE]->set_accessibility_name(TTRC("Create Polygon"));
action_buttons[ACTION_CREATE_INTERNAL]->set_accessibility_name(TTRC("Create Internal Vertex"));
action_buttons[ACTION_REMOVE_INTERNAL]->set_accessibility_name(TTRC("Remove Internal Vertex"));
action_buttons[ACTION_EDIT_POINT]->set_accessibility_name(TTRC("Move Points"));
action_buttons[ACTION_MOVE]->set_accessibility_name(TTRC("Move Polygon"));
action_buttons[ACTION_ROTATE]->set_accessibility_name(TTRC("Rotate Polygon"));
action_buttons[ACTION_SCALE]->set_accessibility_name(TTRC("Scale Polygon"));
action_buttons[ACTION_ADD_POLYGON]->set_accessibility_name(TTRC("Create Custom Polygon"));
action_buttons[ACTION_REMOVE_POLYGON]->set_accessibility_name(TTRC("Remove Custom Polygon"));
action_buttons[ACTION_PAINT_WEIGHT]->set_accessibility_name(TTRC("Paint Weights"));
action_buttons[ACTION_CLEAR_WEIGHT]->set_accessibility_name(TTRC("Unpaint Weights"));
bone_paint_strength = memnew(HSlider);
toolbar->add_child(bone_paint_strength);
bone_paint_strength->set_custom_minimum_size(Size2(75 * EDSCALE, 0));
@ -1327,6 +1339,7 @@ Polygon2DEditor::Polygon2DEditor() {
bone_paint_strength->set_max(1);
bone_paint_strength->set_step(0.01);
bone_paint_strength->set_value(0.5);
bone_paint_strength->set_accessibility_name(TTRC("Strength"));
bone_paint_radius_label = memnew(Label(TTR("Radius:")));
toolbar->add_child(bone_paint_radius_label);
@ -1337,6 +1350,7 @@ Polygon2DEditor::Polygon2DEditor() {
bone_paint_radius->set_max(100);
bone_paint_radius->set_step(1);
bone_paint_radius->set_value(32);
bone_paint_radius->set_accessibility_name(TTRC("Radius"));
HSplitContainer *uv_main_hsc = memnew(HSplitContainer);
polygon_edit->add_child(uv_main_hsc);
@ -1407,6 +1421,7 @@ Polygon2DEditor::Polygon2DEditor() {
sb_off_x->set_value(snap_offset.x);
sb_off_x->set_suffix("px");
sb_off_x->connect(SceneStringName(value_changed), callable_mp(this, &Polygon2DEditor::_set_snap_off_x));
sb_off_x->set_accessibility_name(TTRC("Grid Offset X"));
grid_settings_vb->add_margin_child(TTR("Grid Offset X:"), sb_off_x);
SpinBox *sb_off_y = memnew(SpinBox);
@ -1416,6 +1431,7 @@ Polygon2DEditor::Polygon2DEditor() {
sb_off_y->set_value(snap_offset.y);
sb_off_y->set_suffix("px");
sb_off_y->connect(SceneStringName(value_changed), callable_mp(this, &Polygon2DEditor::_set_snap_off_y));
sb_off_y->set_accessibility_name(TTRC("Grid Offset Y"));
grid_settings_vb->add_margin_child(TTR("Grid Offset Y:"), sb_off_y);
SpinBox *sb_step_x = memnew(SpinBox);
@ -1425,6 +1441,7 @@ Polygon2DEditor::Polygon2DEditor() {
sb_step_x->set_value(snap_step.x);
sb_step_x->set_suffix("px");
sb_step_x->connect(SceneStringName(value_changed), callable_mp(this, &Polygon2DEditor::_set_snap_step_x));
sb_step_x->set_accessibility_name(TTRC("Grid Step X"));
grid_settings_vb->add_margin_child(TTR("Grid Step X:"), sb_step_x);
SpinBox *sb_step_y = memnew(SpinBox);
@ -1434,6 +1451,7 @@ Polygon2DEditor::Polygon2DEditor() {
sb_step_y->set_value(snap_step.y);
sb_step_y->set_suffix("px");
sb_step_y->connect(SceneStringName(value_changed), callable_mp(this, &Polygon2DEditor::_set_snap_step_y));
sb_step_y->set_accessibility_name(TTRC("Grid Step Y"));
grid_settings_vb->add_margin_child(TTR("Grid Step Y:"), sb_step_y);
zoom_widget = memnew(EditorZoomWidget);