Skip to content

Commit

Permalink
Clarify which environments steamworks is supported in
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jul 24, 2024
1 parent ac86917 commit 4db9068
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,11 @@
"string": "Zip, combine assets into single file (not recommended)"
},
"application-win32": {
"string": "{type} Windows application (32-bit or 64-bit)",
"string": "{type} Windows application (32-bit)",
"context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'Windows'."
},
"application-win64": {
"string": "{type} Windows application (64-bit only, not recommended)",
"string": "{type} Windows application (64-bit)",
"context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'Windows'."
},
"application-win-arm": {
Expand Down Expand Up @@ -558,7 +558,7 @@
"string": "Increase max vector costume resolution to make large costumes look better. May increase memory use and cause crashes."
},
"steamworksUnavailable": {
"string": "To enable the Steamworks extension, you must use one of the Electron environments."
"string": "To enable the Steamworks extension, you must use one of these environments:"
},
"steamworksAvailable": {
"string": "This project is using the Steamworks extension. You can find your game's app ID in Steamworks. 480 is the ID of the Steamworks demo game (Spacewar)."
Expand Down
7 changes: 6 additions & 1 deletion src/p4/PackagerOptions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@
}}
>
<h2>Steamworks</h2>
{#if $options.target.startsWith('electron-')}
{#if ['electron-win64', 'electron-linux64', 'electron-mac'].includes($options.target)}
<p>{$_('options.steamworksAvailable')}</p>
<label class="option">
{$_('options.steamworksAppId')}
Expand All @@ -1037,6 +1037,11 @@
</label>
{:else}
<p>{$_('options.steamworksUnavailable')}</p>
<ul>
<li>{$_('options.application-win64').replace('{type}', 'Electron')}</li>
<li>{$_('options.application-mac').replace('{type}', 'Electron')}</li>
<li>{$_('options.application-linux64').replace('{type}', 'Electron')}</li>
</ul>
{/if}
</Section>
{/if}
Expand Down
5 changes: 4 additions & 1 deletion src/packager/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,10 @@ app.whenReady().then(() => {
const {contextBridge, ipcRenderer} = require('electron');
`;

if (this.project.analysis.usesSteamworks) {
if (
this.project.analysis.usesSteamworks &&
['electron-win64', 'electron-linux64', 'electron-mac'].includes(this.options.target)
) {
mainJS += `
const enableSteamworks = () => {
const APP_ID = +${JSON.stringify(this.options.steamworks.appId)};
Expand Down

0 comments on commit 4db9068

Please sign in to comment.