Skip to content

Commit 251f60b

Browse files
authored
Add missing LuaDoc to all functions and improve assertions messages (#33)
1 parent d290c5e commit 251f60b

File tree

6 files changed

+189
-267
lines changed

6 files changed

+189
-267
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ And it's also a good idea to upload a demo build of YaGames to your game's draft
280280
| `ysdk.screen.fullscreen.status` | `yagames.screen_fullscreen_status()`<br>Returns `"on"` or `"off"` |
281281
| `ysdk.screen.fullscreen.request()` | `yagames.screen_fullscreen_request([callback])` |
282282
| `ysdk.screen.fullscreen.exit()` | `yagames.screen_fullscreen_exit([callback])` |
283+
| **Shortcuts** [(docs)](https://yandex.ru/dev/games/doc/ru/sdk/sdk-shortcut) | |
284+
| `ysdk.shortcut.canShowPrompt()` | `yagames.shortcut_can_show_prompt(callback)`<br>The callback result is a table `{ canShow = boolean }` |
285+
| `ysdk.shortcut.showPrompt()` | `yagames.shortcut_show_prompt(callback)`<br>The callback result is a table `{ outcome = "string" }` |
283286
| **Safe Storage** [(docs)](https://yandex.ru/dev/games/doc/en/sdk/sdk-player#progress-loss) | *Note: `key` and `value` should be valid UTF-8 strings. Storing strings with zero bytes aren't supported.* |
284287
| `ysdk.getStorage()` | `yagames.storage_init(callback)` |
285288
| - `safeStorage.getItem(key)` | `yagames.storage_get_item(key)`<br>Returns that key's value or `nil`. |

game.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ high_dpi = 1
1111

1212
[project]
1313
title = yagames
14-
version = 0.15.0
14+
version = 0.16.0
1515
developer = Indiesoft LLC
1616
bundle_resources = example/bundle/
17-
dependencies#0 = https://github.com/subsoap/defos/archive/v2.5.0.zip
17+
dependencies#0 = https://github.com/subsoap/defos/archive/v2.8.1.zip
1818
dependencies#1 = https://github.com/Insality/druid/archive/0.6.0.zip
1919
dependencies#2 = https://github.com/britzl/ludobits/archive/7.1.0.zip
2020

yagames/helpers/mock.lua

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -617,27 +617,6 @@ function M.get_flags(cb_id, options)
617617
M.send(cb_id, NO_ERR, rxi_json.encode(result))
618618
end
619619

620-
--- DEPRECATED
621-
function M.banner_init(cb_id)
622-
M.send(cb_id, "Error loading SDK.")
623-
end
624-
625-
--- DEPRECATED
626-
function M.banner_create(rtb_id, options, cb_id)
627-
end
628-
629-
--- DEPRECATED
630-
function M.banner_refresh(rtb_id, cb_id)
631-
end
632-
633-
--- DEPRECATED
634-
function M.banner_destroy(rtb_id)
635-
end
636-
637-
--- DEPRECATED
638-
function M.banner_set(rtb_id, property, value)
639-
end
640-
641620
return {
642621
enable = function()
643622
if not yagames_private then

yagames/lib/web/lib_yagames.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -965,12 +965,7 @@ var LibYaGamesPrivate = {
965965
} catch (err) {
966966

967967
}
968-
},
969-
970-
YaGamesPrivate_Banner_Init: function (cb_id) {
971-
var self = YaGamesPrivate;
972-
self.delaySend(cb_id, "DEPRECATED.");
973-
},
968+
}
974969
};
975970

976971
autoAddDeps(LibYaGamesPrivate, "$YaGamesPrivate");

yagames/src/main.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ extern "C"
8181
void YaGamesPrivate_Event_Dispatch(const char* cevent_name);
8282
void YaGamesPrivate_Event_On(const char* cevent_name, const int cb_id);
8383
void YaGamesPrivate_GetFlags(const int cb_id, const char* coptions);
84-
void YaGamesPrivate_Banner_Init(const int cb_id);
8584
}
8685

8786
struct YaGamesPrivateListener
@@ -848,37 +847,6 @@ static int GetFlags(lua_State* L)
848847
return 0;
849848
}
850849

851-
//
852-
// DEPRECATED
853-
// Banner Ads API
854-
//
855-
856-
static int Banner_Init(lua_State* L)
857-
{
858-
YaGamesPrivate_Banner_Init(luaL_checkint(L, 1));
859-
return 0;
860-
}
861-
862-
static int Banner_Create(lua_State* L)
863-
{
864-
return 0;
865-
}
866-
867-
static int Banner_Destroy(lua_State* L)
868-
{
869-
return 0;
870-
}
871-
872-
static int Banner_Refresh(lua_State* L)
873-
{
874-
return 0;
875-
}
876-
877-
static int Banner_Set(lua_State* L)
878-
{
879-
return 0;
880-
}
881-
882850
//
883851
//
884852
//
@@ -965,13 +933,6 @@ static const luaL_reg Module_methods[] = {
965933
{ "event_on", Event_On },
966934
// - Config
967935
{ "get_flags", GetFlags },
968-
// DEPRECATED
969-
// - Banner Ads
970-
{ "banner_init", Banner_Init },
971-
{ "banner_create", Banner_Create },
972-
{ "banner_destroy", Banner_Destroy },
973-
{ "banner_refresh", Banner_Refresh },
974-
{ "banner_set", Banner_Set },
975936
{ 0, 0 }
976937
};
977938

0 commit comments

Comments
 (0)