Commit Graph

43 Commits

Author SHA1 Message Date
haven1433
76f1977fb8 fix python enums-with-spaces parsing
* don't include " within the string when getting the value
* use `TryParse` instead of `Write` for converting the enum value from a string, since this is an all-to-one edit, not a pull-from-stream edit.
2022-12-11 22:11:27 -06:00
haven1433
a48316c3f0 improve model table 2022-12-01 08:16:18 -06:00
haven1433
a06368297e add python tool improvements
new 'AnchorGroup' class so we can call anchors by their names
2022-11-28 21:33:49 -06:00
haven1433
6a703c1fae call UpdateFromParent when updating TableStream via textbox 2022-11-18 09:10:31 -06:00
haven1433
051d4edf8d improve resilience 2022-11-10 23:56:03 -06:00
haven1433
a2c12a86dc add the ability to create model tables without validation
no idea what state the rom is going to be in when we load it. Erroneous data should still partially work.
2022-11-10 23:26:42 -06:00
haven1433
197882dec1 fix warp bug 2022-11-04 09:04:34 -05:00
haven1433
9c11ac55cb add automation metacommands exportimage / importimage
```
# sample for exporting / importing sprites via .hma scripts

@graphics.pokemon.sprites.front/bulbasaur  @!exportimage(test1.png)

@graphics.pokemon.sprites.front/charmander @!importimage(test1.png greedy)
```
2022-11-03 20:09:19 -05:00
haven1433
d3d2422ec0 fix decap algorithm
Now works right for capital letters that come after escape bytes
also fix random crash in ModelTable string recognition
also fi random assert from adding an anchor to a pointer
2022-11-01 23:36:40 -05:00
haven1433
04aba5dae7 improve tooltips
also show range for trainers/NPCs
2022-11-01 19:59:53 -05:00
haven1433
b5e15ead3f draft
added right-click menu and a draft of the creation logic. Doesn't quite work right yet.
2022-10-27 21:37:05 -05:00
haven1433
216ac5ebec improve arg recognition
signpost args are complicated. The app can now tell the difference between the different 'kinds'.
2022-10-26 07:39:26 -05:00
haven1433
953fe52fb6 improve tuple model
* add fly spots to event list
* allow moving/deleting fly spots
* remove Elevation from base event interface
* improve header UI
2022-10-20 21:48:29 -05:00
haven1433
86bfec7b1f bugfixes
* python tool should support reading/writing tuples in tables
* writing `0` to a length in a table should update the children to be null (and delete the data)
* change an element count from 0 should create new data if the pointer is null
* creating new data via `@{` should update the length
* tested that this also works as expected with trainer teams (tpt)
* might have issues with ows, but they handle length differently
2022-10-16 00:06:34 -05:00
haven1433
ce3d307251 bug fixing
* fairy script wasn't adding correctly
* right-click menus for inner-pointers weren't showing the right addresses
* appending a table and then updating the new pointer to point into a new table wasn't clearing the old pointer location from the old anchor
* search was causing thread-lock issues
* Display As Text was causing thread-lock issues
* python tool needs to update related fields when updating a table (structType, child table length from parent)
* fix character set issues
* fix crashes with mapper when tables don't have expected elements
* fix showing map options when there's no mapper
* improve handling of custom character escape sequences
* truncate text in tooltips
2022-10-10 21:33:57 -05:00
haven1433
30007082f6 python improvements
* ToString for model elements
* ability to read bit arrays as a number, sort of
* better error message when a field isn't found
* wrap text in python output
2022-10-07 22:56:11 -05:00
haven1433
d537f88c46 bugfixes 2022-09-22 20:58:41 -05:00
haven1433
47d3642bdf face correct way
- fix undo/redo bug for model element
- update event UI
- fix hover selection bug
2022-09-19 18:24:57 -05:00
Haven1433
a2d4c66a33 items
and R/S/E support
2022-09-17 10:04:48 -05:00
Haven1433
4a416981f0 trainers 2022-09-16 23:26:38 -05:00
Haven1433
29092415a6 multi-select
and some flag-based utilities
and hide layoutID
2022-09-16 21:27:55 -05:00
Haven1433
6dbe5c62f0 resilience 2022-09-15 21:22:07 -05:00
Haven1433
e05525e6d4 header / event work
can now create new events, and deleting them is less buggy
2022-09-14 22:08:25 -05:00
Haven1433
d92f9f28b4 allow delete 2022-09-12 21:48:04 -05:00
Haven1433
86b89c4290 improve removal logic 2022-09-11 21:52:11 -05:00
Haven1433
e376d6d664 Write a serialize routine for ModelTable
Lets you do stuff like
table['data.pokemon.moves.levelup'][4].Serialize('movesFromLevel')
2022-09-11 14:04:07 -05:00
Haven1433
464768d791 size reduction
plus some initial code for adding new / existing
2022-09-07 23:13:53 -05:00
Haven1433
1649b35603 connection editing first pass 2022-09-06 19:19:00 -05:00
Haven1433
ddf14d3837 Code cleanup 2022-09-03 00:07:36 -05:00
Haven1433
470f33266b Reading a pointer a ModelArrayElement should be smarter
If the user tries to get a field from a ModelArrayElement, and that field is a pointer that points to an ITable, do the same as GetSubTable would do.
2022-09-01 11:19:36 -05:00
Haven1433
0becbfac3f Tilemap tileset loading needs to be table-index aware
When showing a sprite in the table tool, we check to see what table index it is so we can use that index to find the palette. We need to do the same thing with tilesets. This means that GetPixels() needs a new parameter, the tableIndex, which can be passed in from any context that cares about it. Most of the time, getting the pixels doesn't care what the table index is. But now tilemaps can use this to figure out which tileset to use.
2022-08-25 22:46:48 -05:00
Haven1433
05434521d3 pass a parent in to ArrayRunElementSegment.Write
This method is used when calling TableStreamRun.DeserializeRun. There is always a parent table that owns the element. We need to know the parent in order to correctly deserialize child pointers.
2022-08-24 07:41:00 -05:00
Haven1433
e8cf8453e8 Python Tool improvements
* print elements in list as results
* change layout for wider content
* allow zooming in/out of script
* don't print "" around text from tables in the ModelTable
* allowing printing the address of an element in a ModelTable
* Add button in View menu to bring up the python section
2022-06-20 07:29:55 -05:00
Haven1433
06bfcf95fe add dynamic syntax support for table fields in python
You can now get/set
`table['data.pokemon.names'][1].name`
instead of the more verbose
`table['data.pokemon.names'][1]['name']`
2022-06-19 22:39:29 -05:00
Haven1433
aaa0863ea1 improve ModelTable
make it implement IReadOnlyList so it can be used in for loops. Add `__len__` for python use.
2022-06-18 14:57:21 -05:00
Haven1433
8940c45355 Add python panel
The panel is currently tucked into the right edge of the app, not taking any space. It's an advanced beta feature. The python context only gets access to 2 special variables (editor and table), plus an override for the print function.
2022-06-04 21:17:28 -05:00
Haven1433
65765e695f Allow Text Macros
* Replace the static PCSString.Convert method with an instance method on a TextConverter that's owned by the Model. The TextConverter can know about different macros depending on which rom is being edited.
* Add macros to pcsReference.txt
2022-06-02 20:53:39 -05:00
Haven1433
efac0ae796 Improve data-tolerance for dex reorder images 2022-03-07 22:54:43 -06:00
Benjamin Popp
17bb55a221 Make pokedex reorder utility more resilient 2020-11-02 09:38:07 -06:00
Benjamin Popp
4c26b6baf5 Make Dex tool more resilient
Gaia can now open
2020-09-10 16:13:13 -05:00
Benjamin Popp
8370d27191 Add support for deep copy
Most of this is boilerplate. The actual implementation change is in ArrayRunElementSegment.ToText. Converting a pointer element segment to text can now optionally collect the *content* of that pointer, instead of the pointer itself.

The second test is to fix a bug in plm AppendTo.
2020-05-12 16:26:32 -05:00
Benjamin Popp
5545e2eb70 Attempt to fix startup crash
The crash happened because the ModelTable was looking for the frontsprites / pokepalettes, which it couldn't find.
2020-05-05 21:22:20 -05:00
Benjamin Popp
347430ddcb Render pokemon in dex order
This adds a prototype 'model' element for working with tables/table elements. If you're working with data in a known format, it provides an easier way to navigate through the data. Should be useful for scripts.
2020-05-05 08:12:34 -05:00