Transform: Fixed bug in euler to quaternion conversions | Static_Array: Added overload for operator []= | Widgets: Added changed bool to textfields

This commit is contained in:
2024-12-11 23:28:14 +01:00
parent c4073d7d91
commit 36c6bc5fe7
6 changed files with 36 additions and 15 deletions

View File

@@ -285,18 +285,22 @@ ui_int_field :: (label: string, value: *int, identifier: s64 = 0, loc := #caller
ui_set_next_size_x(.CHILDREN_SUM, 1);
}
ui_float_field :: (label: string, value: *float, identifier: s64 = 0, loc := #caller_location) {
ui_float_field :: (label: string, value: *float, identifier: s64 = 0, loc := #caller_location) -> bool {
changed := false;
ui_container_layout(identifier=identifier, loc=loc);
ui_set_next_size_x(.CHILDREN_SUM);
ui_push_parent(ui_state.last_box, .LEFT, .HORIZONTAL);
{
ui_label(label);
ui_float_field(value, identifier);
changed |= ui_float_field(value, identifier);
}
ui_pop_parent();
return changed;
}
ui_float_field :: (value: *float, identifier: s64 = 0, loc := #caller_location) {
ui_float_field :: (value: *float, identifier: s64 = 0, loc := #caller_location) -> bool {
changed := false;
ui_set_next_background_color(.{0.0,1.0,1.0,0.0});
ui_set_next_border_color(.{0.3,0.3,0.3,1.0});
ui_set_next_size_x(.CHILDREN_SUM, 1);
@@ -344,6 +348,7 @@ ui_float_field :: (value: *float, identifier: s64 = 0, loc := #caller_location)
<<value = parse_float(*temp_str);
outer.interaction.editing = false;
engine.editor.focused_widget = null;
changed = true;
}
if engine.input.has_char {
@@ -414,21 +419,26 @@ ui_float_field :: (value: *float, identifier: s64 = 0, loc := #caller_location)
//
}
ui_pop_parent();
return changed;
}
ui_vector_field :: (label: string, value: *Vector3, identifier: s64 = 0, loc := #caller_location) {
ui_vector_field :: (label: string, value: *Vector3, identifier: s64 = 0, loc := #caller_location) -> bool {
changed := false;
ui_container_layout(identifier=identifier, loc=loc);
ui_push_parent(ui_state.last_box, .LEFT, .HORIZONTAL);
{
ui_label(label);
ui_label("X");
ui_float_field(*value.x);
changed |= ui_float_field(*value.x);
ui_label("Y");
ui_float_field(*value.y);
changed |= ui_float_field(*value.y);
ui_label("Z");
ui_float_field(*value.z);
changed |= ui_float_field(*value.z);
}
ui_pop_parent();
return changed;
}
ui_clickable_label :: (text: string, selected: bool = false, identifier: s64 = 0, loc := #caller_location) -> clicked: bool, Interaction_State {