diff --git a/armorforge/project.js b/armorforge/project.js index db00fc5ab..2a5871f8c 100644 --- a/armorforge/project.js +++ b/armorforge/project.js @@ -7,7 +7,7 @@ flags.with_mpeg_write = true; let project = new Project(flags.name); project.addDefine("is_forge"); project.addDefine("is_paint"); -await project.addProject("../base"); +project.addProject("../base"); project.addSources("../armorpaint/Sources"); //// project.addShaders("../armorpaint/Shaders/*.glsl", { embed: flags.embed }); //// @@ -42,4 +42,4 @@ if (flags.raytrace) { } } -resolve(project); +return project; diff --git a/armorlab/project.js b/armorlab/project.js index 77c043c16..f64a8fb75 100644 --- a/armorlab/project.js +++ b/armorlab/project.js @@ -6,7 +6,7 @@ flags.with_onnx = true; let project = new Project(flags.name); project.addDefine("is_lab"); -await project.addProject("../base"); +project.addProject("../base"); project.addSources("Sources"); project.addSources("Sources/nodes"); @@ -44,4 +44,4 @@ if (flags.raytrace) { } } -resolve(project); +return project; diff --git a/armorpaint/project.js b/armorpaint/project.js index 7ea32099e..7402b863e 100644 --- a/armorpaint/project.js +++ b/armorpaint/project.js @@ -5,7 +5,7 @@ flags.package = 'org.armorpaint'; let project = new Project(flags.name); project.addDefine("is_paint"); -await project.addProject("../base"); +project.addProject("../base"); project.addSources("Sources"); project.addSources("Sources/nodes"); @@ -39,4 +39,4 @@ if (flags.raytrace) { } } -resolve(project); +return project; diff --git a/armorsculpt/project.js b/armorsculpt/project.js index 05064710f..b53882d74 100644 --- a/armorsculpt/project.js +++ b/armorsculpt/project.js @@ -5,7 +5,7 @@ flags.package = 'org.armorsculpt'; let project = new Project(flags.name); project.addDefine("is_sculpt"); -await project.addProject("../base"); +project.addProject("../base"); project.addSources("../armorpaint/Sources"); //// project.addSources("Sources"); @@ -30,4 +30,4 @@ if (flags.physics) { project.addAssets("Assets/plugins/ammo/*", { destination: "data/plugins/{name}" }); } -resolve(project); +return project; diff --git a/base/Sources/base.ts b/base/Sources/base.ts index bd6ad8ea7..77ad07e09 100644 --- a/base/Sources/base.ts +++ b/base/Sources/base.ts @@ -241,7 +241,7 @@ function base_init() { // zui_tr = tr; //// let ops: zui_options_t = { theme: base_theme, - font: f.font_, + font: f, scale_factor: config_raw.window_scale, color_wheel: base_color_wheel.texture_, black_white_gradient: base_color_wheel_gradient.texture_ diff --git a/base/Sources/config.ts b/base/Sources/config.ts index 79f580e44..6a4570463 100644 --- a/base/Sources/config.ts +++ b/base/Sources/config.ts @@ -40,8 +40,65 @@ function config_save() { path += "config.json"; json_encode_start(); - json_encode_string("key", "value"); - json_encode_f32("key", 2.4); + json_encode_string("locale", config_raw.locale); + json_encode_i32("window_mode", config_raw.window_mode); + json_encode_i32("window_w", config_raw.window_w); + json_encode_i32("window_h", config_raw.window_h); + json_encode_i32("window_x", config_raw.window_x); + json_encode_i32("window_y", config_raw.window_y); + json_encode_bool("window_resizable", config_raw.window_resizable); + json_encode_bool("window_maximizable", config_raw.window_maximizable); + json_encode_bool("window_minimizable", config_raw.window_minimizable); + json_encode_bool("window_vsync", config_raw.window_vsync); + json_encode_i32("window_frequency", config_raw.window_frequency); + json_encode_f32("window_scale", config_raw.window_scale); + json_encode_f32("rp_supersample", config_raw.rp_supersample); + json_encode_bool("rp_ssao", config_raw.rp_ssao); + json_encode_bool("rp_ssr", config_raw.rp_ssr); + json_encode_bool("rp_bloom", config_raw.rp_bloom); + json_encode_bool("rp_motionblur", config_raw.rp_motionblur); + json_encode_bool("rp_gi", config_raw.rp_gi); + json_encode_f32("rp_vignette", config_raw.rp_vignette); + json_encode_f32("rp_grain", config_raw.rp_grain); + json_encode_string("version", config_raw.version); + json_encode_string("sha", config_raw.sha); + json_encode_string_array("recent_projects", config_raw.recent_projects); + json_encode_string_array("bookmarks", config_raw.bookmarks); + json_encode_string_array("plugins", config_raw.plugins); + json_encode_string("keymap", config_raw.keymap); + json_encode_string("theme", config_raw.theme); + json_encode_i32("undo_steps", config_raw.undo_steps); + json_encode_f32("camera_pan_speed", config_raw.camera_pan_speed); + json_encode_f32("camera_zoom_speed", config_raw.camera_zoom_speed); + json_encode_f32("camera_rotation_speed", config_raw.camera_rotation_speed); + json_encode_i32("zoom_direction", config_raw.zoom_direction); + json_encode_bool("wrap_mouse", config_raw.wrap_mouse); + json_encode_bool("show_asset_names", config_raw.show_asset_names); + json_encode_bool("touch_ui", config_raw.touch_ui); + json_encode_bool("splash_screen", config_raw.splash_screen); + json_encode_i32_array("layout", config_raw.layout); + json_encode_i32_array("layout_tabs", config_raw.layout_tabs); + json_encode_i32("workspace", config_raw.workspace); + json_encode_i32("camera_controls", config_raw.camera_controls); + json_encode_string("server", config_raw.server); + json_encode_bool("pressure_radius", config_raw.pressure_radius); + json_encode_f32("pressure_sensitivity", config_raw.pressure_sensitivity); + json_encode_f32("displace_strength", config_raw.displace_strength); + json_encode_i32("layer_res", config_raw.layer_res); + json_encode_bool("brush_live", config_raw.brush_live); + json_encode_bool("brush_3d", config_raw.brush_3d); + json_encode_bool("node_preview", config_raw.node_preview); + json_encode_bool("pressure_hardness", config_raw.pressure_hardness); + json_encode_bool("pressure_angle", config_raw.pressure_angle); + json_encode_bool("pressure_opacity", config_raw.pressure_opacity); + json_encode_bool("material_live", config_raw.material_live); + json_encode_bool("brush_depth_reject", config_raw.brush_depth_reject); + json_encode_bool("brush_angle_reject", config_raw.brush_angle_reject); + json_encode_i32("dilate", config_raw.dilate); + json_encode_i32("dilate_radius", config_raw.dilate_radius); + ///if is_lab + json_encode_bool("gpu_inference", config_raw.gpu_inference); + ///end let config_json: string = json_encode_end(); let buffer: buffer_t = sys_string_to_buffer(config_json); @@ -404,63 +461,3 @@ type config_t = { gpu_inference?: bool; ///end }; - -// let config_keys: string[] = [ -// "locale", -// "window_mode", -// "window_w", -// "window_h", -// "window_x", -// "window_y", -// "window_resizable", -// "window_maximizable", -// "window_minimizable", -// "window_vsync", -// "window_frequency", -// "window_scale", -// "rp_supersample", -// "rp_ssao", -// "rp_ssr", -// "rp_bloom", -// "rp_motionblur", -// "rp_gi", -// "rp_vignette", -// "rp_grain", -// "version", -// "sha", -// "recent_projects", -// "bookmarks", -// "plugins", -// "keymap", -// "theme", -// "undo_steps", -// "camera_pan_speed", -// "camera_zoom_speed", -// "camera_rotation_speed", -// "zoom_direction", -// "wrap_mouse", -// "show_asset_names", -// "touch_ui", -// "splash_screen", -// "layout", -// "layout_tabs", -// "workspace", -// "camera_controls", -// "server", -// "pressure_radius", -// "pressure_sensitivity", -// "displace_strength", -// "layer_res", -// "brush_live", -// "brush_3d", -// "node_preview", -// "pressure_hardness", -// "pressure_angle", -// "pressure_opacity", -// "material_live", -// "brush_depth_reject", -// "brush_angle_reject", -// "dilate", -// "dilate_radius", -// "gpu_inference", -// ]; diff --git a/base/Sources/ui_base.ts b/base/Sources/ui_base.ts index 119b6e41d..1a50ae601 100644 --- a/base/Sources/ui_base.ts +++ b/base/Sources/ui_base.ts @@ -215,7 +215,7 @@ function ui_base_init() { let scale: f32 = config_raw.window_scale; let ops: zui_options_t = { theme: base_theme, - font: base_font.font_, + font: base_font, scale_factor: scale, color_wheel: base_color_wheel.texture_, black_white_gradient: base_color_wheel_gradient.texture_ diff --git a/base/Sources/ui_nodes.ts b/base/Sources/ui_nodes.ts index e6f17a484..4ba016eed 100644 --- a/base/Sources/ui_nodes.ts +++ b/base/Sources/ui_nodes.ts @@ -44,7 +44,7 @@ function ui_nodes_init() { let scale: f32 = config_raw.window_scale; let ops: zui_options_t = { theme: base_theme, - font: base_font.font_, + font: base_font, color_wheel: base_color_wheel.texture_, black_white_gradient: base_color_wheel_gradient.texture_, scale_factor: scale @@ -871,7 +871,7 @@ function ui_nodes_render() { // Undo if (ui_nodes_ui.input_started || ui_nodes_ui.is_key_pressed) { - ui_nodes_last_canvas = json_parse(json_stringify(ui_nodes_get_canvas(true))); + // ui_nodes_last_canvas = json_parse(json_stringify(ui_nodes_get_canvas(true))); } // Nodes diff --git a/base/Sources/ui_view2d.ts b/base/Sources/ui_view2d.ts index 2c1eb1d85..1805d91b0 100644 --- a/base/Sources/ui_view2d.ts +++ b/base/Sources/ui_view2d.ts @@ -47,7 +47,7 @@ function ui_view2d_init() { let scale: f32 = config_raw.window_scale; let ops: zui_options_t = { theme: base_theme, - font: base_font.font_, + font: base_font, color_wheel: base_color_wheel.texture_, black_white_gradient: base_color_wheel_gradient.texture_, scale_factor: scale diff --git a/base/project.js b/base/project.js index f229459af..53a97384f 100644 --- a/base/project.js +++ b/base/project.js @@ -122,4 +122,4 @@ if (export_version_info) { project.addAssets(dir + "/version.json", { destination: "data/{name}", embed: flags.embed }); } -resolve(project); +return project; diff --git a/misc/pad/Sources/main.ts b/misc/pad/Sources/main.ts index 974672d3f..6f8414275 100644 --- a/misc/pad/Sources/main.ts +++ b/misc/pad/Sources/main.ts @@ -80,7 +80,7 @@ function main() { theme = {}; zui_theme_default(theme); - let zui_ops: zui_options_t = { scale_factor: 1.0, theme: theme, font: font.font_ }; + let zui_ops: zui_options_t = { scale_factor: 1.0, theme: theme, font: font }; ui = zui_create(zui_ops); let blob_coloring: buffer_t = data_get_blob("text_coloring.json");