Sunday, August 16, 2015

Abiathar Online - Basic Editing, Now With Less Bafflement!

I noticed that in addition to the strange non-cursor-changing of links, the standard Chrome scrollbar had stopped functioning for Abiathar Online - it was there, but it could not be moved, but the arrow keys worked fine. I tried switching the context menu preventer to use only event.preventDefault() rather than doing that and returning false (which I read was problematic), and suddenly everything worked. The scrollbar was fixed, the cursor went back to normal, and best of all the canvas events started working again.

I then noticed that simply clicking (rather than holding/dragging) on the canvas did not result in actions being taken. That's a problem, especially for people who - unlike me - use a real mouse instead of a pen&touch. So I wired up a new event handler that translates the button values (which are for whatever reason different than those used in mouse-move events) into IDs that can be used in the main handler. When I tested it, I found that the strange symptoms had returned. Commenting out the handler wireup didn't help, but after a couple attempts at fiddling, Chrome froze and then crashed. When it came back up, it had apparently updated, and suddenly everything was working correctly. Maybe the problems weren't my fault!

Finally, I realized that having the tile IDs in the selected tile bay is actually very useful (e.g. to disambiguate bogus blanks from the zero tile). After a good while of fiddling with CSS, I got a monospaced hex representation displaying in the upper-right of each bay.

Abiathar Online now has basic tile tweaking functionality. Next, I'll see about getting tile palettes working.

No comments:

Post a Comment