Commit graph

2355 commits

Author SHA1 Message Date
jberg
3559953440 remove checking current hooks for event handling (#824) 2019-11-30 13:42:53 -08:00
jberg
769c7b9577 Initialize maki object tree (#823)
* make initialize tree out of maki objects

* pass global flag to variables, only need hooks for global variables

* implement new opcode

* start using non generic makiobject

* run scripts

* fix running scripts

* skip standardframe for now

* switch to simple example for now

* make WAL a group

* move xml/init functions to be in GuiObject

* handle creating backing XML nodes for objects created (new) in scripts

* simpler null check

* add js_ prefixes

* only bind event handlers for hooks if they are present

* uppercase for Classes

* make null checking explicit

* need to check undefined, not null

* implement init for adding nodes to state tree

* dont render groupdefs, dont execute scripts in groupdefs

* implement getContainer

* move find descendants to utils
2019-11-30 13:42:53 -08:00
Jordan Eldredge
1efded00d3 Fix a few variable names I forgot to update 2019-11-30 13:42:53 -08:00
Jordan Eldredge
440aca6d66 Clean up and document the generator approach 2019-11-30 13:42:53 -08:00
jberg
91cc5767ef working on initialize and linking groupdefs (#820)
* move images to initialize

* return nodes from initialize, lookup groupdefs

* fix attributes when copying groupdefs

* position groups with x/y

* more parsers for classic modern skin

* if img doesn't exist just return the node without adding to registry

* dont need nested node

* simplify ids

* simplify splitValues

* new variable with name
2019-11-30 13:42:53 -08:00
Jordan Eldredge
aa97783ca0 Start sketching out initialization (#815) 2019-11-30 13:42:53 -08:00
Jordan Eldredge
a3b7527f71 Clean up and document the generator approach 2019-11-30 13:42:53 -08:00
Jordan Eldredge
2a3be1656b Unwrap program 2019-11-30 13:42:53 -08:00
Jordan Eldredge
1ecab48bdf Get the first set of internal state right away 2019-11-30 13:42:53 -08:00
Jordan Eldredge
c135cf91a6 Move paused into the reducer 2019-11-30 13:42:53 -08:00
Jordan Eldredge
5cba75f4b8 Don't resume on removing a breakpoint 2019-11-30 13:42:53 -08:00
Jordan Eldredge
d2e27b0349 Rewrite the debugger to use the generator approach to pausing code 2019-11-30 13:42:53 -08:00
Jordan Eldredge
aa54ee33e0 Add the ability to inject a command handler into the interpreter 2019-11-30 13:42:53 -08:00
Jordan Eldredge
e66726f02a Make the VM a generator 2019-11-30 13:42:53 -08:00
Jordan Eldredge
0e059efe99 Make the VM sync 2019-11-30 13:42:53 -08:00
Jordan Eldredge
21caf927c7 Consolidate maki and mordern skin reference files 2019-11-30 13:42:53 -08:00
Jordan Eldredge
7bede9cd5a Improve parser tests
Ensure we can parse all scripts and move the parser tests to a parser test file for clarity
2019-11-30 13:42:53 -08:00
Jordan Eldredge
6b03a353e7 Inline includes (#819)
* Inline includes

Rather than making the content of the included file the _contents_ of
the `<include />` node, we replace the `<include />` node with the
children of the included file.

* Use asyncTreeFlatMap instead of asyncTreeMap

FlatMap is more powerful than map. More importantly, I only want to maintain one tree map function if I can help it.
2019-11-30 13:42:53 -08:00
Jordan Eldredge
c61fbb952d Move offset mapping entirely into the parser 2019-11-30 13:42:53 -08:00
Jordan Eldredge
8529d948ec Assert which files get read from the zip 2019-11-30 13:42:53 -08:00
Jordan Eldredge
ab6c1264fd Introduce asyncDepthFirstFlatMap 2019-11-30 13:42:53 -08:00
Jordan Eldredge
97561b0045 Prettier 2019-11-30 13:42:53 -08:00
jberg
1ab5a9d0d7 Add runtime version and remove version check hacks (#818)
* add runtime version and remove version check hacks

* move jump logic into a shared function
2019-11-30 13:42:53 -08:00
jberg
c55babadd6 lookup command opcodes in debugger (#817) 2019-11-30 13:42:53 -08:00
dependabot[bot]
4a0c1e4a7a Bump lodash from 4.17.11 to 4.17.13 (#816)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-30 13:42:53 -08:00
Jordan Eldredge
2cfec69c66 Add comments in places where we await because of #814 2019-11-30 13:42:53 -08:00
Jordan Eldredge
72ef987112 Clean up test format 2019-11-30 13:42:53 -08:00
Jordan Eldredge
423267a9c0 Remove try/catch blocks
There were only here so that we could check in the tests before the code actually worked
2019-11-30 13:42:53 -08:00
Jordan Eldredge
d6c88039cf Use signed ints for function offsets 2019-11-30 13:42:53 -08:00
Jordan Eldredge
b61ca9f791 Consolidate cases that get a variable offset 2019-11-30 13:42:53 -08:00
Jordan Eldredge
39b7063b5b Make it more clear that func and line get the same info 2019-11-30 13:42:53 -08:00
Jordan Eldredge
f5d080dcf7 Don't leak data from constants outside of the parserEventually we will get rid of the object in constants, so we don't want others to expect this data to be here. 2019-11-30 13:42:53 -08:00
Jordan Eldredge
19c24d18f9 Remove unused data about localFunctions 2019-11-30 13:42:53 -08:00
Jordan Eldredge
585b75ae4e Inline readUInt32LE
This will allow us to do signed ints in some places but not all.
2019-11-30 13:42:53 -08:00
Jordan Eldredge
5dab717425 Prettier 2019-11-30 13:42:53 -08:00
Jordan Eldredge
326c37d149 Add utility function for getting binary arrays out of zips 2019-11-30 13:42:53 -08:00
Jordan Eldredge
81fa6010e8 Avoid annoying message when running yarn commands 2019-11-30 13:42:53 -08:00
jberg
137e78e688 more function and scope tests (#813)
* more function and scope tests

* hack to fix handling of wrong sign offsets

* attempting to fix async issue

* fixes captbaritone found

* add comment about recursive function
2019-11-30 13:42:53 -08:00
Jordan Eldredge
3105ab1372 Move runtime to toplevel 2019-11-30 13:42:53 -08:00
Jordan Eldredge
2a9376e018 Add messages section 2019-11-30 13:42:53 -08:00
Jordan Eldredge
0690f8cf8d Pause before the first command 2019-11-30 13:42:53 -08:00
jberg
d0ceda1520 fix button image rendering and handle layout without x/y (#812) 2019-11-30 13:42:53 -08:00
Jordan Eldredge
62bb17188d Speed up running scripts in the debugger 2019-11-30 13:42:53 -08:00
jberg
a925bfc31e measure image if we don't have node attributes to use (#811)
* measure image if we don't have node attributes to use

* return image, allow for x/y to be specificied without w/h
2019-11-30 13:42:53 -08:00
jberg
d6f9ce8351 tweak 2 arg operatores and coercion (#810) 2019-11-30 13:42:53 -08:00
Jordan Eldredge
005629f9e9 Abstract how we handle two argument operators.
Some don't work. I wonder why.
2019-11-30 13:42:53 -08:00
Jordan Eldredge
3798934615 Don't log the "done" promise 2019-11-30 13:42:53 -08:00
Jordan Eldredge
05362da4a3 Be consistent with ordering of a and b, even when it does not matter
Interestingly this changes the order of << but tests still pass
2019-11-30 13:42:53 -08:00
Jordan Eldredge
5a7489db4e Commands only have a single argument 2019-11-30 13:42:53 -08:00
jberg
e015c15625 fix tests, sprinkle more async/await (#809) 2019-11-30 13:42:53 -08:00