UI updates

Post Reply
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

UI updates

Post by robn »

I'm working on the UI a lot at the moment, so I'm making this thread to post updates. Keep design stuff in the other thread for now; this is more about code-level changes that people might be interested in.

The latest build has a new Table container. Its primarily aimed at data tables (like the commodity trade list). It has a really simple API and will automatically align rows and columns and add scrollbars as necessary. Basically what we've already been doing with grids+vboxes, but without the pain. I do have some future plans for it (horizontal scroll, row/column spanning, live reordering (replacing SmartTable)), but this will do for now. Its already in action in the InfoView, but not everywhere yet. A nice project for someone wanting to try things out would be to rewrite the mission list to use it. The code will end up being very much nicer.

The other thing is a little convenience. If you add a string to a container instead of a widget, a Label widget will automatically be created from it. So now you don't need masses of ui:Label everywhere. Just the string will do.

All of this is me building out what I need to move the station screens to the new UI. Armed with these tools, here's what I have after a few minutes hacking:

Image

And the code:

Code: Select all

local commodityMarket = function (args)
	local station = Game.player:GetDockedWith()

	local table = ui:Table():SetColumnSpacing(10)

	table:SetHeadingRow({ "", "Name", "Price", "In stock" })

	for k,v in pairs(EquipDef) do
		if v.slot == "CARGO" then
			table:AddRow({ ui:Image("icons/goods/Animal_Meat.png"), k, station:GetEquipmentPrice(k), station:GetEquipmentStock(k) })
		end
	end

	return ui:Expand():SetInnerWidget(table)
end
The only bit of magic in there is the expander, and that's going away once I get a moment to think about a couple of things. So all in all, this should make life a hell of a lot easier :)
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: UI updates

Post by FluffyFreak »

Looking good :)

I have a couple of requests for a new commodity screen:
  • can the buy/sell buttons have +/- or some other obvious icon,
  • buy/sell buttons near the item name instead of the cost,
  • alternatively: stripey lists so the eye can follow the item name across to the price and the buttons.
I find it really difficult to find the item I want, then follow it across the empty blue void to the prices, and then to the unmarked buttons.
It's only habit that tells me they're in the order "buy/sell" so that I know which one to click without looking or scrolling up to find the legend along the top.
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: UI updates

Post by robn »

FluffyFreak wrote:I have a couple of requests for a new commodity screen:
Sure, but I still consider this thing to be a placeholder, especially since mods will be able to add arbitrary cargoes. Some kind of grouping might be necessary, and I'm thinking about something very much more visual, with less emphasis on raw data. But that's for later. For now a modest amount of tweaking on the existing theme will be enough.

And so, here's where I'm up to:

Image

(Scroll bar positioning is a bit horked, but it'll be sorted before the end).
can the buy/sell buttons have +/- or some other obvious icon
I'm thinking the buttons will be in the middle somewhere, in some way that's obvious that you're moving things from one side to the other.
buy/sell buttons near the item name instead of the cost,
alternatively: stripey lists so the eye can follow the item name across to the price and the buttons.
Not sure about the position exactly, but so long as its clearly associated it should be fine. I'm thinking about striped lists, but I think what I'll probably do is more like the list widget (eg the "load game" window) - highlight the entire row on hover.

I will experiment anyway. Thanks!
Gleedaniel13
Posts: 5
Joined: Fri Aug 23, 2013 3:32 am
Contact:

Re: UI updates

Post by Gleedaniel13 »

I'm working on the UI a lot at the moment, so I'm making this thread to post updates. Keep design stuff in the other thread for now; this is more about code-level changes that people might be interested in.
This is a very nice information to us that you are making any updates here. UI is very helpful to the people like us.
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: UI updates

Post by robn »

Made some progress today:

Image

Actually I've been making progress for several days, but its all infrastructure. Everything related to creating and removing ships from the market had to be rewritten, not just the UI. Obviously this isn't done yet (that big "Buy" button does nothing), but its on its way!

An idea. If you look back a couple of posts in this thread, you'll see the commodity screen with its icons. I think that small visual element makes a massive difference to these lists of items, and I'd like to do something similar. I was thinking we could have the manufacturer logos as the icons for ships. This would be cool for mods as well - if a single artist does a series of new ships, she could have her own manufacturer logo.

I'll give this a try soon, I think, using the logos from the manufacturer pages on the wiki (who made these pages btw - they're awesome! I've been out of the loop on a bunch of stuff for too long).
nozmajner
Posts: 1079
Joined: Mon Jul 01, 2013 3:25 pm
Location: Budapest HU

Re: UI updates

Post by nozmajner »

Looks nice. I really look forward to the new UI's arrival.
I'm not sure how would the logos look that small, but they could work. How about ship category/role icons instead? Like freighter, fighter, courier, etc. And the logo could be shown in the individual ship screen.
You might want to consider adding some padding to the left of the lists to give some breathing space to it. About the size of the icons should be enough. It feels a bit stiff and cramped this way.

I'm glad you like the manufacturer pages and such. John_minetest and the ship manufacturers wrote it. :D
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: UI updates

Post by robn »

I don't totally hate this :P

Image

I think you might be right about size/role icons (do we have them somewhere already?). Something a bit more icon-ish, a bit more like the cargo icons.

Of course you're right about the margins. There's a couple of rounds of spit-shine to go on all of this before merge. You have given me a bit of an idea of how to fix a layout problem that's been bothering me for a while though :)
nozmajner
Posts: 1079
Joined: Mon Jul 01, 2013 3:25 pm
Location: Budapest HU

Re: UI updates

Post by nozmajner »

As far as I know there aren't any role icons, but I think I can come up with some.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: UI updates

Post by FluffyFreak »

robn wrote:I don't totally hate this :P
Hi praise indeed! :D

Yep it's all looking good so far!
Post Reply