Unify namespaces
This commit is contained in:
+40
-40
@@ -5,7 +5,7 @@ let base_is_resizing: bool = false;
|
||||
let base_drag_asset: asset_t = null;
|
||||
let base_drag_swatch: swatch_color_t = null;
|
||||
let base_drag_file: string = null;
|
||||
let base_drag_file_icon: kinc_g5_texture_t = null;
|
||||
let base_drag_file_icon: iron_g5_texture_t = null;
|
||||
let base_drag_tint: i32 = 0xffffffff;
|
||||
let base_drag_size: i32 = -1;
|
||||
let base_drag_rect: rect_t = null;
|
||||
@@ -16,8 +16,8 @@ let base_drop_x: f32 = 0.0;
|
||||
let base_drop_y: f32 = 0.0;
|
||||
let base_font: draw_font_t = null;
|
||||
let base_theme: ui_theme_t;
|
||||
let base_color_wheel: kinc_g5_texture_t;
|
||||
let base_color_wheel_gradient: kinc_g5_texture_t;
|
||||
let base_color_wheel: iron_g5_texture_t;
|
||||
let base_color_wheel_gradient: iron_g5_texture_t;
|
||||
let base_ui_box: ui_t;
|
||||
let base_ui_menu: ui_t;
|
||||
let base_default_element_w: i32 = 100;
|
||||
@@ -36,8 +36,8 @@ let base_default_fov: f32 = 0.69;
|
||||
let _base_material_count: i32;
|
||||
|
||||
function base_init() {
|
||||
base_last_window_width = kinc_window_width();
|
||||
base_last_window_height = kinc_window_height();
|
||||
base_last_window_width = iron_window_width();
|
||||
base_last_window_height = iron_window_height();
|
||||
|
||||
sys_notify_on_drop_files(function (drop_path: string) {
|
||||
///if arm_linux
|
||||
@@ -70,8 +70,8 @@ function base_init() {
|
||||
iron_set_save_and_quit_callback(base_save_and_quit_callback);
|
||||
|
||||
let font: draw_font_t = data_get_font("font.ttf");
|
||||
let image_color_wheel: kinc_g5_texture_t = data_get_image("color_wheel.k");
|
||||
let image_color_wheel_gradient: kinc_g5_texture_t = data_get_image("color_wheel_gradient.k");
|
||||
let image_color_wheel: iron_g5_texture_t = data_get_image("color_wheel.k");
|
||||
let image_color_wheel_gradient: iron_g5_texture_t = data_get_image("color_wheel_gradient.k");
|
||||
|
||||
base_font = font;
|
||||
config_load_theme(config_raw.theme, false);
|
||||
@@ -156,7 +156,7 @@ function base_save_and_quit_callback(save: bool) {
|
||||
project_save(true);
|
||||
}
|
||||
else {
|
||||
kinc_stop();
|
||||
iron_stop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,16 +174,16 @@ function base_w(): i32 {
|
||||
let res: i32 = 0;
|
||||
if (config_raw.layout == null) {
|
||||
let sidebarw: i32 = ui_base_default_sidebar_w;
|
||||
res = kinc_window_width() - sidebarw - ui_toolbar_default_w;
|
||||
res = iron_window_width() - sidebarw - ui_toolbar_default_w;
|
||||
}
|
||||
else if (ui_nodes_show || ui_view2d_show) {
|
||||
res = kinc_window_width() - config_raw.layout[layout_size_t.SIDEBAR_W] - config_raw.layout[layout_size_t.NODES_W] - ui_toolbar_w;
|
||||
res = iron_window_width() - config_raw.layout[layout_size_t.SIDEBAR_W] - config_raw.layout[layout_size_t.NODES_W] - ui_toolbar_w;
|
||||
}
|
||||
else if (ui_base_show) {
|
||||
res = kinc_window_width() - config_raw.layout[layout_size_t.SIDEBAR_W] - ui_toolbar_w;
|
||||
res = iron_window_width() - config_raw.layout[layout_size_t.SIDEBAR_W] - ui_toolbar_w;
|
||||
}
|
||||
else { // Distract free
|
||||
res = kinc_window_width();
|
||||
res = iron_window_width();
|
||||
}
|
||||
if (context_raw.view_index > -1) {
|
||||
res = math_floor(res / 2);
|
||||
@@ -206,7 +206,7 @@ function base_h(): i32 {
|
||||
return util_render_decal_preview_size;
|
||||
}
|
||||
|
||||
let res: i32 = kinc_window_height();
|
||||
let res: i32 = iron_window_height();
|
||||
|
||||
if (config_raw.layout == null) {
|
||||
res -= ui_header_default_h * 2 + ui_status_default_status_h;
|
||||
@@ -235,33 +235,33 @@ function base_y(): i32 {
|
||||
}
|
||||
|
||||
function base_on_resize() {
|
||||
if (kinc_window_width() == 0 || kinc_window_height() == 0) {
|
||||
if (iron_window_width() == 0 || iron_window_height() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let ratio_w: f32 = kinc_window_width() / base_last_window_width;
|
||||
base_last_window_width = kinc_window_width();
|
||||
let ratio_h: f32 = kinc_window_height() / base_last_window_height;
|
||||
base_last_window_height = kinc_window_height();
|
||||
let ratio_w: f32 = iron_window_width() / base_last_window_width;
|
||||
base_last_window_width = iron_window_width();
|
||||
let ratio_h: f32 = iron_window_height() / base_last_window_height;
|
||||
base_last_window_height = iron_window_height();
|
||||
|
||||
config_raw.layout[layout_size_t.NODES_W] = math_floor(config_raw.layout[layout_size_t.NODES_W] * ratio_w);
|
||||
config_raw.layout[layout_size_t.SIDEBAR_H0] = math_floor(config_raw.layout[layout_size_t.SIDEBAR_H0] * ratio_h);
|
||||
config_raw.layout[layout_size_t.SIDEBAR_H1] = kinc_window_height() - config_raw.layout[layout_size_t.SIDEBAR_H0];
|
||||
config_raw.layout[layout_size_t.SIDEBAR_H1] = iron_window_height() - config_raw.layout[layout_size_t.SIDEBAR_H0];
|
||||
|
||||
base_resize();
|
||||
base_save_window_rect();
|
||||
}
|
||||
|
||||
function base_save_window_rect() {
|
||||
config_raw.window_w = kinc_window_width();
|
||||
config_raw.window_h = kinc_window_height();
|
||||
config_raw.window_x = kinc_window_x();
|
||||
config_raw.window_y = kinc_window_y();
|
||||
config_raw.window_w = iron_window_width();
|
||||
config_raw.window_h = iron_window_height();
|
||||
config_raw.window_x = iron_window_x();
|
||||
config_raw.window_y = iron_window_y();
|
||||
config_save();
|
||||
}
|
||||
|
||||
function base_resize() {
|
||||
if (kinc_window_width() == 0 || kinc_window_height() == 0) {
|
||||
if (iron_window_width() == 0 || iron_window_height() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ function base_update() {
|
||||
}
|
||||
else if (context_in_viewport()) {
|
||||
if (ends_with(to_lower_case(base_drag_asset.file), ".hdr")) {
|
||||
let image: kinc_g5_texture_t = project_get_image(base_drag_asset);
|
||||
let image: iron_g5_texture_t = project_get_image(base_drag_asset);
|
||||
import_envmap_run(base_drag_asset.file, image);
|
||||
}
|
||||
}
|
||||
@@ -504,14 +504,14 @@ function base_handle_drop_paths() {
|
||||
}
|
||||
|
||||
function base_get_drag_background(): rect_t {
|
||||
let icons: kinc_g5_texture_t = resource_get("icons.k");
|
||||
let icons: iron_g5_texture_t = resource_get("icons.k");
|
||||
if (base_drag_layer != null && !slot_layer_is_group(base_drag_layer) && base_drag_layer.fill_layer == null) {
|
||||
return resource_tile50(icons, 4, 1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function base_get_drag_image(): kinc_g5_texture_t {
|
||||
function base_get_drag_image(): iron_g5_texture_t {
|
||||
base_drag_tint = 0xffffffff;
|
||||
base_drag_size = -1;
|
||||
base_drag_rect = null;
|
||||
@@ -527,7 +527,7 @@ function base_get_drag_image(): kinc_g5_texture_t {
|
||||
if (base_drag_file_icon != null) {
|
||||
return base_drag_file_icon;
|
||||
}
|
||||
let icons: kinc_g5_texture_t = resource_get("icons.k");
|
||||
let icons: iron_g5_texture_t = resource_get("icons.k");
|
||||
base_drag_rect = string_index_of(base_drag_file, ".") > 0 ? resource_tile50(icons, 3, 1) : resource_tile50(icons, 2, 1);
|
||||
base_drag_tint = ui_base_ui.ops.theme.HIGHLIGHT_COL;
|
||||
return icons;
|
||||
@@ -537,7 +537,7 @@ function base_get_drag_image(): kinc_g5_texture_t {
|
||||
return base_drag_material.image_icon;
|
||||
}
|
||||
if (base_drag_layer != null && slot_layer_is_group(base_drag_layer)) {
|
||||
let icons: kinc_g5_texture_t = resource_get("icons.k");
|
||||
let icons: iron_g5_texture_t = resource_get("icons.k");
|
||||
let folder_closed: rect_t = resource_tile50(icons, 2, 1);
|
||||
let folder_open: rect_t = resource_tile50(icons, 8, 1);
|
||||
base_drag_rect = base_drag_layer.show_panel ? folder_open : folder_closed;
|
||||
@@ -556,7 +556,7 @@ function base_get_drag_image(): kinc_g5_texture_t {
|
||||
}
|
||||
|
||||
function base_render() {
|
||||
if (kinc_window_width() == 0 || kinc_window_height() == 0) {
|
||||
if (iron_window_width() == 0 || iron_window_height() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ function base_render() {
|
||||
|
||||
if (base_is_dragging) {
|
||||
iron_set_mouse_cursor(1); // Hand
|
||||
let img: kinc_g5_texture_t = base_get_drag_image();
|
||||
let img: iron_g5_texture_t = base_get_drag_image();
|
||||
let scale_factor: f32 = ui_SCALE(ui_base_ui);
|
||||
let size: f32 = (base_drag_size == -1 ? 50 : base_drag_size) * scale_factor;
|
||||
let ratio: f32 = size / img.width;
|
||||
@@ -675,17 +675,17 @@ function base_get_asset_index(file_name: string): i32 {
|
||||
}
|
||||
|
||||
function base_toggle_fullscreen() {
|
||||
if (kinc_window_get_mode() == window_mode_t.WINDOWED) {
|
||||
config_raw.window_w = kinc_window_width();
|
||||
config_raw.window_h = kinc_window_height();
|
||||
config_raw.window_x = kinc_window_x();
|
||||
config_raw.window_y = kinc_window_y();
|
||||
if (iron_window_get_mode() == window_mode_t.WINDOWED) {
|
||||
config_raw.window_w = iron_window_width();
|
||||
config_raw.window_h = iron_window_height();
|
||||
config_raw.window_x = iron_window_x();
|
||||
config_raw.window_y = iron_window_y();
|
||||
iron_set_window_mode(window_mode_t.FULLSCREEN);
|
||||
}
|
||||
else {
|
||||
iron_set_window_mode(window_mode_t.WINDOWED);
|
||||
kinc_window_resize(config_raw.window_w, config_raw.window_h);
|
||||
kinc_window_move(config_raw.window_x, config_raw.window_y);
|
||||
iron_window_resize(config_raw.window_w, config_raw.window_h);
|
||||
iron_window_move(config_raw.window_x, config_raw.window_y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,8 +752,8 @@ function base_init_layout() {
|
||||
let new_layout: i32[] = [];
|
||||
|
||||
array_push(new_layout, math_floor(ui_base_default_sidebar_w * raw.window_scale)); // LayoutSidebarW
|
||||
array_push(new_layout, math_floor(kinc_window_height() / 2)); // LayoutSidebarH0
|
||||
array_push(new_layout, math_floor(kinc_window_height() / 2)); // LayoutSidebarH1
|
||||
array_push(new_layout, math_floor(iron_window_height() / 2)); // LayoutSidebarH0
|
||||
array_push(new_layout, math_floor(iron_window_height() / 2)); // LayoutSidebarH1
|
||||
|
||||
///if arm_ios
|
||||
array_push(new_layout, show2d ? math_floor((app_w() + raw.layout[layout_size_t.NODES_W]) * 0.473) : math_floor(app_w() * 0.473)); // LayoutNodesW
|
||||
|
||||
Reference in New Issue
Block a user