paint: adjust experimental flag

This commit is contained in:
luboslenco
2026-09-03 12:59:13 +02:00
parent a93c449013
commit 470cfd704f
3 changed files with 35 additions and 49 deletions
+33 -35
View File
@@ -640,43 +640,41 @@ void tab_meshes_draw_context_menu() {
}
// Physics
if (g_config->experimental) {
physics_body_t *pb = o->base->_->body;
string_array_t *phys_combo = string_array_create(0);
string_array_push(phys_combo, ""); // Empty = no physics
string_array_push(phys_combo, tr("Box"));
string_array_push(phys_combo, tr("Sphere"));
string_array_push(phys_combo, tr("Terrain"));
string_array_push(phys_combo, tr("Mesh"));
ui_handle_t *hphys = ui_handle(__ID__);
hphys->i = pb == NULL ? 0 : pb->shape + 1;
ui_combo(hphys, phys_combo, tr("Physics"), true, UI_ALIGN_LEFT, false);
array_free(phys_combo);
free(phys_combo);
if (hphys->changed) {
if (pb != NULL) {
physics_body_remove(pb);
pb = NULL;
}
if (hphys->i > 0) {
physics_shape_t shape = (physics_shape_t)(hphys->i - 1);
bool dynamic = shape == PHYSICS_SHAPE_BOX || shape == PHYSICS_SHAPE_SPHERE;
sim_add_body(o->base, shape, dynamic ? 1.0 : 0.0);
pb = o->base->_->body;
}
g_project->mesh_physics_shapes = i32_array_create(0);
}
physics_body_t *pb = o->base->_->body;
string_array_t *phys_combo = string_array_create(0);
string_array_push(phys_combo, ""); // Empty = no physics
string_array_push(phys_combo, tr("Box"));
string_array_push(phys_combo, tr("Sphere"));
string_array_push(phys_combo, tr("Terrain"));
string_array_push(phys_combo, tr("Mesh"));
ui_handle_t *hphys = ui_handle(__ID__);
hphys->i = pb == NULL ? 0 : pb->shape + 1;
ui_combo(hphys, phys_combo, tr("Physics"), true, UI_ALIGN_LEFT, false);
array_free(phys_combo);
free(phys_combo);
if (hphys->changed) {
if (pb != NULL) {
ui_handle_t *hmass = ui_handle(__ID__);
hmass->f = pb->mass;
ui_slider(hmass, tr("Mass"), 0.0, 10.0, true, 100, true, UI_ALIGN_LEFT, true);
if (hmass->changed) {
physics_body_set_mass(pb, hmass->f); // Zero mass = static
g_project->mesh_physics_shapes = i32_array_create(0);
ui_menu_keep_open = true;
}
physics_body_remove(pb);
pb = NULL;
}
if (hphys->i > 0) {
physics_shape_t shape = (physics_shape_t)(hphys->i - 1);
bool dynamic = shape == PHYSICS_SHAPE_BOX || shape == PHYSICS_SHAPE_SPHERE;
sim_add_body(o->base, shape, dynamic ? 1.0 : 0.0);
pb = o->base->_->body;
}
g_project->mesh_physics_shapes = i32_array_create(0);
}
if (pb != NULL) {
ui_handle_t *hmass = ui_handle(__ID__);
hmass->f = pb->mass;
ui_slider(hmass, tr("Mass"), 0.0, 10.0, true, 100, true, UI_ALIGN_LEFT, true);
if (hmass->changed) {
physics_body_set_mass(pb, hmass->f); // Zero mass = static
g_project->mesh_physics_shapes = i32_array_create(0);
ui_menu_keep_open = true;
}
}
-12
View File
@@ -437,12 +437,6 @@ void tab_scripts_draw(ui_handle_t *htab) {
},
3);
// #ifndef NDEBUG
// if (g_config->experimental) {
// f32_array_push(row, -90);
// }
// #endif
ui_row(row);
if (ui_icon_button(tr("Run"), ICON_PLAY, UI_ALIGN_CENTER)) {
@@ -459,12 +453,6 @@ void tab_scripts_draw(ui_handle_t *htab) {
file_handle->i = tab_scripts_selected;
tab_scripts_selected = ui_combo(file_handle, g_project->script_names, tr("File"), false, UI_ALIGN_LEFT, true);
// #ifndef NDEBUG
// if (g_config->experimental && ui_icon_button("Run Tests", ICON_PLAY, UI_ALIGN_CENTER)) {
// minic_tests();
// }
// #endif
ui_end_sticky();
draw_font_t *_font = g_font;
+2 -2
View File
@@ -313,7 +313,7 @@ void ui_menubar_draw_category_items() {
}
ui_menu_separator();
if (ui_menu_sub_button(ui_handle(__ID__), tr("Export"))) {
ui_menu_sub_begin(g_config->experimental ? 4 : 3);
ui_menu_sub_begin(4);
if (ui_menu_button(tr("Textures..."), any_map_get(g_keymap, "file_export_textures_as"), ICON_IMAGE)) {
g_context->layers_export = EXPORT_MODE_VISIBLE;
box_export_show_textures();
@@ -325,7 +325,7 @@ void ui_menubar_draw_category_items() {
g_context->export_mesh_index = 0; // All
box_export_show_mesh();
}
if (g_config->experimental && ui_menu_button(tr("Player..."), "", ICON_PLAY)) {
if (ui_menu_button(tr("Player..."), "", ICON_PLAY)) {
box_export_show_player();
}
ui_menu_sub_end();