Skip to content

石哥救救我 #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions external/steam_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ if((LINK_STEAM_API OR LUASTG_LINK_STEAM_API) AND (TARGET steam_api)) # LINK_STEA
binding/lua_steam_SteamAPI.inl
binding/lua_steam_SteamInput.inl
binding/lua_steam_SteamUserStats.inl
binding/lua_steam_SteamUtils.inl
binding/lua_steam_SteamFriends.inl
binding/lua_steam_SteamUGC.inl
binding/lua_steam.cpp
)
target_link_libraries(lua_steam_api PUBLIC
Expand Down
6 changes: 6 additions & 0 deletions external/steam_api/binding/lua_steam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ static void* xSteamLuaKey = nullptr;
#include "lua_steam_SteamAPI.inl"
#include "lua_steam_SteamInput.inl"
#include "lua_steam_SteamUserStats.inl"
#include "lua_steam_SteamUtils.inl"
#include "lua_steam_SteamFriends.inl"
#include "lua_steam_SteamUGC.inl"

bool lua_steam_check(uint32_t appid)
{
Expand All @@ -145,5 +148,8 @@ int lua_steam_open(lua_State* L)
xSteamAPI::xRegister(L);
xSteamInput::xRegister(L);
xSteamUserStats::xRegister(L);
xSteamUtils::xRegister(L);
xSteamFriends::xRegister(L);
xSteamUGC::xRegister(L);
return 1;
}
28 changes: 28 additions & 0 deletions external/steam_api/binding/lua_steam_SteamFriends.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

struct xSteamFriends {
static int ActivateGameOverlay(lua_State* L) {
const char* pchDialog = luaL_checkstring(L, 1);
SteamFriends()->ActivateGameOverlay(pchDialog);
return 1;
}
static int ActivateGameOverlayToWebPage(lua_State* L) {
const char* pchURL = luaL_checkstring(L, 1);
SteamFriends()->ActivateGameOverlayToWebPage(pchURL);
return 1;
}

static int xRegister(lua_State* L)
{
static const luaL_Reg lib[] = {
xfbinding(ActivateGameOverlay),
xfbinding(ActivateGameOverlayToWebPage),
{NULL, NULL},
};
lua_pushstring(L, "SteamFriends");
lua_createtable(L, 0, 3);
luaL_register(L, NULL, lib);
lua_settable(L, -3);
return 0;
};
};
Loading