From 4866c48e9d99581cce4a64dc715be43f785c8660 Mon Sep 17 00:00:00 2001 From: Anatoly Kulagin Date: Tue, 14 Oct 2025 21:21:44 +0200 Subject: [PATCH 1/6] feat: add one key support in get_data get_stats methods --- addons/webbus/webbus.gd | 26 +++++++++++++++++++------- mkdocs/docs/usage/user_data.md | 16 +++++++++++----- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/addons/webbus/webbus.gd b/addons/webbus/webbus.gd index 29f3372..0f80116 100644 --- a/addons/webbus/webbus.gd +++ b/addons/webbus/webbus.gd @@ -1,7 +1,7 @@ extends Node ## Singlton class[br] ## [br] -## Docs: [url]https://github.com/talkafk/WebBus[/url] +## Docs: [url]https://talkafk.github.io/WebBus[/url] signal inited @@ -591,17 +591,23 @@ var _callback_getting_data_error := JavaScriptBridge.create_callback(func(args): _getted_data.emit({}) ) -func get_data(keys:Array) -> Dictionary: +func get_data(keys:Variant) -> Dictionary: + var keys_array:Array + if keys is Array: + keys_array = keys + else: + keys_array = [keys] + var result := {} if OS.get_name() == "Web": match platform: Platform.YANDEX: - var _data:JavaScriptObject = tools.to_js(keys) + var _data:JavaScriptObject = tools.to_js(keys_array) js_player.getData(_data).then(_callback_getting_data).catch(_callback_getting_data_error) result = await _getted_data return result Platform.CRAZY: - for k in keys: + for k in keys_array: result[k] = CrazySDK.data.getItem(k) return result _: @@ -633,17 +639,23 @@ var _callback_getting_stats_error := JavaScriptBridge.create_callback(func(args) _getted_stats.emit({}) ) -func get_stats(keys:Array) -> Dictionary: +func get_stats(keys:Variant) -> Dictionary: + var keys_array:Array + if keys is Array: + keys_array = keys + else: + keys_array = [keys] + var result := {} if OS.get_name() == "Web": match platform: Platform.YANDEX: - var _data:JavaScriptObject = tools.to_js(keys) + var _data:JavaScriptObject = tools.to_js(keys_array) js_player.getStats(_data).then(_callback_getting_stats).catch(_callback_getting_stats_error) result = await _getted_stats return result Platform.CRAZY: - for k in keys: + for k in keys_array: result[k] = CrazySDK.data.getItem(k) return result _: diff --git a/mkdocs/docs/usage/user_data.md b/mkdocs/docs/usage/user_data.md index 21989da..f79c762 100644 --- a/mkdocs/docs/usage/user_data.md +++ b/mkdocs/docs/usage/user_data.md @@ -17,9 +17,12 @@ WebBus.set_data(data) Getting data: ```gdscript -var keys:Array = ["Key"] -var result = await WebBus.get_data(keys) +var result = await WebBus.get_data("Key") # One key print(result) # {"Key": "Value"} + +var result = await WebBus.get_data(["Key1", "Key2"]) # Several keys +print(result) # {"Key1": "Value1", "Key2": "Value2"} + ``` !!! NOTE @@ -37,7 +40,10 @@ WebBus.set_stats(data) Getting stats: ```gdscript -var keys:Array = ["Key"] -var result = await WebBus.get_stats(keys) -print(result) # {"Key": 12345.0} +var result = await WebBus.get_stats("Key") # One key +print(result) # {"Key": 1234.5} + +var result = await WebBus.get_stats(["Key1", "Key2"]) # Several keys +print(result) # {"Key1": 1234.5, "Key2": 5432.1} + ``` From 726d73fed901aa2764ba2796aba8a26df7bca45b Mon Sep 17 00:00:00 2001 From: Anatoly Kulagin Date: Tue, 14 Oct 2025 22:11:16 +0200 Subject: [PATCH 2/6] fix: correct formatting and improve clarity in documentation --- README.md | 2 +- mkdocs/docs/quick_start.md | 6 +++++- mkdocs/docs/usage/system_info.md | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9ae7243..3f9ba57 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The plugin is designed to simplify the development of HTML5 games and applicatio 1. Download the plugin as a ZIP archive. 2. Extract the ZIP archive and move the `addons/` folder it contains into your project folder. - > Also you can install the plugin from [Asset Library](https://godotengine.org/asset-library/asset/2841). + > You can also install the plugin from the [Asset Library](https://godotengine.org/asset-library/asset/2841). 3. Enable the plugin in **Project > Project Settings > Plugins**. diff --git a/mkdocs/docs/quick_start.md b/mkdocs/docs/quick_start.md index 65badd0..b738239 100644 --- a/mkdocs/docs/quick_start.md +++ b/mkdocs/docs/quick_start.md @@ -3,6 +3,10 @@ 1. Download the plugin as a ZIP archive. 2. Extract the ZIP archive and move the `addons/` folder it contains into your project folder. + +!!! Note + You can also install the plugin from the [Asset Library](https://godotengine.org/asset-library/asset/2841). + 3. Enable the plugin in **Project > Project Settings > Plugins**. ## Initialization @@ -22,7 +26,7 @@ func _ready() -> void: ``` ## Call methods -Call any WebBus method +Call any methods through the `WebBus` singleton. ```gdscript WebBus.show_ad() diff --git a/mkdocs/docs/usage/system_info.md b/mkdocs/docs/usage/system_info.md index ba48d8a..29854df 100644 --- a/mkdocs/docs/usage/system_info.md +++ b/mkdocs/docs/usage/system_info.md @@ -2,7 +2,7 @@ ## Platform Getting name of platform: -The function returns a `String`. Possible values are: "yandex", "crazy_games", "poki" +The function returns a `String`. Possible values are: `yandex`, `crazy_games`, `poki`, `vk`. | Platform | Supported | |-------------------|-----------| @@ -18,7 +18,7 @@ var platform_name = WebBus.get_platform() Getting type of device: -The function returns a `String`, possible values: "desktop", "tablet", "mobile". +The function returns a `String`, possible values: `desktop`, `tablet`, `mobile`. | Platform | Supported | |-------------------|-----------| From 165224e7a1aec11176b85dead639d39e27aaffda Mon Sep 17 00:00:00 2001 From: Anatoly Kulagin Date: Tue, 14 Oct 2025 22:30:30 +0200 Subject: [PATCH 3/6] fix: get_platform method fixed --- addons/webbus/webbus.gd | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/addons/webbus/webbus.gd b/addons/webbus/webbus.gd index 0f80116..def91e2 100644 --- a/addons/webbus/webbus.gd +++ b/addons/webbus/webbus.gd @@ -846,17 +846,8 @@ func start_loading() -> void: func get_platform() -> String: if OS.get_name() == "Web": - match platform: - Platform.YANDEX: - return "yandex" - Platform.CRAZY: - return "crazy_games" - Platform.GAMEDISTRIBUTION: - return "game_distribution" - Platform.POKI: - return "poki" - _: - return "unknown" + if !system_info.is_empty(): + return system_info.get("platform", "unknown") return "unknown" @@ -864,7 +855,6 @@ func get_language() -> String: if OS.get_name() == "Web": if !system_info.is_empty(): return system_info.get("language", "unknown") - return "unknown" return "unknown" @@ -872,7 +862,6 @@ func get_type_device() -> String: if OS.get_name() == "Web": if !system_info.is_empty(): return system_info.get("device_type", "unknown") - return "unknown" return "unknown" #endregion From 86d50b1fc7804fab0b8fb876e580218bd5e2f00d Mon Sep 17 00:00:00 2001 From: Anatoly Kulagin Date: Wed, 15 Oct 2025 16:03:34 +0200 Subject: [PATCH 4/6] feat: add storage data for vk --- README.md | 28 +++++++-------- addons/webbus/tools/tools.gd | 10 +++--- addons/webbus/webbus.gd | 65 ++++++++++++++++++++++++++-------- mkdocs/docs/index.md | 2 +- mkdocs/docs/usage/user_data.md | 13 +++---- mkdocs/docs/usage/user_info.md | 10 +++--- 6 files changed, 83 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 3f9ba57..870ce85 100644 --- a/README.md +++ b/README.md @@ -18,20 +18,20 @@ The plugin is designed to simplify the development of HTML5 games and applicatio ## Short list of features -| Feature | Crazy Games | Yandex Games | Poki | VK | -|--------------------|:-----------:|:------------:|:-------:|:------:| -| Fullscreen Advertisement | ✅ | ✅ | ✅ | ✅ | -| Rewarded Advertisement | ✅ | ✅ | ✅ | ✅ | -| Banner Advertisement | ✅ | ✅ | ❌ | ✅ | -| User Info | ✅ | ✅ | ❌ | ✅ | -| Authentication | ✅ | ✅ | ❌ | ✍️ | -| User Data | ✅ | ✅ | ❌ | ✍️ | -| Leaderboards | ❌ | ✅ | ❌ | ✍️ | -| Payments | ❌ | ✅ | ❌ | ✍️ | -| Invite Links | ✅ | ❌ | ✅ | ❌ | -| Invite Button | ✅ | ❌ | ❌ | ❌ | -| Server time | ❌ | ✅ | ❌ | ❌ | -| Desktop shortcut | ❌ | ✅ | ❌ | ✍️ | +| Feature | Crazy Games | Yandex Games | Poki | VK | +|------------------------------|:-----------:|:------------:|:-------:|:---------:| +| Fullscreen Advertisement | ✅ | ✅ | ✅ | ✅ | +| Rewarded Advertisement | ✅ | ✅ | ✅ | ✅ | +| Banner Advertisement | ✅ | ✅ | ❌ | ✅ | +| User Info | ✅ | ✅ | ❌ | ✅ | +| Authentication | ✅ | ✅ | ❌ | ✍️ | +| User Data | ✅ | ✅ | ❌ | ✅ | +| Leaderboards | ❌ | ✅ | ❌ | ✍️ | +| Payments | ❌ | ✅ | ❌ | ✍️ | +| Invite Links | ✅ | ❌ | ✅ | ❌ | +| Invite Button | ✅ | ❌ | ❌ | ❌ | +| Server time | ❌ | ✅ | ❌ | ❌ | +| Desktop shortcut | ❌ | ✅ | ❌ | ✍️ | ## Installation diff --git a/addons/webbus/tools/tools.gd b/addons/webbus/tools/tools.gd index 2b76d98..2898d6a 100644 --- a/addons/webbus/tools/tools.gd +++ b/addons/webbus/tools/tools.gd @@ -53,7 +53,7 @@ func get_language_by_code(code:String) -> String: class VKRequest: var callback:Callable - var configs:Dictionary + var params:Dictionary var event:String var tools := WebBusTools.new() @@ -67,8 +67,8 @@ class VKRequest: var send_callback := JavaScriptBridge.create_callback(func(args): if args[0]: - if configs: - var _conf := tools.to_js(configs) + if params: + var _conf := tools.to_js(params) WebBus.vkBridge.send(event, _conf).then(result_callback) else: WebBus.vkBridge.send(event).then(result_callback) @@ -76,9 +76,9 @@ class VKRequest: push_error("Error vk request") ) - func send(_event:String, _configs:Dictionary={}, _callback:Callable=_callback_pass): + func send(_event:String, _params:Dictionary={}, _callback:Callable=_callback_pass): if OS.get_name() == "Web" and WebBus.platform == WebBus.Platform.VK: - configs = _configs + params = _params callback = _callback event = _event WebBus.vkBridge.supportsAsync(event).then(send_callback) diff --git a/addons/webbus/webbus.gd b/addons/webbus/webbus.gd index def91e2..10791fb 100644 --- a/addons/webbus/webbus.gd +++ b/addons/webbus/webbus.gd @@ -165,6 +165,7 @@ func _ready() -> void: is_init = true inited.emit() +signal _getted_info func _get_info() -> void: var lang:String @@ -181,6 +182,17 @@ func _get_info() -> void: var c_code :String = CrazySDK.user.systemInfo.countryCode lang = tools.get_language_by_code(c_code) type = CrazySDK.user.systemInfo.device.type + Platform.VK: + while not vkBridge: + await _SDK_inited + var _callback := JavaScriptBridge.create_callback(func(args): + var res = args[0] + lang = res.vk_language + type = res.vk_platform + _getted_info.emit() + ) + vkBridge.send("VKWebAppGetLaunchParams").then(_callback) + await _getted_info _: lang = "unknown" type = "unknown" @@ -451,9 +463,9 @@ func hide_banner() -> void: push_warning("Platform not supported") return #endregion -#region game - +#region Game + func start_gameplay(): match platform: Platform.YANDEX: @@ -527,6 +539,7 @@ func ready(): #endregion #region Data + signal _auth(success:bool) var _callback_auth_dialog := JavaScriptBridge.create_callback(func(args): @@ -576,19 +589,25 @@ func set_data(data:Dictionary) -> void: Platform.CRAZY: for k in data: CrazySDK.data.setItem(k, data[k]) + Platform.VK: + var _data := JavaScriptBridge.create_object("Object") + for k in data: + _data.key = k + _data.value = data[k] + vkBridge.send("VKWebAppStorageSet", _data) _: push_warning("Platform not supported") -signal _getted_data +signal data_received var _callback_getting_data := JavaScriptBridge.create_callback(func(args): - _getted_data.emit(tools.js_to_dict(args[0], false)) + data_received.emit(tools.js_to_dict(args[0], false)) ) var _callback_getting_data_error := JavaScriptBridge.create_callback(func(args): push_error("WebBus error:", tools.js_to_dict(args[0])) - _getted_data.emit({}) + data_received.emit({}) ) func get_data(keys:Variant) -> Dictionary: @@ -604,13 +623,25 @@ func get_data(keys:Variant) -> Dictionary: Platform.YANDEX: var _data:JavaScriptObject = tools.to_js(keys_array) js_player.getData(_data).then(_callback_getting_data).catch(_callback_getting_data_error) - result = await _getted_data + result = await data_received return result Platform.CRAZY: for k in keys_array: result[k] = CrazySDK.data.getItem(k) + data_received.emit(result) + return result + Platform.VK: + var req := tools.VKRequest.new() + var conf := {} + var _result:Dictionary + conf["keys"] = keys_array + req.send("VKWebAppStorageGet", conf, func(args): data_received.emit(args)) + _result = await data_received + for key_value in _result["keys"]: + result[key_value.key] = key_value.value return result _: + data_received.emit(result) push_warning("Platform not supported") return result @@ -624,19 +655,21 @@ func set_stats(data:Dictionary) -> void: Platform.CRAZY: for k in data: CrazySDK.data.setItem(k, data[k]) + Platform.VK: + set_data(data) _: push_warning("Platform not supported") -signal _getted_stats +signal stats_received var _callback_getting_stats := JavaScriptBridge.create_callback(func(args): - _getted_stats.emit(tools.js_to_dict(args[0], false)) + stats_received.emit(tools.js_to_dict(args[0], false)) ) var _callback_getting_stats_error := JavaScriptBridge.create_callback(func(args): push_error("WebBus error:", tools.js_to_dict(args[0])) - _getted_stats.emit({}) + stats_received.emit({}) ) func get_stats(keys:Variant) -> Dictionary: @@ -652,13 +685,17 @@ func get_stats(keys:Variant) -> Dictionary: Platform.YANDEX: var _data:JavaScriptObject = tools.to_js(keys_array) js_player.getStats(_data).then(_callback_getting_stats).catch(_callback_getting_stats_error) - result = await _getted_stats + result = await stats_received return result Platform.CRAZY: for k in keys_array: result[k] = CrazySDK.data.getItem(k) + stats_received.emit(result) return result - _: + Platform.VK: + return await get_data(keys_array) + _: + stats_received.emit(result) push_warning("Platform not supported") return result #endregion @@ -842,7 +879,7 @@ func start_loading() -> void: push_warning("Platform not supported") #endregion -#region getting data +#region System info func get_platform() -> String: if OS.get_name() == "Web": @@ -866,7 +903,7 @@ func get_type_device() -> String: #endregion -#region invite +#region Invite signal invite_link_getted(result:String) @@ -930,7 +967,7 @@ func hide_invite_button() -> void: #endregion -#region purchases +#region Purchases var payments:JavaScriptObject var _init_payments_callback := JavaScriptBridge.create_callback(func(args): diff --git a/mkdocs/docs/index.md b/mkdocs/docs/index.md index b265a12..8b47062 100644 --- a/mkdocs/docs/index.md +++ b/mkdocs/docs/index.md @@ -28,7 +28,7 @@ It allows you to build your project once and use the same build across multiple | [Rewarded Advertisement](usage/advertisement.md/#rewarded-advertisement) | ✅ | ✅ | ✅ | ✅ | | [Banner Advertisement](usage/advertisement.md/#banner-advertisement) | ✅ | ✅ | ❌ | ✅ | | [Authentication](usage/authentication.md) | ✅ | ✅ | ❌ | ✍️ | -| [User Data](usage/user_data.md) | ✅ | ✅ | ❌ | ✍️ | +| [User Data](usage/user_data.md) | ✅ | ✅ | ❌ | ✅ | | [Leaderboards](usage/leaderboards.md) | ❌ | ✅ | ❌ | ✍️ | | [Payments](usage/payments.md) | ❌ | ✅ | ❌ | ✍️ | | [Invite Links](usage/invite.md/#invite-links) | ✅ | ❌ | ✅ | ❌ | diff --git a/mkdocs/docs/usage/user_data.md b/mkdocs/docs/usage/user_data.md index f79c762..c123008 100644 --- a/mkdocs/docs/usage/user_data.md +++ b/mkdocs/docs/usage/user_data.md @@ -1,10 +1,10 @@ -| Platform | Supported | -|-------------------|-----------| -| Crazy Games | ![✔️](https://img.shields.io/badge/Supported-green) | -| Yandex Games | ![✔️](https://img.shields.io/badge/Supported-green) | +| Platform | Supported | +|-------------------|-------------------------------------------------------| +| Crazy Games | ![✔️](https://img.shields.io/badge/Supported-green) | +| Yandex Games | ![✔️](https://img.shields.io/badge/Supported-green) | | Poki | ![❌](https://img.shields.io/badge/Not_Supported-red) | -| VK | ![✍️](https://img.shields.io/badge/In_Progress-yellow) | +| VK | ![✔️](https://img.shields.io/badge/Supported-green) | Setting data: @@ -26,7 +26,7 @@ print(result) # {"Key1": "Value1", "Key2": "Value2"} ``` !!! NOTE - For CrazyGames, the functions set_stats() and get_stats() are identical to the functions set_data() and get_data(), respectively. + For CrazyGames and VK, the functions set_stats() and get_stats() are identical to the functions set_data() and get_data(), respectively. Setting stats: @@ -47,3 +47,4 @@ var result = await WebBus.get_stats(["Key1", "Key2"]) # Several keys print(result) # {"Key1": 1234.5, "Key2": 5432.1} ``` + diff --git a/mkdocs/docs/usage/user_info.md b/mkdocs/docs/usage/user_info.md index dc41a4f..4a3ce6e 100644 --- a/mkdocs/docs/usage/user_info.md +++ b/mkdocs/docs/usage/user_info.md @@ -1,10 +1,10 @@ -| Platform | Supported | -|-------------------|-----------| -| Crazy Games | ![✔️](https://img.shields.io/badge/Supported-green) | -| Yandex Games | ![✔️](https://img.shields.io/badge/Supported-green) | +| Platform | Supported | +|-------------------|-------------------------------------------------------| +| Crazy Games | ![✔️](https://img.shields.io/badge/Supported-green) | +| Yandex Games | ![✔️](https://img.shields.io/badge/Supported-green) | | Poki | ![❌](https://img.shields.io/badge/Not_Supported-red) | -| VK | ![✔️](https://img.shields.io/badge/Supported-green) | +| VK | ![✔️](https://img.shields.io/badge/Supported-green) | `user_info` dictionary contains player's username and avatar link From 4dfae2a90fa424d49963e07d232a37c334e3acd7 Mon Sep 17 00:00:00 2001 From: Anatoly Kulagin Date: Wed, 15 Oct 2025 16:09:01 +0200 Subject: [PATCH 5/6] fix: improve formatting in feature list for clarity --- mkdocs/docs/index.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mkdocs/docs/index.md b/mkdocs/docs/index.md index 8b47062..af56e32 100644 --- a/mkdocs/docs/index.md +++ b/mkdocs/docs/index.md @@ -21,17 +21,17 @@ It allows you to build your project once and use the same build across multiple ## List of features -| Feature | Crazy Games | Yandex Games | Poki | VK | -|--------------------|:-----------:|:------------:|:-------:|:------:| -| [User Info](usage/user_info.md) | ✅ | ✅ | ❌ | ✅ | -| [Fullscreen Advertisement](usage/advertisement.md/#fullscreen-advertisement) | ✅ | ✅ | ✅ | ✅ | -| [Rewarded Advertisement](usage/advertisement.md/#rewarded-advertisement) | ✅ | ✅ | ✅ | ✅ | -| [Banner Advertisement](usage/advertisement.md/#banner-advertisement) | ✅ | ✅ | ❌ | ✅ | -| [Authentication](usage/authentication.md) | ✅ | ✅ | ❌ | ✍️ | -| [User Data](usage/user_data.md) | ✅ | ✅ | ❌ | ✅ | -| [Leaderboards](usage/leaderboards.md) | ❌ | ✅ | ❌ | ✍️ | -| [Payments](usage/payments.md) | ❌ | ✅ | ❌ | ✍️ | -| [Invite Links](usage/invite.md/#invite-links) | ✅ | ❌ | ✅ | ❌ | -| [Invite Button](usage/invite.md/#invite-button) | ✅ | ❌ | ❌ | ❌ | -| [Server time](usage/server_time.md) | ❌ | ✅ | ❌ | ❌ | -| [Desktop shortcut](usage/desktop_shortcuts.md) | ❌ | ✅ | ❌ | ✍️ | \ No newline at end of file +| Feature | Crazy Games | Yandex Games | Poki | VK | +|----------------------------------------------------------------------------------|:-----------:|:------------:|:--------:|:-------:| +| [User Info](usage/user_info.md) | ✅ | ✅ | ❌ | ✅ | +| [Fullscreen Advertisement](usage/advertisement.md/#fullscreen-advertisement) | ✅ | ✅ | ✅ | ✅ | +| [Rewarded Advertisement](usage/advertisement.md/#rewarded-advertisement) | ✅ | ✅ | ✅ | ✅ | +| [Banner Advertisement](usage/advertisement.md/#banner-advertisement) | ✅ | ✅ | ❌ | ✅ | +| [Authentication](usage/authentication.md) | ✅ | ✅ | ❌ | ✍️ | +| [User Data](usage/user_data.md) | ✅ | ✅ | ❌ | ✅ | +| [Leaderboards](usage/leaderboards.md) | ❌ | ✅ | ❌ | ✍️ | +| [Payments](usage/payments.md) | ❌ | ✅ | ❌ | ✍️ | +| [Invite Links](usage/invite.md/#invite-links) | ✅ | ❌ | ✅ | ❌ | +| [Invite Button](usage/invite.md/#invite-button) | ✅ | ❌ | ❌ | ❌ | +| [Server time](usage/server_time.md) | ❌ | ✅ | ❌ | ❌ | +| [Desktop shortcut](usage/desktop_shortcuts.md) | ❌ | ✅ | ❌ | ✍️ | \ No newline at end of file From b7d058ffcbe459c5ef855cf2f409450f14044d20 Mon Sep 17 00:00:00 2001 From: Anatoly Kulagin Date: Wed, 15 Oct 2025 16:27:06 +0200 Subject: [PATCH 6/6] feat: add system info for vk --- addons/webbus/webbus.gd | 11 +++++------ mkdocs/docs/usage/system_info.md | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/webbus/webbus.gd b/addons/webbus/webbus.gd index 10791fb..5e86ab3 100644 --- a/addons/webbus/webbus.gd +++ b/addons/webbus/webbus.gd @@ -165,7 +165,7 @@ func _ready() -> void: is_init = true inited.emit() -signal _getted_info +signal _getted_info(data) func _get_info() -> void: var lang:String @@ -186,13 +186,12 @@ func _get_info() -> void: while not vkBridge: await _SDK_inited var _callback := JavaScriptBridge.create_callback(func(args): - var res = args[0] - lang = res.vk_language - type = res.vk_platform - _getted_info.emit() + _getted_info.emit(args[0]) ) vkBridge.send("VKWebAppGetLaunchParams").then(_callback) - await _getted_info + var res = await _getted_info + lang = res.vk_language + type = res.vk_platform.split("_")[0] _: lang = "unknown" type = "unknown" diff --git a/mkdocs/docs/usage/system_info.md b/mkdocs/docs/usage/system_info.md index 29854df..cf50d9f 100644 --- a/mkdocs/docs/usage/system_info.md +++ b/mkdocs/docs/usage/system_info.md @@ -25,7 +25,7 @@ The function returns a `String`, possible values: `desktop`, `tablet`, `mobile`. | Crazy Games | ![✔️](https://img.shields.io/badge/Supported-green) | | Yandex Games | ![✔️](https://img.shields.io/badge/Supported-green) | | Poki | ![❌](https://img.shields.io/badge/Not_Supported-red) | -| VK | ![✍️](https://img.shields.io/badge/In_Progress-yellow) | +| VK | ![✔️](https://img.shields.io/badge/Supported-green) | ```gdscript @@ -42,7 +42,7 @@ The function returns 2-letter language code. | Crazy Games | ![✔️](https://img.shields.io/badge/Supported-green) | | Yandex Games | ![✔️](https://img.shields.io/badge/Supported-green) | | Poki | ![❌](https://img.shields.io/badge/Not_Supported-red) | -| VK | ![✍️](https://img.shields.io/badge/In_Progress-yellow) | +| VK | ![✔️](https://img.shields.io/badge/Supported-green) | ```gdscript var language = WebBus.get_language()