The game's UI displays lists of blocks in several places:
All of these use different code and have different/inconsistent behaviour. Sometimes the list is split into categories (in the shop), sometimes the list is sorted alphabetically (when you're adding a new filter for storage), sometimes it's not sorted at all, sometimes the block type is listed when there are no blocks (shop, why?) and sometimes they aren't (the storage filter menu, looking at the existing set of filters).
For cases where it's not categorised (everything except the shop); it's a painful mess - a very long list of everything (where often it's a tiny drop down list with a scroll bar), where finding anything is excessively frustrating if you're lucky (and worse when you're not lucky - if the list isn't sorted alphabetically and/or you're not too sure what the block's name is).
What I'm suggesting is to have a single piece of code that categorises and sorts lists of items; that is used by all places where the UI has to display lists of blocks to prepare the list for display. This code would accept a list of block types with a count for each block type; and would generate a "tree of structures" (representing categories, etc) that excludes entries where the block type's count is zero, and excludes whole categories that have nothing in them.
In addition, I suggest a single "item selector widget" that's used:
Not only would this make the game far easier for players to use; it should also reduce the amount of duplicated code (making the client's code faster/smaller and easier to maintain).
In the shop menu
In the storage filter menu (when you're looking at the existing set of filters)
In the storage filter menu (when you're adding a new block type to the filters)
In the factory "item to produce" lists
In the advanced build mode "pick remove/replace filter"
In the storage filter menu (when you're looking at the existing set of filters)
In the storage filter menu (when you're adding a new block type to the filters)
In the factory "item to produce" lists
In the advanced build mode "pick remove/replace filter"
All of these use different code and have different/inconsistent behaviour. Sometimes the list is split into categories (in the shop), sometimes the list is sorted alphabetically (when you're adding a new filter for storage), sometimes it's not sorted at all, sometimes the block type is listed when there are no blocks (shop, why?) and sometimes they aren't (the storage filter menu, looking at the existing set of filters).
For cases where it's not categorised (everything except the shop); it's a painful mess - a very long list of everything (where often it's a tiny drop down list with a scroll bar), where finding anything is excessively frustrating if you're lucky (and worse when you're not lucky - if the list isn't sorted alphabetically and/or you're not too sure what the block's name is).
What I'm suggesting is to have a single piece of code that categorises and sorts lists of items; that is used by all places where the UI has to display lists of blocks to prepare the list for display. This code would accept a list of block types with a count for each block type; and would generate a "tree of structures" (representing categories, etc) that excludes entries where the block type's count is zero, and excludes whole categories that have nothing in them.
In addition, I suggest a single "item selector widget" that's used:
In the storage filter menu (when you're adding a new block type to the filters)
In the factory "item to produce" lists
In the advanced build mode "pick remove/replace filter"
In the factory "item to produce" lists
In the advanced build mode "pick remove/replace filter"
Not only would this make the game far easier for players to use; it should also reduce the amount of duplicated code (making the client's code faster/smaller and easier to maintain).