This commit is contained in:
luboslenco
2025-03-02 21:07:17 +01:00
parent 32bc073574
commit c8a667bfee
59 changed files with 371 additions and 509 deletions
+11 -11
View File
@@ -28,8 +28,8 @@ function ui_box_render() {
let in_use: bool = ui.combo_selected_handle != null;
let is_escape: bool = keyboard_started("escape");
if (ui_box_draws > 2 && (ui.input_released || is_escape) && !in_use && !ui.is_typing) {
let appw: i32 = sys_width();
let apph: i32 = sys_height();
let appw: i32 = kinc_window_width();
let apph: i32 = kinc_window_height();
let mw: i32 = math_floor(ui_box_modalw * ui_SCALE(ui));
let mh: i32 = math_floor(ui_box_modalh * ui_SCALE(ui));
let left: f32 = (appw / 2 - mw / 2) + ui_box_hwnd.drag_x;
@@ -46,18 +46,18 @@ function ui_box_render() {
if (config_raw.touch_ui) { // Darken bg
///if (arm_android || arm_ios)
g2_set_color(color_from_floats(0, 0, 0, ui_box_tween_alpha));
draw_set_color(color_from_floats(0, 0, 0, ui_box_tween_alpha));
///else
g2_set_color(color_from_floats(0, 0, 0, 0.5));
draw_set_color(color_from_floats(0, 0, 0, 0.5));
///end
draw_filled_rect(0, 0, sys_width(), sys_height());
draw_filled_rect(0, 0, kinc_window_width(), kinc_window_height());
}
g2_end();
let ui: ui_t = base_ui_box;
let appw: i32 = sys_width();
let apph: i32 = sys_height();
let appw: i32 = kinc_window_width();
let apph: i32 = kinc_window_height();
let mw: i32 = math_floor(ui_box_modalw * ui_SCALE(ui));
let mh: i32 = math_floor(ui_box_modalh * ui_SCALE(ui));
if (mw > appw) {
@@ -176,7 +176,7 @@ function ui_box_tween_in() {
let a: tween_anim_t = { target: ADDRESS(ui_box_tween_alpha), to: 0.5, duration: 0.2, ease: ease_t.EXPO_OUT };
tween_to(a);
ui_box_hwnd.drag_y = math_floor(sys_height() / 2);
ui_box_hwnd.drag_y = math_floor(kinc_window_height() / 2);
a = { target: ADDRESS(ui_box_hwnd.drag_y), to: 0.0, duration: 0.2, ease: ease_t.EXPO_OUT, tick: ui_box_tween_tick };
tween_to(a);
}
@@ -185,7 +185,7 @@ function ui_box_tween_out() {
let a: tween_anim_t = { target: ADDRESS(ui_box_tween_alpha), to: 0.0, duration: 0.2, ease: ease_t.EXPO_IN, done: ui_box_hide_internal };
tween_to(a);
a = { target: ADDRESS(ui_box_hwnd.drag_y), to: sys_height() / 2, duration: 0.2, ease: ease_t.EXPO_IN };
a = { target: ADDRESS(ui_box_hwnd.drag_y), to: kinc_window_height() / 2, duration: 0.2, ease: ease_t.EXPO_IN };
tween_to(a);
}
@@ -196,10 +196,10 @@ function ui_box_tween_tick() {
function ui_box_window_border(ui: ui_t) {
if (ui.scissor) {
ui.scissor = false;
g2_disable_scissor();
g4_disable_scissor();
}
// Border
g2_set_color(ui.ops.theme.SEPARATOR_COL);
draw_set_color(ui.ops.theme.SEPARATOR_COL);
draw_filled_rect(0, 0, 1, ui._window_h);
draw_filled_rect(0 + ui._window_w - 1, 0, 1, ui._window_h);
draw_filled_rect(0, 0 + ui._window_h - 1, ui._window_w, 1);