diff --git a/docs/targets/pxtarget.md b/docs/targets/pxtarget.md index 0f700e2ad3d..459d7e597bc 100644 --- a/docs/targets/pxtarget.md +++ b/docs/targets/pxtarget.md @@ -216,6 +216,7 @@ Each target has one board (plus optional parts). autoRun?: boolean; // automatically run program after a change to its code stopOnChange?: boolean; // stop execution when user changes code headless?: boolean; // whether simulator should still run while collapsed + hideSim?: boolean; // whether the simulator should be rendered // buttons and parts hideRestart?: boolean; // hide the restart button diff --git a/localtypings/pxtarget.d.ts b/localtypings/pxtarget.d.ts index d602d3a8473..09970e0bde9 100644 --- a/localtypings/pxtarget.d.ts +++ b/localtypings/pxtarget.d.ts @@ -261,6 +261,7 @@ declare namespace pxt { // instructions?: boolean; partsAspectRatio?: number; // aspect ratio of the simulator when parts are displayed headless?: boolean; // whether simulator should still run while collapsed + hideSim?: boolean; // whether simulator should be rendered trustedUrls?: string[]; // URLs that are allowed in simulator modal messages invalidatedClass?: string; // CSS class to be applied to the sim iFrame when it needs to be updated (defaults to sepia filter) stoppedClass?: string; // CSS class to be applied to the sim iFrame when it isn't running (defaults to grayscale filter) diff --git a/webapp/src/editortoolbar.tsx b/webapp/src/editortoolbar.tsx index 5a35201d8c5..22be5532b8a 100644 --- a/webapp/src/editortoolbar.tsx +++ b/webapp/src/editortoolbar.tsx @@ -186,6 +186,9 @@ export class EditorToolbar extends data.Component { pxt.tickEvent("editortools.downloadbutton", { collapsed: this.getCollapsedState() }, { interactiveConsent: true }); + if (!pxt.appTarget.compile.hasHex) { + return this.saveFile(); + } if (this.shouldShowPairingDialogOnDownload() && !pxt.packetio.isConnected() && !pxt.packetio.isConnecting() @@ -199,6 +202,9 @@ export class EditorToolbar extends data.Component { handleHardwareDebugClick, onTutorialStepChange, onTutorialComplete } = this.props; const hasSimulator = !pxt.appTarget.simulator?.headless; + const hideSimulator = pxt.appTarget.simulator?.hideSim; const showOpenInVscodeButton = parent.isJavaScriptActive() && pxt.appTarget?.appTheme?.showOpenInVscode; const simContainerClassName = `simulator-container ${this.props.tutorialSimSidebar ? "" : " hidden"}`; @@ -162,22 +163,22 @@ export class Sidepanel extends data.Component {
-
- {showHostMultiplayerGameButton &&
+ {!hideSimulator &&
} + {!hideSimulator && showHostMultiplayerGameButton &&
} - {showKeymap && } -
+ {!hideSimulator && showKeymap && } + {!hideSimulator &&
{pxt.options.debug &&
-
+
} + {!hideSimulator &&
{showOpenInVscodeButton &&
-
+
} + {!hideSimulator &&
{showHostMultiplayerGameButton &&
- {showSerialButtons &&
+
} + {!hideSimulator && showSerialButtons &&
} diff --git a/webapp/src/simtoolbar.tsx b/webapp/src/simtoolbar.tsx index 43995872341..5004b831484 100644 --- a/webapp/src/simtoolbar.tsx +++ b/webapp/src/simtoolbar.tsx @@ -119,6 +119,7 @@ export class SimulatorToolbar extends data.Component { const fullscreen = run && !simOpts.hideFullscreen && !sandbox; const audio = run && targetTheme.hasAudio; const isHeadless = simOpts.headless; + const hideSim = simOpts.hideSim; const screenshot = !!targetTheme.simScreenshot; const screenshotClass = !!parentState.screenshoting ? "loading" : ""; const debugBtnEnabled = !isStarting && !isSimulatorPending && inCodeEditor; @@ -138,7 +139,7 @@ export class SimulatorToolbar extends data.Component { const showSerialEditorSection = isFullscreen && (simSerialActive || devSerialActive); return