Thursday, July 31, 2014

FMod - Editable Dependency Files

It's official: all features that are going to appear in Abiathar v2.0 have been completed and are in testing. Once I get some feedback from Gridlock (or even if I don't soon), I will begin the probably large documentation update required.

I completed the New Project Wizard refactor I mentioned a while back, creating a function to save the tab's data to the dependency file and approve the move-next command. The Back button is no longer a giant crash bug, and appears to be stable and predictable.

Relatedly, there is now an option to modify the dependency file in-editor! It's called "Project Settings" under Edit, and it produces a pre-filled, slightly renamed version of the New Project Wizard. It's all the same procedures, of course, just all marked visited so that it's loaded from the existing dependency file. The menu option actually just closes the original file, modifies an in-memory copy, takes advantage of the new unified loader to open it, and performs a variable shell game to get it associated with the old path. I was careful to not immediately save the modified file so the user can close without saving to undo it.

Finally (topically but not chronologically - Hebrew style!), the Level Inspector's report has been given an actual GUI. Previously, it just threw up a standard message box with each issue on one line. Now, I have a form containing a list view control, which lets the user sort by importance or name - and scroll, which is important if there are a lot of problems (previously, the box could be so tall that the buttons were off the screen). I even added a button to export the report as a text file.


Wednesday, July 30, 2014

FMod - Better Find

The other bug Gridlock reported yesterday was that Abiathar's Tile Instance Locator (find tool) does not update the highlight overlay when you select a tile from the tile palette instead of by right-clicking in the level. I fixed that bug today with a new event bus.

All that remains before the v2.0 update is a working Back button in the New Project Wizard and the ability to edit existing dependency files.

Tuesday, July 29, 2014

FMod - Graphics Reload Fix

Amid intense studying for my econ final tomorrow, I checked the IRC client I was running in the background and noticed that Gridlock had reported that Abiathar's Reload Graphics feature was still bugged. The first bug he discovered was caused by the mouse-move handler accessing the level view states, which are null while graphics are reloading. I had inserted a null check there, but it seems the level view states are accessed in other places too, possibly by delayed clicks or scrolling (or maybe even moving the mouse in the tileset, which may or may not have a separate handler). So, the graphics reloader now disables all the level and tileset viewer panels, making it impossible for them to handle things while it's rebuilding the view states.

Sunday, July 27, 2014

FMod - Back Button Issues

Gridlock mentioned in an IRC session that he would very much like Abiathar to allow editing of a dependency file after it is created. This is a really difficult problem for me, but of course I can't hide behind my implementation to excuse the lack of a possibly very useful feature.

As I mentioned, there's a Back button now. I have discovered that being able to move back and being able to modify things are very closely related, so I am performing refactoring to make both of those things work better. Specifically, there is now a lot more logic in the "show tab" function. It keeps track of whether a tab has been visited before: if it has, its settings are loaded from the dependency file, otherwise it is given some defaults.

The problem is that it's really hard to keep the tab UI, other dependent tabs' UIs, and the dependency file updated without blowing everything up with a null pointer. When the user can go back and pull a precondition out from under you, the visited list gets confused and tries to load settings that have been deleted from the compound. This is made a lot worse by the UI controls not firing the update event when assigned their current value, which is one of the most subtly terrible bugs ever.

I suppose I'll have to create a "save data" or "on leave tab" handler to manage all the data instead of trusting the update events and Next button to fix everything for me.

Saturday, July 26, 2014

FMod - API Cleanup

There was a part of Abiathar's API that I really didn't want to be there; it was an ugly hack that I included just to get all the view planes migrated to that API style. That part is IAbiatharCoreViewSettings, a little object under IAbiatharState.ViewState that holds a few Boolean values representing whether things under the View menu are checked. This is an ugly hack because extensions shouldn't need to know about that, and Abiathar's own processing shouldn't leak into the API.

So, I removed that section. Those renderers now check directly with the main form's settings to report whether they should be rendered.

In other news, I fixed a crash bug with Reload Graphics and made the Level Inspector not issue as many spurious complaints.

Friday, July 25, 2014

FMod - Back Button

I did actually manage to implement a Back button for the New Project Wizard today. It was actually a lot easier than I expected; there were only two things that caused issues with my first implementation, and they were easily fixed. So, that's pretty much the last feature requested by Gridlock for v1.5; I'll ask him again for feedback before I write up the documentation and release it.

Also, I added some self-documenting behavior to the configuration file. Through yet another attribute on the fields, a comment line is automatically added before the config entry. I have added such attributes to most of the fields in editor.aconf.

Finally, performance improvements! The Tile Tweaker and Freeform Tile Placer no longer register mouse movement handlers when single tile preview is off. This makes the coordinate display and tile scanner much faster.

Thursday, July 24, 2014

FMod - Change Everything

Today was another one of those talk-with-important-community-modders-and-implement-everything-they-say day! This time, Gridlock caught me on IRC in addition to sending me a message on the PCKF. The following changes and additions ensued:

  • Pressing a tool's shortcut key while it's active now acts as a toggle, turning it off and switching back to the default tool.
  • Pressing the space bar opens the previous tileset in addition to closing an open one.
  • The Y offset in the tile palette is remembered until a different palette is opened.
  • The Tile Instance Locator now allows placing tiles.
  • Plane state labels change font and color depending on the represented plane state (to provide multiple and faster means for recognition of the plane state, which is critical while designing).
  • A render-crash bug with Assimilate Infoplane mode is fixed.
  • Assimilate Infoplane mode no longer disables the infoplane palette. Multiple selection in that mode on the combined foreground tileset has been removed.
  • The legacy Dependency Collector no longer appears as an option in the New Project Wizard unless a config option is changed (ShowAdvancedMenuOptions/LegacyDepsCollector).
  • Lots of texts in the New Project Wizard have been changed to make it easier for new/unfamiliar users. Explanatory text has been added for the radio buttons.
  • A leaked file handle bug concerning Infoplane Override was fixed.
  • Tile Instance Locator and Tile Instance Remapper were given shortcut keys.
  • Undo's shortcut was changed from Control+Z to Z.
  • Palette Copier's shortcut key was changed from X to C, in consistency with the normal Copier.
A Back button for the New Project Wizard has been requested, and would probably be very useful. I'll get to that soon, hopefully.

Also, I replaced the cheap-looking default background image (the one with the Fleex and my name) with something much more impressive: