Deciding the UI – Editing Data

Setting level data

Next we had to decide on how we wanted to present UI for actually adding data to the currently selected level, we looked into a few different UI presentations but we didn’t like the early ones, the one we finally settled on…

went through a couple iterations as seen in the following images:

Early rooms utility window with a custom view Close to final version of rooms utility window

Rolling our own

First we looked into rolling our own UI, the way we’ve done it many times in the past with experimental projects and it was pretty easy and we could have gone all the way with that. But why do that?

Since we never really used it before, we decided to jump out of our comfort zone (and not be crazy and reinvent the wheel) and take a look at how NSCollectionView could help us.

At first it was pretty intimidating to try and use something we weren’t familiar with, but with anything new, it was exciting.

  1. We were learning something new
  2. It’s a standard macOS UI element
  3. It provided  many things “automagically”
    • Scrolling
    • Sections
    • Selection

Scrolling –  having our rooms selection view scroll automatically was very nice, as we had more rooms than could fit on a small screen (such as a MacBook) we didn’t have to worry about scrolling in a custom view. Magic \o/

Sections – Collection Views support sections by default, so we could separate out our rooms from items and any other types that could be added to a level and/or room

Selection – This proved to be a little more tricky for us, but after much Googling and looking at Stack Overflow questions/answers and bugging chat buddies on IRC we finally got it working which was a nice major milestone for us.

Here’s a short video of an early version of the Multi-Section Room Toolbox with selections:

Learning the Collection View API wasn’t easy for us but we finally got it working, even in the current version of the editor we still have some UI weirdness and selection issues, but it’s far better than it was and again, very nice not having to reinvent the wheel. Overall we were very happy to use a standard control and get to know something new.

That’s all for now!