Commit Graph

44 Commits

Author SHA1 Message Date
Snarling 04d49e3a6d SCRIPTS: Script modules are reused when they are imported (#461)
Also corrects some compile race conditions.
2023-04-07 00:33:51 -04:00
Snarling fb1f95c26e VARIOUS: Various changes prior to release 2.2 (#271)
See PR #271 description
2022-12-29 20:28:53 -05:00
David Walker 49f732d1ee Revert "Revert "Add keycode table and switch to event.code in select places" (#224)" (#242) 2022-12-03 22:56:42 -05:00
David Walker 70fadde222 Revert "Add keycode table and switch to event.code in select places" (#224)
Using code instead of key is strongly warned against at MDN and causes issues with nonstandard layouts:
https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event#keyboardevent.code

This also fixes ScriptEditorRoot.tsx, where some code snuck in that
wasn't using *any* of the constants.

This reverts commit 016a9a873f.
2022-11-26 08:51:09 -05:00
Snarling 88d51e9a7e MISC: A bunch of enums stuff. (#212)
* Some game enums moved to utils/enums. Others can eventually be moved there as well.
* findEnumMember function for performing fuzzy matching of player input with enum members, without needing separate fuzzy functions for every enum.
* Also used findEnumMember for safely loading save games (allows case changes in enum values)
* Changed capitalization on some enums.
* BREAKING: removed classGains work formulas function
* Split ClassType enum into UniversityClassType and GymType.
* Added universityGains and gymGains work formulas functions
* Provided the new split enums to the player on ns.enums.
2022-11-20 08:37:11 -05:00
omuretsu 9908f4aaa5 Error message fixes 2022-10-14 11:08:24 -04:00
omuretsu ad0be471ce fix ns.prompt typechecking
Introduced some new type assertion functions, initial step in larger type safety rework.
2022-10-14 11:00:29 -04:00
omuretsu 7a384d53f4 typefix netscriptFunctions (see desc)
* Types for InternalFunction and ExternalFunction have been modified to actually typecheck ns functions against docs.
* Internal functions are required to use unknown for any params on the inner function.
* Return types for internal function inner-function must match the respective external function.
* Added new typecheck assertion function for asserting dynamic object types, to allow unknownifying params that were previously hardcoded objec structures.
* Because type assertion for parameter types and return types is enforced by InternalAPI, removed all duplicate type declarations on NetscriptFunction params and returns.
2022-10-12 08:49:27 -04:00
Olivier Gagnon f6f023eeb4 Fix tons of typos 2022-10-09 01:25:31 -04:00
Snarling 068533cd2f format, lint, more enums, revert fn rename 2022-10-05 14:52:48 -04:00
Snarling aa80cf6451 See description
Reverted ToastVariant back to an enum internally. Still exposed to player as just possible strings.
Changed all 1-line documentation comments to actually be 1-line. Moved some because they were not providing documentation for the thing they were trying to.
2022-10-04 06:40:10 -04:00
Snarling 50f14b4f58 Commit1 2022-10-03 12:12:16 -04:00
Snarling b700b0246b Fix contract input handling 2022-08-02 11:11:49 -04:00
hydroflame 9e25833796 Merge pull request #3606 from RevanProdigalKnight/feature/enhanced-terminal-argument-parsing
MISC: #3596 Enhanced terminal command parsing
2022-07-21 18:36:54 -04:00
Olivier Gagnon 4bee746576 rm any 2022-07-15 01:51:30 -04:00
Olivier Gagnon c9432e4cd7 rm any 2022-07-14 21:54:49 -04:00
Olivier Gagnon ca2e22506b more lint 2022-05-25 15:40:57 -04:00
Olivier Gagnon c1650e332b lint fixes 2022-05-25 15:08:48 -04:00
hydroflame a3fe965771 Merge pull request #3572 from Undeemiss/exception-typo
MISC: Fixed typo in exceptionAlert.ts
2022-05-04 11:58:27 -04:00
RevanProdigalKnight df30771744 Add =
Adds the equal sign (`=`) for use in `src/Terminal/Parser.ts`
2022-05-04 00:47:58 -06:00
Zoë Hoekstra 016a9a873f Add keycode table and switch to event.code in select places 2022-05-03 15:59:46 +02:00
Undeemiss 138a945707 Fixed typo in exceptionAlert.ts 2022-04-27 18:45:25 -05:00
Heinous Tugboat 5b96cedd0c Adds SnackbarVariant enum 2022-04-08 23:46:19 -04:00
phyzical c681828ec1 few more event key. constant refactors 2022-03-24 23:09:24 +08:00
Olivier Gagnon 05fe14a5ed Fix some key not working 2022-03-20 23:11:26 -04:00
Master-Guy 9dd933ecee Changed .keyCode to .key for files in "src" 2022-03-18 10:43:56 +01:00
qcorradi 08314ed33e Fixed array comparison handling of NaN
Issue #2033 is fixed, not using Object.is as recommended by https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#when_to_use_object.is_versus_triple_equals
2022-01-23 20:33:32 +01:00
Olivier Gagnon 77f525c98c rm blob caching 2022-01-20 16:11:48 -05:00
theit8514 fd93c6d338 Fix linting errors 2021-12-23 23:26:05 -05:00
theit8514 8f77f720e6 Cache the blobs generated by scripts 2021-12-23 23:06:01 -05:00
Olivier Gagnon e6b263e6ec make infil reward more consistent. 2021-12-03 15:11:31 -05:00
hydroflame 70ffe25bb4 Revert "bunch of bugfixes" 2021-11-11 20:06:05 -05:00
Olivier Gagnon d91d7c564e bunch of bugfixes 2021-11-11 19:56:09 -05:00
Olivier Gagnon cf2efe7698 few bugdic 2021-11-11 17:00:36 -05:00
Olivier Gagnon 3f28b066b0 working on timestamps and make netscript function highlight more specific. 2021-11-11 10:07:16 -05:00
Olivier Gagnon 1e7da4c610 make timestamp with seconds 2021-11-10 19:50:21 -05:00
Olivier Gagnon 55d1dca7b7 Add noodle power. 2021-11-02 20:30:19 -04:00
Olivier Gagnon 97c04a1037 logbox manager, alert manager and fix bitverse colors 2021-10-01 10:39:09 -04:00
Olivier Gagnon 06f716c0fa moved a bunch of files 2021-09-25 14:42:57 -04:00
Olivier Gagnon a18bdd6afc prettify, sorry for the big ass commit 2021-09-04 19:09:30 -04:00
Olivier Gagnon 3fad505096 run auto fix lint 2021-04-29 23:52:56 -04:00
danielyxie 042f926700 Minor bugfixes with killing Netscript scripts, and cleaned up text 2019-07-15 21:40:43 -07:00
danielyxie 3241945452 Added hacknet node api functions for spending hashes. Fixed several bugs with v0.46.0. Rebalanced hash upgrades. continued working on terminal directory implementation 2019-04-05 02:08:41 -07:00
danielyxie 9879d07d7c Fixed a few minor bugs with submitting solutions for Coding Contracts. Started on Getting STarted Guide for wiki 2019-03-04 22:41:31 -08:00