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

Steam Overlay not working at all #97

Closed
dfabulich opened this issue Jun 8, 2023 · 7 comments
Closed

Steam Overlay not working at all #97

dfabulich opened this issue Jun 8, 2023 · 7 comments

Comments

@dfabulich
Copy link
Contributor

dfabulich commented Jun 8, 2023

To reproduce:

  1. On Windows, clone the steamworks.js github, launch Steam, and login.

  2. npm install

  3. npm run build

  4. cd test

  5. cd electron

  6. npm install

  7. npm start. The Electron app will open, and display your Steam display name.

    But it will not show the Steam Overlay hint, which normally looks like this:

  8. Try pressing Shift-Tab. Nothing happens; no overlay appears.

  9. Edit index.html and add this button on line 14, right before the <script> tag:

<button id="activateOverlay">activate overlay</button>
  1. In renderer.js, add this code to the end:
document.getElementById('activateOverlay').addEventListener('click', function() {
    console.log('clicked');
    client.overlay.activateToWebPage('https://www.example.com/')
    console.log('done');
})
  1. Quit and reopen the Electron app, toggle Dev Tools open, and click the "activate overlay" button.

Expected: The overlay should appear immediately at launch with the Shift-Tab hint, and it should fully activate the overlay when you click the "activate overlay" button.

Actual: No overlay appears at all. The Dev Tools console shows log entries, "clicked," and "done" but it doesn't show the overlay.

I've tested this on:

  • Windows 11 x64
  • Ubuntu 22 x64
  • macOS 13 Ventura on aarch64 M1 Apple Silicon

It's hard to be 100% sure, but I've never seen the overlay work; I don't think it ever has worked.

See also #50 and #94. I see your comment #50 (comment) that "it works very well on Linux and Windows," but I've never seen it working on any platform.

@dfabulich
Copy link
Contributor Author

I guess I bear some responsibility for this with #96, but I think that PR just revealed the error.

(And, uh, truth be told, I filed the PR without testing it myself, which is my bad.)

@dfabulich
Copy link
Contributor Author

An easier way to test the overlay is to check out my PR branch in #98, then just click the "activate overlay" button.

@ceifa
Copy link
Owner

ceifa commented Jun 13, 2023

Hey, can you try build the electron project and add the binary on your library as a non steam game?

Launching from the steam library always worked for me.

@saintflow47
Copy link

saintflow47 commented Jun 20, 2023

Hey Guys, thanks for all your efforts in this project, it is appreciated a lot!
Sadly, I am in the same boat and cant seem to get the overlay to work up to now. I do have the new Steam installed maybe that changed up things somewhere.
I tried both, electron start and packing the electron app and then adding it as a non steam game to steam and running it like that. steamworks.js initializes, my friends list shows me ingame, but no overlay to be found. I will be happy to further test things if you need any specific things tested ceifa!

Addendum:
It did not matter if i set contextIsolation to false or true (i would like to use true to be able to utilize the contextBridge for secure communication between render process and electron process)
Addendum 2:
I wasnt sure if the latest commit is already part of the npm package so i built the steamworks.js source for windows and tried it with that, but it did not make any difference sadly.
Addendum 3:
It was my bad. Apparently I dont understand why having require('steamworks.js').electronEnableSteamOverlay() at the end of my index.ts and not at any other point after (thats what i thought at least) the window had been created and steamworks initialised is so important. moving it to the end fixed it. I did make one observation: With the new client, the small initial steam initialized window does not appear, even though opening the overlay afterwards works. with the old client, both work!

@dfabulich
Copy link
Contributor Author

Intriguingly, I'm able to get it to work now, without launching the game from the Steam library, but only on the new client. (I don't know how to revert to the old client to check it.)

I'm going to close this out; I recommend merging #98 to hopefully minimize confusion for other users.

@dfabulich
Copy link
Contributor Author

I should point out that (at least in the new client) I still did not / do not see the Steam Overlay "hint" ("Press Shift-Tab to begin"), but that's perfectly OK by me, because I never really wanted that thing to show up.

@saintflow47
Copy link

I should point out that (at least in the new client) I still did not / do not see the Steam Overlay "hint" ("Press Shift-Tab to begin"), but that's perfectly OK by me, because I never really wanted that thing to show up.

If the hint at the beginning does not show for you, there might be a bigger issue with your setup. I had that as well plus that i needed to launch the game through steam for the overlay to show. The Microtransaction Overlay trigger (and maybe other things you might need) did not work like that. The solution to my issue was, in the end, very simple:

I needed to steamworks.init() at the top of my index.ts(main.js) file and steamworks.electronEnableSteamOverlay() at the bottom of that same file. If i didn't obey those two rules, things started to not work in certain places.

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

No branches or pull requests

3 participants