Merge branch 'dev' into improvement/purchase-augs-ui

This commit is contained in:
nickofolas
2022-04-25 13:35:58 -05:00
8 changed files with 49 additions and 42 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+33 -33
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -164,9 +164,9 @@ export function Roulette(props: IProps): React.ReactElement {
let playerWin = strategy.match(n); let playerWin = strategy.match(n);
// oh yeah, the house straight up cheats. Try finding the seed now! // oh yeah, the house straight up cheats. Try finding the seed now!
if (playerWin && Math.random() > 0.9) { if (playerWin && Math.random() > 0.9) {
playerWin = false; while (playerWin) {
while (strategy.match(n)) { n = Math.floor(rng.random() * 37);
n = (n + 1) % 36; playerWin = strategy.match(n);
} }
} }
if (playerWin) { if (playerWin) {
+1 -1
View File
@@ -202,7 +202,7 @@ function _getScriptUrls(script: Script, scripts: Script[], seen: Script[]): Scri
// We automatically define a print function() in the NetscriptJS module so that // We automatically define a print function() in the NetscriptJS module so that
// accidental calls to window.print() do not bring up the "print screen" dialog // accidental calls to window.print() do not bring up the "print screen" dialog
transformedCode += `\n\nfunction print() {throw new Error("Invalid call to window.print(). Did you mean to use Netscript's print()?");}\n//# sourceURL=${script.server}/${script.filename}`; transformedCode += `\n//# sourceURL=${script.server}/${script.filename}`;
const blob = URL.createObjectURL(makeScriptBlob(transformedCode)); const blob = URL.createObjectURL(makeScriptBlob(transformedCode));
// Push the blob URL onto the top of the stack. // Push the blob URL onto the top of the stack.
+1 -1
View File
@@ -2198,7 +2198,7 @@ export interface Singularity {
* RAM cost: 5 GB * 16/4/1 * RAM cost: 5 GB * 16/4/1
* *
* *
* This function will automatically install your Augmentations, resetting the game as usual. * This function will automatically install your Augmentations, resetting the game as usual. If you do not own uninstalled Augmentations then the game will not reset.
* *
* @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer. * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.
*/ */
+7
View File
@@ -4,6 +4,7 @@ import ReactDOM from "react-dom";
import { TTheme as Theme, ThemeEvents, refreshTheme } from "./Themes/ui/Theme"; import { TTheme as Theme, ThemeEvents, refreshTheme } from "./Themes/ui/Theme";
import { LoadingScreen } from "./ui/LoadingScreen"; import { LoadingScreen } from "./ui/LoadingScreen";
import { initElectron } from "./Electron"; import { initElectron } from "./Electron";
import { AlertEvents } from "./ui/React/AlertManager";
initElectron(); initElectron();
globalThis["React"] = React; globalThis["React"] = React;
globalThis["ReactDOM"] = ReactDOM; globalThis["ReactDOM"] = ReactDOM;
@@ -34,3 +35,9 @@ function rerender(): void {
return "Your work will be lost."; return "Your work will be lost.";
}; };
})(); })();
(function () {
window.print = () => {
throw new Error("You accidentally called window.print instead of ns.print");
};
})();