Skip to content
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

Add SteamInput's SetInputActionManifestFilePath #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhulik
Copy link

@zhulik zhulik commented May 14, 2023

The method is not documented in steamworks docs. It allows one to provide SteamInput with a vdf manifest describing controller actions.

It is extremely useful when you are not a real steam developer, but still want to play with steam input on your steam deck

Usage:

if not STEAMWORKS.Input.SetInputActionManifestFilePath(ABSOLUTE_PATH_TO_VDF_FILE):
    raise InitError("cannot load vdf")

Any ways we can build it on CI? I mean can we legally use the steamworks SDK for it?

@@ -13,6 +13,7 @@
#include "TargetConditionals.h"
#define SW_PY extern "C" __attribute__ ((visibility("default")))
#elif defined( __linux__ )
#include <cstdint>
Copy link
Author

@zhulik zhulik May 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not compile on my machine without this include:

SteamworksPy.cpp:90:14: error: ‘int32_t’ in namespace ‘std’ does not name a type
   90 |         std::int32_t result;
      |              ^~~~~~~
SteamworksPy.cpp:91:14: error: ‘uint64_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
   91 |         std::uint64_t publishedFileId;
      |              ^~~~~~~~
      |              wint_t
SteamworksPy.cpp: In member function ‘void Workshop::OnItemSubscribed(RemoteStorageSubscribePublishedFileResult_t*, bool)’:
SteamworksPy.cpp:185:112: error: too many initializers for ‘SubscriptionResult’
  185 |             SubscriptionResult result{itemSubscribedResult->m_eResult, itemSubscribedResult->m_nPublishedFileId};
      |                                                                                                                ^
SteamworksPy.cpp: In member function ‘void Workshop::OnItemUnsubscribed(RemoteStorageUnsubscribePublishedFileResult_t*, bool)’:
SteamworksPy.cpp:192:116: error: too many initializers for ‘SubscriptionResult’
  192 |             SubscriptionResult result{itemUnsubscribedResult->m_eResult, itemUnsubscribedResult->m_nPublishedFileId};
      |                                                                                                                    ^
make: *** [Makefile:2: SteamworksPy.so] Error 1

I use Arch and gcc 13.1.1. Not sure about other platforms, but it feels like this header is standard and we could use it on all platforms

@philippj
Copy link
Owner

Hey @zhulik,

Adding this function is not a problem. I will have to review your makefile changes to check for cross-platform compatibility though.

CI is currently not set up as the Steamworks source files can not be re-published. At least to the last time I contacted them about it, so I will gonna push out a new release after checking everything.

Thank you for the PR!

@zhulik
Copy link
Author

zhulik commented May 14, 2023

@philippj the Makefile is linux-specific anyway, my change just asks make to only compile the so when the cpp file changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants