From 18fa97df51395c0e7624227e6b2ea76e749c3f0d Mon Sep 17 00:00:00 2001 From: luboslenco Date: Tue, 2 Sep 2025 20:54:22 +0200 Subject: [PATCH 1/5] Fix toolbar icon scale --- paint/sources/ui_base.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paint/sources/ui_base.ts b/paint/sources/ui_base.ts index 8b074cc0..60766e3e 100644 --- a/paint/sources/ui_base.ts +++ b/paint/sources/ui_base.ts @@ -105,6 +105,9 @@ function ui_base_init() { scene_world._.envmap = context_raw.show_envmap ? context_raw.saved_envmap : context_raw.empty_envmap; context_raw.ddirty = 1; + let resources: string[] = ["cursor.k", "icons.k"]; + resource_load(resources); + let scale: f32 = config_raw.window_scale; let ops: ui_options_t = { theme: base_theme, @@ -133,9 +136,6 @@ function ui_base_init() { context_raw.gizmo_rotate_y = object_get_child(context_raw.gizmo, ".RotateY"); context_raw.gizmo_rotate_z = object_get_child(context_raw.gizmo, ".RotateZ"); - let resources: string[] = ["cursor.k", "icons.k"]; - resource_load(resources); - project_new(false); if (project_filepath == "") { From 337ab7505a441a2fcaab460dac14f877b2be16a5 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Tue, 2 Sep 2025 21:42:26 +0200 Subject: [PATCH 2/5] ios file picker fixes --- base/sources/backends/ios_file_dialog.m | 10 +++++++--- base/sources/backends/ios_system.m | 25 +++++++++++-------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/base/sources/backends/ios_file_dialog.m b/base/sources/backends/ios_file_dialog.m index d67b98b0..dd73ac9e 100644 --- a/base/sources/backends/ios_file_dialog.m +++ b/base/sources/backends/ios_file_dialog.m @@ -2,11 +2,15 @@ #import +static UIDocumentPickerViewController *documentPicker = nil; + void IOSFileDialogOpen() { UIViewController *myViewController = [UIApplication sharedApplication].keyWindow.rootViewController; - UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:UIDocumentPickerModeOpen]; - documentPicker.delegate = myViewController; - documentPicker.modalPresentationStyle = UIModalPresentationFormSheet; + if (documentPicker == nil) { + documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:UIDocumentPickerModeOpen]; + documentPicker.delegate = myViewController; + documentPicker.modalPresentationStyle = UIModalPresentationFormSheet; + } [myViewController presentViewController:documentPicker animated:YES completion:nil]; } diff --git a/base/sources/backends/ios_system.m b/base/sources/backends/ios_system.m index e0107c5c..82502001 100644 --- a/base/sources/backends/ios_system.m +++ b/base/sources/backends/ios_system.m @@ -495,13 +495,10 @@ void importFile(NSURL *url) { iron_internal_drop_files_callback(wpath); } -- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url { - // wchar_t *filePath = (wchar_t *)[url.path cStringUsingEncoding:NSUTF32LittleEndianStringEncoding]; - // CFURLRef cfurl = (__bridge CFURLRef)url; - // CFURLStartAccessingSecurityScopedResource(cfurl); - // iron_internal_drop_files_callback(filePath); - // CFURLStopAccessingSecurityScopedResource(cfurl); - importFile(url); +- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray *)urls { + for (NSURL *url in urls) { + importFile(url); + } } - (void)dropInteraction:(UIDropInteraction *)interaction performDrop:(id)session { @@ -522,7 +519,7 @@ void importFile(NSURL *url) { } - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures { - return UIRectEdgeAll; + return UIRectEdgeAll; } @end @@ -544,9 +541,9 @@ void importFile(NSURL *url) { #endif UIWindowScene *windowScene = (UIWindowScene *)scene; - self.window = [[UIWindow alloc] initWithWindowScene:windowScene]; + self.window = [[UIWindow alloc] initWithWindowScene:windowScene]; self.window.frame = windowScene.coordinateSpace.bounds; - [self.window setBackgroundColor:[UIColor blackColor]]; + [self.window setBackgroundColor:[UIColor blackColor]]; my_view_controller = [[MyViewController alloc] init]; my_view_controller.view.multipleTouchEnabled = YES; @@ -561,19 +558,19 @@ void importFile(NSURL *url) { } - (void)sceneDidBecomeActive:(UIScene *)scene { - iron_internal_resume_callback(); + iron_internal_resume_callback(); } - (void)sceneWillResignActive:(UIScene *)scene { - iron_internal_pause_callback(); + iron_internal_pause_callback(); } - (void)sceneWillEnterForeground:(UIScene *)scene { - iron_internal_foreground_callback(); + iron_internal_foreground_callback(); } - (void)sceneDidEnterBackground:(UIScene *)scene { - iron_internal_background_callback(); + iron_internal_background_callback(); } @end From 76d9aecb9b8f3f070b9c5ed484c22ef8a3c1a8c2 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Tue, 2 Sep 2025 22:34:26 +0200 Subject: [PATCH 3/5] ios fixes --- base/project.js | 21 +++++++++++++-------- base/tools/make.js | 9 ++------- paint/icon_ios.png | Bin 0 -> 3637 bytes 3 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 paint/icon_ios.png diff --git a/base/project.js b/base/project.js index 19a6f688..27f5d63f 100644 --- a/base/project.js +++ b/base/project.js @@ -19,6 +19,14 @@ function add_thread_backend(name) { project.add_define("BACKEND_THREAD_H=\"backends/" + name + "_thread.h\""); } +function get_version_code() { + const now = new Date(); + const year = now.getFullYear().toString().slice(-2); + const month = (now.getMonth() + 1).toString().padStart(2, '0'); + const day = now.getDate().toString().padStart(2, '0'); + return parseInt(year + month + day, 10); +} + // flags: make.js/load_project let flags = globalThis.flags; let dir = flags.name.substr(5).toLowerCase(); // ArmorPaint -> paint @@ -94,6 +102,8 @@ else if (platform == "ios") { project.add_cfiles("sources/backends/data/ios.plist"); project.add_cfiles("sources/backends/ios_file_dialog.m"); project.add_define("IRON_METAL"); + project.target_options.ios.build = get_version_code() + ""; + project.target_options.ios.version = get_version_code() + ""; } else if (platform == "android") { add_sys_backend("android"); @@ -113,19 +123,11 @@ else if (platform == "android") { if (flags.with_audio) { project.add_lib("OpenSLES"); } - project.target_options.android.package = flags.package; project.target_options.android.permissions = ["android.permission.READ_MEDIA_IMAGES", "android.permission.INTERNET"]; project.target_options.android.screenOrientation = ["sensorLandscape"]; project.target_options.android.minSdkVersion = 33; // android 13 project.target_options.android.targetSdkVersion = 36; - function get_version_code() { - const now = new Date(); - const year = now.getFullYear().toString().slice(-2); - const month = (now.getMonth() + 1).toString().padStart(2, '0'); - const day = now.getDate().toString().padStart(2, '0'); - return parseInt(year + month + day, 10); - } project.target_options.android.versionCode = get_version_code(); project.target_options.android.versionName = "1.0 alpha"; } @@ -238,6 +240,9 @@ if (fs_exists(os_cwd() + "/icon.png")) { if (platform == "macos" && fs_exists(os_cwd() + "/icon_macos.png")) { project.icon = "icon_macos.png"; } + else if (platform == "ios" && fs_exists(os_cwd() + "/icon_ios.png")) { + project.icon = "icon_ios.png"; + } else if (platform == "linux") { project.add_assets("../" + dir + "/icon.png", { destination: "{name}", noprocessing: true, noembed: true }); } diff --git a/base/tools/make.js b/base/tools/make.js index 3fd86f62..ecd40868 100644 --- a/base/tools/make.js +++ b/base/tools/make.js @@ -1100,7 +1100,7 @@ class XCodeExporter extends Exporter { frameworks.push(new Framework(lib)); } let target_options = { - bundle: 'org.$(PRODUCT_NAME)', + bundle: 'org.armory3d.' + project.getName().toLowerCase(), version: "1.0", build: "1", organizationName: "Armory3D", @@ -1108,16 +1108,10 @@ class XCodeExporter extends Exporter { }; if (project.target_options && project.target_options.ios) { let userOptions = project.target_options.ios; - if (userOptions.bundle) - target_options.bundle = userOptions.bundle; if (userOptions.version) target_options.version = userOptions.version; if (userOptions.build) target_options.build = userOptions.build; - if (userOptions.organizationName) - target_options.organizationName = userOptions.organizationName; - if (userOptions.developmentTeam) - target_options.developmentTeam = userOptions.developmentTeam; } let projectId = new_path_id("_projectId"); let appFileId = new_path_id("_appFileId"); @@ -2779,6 +2773,7 @@ class Project { this.includes = []; this.target_options = { android: {}, + ios: {} }; this.executable_name = null; this.sources = []; diff --git a/paint/icon_ios.png b/paint/icon_ios.png new file mode 100644 index 0000000000000000000000000000000000000000..e1efda610c16e2bddaad5b3cc405dd71601e3852 GIT binary patch literal 3637 zcmc&%c|26>8$WY0mT|3FLZ1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J_0C=C6MHG^CaW>|W=GctRj$25&(Y7= zCCBRWVODR2mc;HVWsQ{=dCZjR+0nc!H)AAc<|GH>_-O=NdH)^*;+JglNz|{BEjyLE zOP`aQ5bbplhgxfi8KIg+{i~KDUM9gxKAs5v#aB}ZIWbhsjJ^Z&lH{I5&Yx}?U?Kx%hI@j>+J2RIyYv2C&mO!*HzHQImx literal 0 HcmV?d00001 From e09f4208338d4bf85e0ac8367bb2fff73c939241 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 3 Sep 2025 10:59:09 +0200 Subject: [PATCH 4/5] Fix show_envmap --- paint/sources/import_envmap.ts | 1 + paint/sources/ui_menubar.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/paint/sources/import_envmap.ts b/paint/sources/import_envmap.ts index 912a7fad..f35adc63 100644 --- a/paint/sources/import_envmap.ts +++ b/paint/sources/import_envmap.ts @@ -57,6 +57,7 @@ function import_envmap_run(path: string, image: gpu_texture_t) { scene_world._.radiance = import_envmap_radiance; scene_world._.radiance_mipmaps = import_envmap_mips; context_raw.saved_envmap = image; + context_raw.show_envmap = true; if (context_raw.show_envmap_blur) { scene_world._.envmap = scene_world._.radiance_mipmaps[0]; } diff --git a/paint/sources/ui_menubar.ts b/paint/sources/ui_menubar.ts index d9293a8e..7c3b51c7 100644 --- a/paint/sources/ui_menubar.ts +++ b/paint/sources/ui_menubar.ts @@ -341,6 +341,7 @@ function ui_menubar_draw_category_items() { context_raw.ddirty = 2; } + context_raw.show_envmap_handle.selected = context_raw.show_envmap; context_raw.show_envmap = ui_check(context_raw.show_envmap_handle, " " + tr("Envmap")); if (context_raw.show_envmap_handle.changed) { context_load_envmap(); From 1c38533bb4d3774087a56db1e7c2b94caa34216a Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 3 Sep 2025 11:23:17 +0200 Subject: [PATCH 5/5] Show downloading info --- paint/sources/import_asset.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paint/sources/import_asset.ts b/paint/sources/import_asset.ts index 3cbac2b5..c61337b8 100644 --- a/paint/sources/import_asset.ts +++ b/paint/sources/import_asset.ts @@ -8,8 +8,10 @@ let _import_asset_done: ()=>void; function import_asset_run(path: string, drop_x: f32 = -1.0, drop_y: f32 = -1.0, show_box: bool = true, hdr_as_envmap: bool = true, done: ()=>void = null) { if (starts_with(path, "cloud")) { - ///if (arm_android || arm_ios) + ///if arm_android console_toast(tr("Downloading")); + ///else + console_info(tr("Downloading")); ///end _import_asset_drop_x = drop_x;