Apply export bonus when using options menu

Also applies the bonus before saving the game instead of after
This commit is contained in:
Martin Fournier 2022-01-07 09:03:04 -05:00
parent 3562671772
commit b9ad1d3082

@ -389,7 +389,11 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
<GameOptionsRoot <GameOptionsRoot
player={player} player={player}
save={() => saveObject.saveGame()} save={() => saveObject.saveGame()}
export={() => saveObject.exportGame()} export={() => {
// Apply the export bonus before saving the game
onExport(player);
saveObject.exportGame()
}}
forceKill={killAllScripts} forceKill={killAllScripts}
softReset={() => { softReset={() => {
dialogBoxCreate("Soft Reset!"); dialogBoxCreate("Soft Reset!");
@ -400,8 +404,9 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
) : page === Page.Augmentations ? ( ) : page === Page.Augmentations ? (
<AugmentationsRoot <AugmentationsRoot
exportGameFn={() => { exportGameFn={() => {
saveObject.exportGame(); // Apply the export bonus before saving the game
onExport(player); onExport(player);
saveObject.exportGame();
}} }}
installAugmentationsFn={() => { installAugmentationsFn={() => {
installAugmentations(); installAugmentations();